Skip to content

[pod logs] Use the K8s deployment/cronjob/job name in the service_name logic #1540

@cyrille-leclerc

Description

@cyrille-leclerc

We want to align the service_name logic of the K8s Monitoring Helm Chart Pod Logs feature on OpenTelemetry resource attributes specs on Kubernetes.

For this, we need to retrieve the deployment/cronjob/job of the pods through the "controller-by" attribute.
If the OpenTelemetry Collector K8s Processor is capable of retrieving these metadata, it's not clear if Alloy's discovery.relabel can also do it.

OpenTelemetry logic for service.name

Choose the first value found:

  • pod.annotation[resource.opentelemetry.io/service.name]
  • pod.label[app.kubernetes.io/instance] (well-known label app.kubernetes.io/instance)
  • pod.label[app.kubernetes.io/name] (well-known label app.kubernetes.io/name)
  • k8s.deployment.name
  • k8s.replicaset.name
  • k8s.statefulset.name
  • k8s.daemonset.name
  • k8s.cronjob.name
  • k8s.job.name
  • k8s.pod.name
  • k8s.container.name

See also

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions