Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log a warning for duplicate instrument creation from the No-op Meter #3565

Closed
MrAlias opened this issue Jan 5, 2023 · 4 comments
Closed
Labels
area:metrics Part of OpenTelemetry Metrics pkg:API Related to an API package

Comments

@MrAlias
Copy link
Contributor

MrAlias commented Jan 5, 2023

The OpenTelemetry metric API specification states:

When more than one distinct Instrument is registered with the same name for identical Meters, the implementation SHOULD emit a warning to the user informing them of duplicate registration conflict(s).

Currently our noopMeter does not do this. It needs to be updated to log a warning, similar to the SDK, to comply with the specification.

@MrAlias MrAlias added pkg:API Related to an API package area:metrics Part of OpenTelemetry Metrics labels Jan 5, 2023
@MrAlias MrAlias added this to the Metric v0.35.0 milestone Jan 5, 2023
@MrAlias
Copy link
Contributor Author

MrAlias commented Jan 9, 2023

This is likely not what we want to do. Logging a warning would be compliant with the specification, but it would result in a poor user experience. The user that uses a no-op implementation to effectively disable OTel will still be annoyed with warnings from bad instrumentation.

@MrAlias
Copy link
Contributor Author

MrAlias commented Jan 9, 2023

Blocked by open-telemetry/opentelemetry-specification#3071

The resolution of that issue should explicitly define the no-op implementation. Hopefully, one without logging.

@MrAlias MrAlias removed this from the Metric v0.35.0 milestone Jan 19, 2023
@MrAlias
Copy link
Contributor Author

MrAlias commented Feb 2, 2023

Related specification PR: open-telemetry/opentelemetry-specification#3171

@MrAlias
Copy link
Contributor Author

MrAlias commented Feb 14, 2023

The specification no longer requires this: open-telemetry/opentelemetry-specification#3171

@MrAlias MrAlias closed this as completed Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:metrics Part of OpenTelemetry Metrics pkg:API Related to an API package
Projects
No open projects
Status: Done
Development

No branches or pull requests

1 participant