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
We want to align the
service_namelogic 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/jobof 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.relabelcan also do it.OpenTelemetry logic for
service.nameChoose 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.namek8s.replicaset.namek8s.statefulset.namek8s.daemonset.namek8s.cronjob.namek8s.job.namek8s.pod.namek8s.container.nameSee also
service_namepreference ofcontainer.namevsk8s.pod.name#1533