Skip to content

Commit

Permalink
add K8s resoure attributes to apm services
Browse files Browse the repository at this point in the history
  • Loading branch information
rogercoll committed Aug 14, 2024
1 parent 23a24b2 commit ef5c892
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion kubernetes/elastic-helm/configmap-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ data:
resourcedetection/gcp:
detectors: [env, gcp]
timeout: 2s
override: false
override: true
resource/k8s:
attributes:
- key: service.name
Expand Down
29 changes: 29 additions & 0 deletions kubernetes/elastic-helm/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,35 @@ default:
image:
repository: ghcr.io/elastic/opentelemetry-demo
tag: 1.11.2
envOverrides:
- name: OTEL_SERVICE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.labels['app.kubernetes.io/component']
- name: OTEL_K8S_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: OTEL_K8S_NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
- name: OTEL_K8S_POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: OTEL_K8S_POD_UID
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.uid
- name: OTEL_RESOURCE_ATTRIBUTES
value: 'service.name=$(OTEL_SERVICE_NAME),service.instance.id=$(OTEL_K8S_POD_UID),service.namespace=opentelemetry-demo,k8s.namespace.name=$(OTEL_K8S_NAMESPACE),k8s.node.name=$(OTEL_K8S_NODE_NAME),k8s.pod.name=$(OTEL_K8S_POD_NAME)'


opentelemetry-collector:
image:
Expand Down

0 comments on commit ef5c892

Please sign in to comment.