From 1d4e6fcc407cab9fc99894b47d514da1b9402e4e Mon Sep 17 00:00:00 2001 From: Prashant Shahi Date: Fri, 21 Jun 2024 14:49:02 +0530 Subject: [PATCH 01/12] feat(k8s-infra): introduce prometheus scraper using pod annotations Signed-off-by: Prashant Shahi --- charts/k8s-infra/templates/_config.tpl | 153 +++++++++++++++++++++++++ charts/k8s-infra/values.yaml | 34 ++++++ 2 files changed, 187 insertions(+) diff --git a/charts/k8s-infra/templates/_config.tpl b/charts/k8s-infra/templates/_config.tpl index 2f2fb76b..96dc4cc8 100644 --- a/charts/k8s-infra/templates/_config.tpl +++ b/charts/k8s-infra/templates/_config.tpl @@ -71,6 +71,9 @@ Build config file for deployment OpenTelemetry Collector: OtelDeployment {{- if .Values.presets.clusterMetrics.enabled }} {{- $config = (include "opentelemetry-collector.applyClusterMetricsConfig" (dict "Values" $data "config" $config) | fromYaml) }} {{- end }} +{{- if and .Values.presets.prometheusScraper.enabled (or .Values.presets.prometheusScraper.signoz.enabled .Values.presets.prometheusScraper.prometheus.enabled) }} +{{- $config = (include "opentelemetry-collector.applyPrometheusScraperConfig" (dict "Values" $data "config" $config) | fromYaml) }} +{{- end }} {{- if .Values.presets.loggingExporter.enabled }} {{- $config = (include "opentelemetry-collector.applyLoggingExporterConfig" (dict "Values" $data "config" $config) | fromYaml) }} {{- end }} @@ -80,6 +83,9 @@ Build config file for deployment OpenTelemetry Collector: OtelDeployment {{- if or (eq (len (index (index $config.service.pipelines "metrics/internal") "receivers")) 0) (eq (len (index (index $config.service.pipelines "metrics/internal") "exporters")) 0) }} {{- $_ := unset $config.service.pipelines "metrics/internal" }} {{- end }} +{{- if or (eq (len (index (index $config.service.pipelines "metrics/scraper") "receivers")) 0) (eq (len (index (index $config.service.pipelines "metrics/scraper") "exporters")) 0) }} +{{- $_ := unset $config.service.pipelines "metrics/scraper" }} +{{- end }} {{- tpl (toYaml $config) . }} {{- end }} @@ -97,6 +103,9 @@ Build config file for deployment OpenTelemetry Collector: OtelDeployment {{- if index $config.service.pipelines "metrics/internal" }} {{- $_ := set (index $config.service.pipelines "metrics/internal") "exporters" (prepend (index (index $config.service.pipelines "metrics/internal") "exporters") "logging" | uniq) }} {{- end }} +{{- if index $config.service.pipelines "metrics/scraper" }} +{{- $_ := set (index $config.service.pipelines "metrics/scraper") "exporters" (prepend (index (index $config.service.pipelines "metrics/scraper") "exporters") "logging" | uniq) }} +{{- end }} {{- $config | toYaml }} {{- end }} @@ -125,6 +134,9 @@ exporters: {{- if index $config.service.pipelines "metrics/internal" }} {{- $_ := set (index $config.service.pipelines "metrics/internal") "exporters" (prepend (index (index $config.service.pipelines "metrics/internal") "exporters") "otlp" | uniq) }} {{- end }} +{{- if index $config.service.pipelines "metrics/scraper" }} +{{- $_ := set (index $config.service.pipelines "metrics/scraper") "exporters" (prepend (index (index $config.service.pipelines "metrics/scraper") "exporters") "otlp" | uniq) }} +{{- end }} {{- $config | toYaml }} {{- end }} @@ -164,6 +176,147 @@ receivers: {{- toYaml .Values.presets.clusterMetrics.allocatableTypesToReport | nindent 6 }} {{- end }} +{{- define "opentelemetry-collector.applyPrometheusScraperConfig" -}} +{{- $config := mustMergeOverwrite (include "opentelemetry-collector.prometheusScraperConfig" .Values | fromYaml) .config }} +{{- if index $config.service.pipelines "metrics/internal" }} +{{- $_ := set (index $config.service.pipelines "metrics/internal") "receivers" (append (index (index $config.service.pipelines "metrics/internal") "receivers") "prometheus" | uniq) }} +{{- end }} +{{- $config | toYaml }} +{{- end }} + +{{- define "opentelemetry-collector.prometheusScraperConfig" -}} +receivers: + prometheus/scraper: + config: + scrape_configs: + {{- if .Values.presets.prometheusScraper.signoz.enabled }} + - job_name: "signoz-scraper" + scrape_interval: {{ .Values.presets.prometheusScraper.signoz.scrapeInterval }} + kubernetes_sd_configs: + - role: pod + {{- if .Values.presets.prometheusScraper.signoz.namespaceScoped }} + namespaces: + own_namespace: true + {{- end }} + relabel_configs: + - source_labels: [__meta_kubernetes_pod_annotation_signoz_io_scrape] + action: keep + regex: true + - source_labels: [__meta_kubernetes_pod_annotation_signoz_io_path] + action: replace + target_label: __metrics_path__ + regex: (.+) + - source_labels: [__meta_kubernetes_pod_ip, __meta_kubernetes_pod_annotation_signoz_io_port] + action: replace + separator: ":" + target_label: __address__ + - target_label: job_name + replacement: signoz-scraper + {{- if .Values.presets.prometheusScraper.signoz.includePodLabel }} + - action: labelmap + regex: __meta_kubernetes_pod_label_(.+) + {{- end }} + - source_labels: [__meta_kubernetes_pod_label_app_kubernetes_io_name] + action: replace + target_label: signoz_k8s_name + - source_labels: [__meta_kubernetes_pod_label_app_kubernetes_io_instance] + action: replace + target_label: signoz_k8s_instance + - source_labels: [__meta_kubernetes_pod_label_app_kubernetes_io_component] + action: replace + target_label: signoz_k8s_component + - source_labels: [__meta_kubernetes_namespace] + action: replace + target_label: k8s_namespace_name + - source_labels: [__meta_kubernetes_pod_name] + action: replace + target_label: k8s_pod_name + - source_labels: [__meta_kubernetes_pod_uid] + action: replace + target_label: k8s_pod_uid + {{- if .Values.presets.prometheusScraper.signoz.includeContainerName }} + - source_labels: [__meta_kubernetes_pod_container_name] + action: replace + target_label: k8s_container_name + - source_labels: [__meta_kubernetes_pod_container_name] + regex: (.+)-init + action: drop + {{- end }} + - source_labels: [__meta_kubernetes_pod_node_name] + action: replace + target_label: k8s_node_name + - source_labels: [__meta_kubernetes_pod_ready] + action: replace + target_label: k8s_pod_ready + - source_labels: [__meta_kubernetes_pod_phase] + action: replace + target_label: k8s_pod_phase + {{- end }} + {{- if .Values.presets.prometheusScraper.prometheus.enabled }} + - job_name: "prometheus-scraper" + scrape_interval: {{ .Values.presets.prometheusScraper.prometheus.scrapeInterval }} + kubernetes_sd_configs: + - role: pod + {{- if .Values.presets.prometheusScraper.prometheus.namespaceScoped }} + namespaces: + own_namespace: true + {{- end }} + relabel_configs: + - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape] + action: keep + regex: true + - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_path] + action: replace + target_label: __metrics_path__ + regex: (.+) + - source_labels: [__meta_kubernetes_pod_ip, __meta_kubernetes_pod_annotation_prometheus_io_port] + action: replace + separator: ":" + target_label: __address__ + - target_label: job_name + replacement: prometheus-scraper + {{- if .Values.presets.prometheusScraper.prometheus.includePodLabel }} + - action: labelmap + regex: __meta_kubernetes_pod_label_(.+) + {{- end }} + - source_labels: [__meta_kubernetes_pod_label_app_kubernetes_io_name] + action: replace + target_label: signoz_k8s_name + - source_labels: [__meta_kubernetes_pod_label_app_kubernetes_io_instance] + action: replace + target_label: signoz_k8s_instance + - source_labels: [__meta_kubernetes_pod_label_app_kubernetes_io_component] + action: replace + target_label: signoz_k8s_component + - source_labels: [__meta_kubernetes_namespace] + action: replace + target_label: k8s_namespace_name + - source_labels: [__meta_kubernetes_pod_name] + action: replace + target_label: k8s_pod_name + - source_labels: [__meta_kubernetes_pod_uid] + action: replace + target_label: k8s_pod_uid + {{- if .Values.presets.prometheusScraper.prometheus.includeContainerName }} + - source_labels: [__meta_kubernetes_pod_container_name] + action: replace + target_label: k8s_container_name + - source_labels: [__meta_kubernetes_pod_container_name] + regex: (.+)-init + action: drop + {{- end }} + - source_labels: [__meta_kubernetes_pod_node_name] + action: replace + target_label: k8s_node_name + - source_labels: [__meta_kubernetes_pod_ready] + action: replace + target_label: k8s_pod_ready + - source_labels: [__meta_kubernetes_pod_phase] + action: replace + target_label: k8s_pod_phase + {{- end }} +{{- end }} + {{- define "opentelemetry-collector.applyHostMetricsConfig" -}} {{- $config := mustMergeOverwrite (include "opentelemetry-collector.hostMetricsConfig" .Values | fromYaml) .config }} {{- if index $config.service.pipelines "metrics/internal" }} diff --git a/charts/k8s-infra/values.yaml b/charts/k8s-infra/values.yaml index ea86151d..d2023ee9 100644 --- a/charts/k8s-infra/values.yaml +++ b/charts/k8s-infra/values.yaml @@ -270,6 +270,36 @@ presets: - memory # - ephemeral-storage # - storage + prometheusScraper: + enabled: true + signoz: + # -- Whether to enable metrics scraping using `signoz.io/scrape` pod annotation + enabled: true + # -- How often to scrape metrics + scrapeInterval: 60s + # -- Whether to only scrape metrics from pods in the same namespace + namespaceScoped: false + # -- This will include all pod labels in the metrics, could potentially cause + # performance issues with large number of pods with many labels + includePodLabel: false + # -- This is not recommended in case of multiple containers or init containers in a pod + # Since it will create multiple timeseries for the same pod metrics with different container names + # containers with `-init` suffix in the name will be ignored + includeContainerName: false + prometheus: + # -- Whether to enable metrics scraping using `prometheus.io/scrape` pod annotation + enabled: false + # -- How often to scrape metrics + scrapeInterval: 60s + # -- Whether to only scrape metrics from pods in the same namespace + namespaceScoped: false + # -- This will include all pod labels in the metrics, could potentially cause + # performance issues with large number of pods with many labels + includePodLabel: false + # -- This is not recommended to be enabled in case of multiple containers or init containers in a pod + # Since it will create multiple timeseries for the same pod metrics with different container names + # containers with `-init` suffix in the name will be ignored + includeContainerName: true resourceDetectionInternal: enabled: true timeout: 2s @@ -931,3 +961,7 @@ otelDeployment: receivers: [] processors: [batch] exporters: [] + metrics/scraper: + receivers: [] + processors: [batch] + exporters: [] From e39b6203de59a7f5e45a80126663e61069960f97 Mon Sep 17 00:00:00 2001 From: Prashant Shahi Date: Fri, 21 Jun 2024 15:21:17 +0530 Subject: [PATCH 02/12] chore(k8s-infra): include namespace in test-connection Signed-off-by: Prashant Shahi --- charts/k8s-infra/templates/otel-agent/tests/test-connection.yaml | 1 + .../templates/otel-deployment/tests/test-connection.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/charts/k8s-infra/templates/otel-agent/tests/test-connection.yaml b/charts/k8s-infra/templates/otel-agent/tests/test-connection.yaml index fc90bb38..f2eb738c 100644 --- a/charts/k8s-infra/templates/otel-agent/tests/test-connection.yaml +++ b/charts/k8s-infra/templates/otel-agent/tests/test-connection.yaml @@ -4,6 +4,7 @@ apiVersion: v1 kind: Pod metadata: name: "{{ include "otelAgent.fullname" . }}-test-connection" + namespace: {{ include "k8s-infra.namespace" . }} annotations: "helm.sh/hook": test spec: diff --git a/charts/k8s-infra/templates/otel-deployment/tests/test-connection.yaml b/charts/k8s-infra/templates/otel-deployment/tests/test-connection.yaml index 2f98e336..9c8c6de8 100644 --- a/charts/k8s-infra/templates/otel-deployment/tests/test-connection.yaml +++ b/charts/k8s-infra/templates/otel-deployment/tests/test-connection.yaml @@ -4,6 +4,7 @@ apiVersion: v1 kind: Pod metadata: name: "{{ include "otelDeployment.fullname" . }}-test-connection" + namespace: {{ include "k8s-infra.namespace" . }} labels: {{- include "otelDeployment.labels" . | nindent 4 }} annotations: From aa1dfd7fc4b554eaaf4be520b0866f31c1c006be Mon Sep 17 00:00:00 2001 From: Prashant Shahi Date: Fri, 21 Jun 2024 15:39:55 +0530 Subject: [PATCH 03/12] chore(k8s-infra): update receiver name in template Signed-off-by: Prashant Shahi --- charts/k8s-infra/templates/_config.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/k8s-infra/templates/_config.tpl b/charts/k8s-infra/templates/_config.tpl index 96dc4cc8..d299dfe7 100644 --- a/charts/k8s-infra/templates/_config.tpl +++ b/charts/k8s-infra/templates/_config.tpl @@ -179,7 +179,7 @@ receivers: {{- define "opentelemetry-collector.applyPrometheusScraperConfig" -}} {{- $config := mustMergeOverwrite (include "opentelemetry-collector.prometheusScraperConfig" .Values | fromYaml) .config }} {{- if index $config.service.pipelines "metrics/internal" }} -{{- $_ := set (index $config.service.pipelines "metrics/internal") "receivers" (append (index (index $config.service.pipelines "metrics/internal") "receivers") "prometheus" | uniq) }} +{{- $_ := set (index $config.service.pipelines "metrics/internal") "receivers" (append (index (index $config.service.pipelines "metrics/internal") "receivers") "prometheus/scraper" | uniq) }} {{- end }} {{- $config | toYaml }} {{- end }} From 173a46e9d24d760242eeece46d40b6640941c70f Mon Sep 17 00:00:00 2001 From: Prashant Shahi Date: Fri, 21 Jun 2024 15:45:58 +0530 Subject: [PATCH 04/12] chore(k8s-infra): support namespace whitelisting and enable prometheus by default Signed-off-by: Prashant Shahi --- charts/k8s-infra/templates/_config.tpl | 15 +++++++++++++-- charts/k8s-infra/values.yaml | 10 +++++++--- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/charts/k8s-infra/templates/_config.tpl b/charts/k8s-infra/templates/_config.tpl index d299dfe7..0adce368 100644 --- a/charts/k8s-infra/templates/_config.tpl +++ b/charts/k8s-infra/templates/_config.tpl @@ -194,9 +194,14 @@ receivers: scrape_interval: {{ .Values.presets.prometheusScraper.signoz.scrapeInterval }} kubernetes_sd_configs: - role: pod - {{- if .Values.presets.prometheusScraper.signoz.namespaceScoped }} + {{- if or .Values.presets.prometheusScraper.signoz.namespaceScoped (len .Values.presets.prometheusScraper.signoz.namespaces) }} namespaces: + {{- if .Values.presets.prometheusScraper.signoz.namespaceScoped }} own_namespace: true + {{- end }} + {{- if .Values.presets.prometheusScraper.signoz.namespaces }} + names: {{ toYaml .Values.presets.prometheusScraper.signoz.namespaces | nindent 16 }} + {{- end }} {{- end }} relabel_configs: - source_labels: [__meta_kubernetes_pod_annotation_signoz_io_scrape] @@ -257,9 +262,15 @@ receivers: scrape_interval: {{ .Values.presets.prometheusScraper.prometheus.scrapeInterval }} kubernetes_sd_configs: - role: pod - {{- if .Values.presets.prometheusScraper.prometheus.namespaceScoped }} + {{- if or .Values.presets.prometheusScraper.prometheus.namespaceScoped (len .Values.presets.prometheusScraper.prometheus.namespaces) }} namespaces: + {{- if .Values.presets.prometheusScraper.prometheus.namespaceScoped }} own_namespace: true + {{- end }} + {{- if.Values.presets.prometheusScraper.prometheus.namespaces }} + names: + {{- toYaml .Values.presets.prometheusScraper.prometheus.namespaces | nindent 16 }} + {{- end }} {{- end }} relabel_configs: - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape] diff --git a/charts/k8s-infra/values.yaml b/charts/k8s-infra/values.yaml index d2023ee9..ea626390 100644 --- a/charts/k8s-infra/values.yaml +++ b/charts/k8s-infra/values.yaml @@ -279,6 +279,8 @@ presets: scrapeInterval: 60s # -- Whether to only scrape metrics from pods in the same namespace namespaceScoped: false + # -- If set, only scrape metrics from pods in the specified namespaces + namespaces: [] # -- This will include all pod labels in the metrics, could potentially cause # performance issues with large number of pods with many labels includePodLabel: false @@ -288,18 +290,20 @@ presets: includeContainerName: false prometheus: # -- Whether to enable metrics scraping using `prometheus.io/scrape` pod annotation - enabled: false + enabled: true # -- How often to scrape metrics scrapeInterval: 60s - # -- Whether to only scrape metrics from pods in the same namespace + # -- If enabled, only scrape metrics from pods in the same namespace namespaceScoped: false + # -- If set, only scrape metrics from pods in the specified namespaces + namespaces: [] # -- This will include all pod labels in the metrics, could potentially cause # performance issues with large number of pods with many labels includePodLabel: false # -- This is not recommended to be enabled in case of multiple containers or init containers in a pod # Since it will create multiple timeseries for the same pod metrics with different container names # containers with `-init` suffix in the name will be ignored - includeContainerName: true + includeContainerName: false resourceDetectionInternal: enabled: true timeout: 2s From a34cf896c81ebd8292a2148c3cee5743d902bbb6 Mon Sep 17 00:00:00 2001 From: Prashant Shahi Date: Tue, 7 Jan 2025 04:55:17 +0530 Subject: [PATCH 05/12] feat(k8s-infra): single generic prometheus scraper Signed-off-by: Prashant Shahi --- charts/k8s-infra/templates/_config.tpl | 103 ++++++------------------- charts/k8s-infra/values.yaml | 52 +++++-------- 2 files changed, 40 insertions(+), 115 deletions(-) diff --git a/charts/k8s-infra/templates/_config.tpl b/charts/k8s-infra/templates/_config.tpl index 95a677e8..dd161882 100644 --- a/charts/k8s-infra/templates/_config.tpl +++ b/charts/k8s-infra/templates/_config.tpl @@ -71,7 +71,7 @@ Build config file for deployment OpenTelemetry Collector: OtelDeployment {{- if .Values.presets.clusterMetrics.enabled }} {{- $config = (include "opentelemetry-collector.applyClusterMetricsConfig" (dict "Values" $data "config" $config) | fromYaml) }} {{- end }} -{{- if and .Values.presets.prometheusScraper.enabled (or .Values.presets.prometheusScraper.signoz.enabled .Values.presets.prometheusScraper.prometheus.enabled) }} +{{- if and .Values.presets.prometheus.enabled (or .Values.presets.prometheus.enabled .Values.presets.prometheus.prometheus.enabled) }} {{- $config = (include "opentelemetry-collector.applyPrometheusScraperConfig" (dict "Values" $data "config" $config) | fromYaml) }} {{- end }} {{- if .Values.presets.k8sEvents.enabled }} @@ -209,109 +209,50 @@ receivers: {{- $config | toYaml }} {{- end }} +{{- define "opentelemetry-collector.convertAnnotationToPrometheusMetaLabel" -}} +{{- $name := . | lower -}} +{{- $name = regexReplaceAll "\\." $name "_" -}} +{{- $name := regexReplaceAll "/" $name "_" -}} +{{- $name := regexReplaceAll "-" $name "_" -}} +{{- $name := regexReplaceAll "[^a-z0-9_]" $name "_" -}} +{{- $name -}} +{{- end -}} + {{- define "opentelemetry-collector.prometheusScraperConfig" -}} +{{- $annotationsPrefix := include "opentelemetry-collector.convertAnnotationToPrometheusMetaLabel" .Values.presets.prometheus.annotationsPrefix }} receivers: prometheus/scraper: config: scrape_configs: - {{- if .Values.presets.prometheusScraper.signoz.enabled }} + {{- if .Values.presets.prometheus.enabled }} - job_name: "signoz-scraper" - scrape_interval: {{ .Values.presets.prometheusScraper.signoz.scrapeInterval }} + scrape_interval: {{ .Values.presets.prometheus.scrapeInterval }} kubernetes_sd_configs: - role: pod - {{- if or .Values.presets.prometheusScraper.signoz.namespaceScoped (len .Values.presets.prometheusScraper.signoz.namespaces) }} + {{- if or .Values.presets.prometheus.namespaceScoped (len .Values.presets.prometheus.namespaces) }} namespaces: - {{- if .Values.presets.prometheusScraper.signoz.namespaceScoped }} + {{- if .Values.presets.prometheus.namespaceScoped }} own_namespace: true {{- end }} - {{- if .Values.presets.prometheusScraper.signoz.namespaces }} - names: {{ toYaml .Values.presets.prometheusScraper.signoz.namespaces | nindent 16 }} + {{- if .Values.presets.prometheus.namespaces }} + names: {{ toYaml .Values.presets.prometheus.namespaces | nindent 16 }} {{- end }} {{- end }} relabel_configs: - - source_labels: [__meta_kubernetes_pod_annotation_signoz_io_scrape] + - source_labels: [__meta_kubernetes_pod_annotation_{{ $annotationsPrefix }}_scrape] action: keep regex: true - - source_labels: [__meta_kubernetes_pod_annotation_signoz_io_path] + - source_labels: [__meta_kubernetes_pod_annotation_{{ $annotationsPrefix }}_path] action: replace target_label: __metrics_path__ regex: (.+) - - source_labels: [__meta_kubernetes_pod_ip, __meta_kubernetes_pod_annotation_signoz_io_port] + - source_labels: [__meta_kubernetes_pod_ip, __meta_kubernetes_pod_annotation_{{ $annotationsPrefix }}_port] action: replace separator: ":" target_label: __address__ - target_label: job_name replacement: signoz-scraper - {{- if .Values.presets.prometheusScraper.signoz.includePodLabel }} - - action: labelmap - regex: __meta_kubernetes_pod_label_(.+) - {{- end }} - - source_labels: [__meta_kubernetes_pod_label_app_kubernetes_io_name] - action: replace - target_label: signoz_k8s_name - - source_labels: [__meta_kubernetes_pod_label_app_kubernetes_io_instance] - action: replace - target_label: signoz_k8s_instance - - source_labels: [__meta_kubernetes_pod_label_app_kubernetes_io_component] - action: replace - target_label: signoz_k8s_component - - source_labels: [__meta_kubernetes_namespace] - action: replace - target_label: k8s_namespace_name - - source_labels: [__meta_kubernetes_pod_name] - action: replace - target_label: k8s_pod_name - - source_labels: [__meta_kubernetes_pod_uid] - action: replace - target_label: k8s_pod_uid - {{- if .Values.presets.prometheusScraper.signoz.includeContainerName }} - - source_labels: [__meta_kubernetes_pod_container_name] - action: replace - target_label: k8s_container_name - - source_labels: [__meta_kubernetes_pod_container_name] - regex: (.+)-init - action: drop - {{- end }} - - source_labels: [__meta_kubernetes_pod_node_name] - action: replace - target_label: k8s_node_name - - source_labels: [__meta_kubernetes_pod_ready] - action: replace - target_label: k8s_pod_ready - - source_labels: [__meta_kubernetes_pod_phase] - action: replace - target_label: k8s_pod_phase - {{- end }} - {{- if .Values.presets.prometheusScraper.prometheus.enabled }} - - job_name: "prometheus-scraper" - scrape_interval: {{ .Values.presets.prometheusScraper.prometheus.scrapeInterval }} - kubernetes_sd_configs: - - role: pod - {{- if or .Values.presets.prometheusScraper.prometheus.namespaceScoped (len .Values.presets.prometheusScraper.prometheus.namespaces) }} - namespaces: - {{- if .Values.presets.prometheusScraper.prometheus.namespaceScoped }} - own_namespace: true - {{- end }} - {{- if.Values.presets.prometheusScraper.prometheus.namespaces }} - names: - {{- toYaml .Values.presets.prometheusScraper.prometheus.namespaces | nindent 16 }} - {{- end }} - {{- end }} - relabel_configs: - - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape] - action: keep - regex: true - - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_path] - action: replace - target_label: __metrics_path__ - regex: (.+) - - source_labels: [__meta_kubernetes_pod_ip, __meta_kubernetes_pod_annotation_prometheus_io_port] - action: replace - separator: ":" - target_label: __address__ - - target_label: job_name - replacement: prometheus-scraper - {{- if .Values.presets.prometheusScraper.prometheus.includePodLabel }} + {{- if .Values.presets.prometheus.includePodLabel }} - action: labelmap regex: __meta_kubernetes_pod_label_(.+) {{- end }} @@ -333,7 +274,7 @@ receivers: - source_labels: [__meta_kubernetes_pod_uid] action: replace target_label: k8s_pod_uid - {{- if .Values.presets.prometheusScraper.prometheus.includeContainerName }} + {{- if .Values.presets.prometheus.includeContainerName }} - source_labels: [__meta_kubernetes_pod_container_name] action: replace target_label: k8s_container_name diff --git a/charts/k8s-infra/values.yaml b/charts/k8s-infra/values.yaml index 91dd2ea7..b44ca22d 100644 --- a/charts/k8s-infra/values.yaml +++ b/charts/k8s-infra/values.yaml @@ -309,40 +309,24 @@ presets: enabled: true k8s.pod.status_reason: enabled: true - prometheusScraper: - enabled: true - signoz: - # -- Whether to enable metrics scraping using `signoz.io/scrape` pod annotation - enabled: true - # -- How often to scrape metrics - scrapeInterval: 60s - # -- Whether to only scrape metrics from pods in the same namespace - namespaceScoped: false - # -- If set, only scrape metrics from pods in the specified namespaces - namespaces: [] - # -- This will include all pod labels in the metrics, could potentially cause - # performance issues with large number of pods with many labels - includePodLabel: false - # -- This is not recommended in case of multiple containers or init containers in a pod - # Since it will create multiple timeseries for the same pod metrics with different container names - # containers with `-init` suffix in the name will be ignored - includeContainerName: false - prometheus: - # -- Whether to enable metrics scraping using `prometheus.io/scrape` pod annotation - enabled: true - # -- How often to scrape metrics - scrapeInterval: 60s - # -- If enabled, only scrape metrics from pods in the same namespace - namespaceScoped: false - # -- If set, only scrape metrics from pods in the specified namespaces - namespaces: [] - # -- This will include all pod labels in the metrics, could potentially cause - # performance issues with large number of pods with many labels - includePodLabel: false - # -- This is not recommended to be enabled in case of multiple containers or init containers in a pod - # Since it will create multiple timeseries for the same pod metrics with different container names - # containers with `-init` suffix in the name will be ignored - includeContainerName: false + prometheus: + # -- Whether to enable metrics scraping using pod annotation + enabled: false + # -- Prefix for the pod annotations to be used for metrics scraping + annotationsPrefix: signoz.io + # -- How often to scrape metrics + scrapeInterval: 60s + # -- Whether to only scrape metrics from pods in the same namespace + namespaceScoped: false + # -- If set, only scrape metrics from pods in the specified namespaces + namespaces: [] + # -- This will include all pod labels in the metrics, could potentially cause + # performance issues with large number of pods with many labels + includePodLabel: false + # -- This is not recommended in case of multiple containers or init containers in a pod + # Since it will create multiple timeseries for the same pod metrics with different container names + # containers with `-init` suffix in the name will be ignored + includeContainerName: false resourceDetectionInternal: enabled: true timeout: 2s From 123f791bdd605f3eeb8ee5c4cd8992147b42f458 Mon Sep 17 00:00:00 2001 From: Prashant Shahi Date: Tue, 7 Jan 2025 11:15:17 +0530 Subject: [PATCH 06/12] chore(k8s-infra): update prometheus condition and function name Signed-off-by: Prashant Shahi --- charts/k8s-infra/templates/_config.tpl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/charts/k8s-infra/templates/_config.tpl b/charts/k8s-infra/templates/_config.tpl index dd161882..006cb8c4 100644 --- a/charts/k8s-infra/templates/_config.tpl +++ b/charts/k8s-infra/templates/_config.tpl @@ -71,8 +71,8 @@ Build config file for deployment OpenTelemetry Collector: OtelDeployment {{- if .Values.presets.clusterMetrics.enabled }} {{- $config = (include "opentelemetry-collector.applyClusterMetricsConfig" (dict "Values" $data "config" $config) | fromYaml) }} {{- end }} -{{- if and .Values.presets.prometheus.enabled (or .Values.presets.prometheus.enabled .Values.presets.prometheus.prometheus.enabled) }} -{{- $config = (include "opentelemetry-collector.applyPrometheusScraperConfig" (dict "Values" $data "config" $config) | fromYaml) }} +{{- if .Values.presets.prometheus.enabled }} +{{- $config = (include "opentelemetry-collector.applyPrometheusConfig" (dict "Values" $data "config" $config) | fromYaml) }} {{- end }} {{- if .Values.presets.k8sEvents.enabled }} {{- $config = (include "opentelemetry-collector.applyK8sEventsConfig" (dict "Values" $data "config" $config) | fromYaml) }} @@ -201,8 +201,8 @@ receivers: {{- end }} {{- end }} -{{- define "opentelemetry-collector.applyPrometheusScraperConfig" -}} -{{- $config := mustMergeOverwrite (include "opentelemetry-collector.prometheusScraperConfig" .Values | fromYaml) .config }} +{{- define "opentelemetry-collector.applyPrometheusConfig" -}} +{{- $config := mustMergeOverwrite (include "opentelemetry-collector.prometheusConfig" .Values | fromYaml) .config }} {{- if index $config.service.pipelines "metrics/internal" }} {{- $_ := set (index $config.service.pipelines "metrics/internal") "receivers" (append (index (index $config.service.pipelines "metrics/internal") "receivers") "prometheus/scraper" | uniq) }} {{- end }} @@ -218,7 +218,7 @@ receivers: {{- $name -}} {{- end -}} -{{- define "opentelemetry-collector.prometheusScraperConfig" -}} +{{- define "opentelemetry-collector.prometheusConfig" -}} {{- $annotationsPrefix := include "opentelemetry-collector.convertAnnotationToPrometheusMetaLabel" .Values.presets.prometheus.annotationsPrefix }} receivers: prometheus/scraper: From ef3052b75049c861c0ad89abc2a1b3fc4cd9d9d5 Mon Sep 17 00:00:00 2001 From: Prashant Shahi Date: Tue, 7 Jan 2025 22:47:09 +0530 Subject: [PATCH 07/12] fix(k8s-infra): use metrics/scraper pipeline, remove logs pipeline when empty Signed-off-by: Prashant Shahi --- charts/k8s-infra/templates/_config.tpl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/charts/k8s-infra/templates/_config.tpl b/charts/k8s-infra/templates/_config.tpl index 006cb8c4..61178399 100644 --- a/charts/k8s-infra/templates/_config.tpl +++ b/charts/k8s-infra/templates/_config.tpl @@ -89,6 +89,9 @@ Build config file for deployment OpenTelemetry Collector: OtelDeployment {{- if or (eq (len (index (index $config.service.pipelines "metrics/scraper") "receivers")) 0) (eq (len (index (index $config.service.pipelines "metrics/scraper") "exporters")) 0) }} {{- $_ := unset $config.service.pipelines "metrics/scraper" }} {{- end }} +{{ if or (eq (len $config.service.pipelines.logs.receivers) 0) (eq (len $config.service.pipelines.logs.exporters) 0) }} +{{- $_ := unset $config.service.pipelines "logs" }} +{{- end }} {{- tpl (toYaml $config) . }} {{- end }} @@ -203,8 +206,8 @@ receivers: {{- define "opentelemetry-collector.applyPrometheusConfig" -}} {{- $config := mustMergeOverwrite (include "opentelemetry-collector.prometheusConfig" .Values | fromYaml) .config }} -{{- if index $config.service.pipelines "metrics/internal" }} -{{- $_ := set (index $config.service.pipelines "metrics/internal") "receivers" (append (index (index $config.service.pipelines "metrics/internal") "receivers") "prometheus/scraper" | uniq) }} +{{- if index $config.service.pipelines "metrics/scraper" }} +{{- $_ := set (index $config.service.pipelines "metrics/scraper") "receivers" (append (index (index $config.service.pipelines "metrics/scraper") "receivers") "prometheus/scraper" | uniq) }} {{- end }} {{- $config | toYaml }} {{- end }} From 58080c7c34b808777c0cffe323743db0ef2aa7a8 Mon Sep 17 00:00:00 2001 From: Prashant Shahi Date: Tue, 7 Jan 2025 22:47:27 +0530 Subject: [PATCH 08/12] ci(k8s-infra): tests for prometheus preset Signed-off-by: Prashant Shahi --- .../otel-deployment_prometheus_test.yaml | 139 ++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 charts/k8s-infra/tests/otel-deployment_prometheus_test.yaml diff --git a/charts/k8s-infra/tests/otel-deployment_prometheus_test.yaml b/charts/k8s-infra/tests/otel-deployment_prometheus_test.yaml new file mode 100644 index 00000000..19850fb9 --- /dev/null +++ b/charts/k8s-infra/tests/otel-deployment_prometheus_test.yaml @@ -0,0 +1,139 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json +suite: otel-deployment_prometheus_test.yaml +templates: + - otel-deployment/configmap.yaml +release: + name: k8s-infra + namespace: signoz +set: + presets: + prometheus: + enabled: true + annotationsPrefix: "signoz.io" + scrapeInterval: 60s + loggingExporter: + enabled: true + otlpExporter: + enabled: false + logsCollection: + enabled: false + hostMetrics: + enabled: false + kubeletMetrics: + enabled: false + kubernetesAttributes: + enabled: false + clusterMetrics: + enabled: false + resourceDetectionInternal: + enabled: false + resourceDetection: + enabled: false + k8sEvents: + enabled: false +tests: + - it: should have otel-deployment configuration in otel-deployment-config.yaml + asserts: + - exists: + path: data["otel-deployment-config.yaml"] + - it: should have prometheus/scraper receiver with signoz.io annotations prefix + asserts: + - equal: + path: data["otel-deployment-config.yaml"] + value: |- + exporters: + logging: + sampling_initial: 2 + sampling_thereafter: 500 + verbosity: basic + extensions: + health_check: + endpoint: 0.0.0.0:13133 + pprof: + endpoint: localhost:1777 + zpages: + endpoint: localhost:55679 + processors: + batch: + send_batch_size: 10000 + timeout: 1s + receivers: + prometheus/scraper: + config: + scrape_configs: + - job_name: signoz-scraper + kubernetes_sd_configs: + - role: pod + relabel_configs: + - action: keep + regex: true + source_labels: + - __meta_kubernetes_pod_annotation_signoz_io_scrape + - action: replace + regex: (.+) + source_labels: + - __meta_kubernetes_pod_annotation_signoz_io_path + target_label: __metrics_path__ + - action: replace + separator: ':' + source_labels: + - __meta_kubernetes_pod_ip + - __meta_kubernetes_pod_annotation_signoz_io_port + target_label: __address__ + - replacement: signoz-scraper + target_label: job_name + - action: replace + source_labels: + - __meta_kubernetes_pod_label_app_kubernetes_io_name + target_label: signoz_k8s_name + - action: replace + source_labels: + - __meta_kubernetes_pod_label_app_kubernetes_io_instance + target_label: signoz_k8s_instance + - action: replace + source_labels: + - __meta_kubernetes_pod_label_app_kubernetes_io_component + target_label: signoz_k8s_component + - action: replace + source_labels: + - __meta_kubernetes_namespace + target_label: k8s_namespace_name + - action: replace + source_labels: + - __meta_kubernetes_pod_name + target_label: k8s_pod_name + - action: replace + source_labels: + - __meta_kubernetes_pod_uid + target_label: k8s_pod_uid + - action: replace + source_labels: + - __meta_kubernetes_pod_node_name + target_label: k8s_node_name + - action: replace + source_labels: + - __meta_kubernetes_pod_ready + target_label: k8s_pod_ready + - action: replace + source_labels: + - __meta_kubernetes_pod_phase + target_label: k8s_pod_phase + scrape_interval: 60s + service: + extensions: + - health_check + - zpages + - pprof + pipelines: + metrics/scraper: + exporters: + - logging + processors: + - batch + receivers: + - prometheus/scraper + telemetry: + logs: + encoding: json + metrics: + address: 0.0.0.0:8888 From efd566b2b686c4b7edcf9b85d3224d6325e42274 Mon Sep 17 00:00:00 2001 From: Prashant Shahi Date: Tue, 7 Jan 2025 23:09:34 +0530 Subject: [PATCH 09/12] chore(k8s-infra): remove conflicting attributes from prometheus scraper Signed-off-by: Prashant Shahi --- charts/k8s-infra/templates/_config.tpl | 28 +++++++++++++++++++ .../otel-deployment_prometheus_test.yaml | 28 +++++++++++++++++-- charts/k8s-infra/values.yaml | 5 ---- 3 files changed, 53 insertions(+), 8 deletions(-) diff --git a/charts/k8s-infra/templates/_config.tpl b/charts/k8s-infra/templates/_config.tpl index 61178399..e2602b71 100644 --- a/charts/k8s-infra/templates/_config.tpl +++ b/charts/k8s-infra/templates/_config.tpl @@ -207,6 +207,8 @@ receivers: {{- define "opentelemetry-collector.applyPrometheusConfig" -}} {{- $config := mustMergeOverwrite (include "opentelemetry-collector.prometheusConfig" .Values | fromYaml) .config }} {{- if index $config.service.pipelines "metrics/scraper" }} +{{- $_ := set (index $config.service.pipelines "metrics/scraper") "processors" (prepend (index (index $config.service.pipelines "metrics/scraper") "processors") "attributes/prometheus" | uniq) }} +{{- $_ := set (index $config.service.pipelines "metrics/scraper") "processors" (prepend (index (index $config.service.pipelines "metrics/scraper") "processors") "resource/prometheus" | uniq) }} {{- $_ := set (index $config.service.pipelines "metrics/scraper") "receivers" (append (index (index $config.service.pipelines "metrics/scraper") "receivers") "prometheus/scraper" | uniq) }} {{- end }} {{- $config | toYaml }} @@ -223,6 +225,23 @@ receivers: {{- define "opentelemetry-collector.prometheusConfig" -}} {{- $annotationsPrefix := include "opentelemetry-collector.convertAnnotationToPrometheusMetaLabel" .Values.presets.prometheus.annotationsPrefix }} +processors: + resource/prometheus: + attributes: + - key: service.name + action: delete + - key: service.instance.id + action: delete + - key: service_name + action: delete + - key: service_instance_id + action: delete + attributes/prometheus: + actions: + - key: service_name + action: delete + - key: service_instance_id + action: delete receivers: prometheus/scraper: config: @@ -438,6 +457,9 @@ receivers: {{- if index $config.service.pipelines "metrics/internal" }} {{- $_ := set (index $config.service.pipelines "metrics/internal") "processors" (prepend (index (index $config.service.pipelines "metrics/internal") "processors") "k8sattributes" | uniq) }} {{- end }} +{{- if index $config.service.pipelines "metrics/scraper" }} +{{- $_ := set (index $config.service.pipelines "metrics/scraper") "processors" (prepend (index (index $config.service.pipelines "metrics/scraper") "processors") "k8sattributes" | uniq) }} +{{- end }} {{- $config | toYaml }} {{- end }} @@ -474,6 +496,9 @@ processors: {{- if index $config.service.pipelines "metrics/internal" }} {{- $_ := set (index $config.service.pipelines "metrics/internal") "processors" (prepend (index (index $config.service.pipelines "metrics/internal") "processors") "resourcedetection" | uniq) }} {{- end }} +{{- if index $config.service.pipelines "metrics/scraper" }} +{{- $_ := set (index $config.service.pipelines "metrics/scraper") "processors" (prepend (index (index $config.service.pipelines "metrics/scraper") "processors") "resourcedetection" | uniq) }} +{{- end }} {{- $config | toYaml }} {{- end }} @@ -491,6 +516,9 @@ processors: {{- if index $config.service.pipelines "metrics/internal" }} {{- $_ := set (index $config.service.pipelines "metrics/internal") "processors" (prepend (index (index $config.service.pipelines "metrics/internal") "processors") "resourcedetection" | uniq) }} {{- end }} +{{- if index $config.service.pipelines "metrics/scraper" }} +{{- $_ := set (index $config.service.pipelines "metrics/scraper") "processors" (prepend (index (index $config.service.pipelines "metrics/scraper") "processors") "resourcedetection" | uniq) }} +{{- end }} {{- $config | toYaml }} {{- end }} diff --git a/charts/k8s-infra/tests/otel-deployment_prometheus_test.yaml b/charts/k8s-infra/tests/otel-deployment_prometheus_test.yaml index 19850fb9..11f8a2ed 100644 --- a/charts/k8s-infra/tests/otel-deployment_prometheus_test.yaml +++ b/charts/k8s-infra/tests/otel-deployment_prometheus_test.yaml @@ -25,10 +25,8 @@ set: enabled: false clusterMetrics: enabled: false - resourceDetectionInternal: - enabled: false resourceDetection: - enabled: false + enabled: true k8sEvents: enabled: false tests: @@ -54,9 +52,30 @@ tests: zpages: endpoint: localhost:55679 processors: + attributes/prometheus: + actions: + - action: delete + key: service_name + - action: delete + key: service_instance_id batch: send_batch_size: 10000 timeout: 1s + resource/prometheus: + attributes: + - action: delete + key: service.name + - action: delete + key: service.instance.id + - action: delete + key: service_name + - action: delete + key: service_instance_id + resourcedetection: + detectors: + - env + override: false + timeout: 2s receivers: prometheus/scraper: config: @@ -129,6 +148,9 @@ tests: exporters: - logging processors: + - resource/prometheus + - attributes/prometheus + - resourcedetection - batch receivers: - prometheus/scraper diff --git a/charts/k8s-infra/values.yaml b/charts/k8s-infra/values.yaml index b44ca22d..c75e4722 100644 --- a/charts/k8s-infra/values.yaml +++ b/charts/k8s-infra/values.yaml @@ -327,11 +327,6 @@ presets: # Since it will create multiple timeseries for the same pod metrics with different container names # containers with `-init` suffix in the name will be ignored includeContainerName: false - resourceDetectionInternal: - enabled: true - timeout: 2s - # DO NOT CHANGE BELOW TO false, causes data duplication in case attributes mismatched. - override: true resourceDetection: enabled: true timeout: 2s From bcdf22ffbfb331e022c344e977db9f037fe07165 Mon Sep 17 00:00:00 2001 From: Prashant Shahi Date: Tue, 7 Jan 2025 23:36:25 +0530 Subject: [PATCH 10/12] chore(k8s-infra): update helm installation notes Signed-off-by: Prashant Shahi --- charts/k8s-infra/templates/NOTES.txt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/charts/k8s-infra/templates/NOTES.txt b/charts/k8s-infra/templates/NOTES.txt index b72c1cff..e35494a0 100644 --- a/charts/k8s-infra/templates/NOTES.txt +++ b/charts/k8s-infra/templates/NOTES.txt @@ -1,7 +1,16 @@ + +You have just deployed K8s-Infra chart: + +- otel-agent version: '{{ .Values.otelAgent.image.tag }}' +- otel-deployment version: '{{ .Values.otelDeployment.image.tag }}' + +NOTE: If you enable Prometheus preset in this chart and have installed SigNoz helm chart in the same cluster, + please set otelCollectorMetrics.enabled to false in the signoz chart to avoid data duplication. + {{- if not .Values.otelAgent.configMap.create }} -[WARNING] "configMap" wil not be created and "config" will not take effect. +[WARNING] otel-agent "configMap" will not be created and "otelAgent.config" will not take effect. {{ end }} {{- if not .Values.otelDeployment.configMap.create }} -[WARNING] "configMap" wil not be created and "config" will not take effect. +[WARNING] otel-deployment "configMap" will not be created and "otelDeployment.config" will not take effect. {{ end }} From 59bfced718f334d57817b1386b992876c8564002 Mon Sep 17 00:00:00 2001 From: Prashant Shahi Date: Tue, 7 Jan 2025 23:36:48 +0530 Subject: [PATCH 11/12] chore(release): bump up k8s-infra chart to 0.12.0 Signed-off-by: Prashant Shahi --- charts/k8s-infra/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/k8s-infra/Chart.yaml b/charts/k8s-infra/Chart.yaml index 17410a22..02a0a0e3 100644 --- a/charts/k8s-infra/Chart.yaml +++ b/charts/k8s-infra/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: k8s-infra description: Helm chart for collecting metrics and logs in K8s type: application -version: 0.11.20 +version: 0.12.0 appVersion: "0.109.0" home: https://signoz.io icon: https://signoz.io/img/SigNozLogo-orange.svg From dac5b2336f038f3762fa4206a7257c488ece61a1 Mon Sep 17 00:00:00 2001 From: Prashant Shahi Date: Wed, 8 Jan 2025 00:01:58 +0530 Subject: [PATCH 12/12] chore(k8s-infra): revert conflicting attribute changes - not needed for now Signed-off-by: Prashant Shahi --- charts/k8s-infra/templates/_config.tpl | 19 ------------------- .../otel-deployment_prometheus_test.yaml | 18 ------------------ 2 files changed, 37 deletions(-) diff --git a/charts/k8s-infra/templates/_config.tpl b/charts/k8s-infra/templates/_config.tpl index e2602b71..8a7ae067 100644 --- a/charts/k8s-infra/templates/_config.tpl +++ b/charts/k8s-infra/templates/_config.tpl @@ -207,8 +207,6 @@ receivers: {{- define "opentelemetry-collector.applyPrometheusConfig" -}} {{- $config := mustMergeOverwrite (include "opentelemetry-collector.prometheusConfig" .Values | fromYaml) .config }} {{- if index $config.service.pipelines "metrics/scraper" }} -{{- $_ := set (index $config.service.pipelines "metrics/scraper") "processors" (prepend (index (index $config.service.pipelines "metrics/scraper") "processors") "attributes/prometheus" | uniq) }} -{{- $_ := set (index $config.service.pipelines "metrics/scraper") "processors" (prepend (index (index $config.service.pipelines "metrics/scraper") "processors") "resource/prometheus" | uniq) }} {{- $_ := set (index $config.service.pipelines "metrics/scraper") "receivers" (append (index (index $config.service.pipelines "metrics/scraper") "receivers") "prometheus/scraper" | uniq) }} {{- end }} {{- $config | toYaml }} @@ -225,23 +223,6 @@ receivers: {{- define "opentelemetry-collector.prometheusConfig" -}} {{- $annotationsPrefix := include "opentelemetry-collector.convertAnnotationToPrometheusMetaLabel" .Values.presets.prometheus.annotationsPrefix }} -processors: - resource/prometheus: - attributes: - - key: service.name - action: delete - - key: service.instance.id - action: delete - - key: service_name - action: delete - - key: service_instance_id - action: delete - attributes/prometheus: - actions: - - key: service_name - action: delete - - key: service_instance_id - action: delete receivers: prometheus/scraper: config: diff --git a/charts/k8s-infra/tests/otel-deployment_prometheus_test.yaml b/charts/k8s-infra/tests/otel-deployment_prometheus_test.yaml index 11f8a2ed..32cfe184 100644 --- a/charts/k8s-infra/tests/otel-deployment_prometheus_test.yaml +++ b/charts/k8s-infra/tests/otel-deployment_prometheus_test.yaml @@ -52,25 +52,9 @@ tests: zpages: endpoint: localhost:55679 processors: - attributes/prometheus: - actions: - - action: delete - key: service_name - - action: delete - key: service_instance_id batch: send_batch_size: 10000 timeout: 1s - resource/prometheus: - attributes: - - action: delete - key: service.name - - action: delete - key: service.instance.id - - action: delete - key: service_name - - action: delete - key: service_instance_id resourcedetection: detectors: - env @@ -148,8 +132,6 @@ tests: exporters: - logging processors: - - resource/prometheus - - attributes/prometheus - resourcedetection - batch receivers: