Skip to content

Commit 152f628

Browse files
include some useful attributes to queue proxy resource (#16051)
Co-authored-by: Dave Protasowski <dprotaso@gmail.com>
1 parent 12709ea commit 152f628

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg/queue/sharedmain/otel.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ func SetupObservabilityOrDie(
8888
}
8989

9090
func res(logger *zap.SugaredLogger, cfg *config) *resource.Resource {
91+
podName := system.PodName()
92+
9193
serviceName := cmp.Or(
9294
os.Getenv("OTEL_SERVICE_NAME"),
9395
os.Getenv("SERVING_SERVICE"),
@@ -96,14 +98,16 @@ func res(logger *zap.SugaredLogger, cfg *config) *resource.Resource {
9698

9799
// I always expect SERVING_REVISION to be set but in case it's
98100
// not fallback on pod name
99-
system.PodName(),
101+
podName,
100102
)
101103

102104
attrs := []attribute.KeyValue{
105+
semconv.K8SContainerName("queue-proxy"),
103106
semconv.K8SNamespaceName(cfg.ServingNamespace),
107+
semconv.K8SPodName(podName),
104108
semconv.ServiceVersion(changeset.Get()),
105109
semconv.ServiceName(serviceName),
106-
semconv.ServiceInstanceID(system.PodName()),
110+
semconv.ServiceInstanceID(podName),
107111
}
108112

109113
if val := os.Getenv("SERVING_SERVICE"); val != "" {

0 commit comments

Comments
 (0)