elastic / opentelemetry

Get started with our Elastic Distros of OpenTelemetry
11 stars 8 forks source link

Add service.name field and drop_origin: true #24

Closed tetianakravchenko closed 1 month ago

tetianakravchenko commented 1 month ago

In this PR:

  1. Set service.name:

1.1. container with name: prometheus-server - has a service.name : server - that is set from pod labels:

kubectl describe pod prometheus-server-server-64ddbf6c85-r7tk5 | grep "Labels:" -a5
...
Labels:           app.kubernetes.io/component=server
                  app.kubernetes.io/instance=prometheus-server
                  app.kubernetes.io/managed-by=Helm
                  app.kubernetes.io/name=prometheus
                  app.kubernetes.io/part-of=prometheus
                  app.kubernetes.io/version=v2.54.1
Screenshot 2024-10-11 at 12 42 43

1.2. rest of pods have k8s.container.name = service.name (screenshot above)

  1. Set service.version based on app.kubernetes.io/version label (screenshot above)
  2. remove redundant fields: resource.attributes.app.label.component and resource.attributes.app.label.version
  3. Add drop_origin: true parameter for the elasticinframetrics processor