mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-01 14:47:38 +00:00
lib/promscrape/discovery/kubernetes: add missing __meta_kubernetes_ingress_class_name
label for role: ingress
See7e65ad3e43
and7e1111ff14
This commit is contained in:
parent
8506d533b1
commit
4d8aa13ec1
3 changed files with 19 additions and 14 deletions
|
@ -17,6 +17,7 @@ The following tip changes can be tested by building VictoriaMetrics components f
|
||||||
|
|
||||||
* BUGFIX: [VictoriaMetrics cluster](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html): fix potential panic in [multi-level cluster setup](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#multi-level-cluster-setup) when top-level `vmselect` is configured with `-replicationFactor` bigger than 1. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2961).
|
* BUGFIX: [VictoriaMetrics cluster](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html): fix potential panic in [multi-level cluster setup](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#multi-level-cluster-setup) when top-level `vmselect` is configured with `-replicationFactor` bigger than 1. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2961).
|
||||||
* BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): properly handle custom `endpoint` value in [ec2_sd_configs](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#ec2_sd_config). It was ignored since [v1.77.0](https://docs.victoriametrics.com/CHANGELOG.html#v1770) because of a bug in the implementation of [this feature request](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1287).
|
* BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): properly handle custom `endpoint` value in [ec2_sd_configs](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#ec2_sd_config). It was ignored since [v1.77.0](https://docs.victoriametrics.com/CHANGELOG.html#v1770) because of a bug in the implementation of [this feature request](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1287).
|
||||||
|
* BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): add missing `__meta_kubernetes_ingress_class_name` meta-label for `role: ingress` service discovery in Kubernetes. See [this commit from Prometheus](https://github.com/prometheus/prometheus/commit/7e65ad3e432bd2837c17e3e63e85dcbcc30f4a8a).
|
||||||
* BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): allow stale responses from Consul service discovery (aka [consul_sd_configs](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#consul_sd_config)) by default in the same way as Prometheus does. This should reduce load on Consul when discovering big number of targets. Stale responses can be disabled by specifying `allow_stale: false` option in `consul_sd_config`. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2940).
|
* BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): allow stale responses from Consul service discovery (aka [consul_sd_configs](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#consul_sd_config)) by default in the same way as Prometheus does. This should reduce load on Consul when discovering big number of targets. Stale responses can be disabled by specifying `allow_stale: false` option in `consul_sd_config`. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2940).
|
||||||
* BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): [dockerswarm_sd_configs](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#dockerswarm_sd_config): properly set `__meta_dockerswarm_container_label_*` labels instead of `__meta_dockerswarm_task_label_*` labels as Prometheus does. See [this issue](https://github.com/prometheus/prometheus/issues/9187).
|
* BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): [dockerswarm_sd_configs](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#dockerswarm_sd_config): properly set `__meta_dockerswarm_container_label_*` labels instead of `__meta_dockerswarm_task_label_*` labels as Prometheus does. See [this issue](https://github.com/prometheus/prometheus/issues/9187).
|
||||||
* BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): set `up` metric to `0` for partial scrapes in [stream parsing mode](https://docs.victoriametrics.com/vmagent.html#stream-parsing-mode). Previously the `up` metric was set to `1` when at least a single metric has been scraped before the error. This aligns the behaviour of `vmselect` with Prometheus.
|
* BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): set `up` metric to `0` for partial scrapes in [stream parsing mode](https://docs.victoriametrics.com/vmagent.html#stream-parsing-mode). Previously the `up` metric was set to `1` when at least a single metric has been scraped before the error. This aligns the behaviour of `vmselect` with Prometheus.
|
||||||
|
|
|
@ -54,6 +54,7 @@ type Ingress struct {
|
||||||
type IngressSpec struct {
|
type IngressSpec struct {
|
||||||
TLS []IngressTLS `json:"tls"`
|
TLS []IngressTLS `json:"tls"`
|
||||||
Rules []IngressRule
|
Rules []IngressRule
|
||||||
|
IngressClassName string
|
||||||
}
|
}
|
||||||
|
|
||||||
// IngressTLS represents ingress TLS spec in k8s.
|
// IngressTLS represents ingress TLS spec in k8s.
|
||||||
|
@ -136,6 +137,7 @@ func getLabelsForIngressPath(ig *Ingress, scheme, host, path string) map[string]
|
||||||
"__meta_kubernetes_ingress_scheme": scheme,
|
"__meta_kubernetes_ingress_scheme": scheme,
|
||||||
"__meta_kubernetes_ingress_host": host,
|
"__meta_kubernetes_ingress_host": host,
|
||||||
"__meta_kubernetes_ingress_path": path,
|
"__meta_kubernetes_ingress_path": path,
|
||||||
|
"__meta_kubernetes_ingress_class_name": ig.Spec.IngressClassName,
|
||||||
}
|
}
|
||||||
ig.Metadata.registerLabelsAndAnnotations("__meta_kubernetes_ingress", m)
|
ig.Metadata.registerLabelsAndAnnotations("__meta_kubernetes_ingress", m)
|
||||||
return m
|
return m
|
||||||
|
|
|
@ -78,7 +78,8 @@ func TestParseIngressListSuccess(t *testing.T) {
|
||||||
{
|
{
|
||||||
"host": "foobar"
|
"host": "foobar"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"ingressClassName": "foo-class"
|
||||||
},
|
},
|
||||||
"status": {
|
"status": {
|
||||||
"loadBalancer": {
|
"loadBalancer": {
|
||||||
|
@ -111,6 +112,7 @@ func TestParseIngressListSuccess(t *testing.T) {
|
||||||
"__meta_kubernetes_ingress_name": "test-ingress",
|
"__meta_kubernetes_ingress_name": "test-ingress",
|
||||||
"__meta_kubernetes_ingress_path": "/",
|
"__meta_kubernetes_ingress_path": "/",
|
||||||
"__meta_kubernetes_ingress_scheme": "http",
|
"__meta_kubernetes_ingress_scheme": "http",
|
||||||
|
"__meta_kubernetes_ingress_class_name": "foo-class",
|
||||||
"__meta_kubernetes_namespace": "default",
|
"__meta_kubernetes_namespace": "default",
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue