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

sdk/metric: Refactor pipeline and observable measures #5946

Open
pellared opened this issue Nov 7, 2024 · 0 comments
Open

sdk/metric: Refactor pipeline and observable measures #5946

pellared opened this issue Nov 7, 2024 · 0 comments
Labels
area:metrics Part of OpenTelemetry Metrics pkg:SDK Related to an SDK package

Comments

@pellared
Copy link
Member

pellared commented Nov 7, 2024

Do we need to lock around this? It would be good to ensure our parallel tests Invoke a callback in parallel with RegisterCallbacks

Originally posted by @dashpole in #5900 (comment)

I spend literally more than half an hour to figure out the same thing. I think we could refactor the code to make it cleaner or more readable. Maybe we should have a []aggregate.Measure[N] field in type observable[N int64 | float64] struct? Yet, I find it is out of the scope for this PR as I do not think it would be an easy task and having a fix is critical. Making a refactoring with the tests and working functionality would also be an easier task.

However, can we at least add comments that there is no race condition when accessing p.float64Measures and p.int64Measures as the pipeline is already locked by pipeline.Produce? Should we create a follow-up refactoring issue? @pree-dew what are your thoughts here? I do not want to block you.

Side note: I guess it is possible to achieve race conditions, but these would be in cases of bad usage of the Metrics API.

Originally posted by @pellared in #5900 (comment)

@pellared pellared changed the title sdk/metric: Refactor pipeline meaures sdk/metric: Refactor pipeline measures Nov 7, 2024
@pellared pellared added pkg:SDK Related to an SDK package area:metrics Part of OpenTelemetry Metrics labels Nov 7, 2024
@pellared pellared changed the title sdk/metric: Refactor pipeline measures sdk/metric: Refactor pipeline and observable measures Nov 7, 2024
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:SDK Related to an SDK package
Projects
None yet
Development

No branches or pull requests

1 participant