From c522e3f39ea8588841eadfe97432b483f6b404f7 Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Wed, 27 Mar 2024 14:10:12 +0000 Subject: [PATCH 1/4] temp commit Signed-off-by: Michel Hollands --- charts/meta-monitoring/templates/agent/config.yaml | 5 +++-- charts/meta-monitoring/values.yaml | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/charts/meta-monitoring/templates/agent/config.yaml b/charts/meta-monitoring/templates/agent/config.yaml index e55d100..a9f2dba 100644 --- a/charts/meta-monitoring/templates/agent/config.yaml +++ b/charts/meta-monitoring/templates/agent/config.yaml @@ -32,8 +32,9 @@ data: target_label = "job" } rule { - target_label = "cluster" - replacement = "{{- .Values.clusterName -}}" + source_labels = ["__meta_kubernetes_pod_container_port_name"] + regex="(?!http-metrics)" + action = "drop" } } diff --git a/charts/meta-monitoring/values.yaml b/charts/meta-monitoring/values.yaml index 0a8efde..c8310d4 100644 --- a/charts/meta-monitoring/values.yaml +++ b/charts/meta-monitoring/values.yaml @@ -5,6 +5,7 @@ namespacesToMonitor: - tempo # The name of the cluster where this will be installed clusterName: "meta-monitoring" +httpPort: 3100 # Set to true to write logs, metrics or traces to Grafana Cloud cloud: From b02aee68160c42148c83be245f909c8db3f12382 Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Thu, 28 Mar 2024 09:46:35 +0000 Subject: [PATCH 2/4] temp Signed-off-by: Michel Hollands --- charts/meta-monitoring/templates/agent/config.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/charts/meta-monitoring/templates/agent/config.yaml b/charts/meta-monitoring/templates/agent/config.yaml index a9f2dba..310111d 100644 --- a/charts/meta-monitoring/templates/agent/config.yaml +++ b/charts/meta-monitoring/templates/agent/config.yaml @@ -31,11 +31,11 @@ data: replacement = "${1}/${2}-${3}" target_label = "job" } - rule { - source_labels = ["__meta_kubernetes_pod_container_port_name"] - regex="(?!http-metrics)" - action = "drop" - } + // rule { + // source_labels = ["__meta_kubernetes_pod_container_port_name"] + // regex="http-metrics" + // action = "keep" + // } } // Logs From efea1c50544f3f6e4a304d14fdaeb91e400a4bd8 Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Thu, 28 Mar 2024 11:00:09 +0000 Subject: [PATCH 3/4] Fix filtering of log lines Signed-off-by: Michel Hollands --- charts/meta-monitoring/templates/agent/config.yaml | 11 +++++------ charts/meta-monitoring/values.yaml | 1 + 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/charts/meta-monitoring/templates/agent/config.yaml b/charts/meta-monitoring/templates/agent/config.yaml index 310111d..ef0d53a 100644 --- a/charts/meta-monitoring/templates/agent/config.yaml +++ b/charts/meta-monitoring/templates/agent/config.yaml @@ -31,11 +31,10 @@ data: replacement = "${1}/${2}-${3}" target_label = "job" } - // rule { - // source_labels = ["__meta_kubernetes_pod_container_port_name"] - // regex="http-metrics" - // action = "keep" - // } + rule { + target_label = "cluster" + replacement = "{{- .Values.clusterName -}}" + } } // Logs @@ -55,7 +54,7 @@ data: {{- if not (empty .Values.logs.retain) }} stage.match { - selector = "{cluster=\"{{- .Values.clusterName -}}\"} !~ \"{{ join "|" .Values.logs.retain }}\"" + selector = "{cluster=\"{{- .Values.clusterName -}}\", namespace=\"{{- .Values.lokiNamespace -}}\"} !~ \"{{ join "|" .Values.logs.retain }}\"" action = "drop" } {{- end }} diff --git a/charts/meta-monitoring/values.yaml b/charts/meta-monitoring/values.yaml index c8310d4..544d3ec 100644 --- a/charts/meta-monitoring/values.yaml +++ b/charts/meta-monitoring/values.yaml @@ -5,6 +5,7 @@ namespacesToMonitor: - tempo # The name of the cluster where this will be installed clusterName: "meta-monitoring" +lokiNamespace: "loki" httpPort: 3100 # Set to true to write logs, metrics or traces to Grafana Cloud From 6f5f50f9012b378e47a5cc1bae6e4fe24bb2cc6c Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Thu, 28 Mar 2024 11:02:13 +0000 Subject: [PATCH 4/4] Remove httpPort variable Signed-off-by: Michel Hollands --- charts/meta-monitoring/values.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/charts/meta-monitoring/values.yaml b/charts/meta-monitoring/values.yaml index 544d3ec..8e2d4d5 100644 --- a/charts/meta-monitoring/values.yaml +++ b/charts/meta-monitoring/values.yaml @@ -6,7 +6,6 @@ namespacesToMonitor: # The name of the cluster where this will be installed clusterName: "meta-monitoring" lokiNamespace: "loki" -httpPort: 3100 # Set to true to write logs, metrics or traces to Grafana Cloud cloud: