From ee91e9cae93e34748b945224ad5056ba79dbdbd1 Mon Sep 17 00:00:00 2001 From: Kevin Hahn Date: Fri, 6 Sep 2024 12:37:28 +0700 Subject: [PATCH] include k8s pod name in otel resource attributes --- deployment/base/hg-deployment.yaml | 6 +++++- deployment/base/lexbox-deployment.yaml | 6 +++++- deployment/base/ui-deployment.yaml | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/deployment/base/hg-deployment.yaml b/deployment/base/hg-deployment.yaml index 3e570d1ca..b14655e7b 100644 --- a/deployment/base/hg-deployment.yaml +++ b/deployment/base/hg-deployment.yaml @@ -99,8 +99,12 @@ spec: valueFrom: fieldRef: fieldPath: spec.nodeName + - name: K8S_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name - name: OTEL_RESOURCE_ATTRIBUTES - value: k8s.node.name=$(K8S_NODE_NAME) + value: k8s.node.name=$(K8S_NODE_NAME),k8s.pod.name=$(K8S_POD_NAME) - name: OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST value: ".*" - name: OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE diff --git a/deployment/base/lexbox-deployment.yaml b/deployment/base/lexbox-deployment.yaml index 60cdabaad..e25403128 100644 --- a/deployment/base/lexbox-deployment.yaml +++ b/deployment/base/lexbox-deployment.yaml @@ -95,8 +95,12 @@ spec: valueFrom: fieldRef: fieldPath: spec.nodeName + - name: K8S_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name - name: OTEL_RESOURCE_ATTRIBUTES - value: k8s.node.name=$(K8S_NODE_NAME) + value: k8s.node.name=$(K8S_NODE_NAME),k8s.pod.name=$(K8S_POD_NAME) - name: OTEL_DOTNET_EXPERIMENTAL_ASPNETCORE_DISABLE_URL_QUERY_REDACTION value: 'true' - name: POSTGRES_DB diff --git a/deployment/base/ui-deployment.yaml b/deployment/base/ui-deployment.yaml index 98567d2ce..eb23cbd04 100644 --- a/deployment/base/ui-deployment.yaml +++ b/deployment/base/ui-deployment.yaml @@ -74,8 +74,12 @@ spec: valueFrom: fieldRef: fieldPath: spec.nodeName + - name: K8S_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name - name: OTEL_RESOURCE_ATTRIBUTES - value: k8s.node.name=$(K8S_NODE_NAME) + value: k8s.node.name=$(K8S_NODE_NAME),k8s.pod.name=$(K8S_POD_NAME) - name: OTEL_ENDPOINT value: http://lexbox:4318