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

Prometheus metrics label value inconsistency between Go and Java #664

Open
yzhangyext opened this issue Oct 20, 2023 · 3 comments
Open

Prometheus metrics label value inconsistency between Go and Java #664

yzhangyext opened this issue Oct 20, 2023 · 3 comments

Comments

@yzhangyext
Copy link

Hi Team,
I've noticed a Prometheus label value inconsistency between Go and Java (java-grpc-prometheus):
e.g. In metrics grpc_server_handled_total,
For grpc_type label, Java is uppercase while go is lower case, e.g. "UNARY" vs "unary"
For grpc_code label, Java is uppercase while go is camel case, e.g. "UNKNOWN" vs "Unknown"
Do you think it's a good idea to have them standardized? I personally prefer the uppercase, but I would love to hear your thoughts on this.

@johanbrandhorst
Copy link
Collaborator

Hi, thanks for your issue. I don't know that we can change these now unfortunately, it might break existing users. Note that this is just a third party library and you can probably just copy one of the interceptors and change the labels (preserving the license, of course).

@yzhangyext
Copy link
Author

I see. In that case, do you think it's a good idea to allow passing in an option to convert these label values to standardized form (upper case)? It would greatly help us grouping metrics between Go and Java services.

@johanbrandhorst
Copy link
Collaborator

I suppose we could consider an option. It looks like the logic for this is here:

r.incrementWithExemplar(r.serverMetrics.serverHandledCounter, string(r.typ), r.service, r.method, code.String())
and here:
Unary GRPCType = "unary"
. Please make a more concrete proposal for this option (a PR would do) and we can see if it fits well into the code.

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

No branches or pull requests

2 participants