-
Hi, I am doing some prototyping / discovery of using OpenTelemetry with Kafka products and am running into a restriction of Resource information being set on application level vs being able to specify / change those attributes per scope / process. For my use case it would make sense to be able to set service information per connector - i.e. things like service name, version, namespace etc. I am instrumenting it with java-instrumentation agent using auto instrumentation approach and adding additional custom behaviour using extensions support. Of course i can use custom span attributes but problem then is with data export / visualization - for example using Jaeger - service name being that of Connect platform rather than individual connector services running on it. Cheers, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
hi @rkolesnev! I think this is a common-ish use case, e.g. when using the Javaagent in an application server that hosts multiple applications. we don't really have a pre-baked answer for this, but I hope some day we will for now, I think you could use a SpanProcessor to propagate custom "tenant" attributes down from parent to child, e.g. https://github.com/microsoft/ApplicationInsights-Java/blob/main/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/init/InheritedAttributesSpanProcessor.java and then write a SpanExporter wrapper that wraps the SpanData and provides your custom Resource info before passing to the real SpanExporter |
Beta Was this translation helpful? Give feedback.
hi @rkolesnev! I think this is a common-ish use case, e.g. when using the Javaagent in an application server that hosts multiple applications.
we don't really have a pre-baked answer for this, but I hope some day we will
for now, I think you could use a SpanProcessor to propagate custom "tenant" attributes down from parent to child, e.g. https://github.com/microsoft/ApplicationInsights-Java/blob/main/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/init/InheritedAttributesSpanProcessor.java
and then write a SpanExporter wrapper that wraps the SpanData and provides your custom Resource info before passing to the real SpanExporter