@@ -472,7 +472,7 @@ func chooseServiceVersion(pod corev1.Pod, useLabelsForResourceAttributes bool, i
472
472
// 1. annotation with key "service.instance.id"
473
473
// 2. namespace name + pod name + container name
474
474
// (as defined by https://opentelemetry.io/docs/specs/semconv/resource/#service-experimental)
475
- func createServiceInstanceId (pod corev1.Pod , useLabelsForResourceAttributes bool , namespaceName , podName , containerName string ) string {
475
+ func createServiceInstanceId (pod corev1.Pod , namespaceName , podName , containerName string ) string {
476
476
// Do not use labels for service instance id,
477
477
// because multiple containers in the same pod would get the same service instance id,
478
478
// which violates the uniqueness requirement of service instance id -
@@ -527,7 +527,7 @@ func (i *sdkInjector) createResourceMap(ctx context.Context, otelinst v1alpha1.I
527
527
k8sResources [semconv .K8SPodNameKey ] = pod .Name
528
528
k8sResources [semconv .K8SPodUIDKey ] = string (pod .UID )
529
529
k8sResources [semconv .K8SNodeNameKey ] = pod .Spec .NodeName
530
- k8sResources [semconv .ServiceInstanceIDKey ] = createServiceInstanceId (pod , useLabelsForResourceAttributes , ns .Name , fmt .Sprintf ("$(%s)" , constants .EnvPodName ), pod .Spec .Containers [index ].Name )
530
+ k8sResources [semconv .ServiceInstanceIDKey ] = createServiceInstanceId (pod , ns .Name , fmt .Sprintf ("$(%s)" , constants .EnvPodName ), pod .Spec .Containers [index ].Name )
531
531
i .addParentResourceLabels (ctx , otelinst .Spec .Resource .AddK8sUIDAttributes , ns , pod .ObjectMeta , k8sResources )
532
532
533
533
for k , v := range k8sResources {
0 commit comments