Replies: 7 comments 6 replies
-
Some of those asks can be managed by folks themselves with custom handlers, since attributes can be added to spans at any moment of their duration. And spans are expected to high cardinality so that's a good thing. I'm rather skeptical at the ask to add dynamic attributes to metrics though, as even though some providers allow reducing the cardinality of those metrics on their platform, allowing that provides a rather big gun for folks to shoot them in the foot. |
Beta Was this translation helpful? Give feedback.
-
My suggestion is to write based on something like Then, all other components should implement dependencies based on this |
Beta Was this translation helpful? Give feedback.
-
I've seen similar asks in .NET, I think the key factors are:
For example, folks who use ASP.NET Core instrumentation would want to manipulate the telemetry based on contextual information (async context, http context, thread context, etc.), the maintainers ended up providing a callback which allows the user to do whatever they want https://github.com/open-telemetry/opentelemetry-dotnet-contrib/tree/main/src/OpenTelemetry.Instrumentation.AspNetCore#enrich. Another thing to consider - processors will see all the telemetry data for that particular provider, there is efficiency problem: graph LR
InstrumentationLibraryA --> ProcessorX
InstrumentationLibraryB --> ProcessorX
InstrumentationLibraryC --> ProcessorX
ProcessorX --> ProcessorY --> ProcessorZ
If we want to manipulate the data from InstrumentationLibraryA, doing that in InstrumentationLibraryA would be more efficient than doing that in ProcessorX. |
Beta Was this translation helpful? Give feedback.
-
I don't understand where this is coming from or why these things are a challenge.
This is kinda ridiculous, and I'm not sure why someone would want this over a resource attribute or whatever....but you can already do this trivially with a
You can already do this today with a
There are spec'd rules about span kind and span names, so I don't think they should be readily alterable after creation. Why would we want to allow two spans for the same piece of instrumentation to have different kinds or names depending on configuration!? Sounds maddening to me. Consistency wins here. Span links area easily added with a
That happens at a layer that's "higher" (above?) the instrumentation itself, right? Isn't it the responsibility of the thing creating/installing the instrumentation to do this? I don't think the instrumentation should be able to change its own scope (attributes). |
Beta Was this translation helpful? Give feedback.
-
The user can e.g. change the span kind using or create attributes which are not aligned with the semantic conventions This is okay right? OTel instrumentations produce semantic convention compliant telemetry by default, but user can always override it to produce something else. |
Beta Was this translation helpful? Give feedback.
-
Linking some relevant discussions:
Update: |
Beta Was this translation helpful? Give feedback.
-
I came across this issue when trying to add some additional attributes across all our metrics in some of my own services, and found it quite surprising that it wasn't supported by default in the Node.js SDK. The approach I ultimately ended up taking was to require that any additional custom attributes were defined in the resource, and then allowing the exporters to be extended with functionality that would copy over specific attributes from the resources as specified, see: open-telemetry/opentelemetry-js#5253 const openTelemetrySdk = new NodeSDK({
resource: new resources.Resource({
[ATTR_SERVICE_NAME]: "test-otel-app",
"deployment.environment.name": "production",
}),
metricReader: new PeriodicExportingMetricReader({
exporter: extendExporterWithResourceAttributes(
new ConsoleMetricExporter(),
new Set(["deployment.environment.name", "process.pid"])
),
}),
instrumentations: getNodeAutoInstrumentations(),
}); |
Beta Was this translation helpful? Give feedback.
-
The OTel Go community often asks to add customization to OTel Go Contrib instrumentation libraries such us (but not limited to):
Let's look at https://pkg.go.dev/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp as an example where such customization possibilities have been added via
The customizations that we added are seen like a precedence and the community often asks to add similar capabilities to other OTel Go Contrib instrumentation libraries (issues found in 3 minutes):
However, I am not sure if such capabilities should be added as
Do other languages have similar requests?
Do other languages also have such customization options?
Do other languages have similar problems?
CC @open-telemetry/go-maintainers
Beta Was this translation helpful? Give feedback.
All reactions