diff --git a/freeleaps/helm-pkg/chat/templates/chat/opentelemetry.yaml b/freeleaps/helm-pkg/chat/templates/chat/opentelemetry.yaml index cbb97aec..0a6bdbad 100644 --- a/freeleaps/helm-pkg/chat/templates/chat/opentelemetry.yaml +++ b/freeleaps/helm-pkg/chat/templates/chat/opentelemetry.yaml @@ -79,8 +79,20 @@ spec: log_statements: - context: log statements: - - set(resource.attributes["application"], "chat") + # Set Grafana queryable labels + - set(resource.attributes["service_name"], "chat") - set(resource.attributes["environment"], "{{ .Values.global.environment | default .Release.Namespace }}") + - set(resource.attributes["pod_name"], resource.attributes["k8s.pod.name"]) + - set(resource.attributes["pod_ip"], resource.attributes["k8s.pod.ip"]) + # Keep application for backward compatibility + - set(resource.attributes["application"], "chat") + # Set additional kubernetes labels + - set(resource.attributes["kubernetes_node_name"], resource.attributes["k8s.node.name"]) + - set(resource.attributes["kubernetes_pod_name"], resource.attributes["k8s.pod.name"]) + - set(resource.attributes["kubernetes_pod_ip"], resource.attributes["k8s.pod.ip"]) + - set(resource.attributes["kubernetes_deployment_name"], resource.attributes["k8s.deployment.name"]) + - set(resource.attributes["kubernetes_namespace"], resource.attributes["k8s.namespace.name"]) + # Parse and enrich log body - set(resource.attributes["body_json"], ParseJSON(log.body)) - set(resource.attributes["body_json"]["kubernetes"]["pod"], resource.attributes["k8s.pod.name"]) - set(resource.attributes["body_json"]["kubernetes"]["namespace"], resource.attributes["k8s.namespace.name"]) diff --git a/freeleaps/helm-pkg/content/templates/content/opentelemetry.yaml b/freeleaps/helm-pkg/content/templates/content/opentelemetry.yaml index ba1bcf9b..54c270a8 100644 --- a/freeleaps/helm-pkg/content/templates/content/opentelemetry.yaml +++ b/freeleaps/helm-pkg/content/templates/content/opentelemetry.yaml @@ -78,13 +78,20 @@ spec: log_statements: - context: log statements: - - set(resource.attributes["application"], log.attributes["context"]["app"]) + # Set Grafana queryable labels + - set(resource.attributes["service_name"], "content") - set(resource.attributes["environment"], log.attributes["context"]["env"]) + - set(resource.attributes["pod_name"], resource.attributes["k8s.pod.name"]) + - set(resource.attributes["pod_ip"], resource.attributes["k8s.pod.ip"]) + # Keep application for backward compatibility + - set(resource.attributes["application"], log.attributes["context"]["app"]) + # Set additional kubernetes labels - set(resource.attributes["kubernetes_node_name"], resource.attributes["k8s.node.name"]) - set(resource.attributes["kubernetes_pod_name"], resource.attributes["k8s.pod.name"]) - set(resource.attributes["kubernetes_pod_ip"], resource.attributes["k8s.pod.ip"]) - set(resource.attributes["kubernetes_deployment_name"], resource.attributes["k8s.deployment.name"]) - set(resource.attributes["kubernetes_namespace"], resource.attributes["k8s.namespace.name"]) + # Parse and enrich log body - set(resource.attributes["body_json"], ParseJSON(log.body)) - set(resource.attributes["body_json"]["kubernetes"]["pod"], resource.attributes["k8s.pod.name"]) - set(resource.attributes["body_json"]["kubernetes"]["namespace"], resource.attributes["k8s.namespace.name"]) diff --git a/freeleaps/helm-pkg/devops/templates/devops/opentelemetry.yaml b/freeleaps/helm-pkg/devops/templates/devops/opentelemetry.yaml index e9449099..5680b493 100644 --- a/freeleaps/helm-pkg/devops/templates/devops/opentelemetry.yaml +++ b/freeleaps/helm-pkg/devops/templates/devops/opentelemetry.yaml @@ -78,13 +78,20 @@ spec: log_statements: - context: log statements: - - set(resource.attributes["application"], log.attributes["context"]["app"]) + # Set Grafana queryable labels + - set(resource.attributes["service_name"], "devops") - set(resource.attributes["environment"], log.attributes["context"]["env"]) + - set(resource.attributes["pod_name"], resource.attributes["k8s.pod.name"]) + - set(resource.attributes["pod_ip"], resource.attributes["k8s.pod.ip"]) + # Keep application for backward compatibility + - set(resource.attributes["application"], log.attributes["context"]["app"]) + # Set additional kubernetes labels - set(resource.attributes["kubernetes_node_name"], resource.attributes["k8s.node.name"]) - set(resource.attributes["kubernetes_pod_name"], resource.attributes["k8s.pod.name"]) - set(resource.attributes["kubernetes_pod_ip"], resource.attributes["k8s.pod.ip"]) - set(resource.attributes["kubernetes_deployment_name"], resource.attributes["k8s.deployment.name"]) - set(resource.attributes["kubernetes_namespace"], resource.attributes["k8s.namespace.name"]) + # Parse and enrich log body - set(resource.attributes["body_json"], ParseJSON(log.body)) - set(resource.attributes["body_json"]["kubernetes"]["pod"], resource.attributes["k8s.pod.name"]) - set(resource.attributes["body_json"]["kubernetes"]["namespace"], resource.attributes["k8s.namespace.name"]) diff --git a/freeleaps/helm-pkg/devsvc/templates/devsvc/opentelemetry.yaml b/freeleaps/helm-pkg/devsvc/templates/devsvc/opentelemetry.yaml index 44712e4c..79cae946 100644 --- a/freeleaps/helm-pkg/devsvc/templates/devsvc/opentelemetry.yaml +++ b/freeleaps/helm-pkg/devsvc/templates/devsvc/opentelemetry.yaml @@ -81,14 +81,20 @@ spec: log_statements: - context: log statements: - - set(resource.attributes["application"], log.attributes["context"]["app"]) + # Set Grafana queryable labels - set(resource.attributes["service_name"], "devsvc") - set(resource.attributes["environment"], "{{ .Values.global.environment | default .Release.Namespace }}") + - set(resource.attributes["pod_name"], resource.attributes["k8s.pod.name"]) + - set(resource.attributes["pod_ip"], resource.attributes["k8s.pod.ip"]) + # Keep application for backward compatibility + - set(resource.attributes["application"], log.attributes["context"]["app"]) + # Set additional kubernetes labels - set(resource.attributes["kubernetes_node_name"], resource.attributes["k8s.node.name"]) - set(resource.attributes["kubernetes_pod_name"], resource.attributes["k8s.pod.name"]) - set(resource.attributes["kubernetes_pod_ip"], resource.attributes["k8s.pod.ip"]) - set(resource.attributes["kubernetes_deployment_name"], resource.attributes["k8s.deployment.name"]) - set(resource.attributes["kubernetes_namespace"], resource.attributes["k8s.namespace.name"]) + # Parse and enrich log body - set(resource.attributes["body_json"], ParseJSON(log.body)) - set(resource.attributes["body_json"]["kubernetes"]["pod"], resource.attributes["k8s.pod.name"]) - set(resource.attributes["body_json"]["kubernetes"]["namespace"], resource.attributes["k8s.namespace.name"]) diff --git a/freeleaps/helm-pkg/freeleaps/templates/freeleaps/opentelemetry.yaml b/freeleaps/helm-pkg/freeleaps/templates/freeleaps/opentelemetry.yaml index cefae709..34a81395 100644 --- a/freeleaps/helm-pkg/freeleaps/templates/freeleaps/opentelemetry.yaml +++ b/freeleaps/helm-pkg/freeleaps/templates/freeleaps/opentelemetry.yaml @@ -81,8 +81,14 @@ spec: log_statements: - context: log statements: - - set(resource.attributes["application"], "freeleaps") + # Set Grafana queryable labels + - set(resource.attributes["service_name"], "freeleaps") - set(resource.attributes["environment"], "{{ .Values.global.environment | default .Release.Namespace }}") + - set(resource.attributes["pod_name"], resource.attributes["k8s.pod.name"]) + - set(resource.attributes["pod_ip"], resource.attributes["k8s.pod.ip"]) + # Keep application for backward compatibility + - set(resource.attributes["application"], "freeleaps") + # Set additional kubernetes labels - set(resource.attributes["kubernetes_node_name"], resource.attributes["k8s.node.name"]) - set(resource.attributes["kubernetes_pod_name"], resource.attributes["k8s.pod.name"]) - set(resource.attributes["kubernetes_pod_ip"], resource.attributes["k8s.pod.ip"]) diff --git a/freeleaps/helm-pkg/notification/templates/notification/opentelemetry.yaml b/freeleaps/helm-pkg/notification/templates/notification/opentelemetry.yaml index ba1bcf9b..1f15c536 100644 --- a/freeleaps/helm-pkg/notification/templates/notification/opentelemetry.yaml +++ b/freeleaps/helm-pkg/notification/templates/notification/opentelemetry.yaml @@ -78,13 +78,20 @@ spec: log_statements: - context: log statements: - - set(resource.attributes["application"], log.attributes["context"]["app"]) + # Set Grafana queryable labels + - set(resource.attributes["service_name"], "notification") - set(resource.attributes["environment"], log.attributes["context"]["env"]) + - set(resource.attributes["pod_name"], resource.attributes["k8s.pod.name"]) + - set(resource.attributes["pod_ip"], resource.attributes["k8s.pod.ip"]) + # Keep application for backward compatibility + - set(resource.attributes["application"], log.attributes["context"]["app"]) + # Set additional kubernetes labels - set(resource.attributes["kubernetes_node_name"], resource.attributes["k8s.node.name"]) - set(resource.attributes["kubernetes_pod_name"], resource.attributes["k8s.pod.name"]) - set(resource.attributes["kubernetes_pod_ip"], resource.attributes["k8s.pod.ip"]) - set(resource.attributes["kubernetes_deployment_name"], resource.attributes["k8s.deployment.name"]) - set(resource.attributes["kubernetes_namespace"], resource.attributes["k8s.namespace.name"]) + # Parse and enrich log body - set(resource.attributes["body_json"], ParseJSON(log.body)) - set(resource.attributes["body_json"]["kubernetes"]["pod"], resource.attributes["k8s.pod.name"]) - set(resource.attributes["body_json"]["kubernetes"]["namespace"], resource.attributes["k8s.namespace.name"]) diff --git a/freeleaps/helm-pkg/payment/templates/payment/opentelemetry.yaml b/freeleaps/helm-pkg/payment/templates/payment/opentelemetry.yaml index ba1bcf9b..6c8362ab 100644 --- a/freeleaps/helm-pkg/payment/templates/payment/opentelemetry.yaml +++ b/freeleaps/helm-pkg/payment/templates/payment/opentelemetry.yaml @@ -78,13 +78,20 @@ spec: log_statements: - context: log statements: - - set(resource.attributes["application"], log.attributes["context"]["app"]) + # Set Grafana queryable labels + - set(resource.attributes["service_name"], "payment") - set(resource.attributes["environment"], log.attributes["context"]["env"]) + - set(resource.attributes["pod_name"], resource.attributes["k8s.pod.name"]) + - set(resource.attributes["pod_ip"], resource.attributes["k8s.pod.ip"]) + # Keep application for backward compatibility + - set(resource.attributes["application"], log.attributes["context"]["app"]) + # Set additional kubernetes labels - set(resource.attributes["kubernetes_node_name"], resource.attributes["k8s.node.name"]) - set(resource.attributes["kubernetes_pod_name"], resource.attributes["k8s.pod.name"]) - set(resource.attributes["kubernetes_pod_ip"], resource.attributes["k8s.pod.ip"]) - set(resource.attributes["kubernetes_deployment_name"], resource.attributes["k8s.deployment.name"]) - set(resource.attributes["kubernetes_namespace"], resource.attributes["k8s.namespace.name"]) + # Parse and enrich log body - set(resource.attributes["body_json"], ParseJSON(log.body)) - set(resource.attributes["body_json"]["kubernetes"]["pod"], resource.attributes["k8s.pod.name"]) - set(resource.attributes["body_json"]["kubernetes"]["namespace"], resource.attributes["k8s.namespace.name"])