Traces should include k8s/knative attributes
Problem Traces generated by Knative Eventing components do not include k8s specific attributes, which makes it hard to understand where they are coming from.
For instance, when the IMC dispatcher sends an event, it produces this kind of traces (showing tags only):
tags:
otel.status_code=STATUS_CODE_UNSET
cloudevents.source=/apis/v1/namespaces/vet/pingsources/make-vet-appointment
cloudevents.specversion=1.0
cloudevents.type=dev.knative.sources.ping
messaging.protocol=HTTP
messaging.system=knative
cloudevents.id=1f7f68c3-156d-466d-b078-8507d4a9e6bd
messaging.destination=http://make-vet-appointment.vet.svc.cluster.local
messaging.message_id=1f7f68c3-156d-466d-b078-8507d4a9e6bd
What I would like to see is the Subscription name and namespace (and from there retrieve the Sequence CR when applicable)
Persona: Which persona is this feature for?
Exit Criteria A measurable (binary) test that would indicate that the problem has been resolved.
Time Estimate (optional): How many developer-days do you think this may take to resolve? few
Additional context (optional) Add any other context about the feature request here.
OpenTelemetry semantic conventions for Kubernetes: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/k8s.md
List of components to update:
- [ ] PingSource
- [ ] APIServerSource
- [ ] InMemoryChannel
- [ ] MT Broker
@Cali0707 is this still the case with OTel instrumentation or should we close this out?
@dprotaso the original link in this issue is broken now, but here is the attributes we set on traces: https://github.com/knative/eventing/blob/1c920ca1452d391ac8469708855bb7db0e88d3a8/pkg/observability/key.go#L28-L62