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

Instrument identity, registration conflicts, multi-callback registration, unregister support #2317

Merged
merged 56 commits into from Feb 17, 2022

Conversation

jmacd
Copy link
Contributor

@jmacd jmacd commented Feb 4, 2022

Fixes #2226
Part of #2232
Fixes #2250
Supercedes #2270
Related to, but does not supercede #2281
Part of #2280

Changes

See the discussion in #2226.
Defines "duplicate" and "identical" for Meter and Instrument concepts.
Permits duplicate instrument registration as a first-class feature, including the associated async callbacks
Clarifies that multi-instrument callback idioms are permitted.
Specifies support for unregistering async callbacks.
Specifies a warning for duplicate instrumentation registration conflicts (i.e., same name, not identical)
Specifies that SDKs are permitted to pass-through the semantic conflict.
Specifies that consumers are permitted to reject such data.

specification/metrics/api.md Outdated Show resolved Hide resolved
specification/metrics/api.md Outdated Show resolved Hide resolved
specification/metrics/api.md Outdated Show resolved Hide resolved
specification/metrics/datamodel.md Outdated Show resolved Hide resolved
Copy link
Member

@jack-berg jack-berg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is great 👍 👍

specification/metrics/datamodel.md Outdated Show resolved Hide resolved
specification/metrics/api.md Outdated Show resolved Hide resolved
specification/metrics/api.md Outdated Show resolved Hide resolved
Copy link
Member

@pichlermarc pichlermarc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one nit. 🙂

specification/metrics/sdk.md Outdated Show resolved Hide resolved
@bogdandrutu
Copy link
Member

@jmacd are we sure that this fixes #2232?

@jmacd
Copy link
Contributor Author

jmacd commented Feb 16, 2022

@jmacd are we sure that this fixes #2232?

I tried to answer this here: #2232 (comment)

I changed the PR description to state this is part of #2232 either way, would prefer not to block on the answers to what I think are independent questions about supporting API-level deletion and/or a SDK-level memory preference.

@jmacd
Copy link
Contributor Author

jmacd commented Feb 16, 2022

@bogdandrutu Do you think it's worth holding up this change for an answer to the question above? There are a number of approvals and the PR description has included "unregister support" from the beginning. It seems your question is whether adding unregister support is sufficient to address #2232, which we can debate, but do we still need to debate unregister support?

The original request in #2232 is for a way to Close an entire Meter, unregister its instruments and stop reporting its metrics. in the context of a metrics bridge. I've tried to frame this as request for unregistering callbacks and for allowing the SDK to automatically forget stale metrics.

@open-telemetry/specs-metrics-approvers Do we know of other reasons to support unregister()? I've tried to argue for this on the principle that without unregister support, users are forced to implement synchronization within callbacks on their own, which is not simple. (Unlike synchronous instruments, which are easy to stop using.)

@jmacd
Copy link
Contributor Author

jmacd commented Feb 16, 2022

Yesterday I removed support for multi-instrument callbacks from this PR.
Here is the PR that will add the same after this PR merges:
#2355

specification/metrics/api.md Outdated Show resolved Hide resolved
Bogdan Drutu and others added 2 commits February 17, 2022 09:40
@bogdandrutu
Copy link
Member

@MadVikingGod

This change, specifically the relaxation of the callback at registration, allows us to better match the go ecosystem.

You still need to offer that.

@bogdandrutu bogdandrutu merged commit 5f0282c into open-telemetry:main Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:api Cross language API specification issue area:data-model For issues related to data model spec:metrics Related to the specification/metrics directory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clarify mutability of AggregationTemporality and monotonicity Meter and instrument identity