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

[Feature]: Unregister Callbacks #2245

Open
landonxjames opened this issue Oct 25, 2024 · 2 comments
Open

[Feature]: Unregister Callbacks #2245

landonxjames opened this issue Oct 25, 2024 · 2 comments
Labels
A-metrics Area: issues related to metrics enhancement New feature or request triage:todo Needs to be traiged.

Comments

@landonxjames
Copy link

Related Problems?

#958

Describe the solution you'd like:

Issue #958 implies the OTel-rust allows users to unregister callbacks as of 0.20.0. I do see the function for doing that in the 0.20 docs. But in the docs for the most recent version (0.26.0 currently) I cannot find anything about unregistering callback functions. I am not sure if the capability for doing that was moved or if it no longer exists. This functionality is in the spec and is present in other language libraries.

Considered Alternatives

N/A

Additional Context

N/A

@landonxjames landonxjames added enhancement New feature or request triage:todo Needs to be traiged. labels Oct 25, 2024
@cijothomas
Copy link
Member

We removed the ability to provide callbacks after instrument creation. Unregister is needed, only if an ability to register callback after instrument creation exists.
Currently, only way to provide callback is while instrument registration and not after.

Related: #2151

Can you share more details on how you are using callbacks, and why is unregister needed, so we can re-evaluate the priority for bringing back the ability to do so?

@cijothomas cijothomas added the A-metrics Area: issues related to metrics label Oct 25, 2024
@landonxjames
Copy link
Author

landonxjames commented Oct 25, 2024

My use case is almost certainly too niche to warrant prioritizing this, but I will lay it out anyway.

I work on the AWS SDK for Rust and am currently implementing the observability portions of our spec (internal so unfortunately I can't share it). The spec is more or less a simplified version of the OTel interfaces, but they are not tied to an OTel implementation and users can implement their own observability provider using the interfaces we provide. You can see a WIP version of the Rust version of the interfaces here and the OTel based implementation of those interfaces here.

Our create_{someAsyncInstrument} methods all return an AsyncMeasurementHandle which allows the user to stop recording metrics and unregister the callback.

pub trait AsyncMeasurementHandle {
    /// Stop recording , unregister callback.
    fn stop(&self);
}

For reference here is the Kotlin version of this interface implemented for OTel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-metrics Area: issues related to metrics enhancement New feature or request triage:todo Needs to be traiged.
Projects
None yet
Development

No branches or pull requests

2 participants