diff --git a/charts/feature-integrations/docs/integrations/alloy.md b/charts/feature-integrations/docs/integrations/alloy.md index 062e111ca0..4ee36cf01a 100644 --- a/charts/feature-integrations/docs/integrations/alloy.md +++ b/charts/feature-integrations/docs/integrations/alloy.md @@ -6,7 +6,7 @@ | Key | Type | Default | Description | |-----|------|---------|-------------| -| labelSelectors | object | `{"app.kubernetes.io/name":"alloy"}` | Discover Alloy instances based on label selectors. | +| labelSelectors | object | `{}` | Discover Alloy instances based on label selectors. Will automatically set a matcher for `app.kubernetes.io/name: ` unless set here. | ### Metric Processing Settings diff --git a/charts/feature-integrations/docs/integrations/cert-manager.md b/charts/feature-integrations/docs/integrations/cert-manager.md index 9cae456ba2..1b0151e016 100644 --- a/charts/feature-integrations/docs/integrations/cert-manager.md +++ b/charts/feature-integrations/docs/integrations/cert-manager.md @@ -7,7 +7,7 @@ | Key | Type | Default | Description | |-----|------|---------|-------------| | field_selectors | list | `[]` | Discover cert-manager instances based on field selectors. | -| labelSelectors | object | `{"app.kubernetes.io/name":"cert-manager"}` | Discover cert-manager instances based on label selectors. | +| labelSelectors | object | `{}` | Discover cert-manager instances based on label selectors. Will automatically set a matcher for `app.kubernetes.io/name: ` unless set here. | | namespaces | list | `[]` | Namespaces to look for cert-manager instances. | | portName | string | `"http-metrics"` | Name of the port to scrape metrics from. | diff --git a/charts/feature-integrations/integrations/alloy-values.yaml b/charts/feature-integrations/integrations/alloy-values.yaml index 1b5d367af3..ff3b8e886d 100644 --- a/charts/feature-integrations/integrations/alloy-values.yaml +++ b/charts/feature-integrations/integrations/alloy-values.yaml @@ -4,9 +4,9 @@ name: "" # -- Discover Alloy instances based on label selectors. +# Will automatically set a matcher for `app.kubernetes.io/name: ` unless set here. # @section -- Discovery Settings -labelSelectors: - app.kubernetes.io/name: alloy +labelSelectors: {} # -- How frequently to scrape metrics from Alloy. # @default -- `60s` diff --git a/charts/feature-integrations/integrations/cert-manager-values.yaml b/charts/feature-integrations/integrations/cert-manager-values.yaml index 8618c631ae..9ed2c7d8b6 100644 --- a/charts/feature-integrations/integrations/cert-manager-values.yaml +++ b/charts/feature-integrations/integrations/cert-manager-values.yaml @@ -12,9 +12,9 @@ namespaces: [] field_selectors: [] # -- Discover cert-manager instances based on label selectors. +# Will automatically set a matcher for `app.kubernetes.io/name: ` unless set here. # @section -- Discovery Settings -labelSelectors: - app.kubernetes.io/name: cert-manager +labelSelectors: {} # -- Name of the port to scrape metrics from. # @section -- Discovery Settings diff --git a/charts/feature-integrations/schema-mods/definitions/alloy-integration.schema.json b/charts/feature-integrations/schema-mods/definitions/alloy-integration.schema.json index 9a78342206..bc5bf39d0c 100644 --- a/charts/feature-integrations/schema-mods/definitions/alloy-integration.schema.json +++ b/charts/feature-integrations/schema-mods/definitions/alloy-integration.schema.json @@ -2,12 +2,7 @@ "type": "object", "properties": { "labelSelectors": { - "type": "object", - "properties": { - "app.kubernetes.io/name": { - "type": "string" - } - } + "type": "object" }, "maxCacheSize": { "type": "null" diff --git a/charts/feature-integrations/schema-mods/definitions/cert-manager-integration.schema.json b/charts/feature-integrations/schema-mods/definitions/cert-manager-integration.schema.json index e7fb336638..852d823a48 100644 --- a/charts/feature-integrations/schema-mods/definitions/cert-manager-integration.schema.json +++ b/charts/feature-integrations/schema-mods/definitions/cert-manager-integration.schema.json @@ -8,12 +8,7 @@ "type": "string" }, "labelSelectors": { - "type": "object", - "properties": { - "app.kubernetes.io/name": { - "type": "string" - } - } + "type": "object" }, "maxCacheSize": { "type": "null" diff --git a/charts/feature-integrations/templates/_integration_alloy.tpl b/charts/feature-integrations/templates/_integration_alloy.tpl index 362b51d283..8a9e95dabd 100644 --- a/charts/feature-integrations/templates/_integration_alloy.tpl +++ b/charts/feature-integrations/templates/_integration_alloy.tpl @@ -291,9 +291,17 @@ declare "alloy_integration" { {{- with $defaultValues | merge (deepCopy .instance) }} {{- $metricAllowList := include "integrations.alloy.allowList" (dict "instance" . "Files" $.Files) | fromYamlArray }} {{- $metricDenyList := .excludeMetrics }} + +{{- $nameLabelDefined := false }} {{- $labelSelectors := list }} {{- range $k, $v := .labelSelectors }} -{{- $labelSelectors = append $labelSelectors (printf "%s=%s" $k $v) }} + {{- if eq $k "app.kubernetes.io/name" }}{{- $nameLabelDefined = true }}{{- end }} + {{- if $v }} + {{- $labelSelectors = append $labelSelectors (printf "%s=%s" $k $v) }} + {{- end }} +{{- end }} +{{- if not $nameLabelDefined }} + {{- $labelSelectors = append $labelSelectors (printf "app.kubernetes.io/name=%s" .name) }} {{- end }} alloy_integration_discovery {{ include "helper.alloy_name" .name | quote }} { diff --git a/charts/feature-integrations/templates/_integration_cert-manager.tpl b/charts/feature-integrations/templates/_integration_cert-manager.tpl index 297d3174b9..267d8a2854 100644 --- a/charts/feature-integrations/templates/_integration_cert-manager.tpl +++ b/charts/feature-integrations/templates/_integration_cert-manager.tpl @@ -23,9 +23,17 @@ declare "cert_manager_integration" { {{- with $defaultValues | merge (deepCopy .instance) }} {{- $metricAllowList := .metricsTuning.includeMetrics }} {{- $metricDenyList := .metricsTuning.excludeMetrics }} + +{{- $nameLabelDefined := false }} {{- $labelSelectors := list }} {{- range $k, $v := .labelSelectors }} -{{- $labelSelectors = append $labelSelectors (printf "%s=%s" $k $v) }} + {{- if eq $k "app.kubernetes.io/name" }}{{- $nameLabelDefined = true }}{{- end }} + {{- if $v }} + {{- $labelSelectors = append $labelSelectors (printf "%s=%s" $k $v) }} + {{- end }} +{{- end }} +{{- if not $nameLabelDefined }} + {{- $labelSelectors = append $labelSelectors (printf "app.kubernetes.io/name=%s" .name) }} {{- end }} {{- $fieldSelectors := list }} {{- range $k, $v := .fieldSelectors }} diff --git a/charts/feature-integrations/tests/alloy_test.yaml b/charts/feature-integrations/tests/alloy_test.yaml index a58446dcf2..7ab9db425d 100644 --- a/charts/feature-integrations/tests/alloy_test.yaml +++ b/charts/feature-integrations/tests/alloy_test.yaml @@ -9,8 +9,6 @@ tests: alloy: instances: - name: alloy-metrics - labelSelectors: - app.kubernetes.io/name: alloy-metrics asserts: - isKind: of: ConfigMap @@ -299,11 +297,38 @@ tests: - name: alloy-metrics metricsTuning: useIntegrationAllowList: true - labelSelectors: - app.kubernetes.io/name: alloy-metrics asserts: - isKind: of: ConfigMap - matchRegex: path: data["metrics.alloy"] pattern: alloy_component_controller_running_components + - it: should allow you to overwrite the name label + set: + deployAsConfigMap: true + alloy: + instances: + - name: alloy-metrics + labelSelectors: + app.kubernetes.io/name: my-alloy-instance + asserts: + - isKind: + of: ConfigMap + - matchRegex: + path: data["metrics.alloy"] + pattern: label_selectors = \["app.kubernetes.io/name=my-alloy-instance"\] + - it: should allow you to dismiss the name label + set: + deployAsConfigMap: true + alloy: + instances: + - name: alloy-metrics + labelSelectors: + app.kubernetes.io/name: null + app.kubernetes.io/instance: k8smon + asserts: + - isKind: + of: ConfigMap + - matchRegex: + path: data["metrics.alloy"] + pattern: label_selectors = \["app.kubernetes.io/instance=k8smon"\] diff --git a/charts/feature-integrations/tests/cert-manager_test.yaml b/charts/feature-integrations/tests/cert-manager_test.yaml index a5736843d2..fe08dd6399 100644 --- a/charts/feature-integrations/tests/cert-manager_test.yaml +++ b/charts/feature-integrations/tests/cert-manager_test.yaml @@ -8,7 +8,7 @@ tests: deployAsConfigMap: true cert-manager: instances: - - name: my-cert-manager + - name: cert-manager asserts: - isKind: of: ConfigMap @@ -27,13 +27,13 @@ tests: pull_frequency = "15m" } - cert_manager.kubernetes "my_cert_manager" { + cert_manager.kubernetes "cert_manager" { label_selectors = ["app.kubernetes.io/name=cert-manager"] port_name = "http-metrics" } - cert_manager.scrape "my_cert_manager" { - targets = cert_manager.kubernetes.my_cert_manager.output + cert_manager.scrape "cert_manager" { + targets = cert_manager.kubernetes.cert_manager.output clustering = true job_label = "integrations/cert-manager" scrape_interval = "60s" @@ -69,7 +69,7 @@ tests: cert_manager.kubernetes "my_cert_manager" { namespaces = ["kube-system"] - label_selectors = ["app.kubernetes.io/name=cert-manager"] + label_selectors = ["app.kubernetes.io/name=my-cert-manager"] port_name = "http-metrics" } diff --git a/charts/feature-integrations/values.schema.json b/charts/feature-integrations/values.schema.json index 5dbfc19c95..e89237d23f 100644 --- a/charts/feature-integrations/values.schema.json +++ b/charts/feature-integrations/values.schema.json @@ -71,12 +71,7 @@ "type": "object", "properties": { "labelSelectors": { - "type": "object", - "properties": { - "app.kubernetes.io/name": { - "type": "string" - } - } + "type": "object" }, "maxCacheSize": { "type": "null" @@ -120,12 +115,7 @@ "type": "string" }, "labelSelectors": { - "type": "object", - "properties": { - "app.kubernetes.io/name": { - "type": "string" - } - } + "type": "object" }, "maxCacheSize": { "type": "null" diff --git a/charts/k8s-monitoring/charts/k8s-monitoring-feature-annotation-autodiscovery-1.0.0.tgz b/charts/k8s-monitoring/charts/k8s-monitoring-feature-annotation-autodiscovery-1.0.0.tgz index 976b17396a..cd4660d611 100644 Binary files a/charts/k8s-monitoring/charts/k8s-monitoring-feature-annotation-autodiscovery-1.0.0.tgz and b/charts/k8s-monitoring/charts/k8s-monitoring-feature-annotation-autodiscovery-1.0.0.tgz differ diff --git a/charts/k8s-monitoring/charts/k8s-monitoring-feature-application-observability-1.0.0.tgz b/charts/k8s-monitoring/charts/k8s-monitoring-feature-application-observability-1.0.0.tgz index 9e8fafb2bf..0904464bd0 100644 Binary files a/charts/k8s-monitoring/charts/k8s-monitoring-feature-application-observability-1.0.0.tgz and b/charts/k8s-monitoring/charts/k8s-monitoring-feature-application-observability-1.0.0.tgz differ diff --git a/charts/k8s-monitoring/charts/k8s-monitoring-feature-auto-instrumentation-1.0.0.tgz b/charts/k8s-monitoring/charts/k8s-monitoring-feature-auto-instrumentation-1.0.0.tgz index 20333ea1ed..6a77ae52af 100644 Binary files a/charts/k8s-monitoring/charts/k8s-monitoring-feature-auto-instrumentation-1.0.0.tgz and b/charts/k8s-monitoring/charts/k8s-monitoring-feature-auto-instrumentation-1.0.0.tgz differ diff --git a/charts/k8s-monitoring/charts/k8s-monitoring-feature-cluster-events-1.0.0.tgz b/charts/k8s-monitoring/charts/k8s-monitoring-feature-cluster-events-1.0.0.tgz index 9b3a0ee341..fe4cb69d6b 100644 Binary files a/charts/k8s-monitoring/charts/k8s-monitoring-feature-cluster-events-1.0.0.tgz and b/charts/k8s-monitoring/charts/k8s-monitoring-feature-cluster-events-1.0.0.tgz differ diff --git a/charts/k8s-monitoring/charts/k8s-monitoring-feature-cluster-metrics-1.0.0.tgz b/charts/k8s-monitoring/charts/k8s-monitoring-feature-cluster-metrics-1.0.0.tgz index 21de443e78..3bbac97e03 100644 Binary files a/charts/k8s-monitoring/charts/k8s-monitoring-feature-cluster-metrics-1.0.0.tgz and b/charts/k8s-monitoring/charts/k8s-monitoring-feature-cluster-metrics-1.0.0.tgz differ diff --git a/charts/k8s-monitoring/charts/k8s-monitoring-feature-integrations-1.0.0.tgz b/charts/k8s-monitoring/charts/k8s-monitoring-feature-integrations-1.0.0.tgz index f40d879cfb..35d830b55f 100644 Binary files a/charts/k8s-monitoring/charts/k8s-monitoring-feature-integrations-1.0.0.tgz and b/charts/k8s-monitoring/charts/k8s-monitoring-feature-integrations-1.0.0.tgz differ diff --git a/charts/k8s-monitoring/charts/k8s-monitoring-feature-pod-logs-1.0.0.tgz b/charts/k8s-monitoring/charts/k8s-monitoring-feature-pod-logs-1.0.0.tgz index 46b538c87e..055bd28253 100644 Binary files a/charts/k8s-monitoring/charts/k8s-monitoring-feature-pod-logs-1.0.0.tgz and b/charts/k8s-monitoring/charts/k8s-monitoring-feature-pod-logs-1.0.0.tgz differ diff --git a/charts/k8s-monitoring/charts/k8s-monitoring-feature-profiling-1.0.0.tgz b/charts/k8s-monitoring/charts/k8s-monitoring-feature-profiling-1.0.0.tgz index 4d34e1d347..4c05fdb830 100644 Binary files a/charts/k8s-monitoring/charts/k8s-monitoring-feature-profiling-1.0.0.tgz and b/charts/k8s-monitoring/charts/k8s-monitoring-feature-profiling-1.0.0.tgz differ diff --git a/charts/k8s-monitoring/charts/k8s-monitoring-feature-prometheus-operator-objects-1.0.0.tgz b/charts/k8s-monitoring/charts/k8s-monitoring-feature-prometheus-operator-objects-1.0.0.tgz index ea58e04163..f028023cc2 100644 Binary files a/charts/k8s-monitoring/charts/k8s-monitoring-feature-prometheus-operator-objects-1.0.0.tgz and b/charts/k8s-monitoring/charts/k8s-monitoring-feature-prometheus-operator-objects-1.0.0.tgz differ diff --git a/charts/k8s-monitoring/docs/examples/features/auto-instrumentation/beyla-metrics-and-traces/output.yaml b/charts/k8s-monitoring/docs/examples/features/auto-instrumentation/beyla-metrics-and-traces/output.yaml index feb34cf165..85ebbca7db 100644 --- a/charts/k8s-monitoring/docs/examples/features/auto-instrumentation/beyla-metrics-and-traces/output.yaml +++ b/charts/k8s-monitoring/docs/examples/features/auto-instrumentation/beyla-metrics-and-traces/output.yaml @@ -38,10 +38,10 @@ metadata: name: ko-beyla namespace: default labels: - helm.sh/chart: beyla-1.4.12 + helm.sh/chart: beyla-1.4.13 app.kubernetes.io/name: beyla app.kubernetes.io/instance: ko - app.kubernetes.io/version: "1.8.6" + app.kubernetes.io/version: "1.8.8" app.kubernetes.io/managed-by: Helm app.kubernetes.io/part-of: beyla app.kubernetes.io/component: rbac @@ -398,10 +398,10 @@ metadata: name: ko-beyla namespace: default labels: - helm.sh/chart: beyla-1.4.12 + helm.sh/chart: beyla-1.4.13 app.kubernetes.io/name: beyla app.kubernetes.io/instance: ko - app.kubernetes.io/version: "1.8.6" + app.kubernetes.io/version: "1.8.8" app.kubernetes.io/managed-by: Helm app.kubernetes.io/part-of: beyla app.kubernetes.io/component: config @@ -649,10 +649,10 @@ kind: ClusterRole metadata: name: ko-beyla labels: - helm.sh/chart: beyla-1.4.12 + helm.sh/chart: beyla-1.4.13 app.kubernetes.io/name: beyla app.kubernetes.io/instance: ko - app.kubernetes.io/version: "1.8.6" + app.kubernetes.io/version: "1.8.8" app.kubernetes.io/managed-by: Helm app.kubernetes.io/part-of: beyla app.kubernetes.io/component: rbac @@ -716,10 +716,10 @@ kind: ClusterRoleBinding metadata: name: ko-beyla labels: - helm.sh/chart: beyla-1.4.12 + helm.sh/chart: beyla-1.4.13 app.kubernetes.io/name: beyla app.kubernetes.io/instance: ko - app.kubernetes.io/version: "1.8.6" + app.kubernetes.io/version: "1.8.8" app.kubernetes.io/managed-by: Helm app.kubernetes.io/part-of: beyla app.kubernetes.io/component: rbac @@ -932,10 +932,10 @@ metadata: name: ko-beyla namespace: default labels: - helm.sh/chart: beyla-1.4.12 + helm.sh/chart: beyla-1.4.13 app.kubernetes.io/name: beyla app.kubernetes.io/instance: ko - app.kubernetes.io/version: "1.8.6" + app.kubernetes.io/version: "1.8.8" app.kubernetes.io/managed-by: Helm app.kubernetes.io/part-of: beyla app.kubernetes.io/component: workload @@ -952,10 +952,10 @@ spec: checksum/config: 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b k8s.grafana.com/logs.job: integrations/beyla labels: - helm.sh/chart: beyla-1.4.12 + helm.sh/chart: beyla-1.4.13 app.kubernetes.io/name: beyla app.kubernetes.io/instance: ko - app.kubernetes.io/version: "1.8.6" + app.kubernetes.io/version: "1.8.8" app.kubernetes.io/managed-by: Helm app.kubernetes.io/part-of: beyla app.kubernetes.io/component: workload @@ -964,7 +964,7 @@ spec: hostPID: true containers: - name: beyla - image: docker.io/grafana/beyla:1.8.6 + image: docker.io/grafana/beyla:1.8.8 imagePullPolicy: IfNotPresent securityContext: privileged: true diff --git a/charts/k8s-monitoring/docs/examples/features/auto-instrumentation/beyla-metrics/output.yaml b/charts/k8s-monitoring/docs/examples/features/auto-instrumentation/beyla-metrics/output.yaml index 226b63858e..ca39662e63 100644 --- a/charts/k8s-monitoring/docs/examples/features/auto-instrumentation/beyla-metrics/output.yaml +++ b/charts/k8s-monitoring/docs/examples/features/auto-instrumentation/beyla-metrics/output.yaml @@ -22,10 +22,10 @@ metadata: name: ko-beyla namespace: default labels: - helm.sh/chart: beyla-1.4.12 + helm.sh/chart: beyla-1.4.13 app.kubernetes.io/name: beyla app.kubernetes.io/instance: ko - app.kubernetes.io/version: "1.8.6" + app.kubernetes.io/version: "1.8.8" app.kubernetes.io/managed-by: Helm app.kubernetes.io/part-of: beyla app.kubernetes.io/component: rbac @@ -195,10 +195,10 @@ metadata: name: ko-beyla namespace: default labels: - helm.sh/chart: beyla-1.4.12 + helm.sh/chart: beyla-1.4.13 app.kubernetes.io/name: beyla app.kubernetes.io/instance: ko - app.kubernetes.io/version: "1.8.6" + app.kubernetes.io/version: "1.8.8" app.kubernetes.io/managed-by: Helm app.kubernetes.io/part-of: beyla app.kubernetes.io/component: config @@ -344,10 +344,10 @@ kind: ClusterRole metadata: name: ko-beyla labels: - helm.sh/chart: beyla-1.4.12 + helm.sh/chart: beyla-1.4.13 app.kubernetes.io/name: beyla app.kubernetes.io/instance: ko - app.kubernetes.io/version: "1.8.6" + app.kubernetes.io/version: "1.8.8" app.kubernetes.io/managed-by: Helm app.kubernetes.io/part-of: beyla app.kubernetes.io/component: rbac @@ -388,10 +388,10 @@ kind: ClusterRoleBinding metadata: name: ko-beyla labels: - helm.sh/chart: beyla-1.4.12 + helm.sh/chart: beyla-1.4.13 app.kubernetes.io/name: beyla app.kubernetes.io/instance: ko - app.kubernetes.io/version: "1.8.6" + app.kubernetes.io/version: "1.8.8" app.kubernetes.io/managed-by: Helm app.kubernetes.io/part-of: beyla app.kubernetes.io/component: rbac @@ -470,10 +470,10 @@ metadata: name: ko-beyla namespace: default labels: - helm.sh/chart: beyla-1.4.12 + helm.sh/chart: beyla-1.4.13 app.kubernetes.io/name: beyla app.kubernetes.io/instance: ko - app.kubernetes.io/version: "1.8.6" + app.kubernetes.io/version: "1.8.8" app.kubernetes.io/managed-by: Helm app.kubernetes.io/part-of: beyla app.kubernetes.io/component: workload @@ -490,10 +490,10 @@ spec: checksum/config: 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b k8s.grafana.com/logs.job: integrations/beyla labels: - helm.sh/chart: beyla-1.4.12 + helm.sh/chart: beyla-1.4.13 app.kubernetes.io/name: beyla app.kubernetes.io/instance: ko - app.kubernetes.io/version: "1.8.6" + app.kubernetes.io/version: "1.8.8" app.kubernetes.io/managed-by: Helm app.kubernetes.io/part-of: beyla app.kubernetes.io/component: workload @@ -502,7 +502,7 @@ spec: hostPID: true containers: - name: beyla - image: docker.io/grafana/beyla:1.8.6 + image: docker.io/grafana/beyla:1.8.8 imagePullPolicy: IfNotPresent securityContext: privileged: true diff --git a/charts/k8s-monitoring/docs/examples/features/integrations/alloy/README.md b/charts/k8s-monitoring/docs/examples/features/integrations/alloy/README.md index 7916ad7b97..47d28ae1b6 100644 --- a/charts/k8s-monitoring/docs/examples/features/integrations/alloy/README.md +++ b/charts/k8s-monitoring/docs/examples/features/integrations/alloy/README.md @@ -20,8 +20,6 @@ integrations: alloy: instances: - name: alloy-metrics - labelSelectors: - app.kubernetes.io/name: alloy-metrics alloy-metrics: enabled: true diff --git a/charts/k8s-monitoring/docs/examples/features/integrations/alloy/values.yaml b/charts/k8s-monitoring/docs/examples/features/integrations/alloy/values.yaml index 9e664b9bdd..09347ced5b 100644 --- a/charts/k8s-monitoring/docs/examples/features/integrations/alloy/values.yaml +++ b/charts/k8s-monitoring/docs/examples/features/integrations/alloy/values.yaml @@ -11,8 +11,6 @@ integrations: alloy: instances: - name: alloy-metrics - labelSelectors: - app.kubernetes.io/name: alloy-metrics alloy-metrics: enabled: true