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

Decide if methods that create asynchronous instruments should return an object or not #2369

Closed
ocelotl opened this issue Jan 13, 2022 · 3 comments
Labels

Comments

@ocelotl
Copy link
Contributor

ocelotl commented Jan 13, 2022

Can someone make a separate issue for this documenting what other languages are doing? I had a look at Java and the builder will return an instrument handle: https://github.com/open-telemetry/opentelemetry-java/blob/5ff5f3f494fe6958574acff0e8c59bc013b69dad/api/all/src/main/java/io/opentelemetry/api/metrics/LongCounterBuilder.java#L54

Originally posted by @aabmass in #2339 (comment)

@ocelotl
Copy link
Contributor Author

ocelotl commented Jan 13, 2022

I think it is better to return an instrument. I understand that an asynchronous instrument itself has no functionality available for the user but I see no point in "hiding" it from the user.

The instruments also have attributes that the user may want to access like name, description and unit.

@aabmass
Copy link
Member

aabmass commented Feb 1, 2022

@ocelotl
Copy link
Contributor Author

ocelotl commented Apr 11, 2022

We are already returning an instrument regardless of it being synchronous or not, closing.

@ocelotl ocelotl closed this as completed Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants