Skip to content

Commit

Permalink
fix: unit test: TestSDKInjection/Resource_attribute_propagate (open-t…
Browse files Browse the repository at this point in the history
  • Loading branch information
chinaran authored Aug 8, 2024
1 parent 2f73582 commit 58a3a4f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/instrumentation/sdk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,14 @@ func TestSDKInjection(t *testing.T) {
Name: "OTEL_TRACES_SAMPLER",
Value: "always_on",
},
{
Name: "OTEL_RESOURCE_ATTRIBUTES_POD_NAME",
ValueFrom: &corev1.EnvVarSource{
FieldRef: &corev1.ObjectFieldSelector{
FieldPath: "metadata.name",
},
},
},
{
Name: "OTEL_RESOURCE_ATTRIBUTES_NODE_NAME",
ValueFrom: &corev1.EnvVarSource{
Expand All @@ -606,7 +614,7 @@ func TestSDKInjection(t *testing.T) {
},
{
Name: "OTEL_RESOURCE_ATTRIBUTES",
Value: "foo=bar,k8s.container.name=other,service.version=explicitly_set,foo=test,fromcr=val,fromtest=val,k8s.namespace.name=project1,k8s.node.name=$(OTEL_RESOURCE_ATTRIBUTES_NODE_NAME),k8s.pod.name=app",
Value: "foo=bar,k8s.container.name=other,service.version=explicitly_set,foo=test,fromcr=val,fromtest=val,k8s.namespace.name=project1,k8s.node.name=$(OTEL_RESOURCE_ATTRIBUTES_NODE_NAME),k8s.pod.name=$(OTEL_RESOURCE_ATTRIBUTES_POD_NAME)",
},
},
},
Expand Down

0 comments on commit 58a3a4f

Please sign in to comment.