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

api metrics missing toString/get implementation #4829

Closed
amouhadi opened this issue Oct 7, 2022 · 6 comments · Fixed by #4883
Closed

api metrics missing toString/get implementation #4829

amouhadi opened this issue Oct 7, 2022 · 6 comments · Fixed by #4883

Comments

@amouhadi
Copy link

amouhadi commented Oct 7, 2022

All classes under io.opentelemetry.api.metrics are missing toString or any get method. e.g:(DoubleCounter, DoubleGaugeBuilder, DoubleHistogram, DoubleUpDownCounter, DoubleUpDownCounterBuilder, LongCounter, LongGaugeBuilder, LongUpDownCounter, LongUpDownCounterBuilder, ...)
After we use the Builder classes and set name, unit, description then there is no way to get the metric name or use toString to get the information about that api metrics. This is becoming more critical each time we need to debug/troubleshoot

@jkwatson
Copy link
Contributor

jkwatson commented Oct 7, 2022

Please submit a PR for this change! Thanks!

@mkorzeniewski
Copy link
Contributor

May I be assigned to this issue?

@mkorzeniewski
Copy link
Contributor

mkorzeniewski commented Oct 24, 2022

I can not see any way to add toString methods to members of the io.opentelemetry.api.metrics package. It contains interfaces which are contracts with no state to describe for the toString method.

I assumed the origin of the problem lies in the luck of toString method in io.opentelemetry.sdk.metrics package. Any instance of an AbstractInstrument has only default toString method which is not meaningful.

Now it should be possible to see the following fields name, unit, description.

image

@mkorzeniewski
Copy link
Contributor

mkorzeniewski commented Oct 24, 2022

Does it resolve the problem somehow? Is a toString method needed for Builders? I believe it is always a way to create an instance and then call toString method

@jack-berg
Copy link
Member

The change in #4833 does not add toString to the instrument builders. If you feel this is necessary please re-open.

@mkorzeniewski
Copy link
Contributor

You can assign me to the new issue you will create.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants