Replies: 1 comment
-
Hi @haffla, thanks for catching this! I believe our intention with those errors was to have them caught by the OpenTelemetry error handler so they could emit helpful logs rather than raise them within the user's application. I think your interpretation of the spec is spot on and appreciate your links to other implementations. I'm able to reproduce this behavior. I'll open an issue to get this bug fixed. Stay tuned! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
I hope this message finds you well.
While working with the SDK, we encountered an issue where it raises an
OpenTelemetry::Metrics::Meter::InstrumentNameError
if the instrument name is invalid (such as being nil, empty, or too long). This causes the application to fail unexpectedly.Reviewing the OpenTelemetry specification, I found that it states:
This behavior seems to contradict the specification, as it leads to unhandled exceptions rather than providing a safe default or handling the error more gracefully.
However, I want to ensure that I'm interpreting the specification correctly. Are there aspects of the specification that I might be misunderstanding? Is it maybe that this method is SDK and as such it only SHOULD provide safe defaults?
The error is raised in this method.
Just FYI and reference, the Java library seems to follow the specification and return a NOOP meter if the name is invalid.
In Javascript they seem to simply emit a warning if the name is invalid: https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/sdk-metrics/src/InstrumentDescriptor.ts#L54.
Thank you for your attention and assistance.
Cheers, Jakob
Beta Was this translation helpful? Give feedback.
All reactions