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

Examples using the experimental stats package #7492

Closed
davinci26 opened this issue Aug 8, 2024 · 7 comments
Closed

Examples using the experimental stats package #7492

davinci26 opened this issue Aug 8, 2024 · 7 comments

Comments

@davinci26
Copy link

Hey folks,

I am looking into the metrics registered in

and they seem quite useful but I have hard time figuring out how I can use the experimental stats/metrics package to extract them.

Do you have any examples/pointers?

@purnesh42H
Copy link
Contributor

@davinci26
Copy link
Author

@purnesh42H hmmm I have to look into this a bit more, I dont think this example is the best one because it is not immediately obvious how you can retrieve the values here

rrFallbackMetric = estats.RegisterInt64Count(estats.MetricDescriptor{
Name: "grpc.lb.wrr.rr_fallback",
Description: "EXPERIMENTAL. Number of scheduler updates in which there were not enough endpoints with valid weight, which caused the WRR policy to fall back to RR behavior.",
Unit: "update",
Labels: []string{"grpc.target"},
OptionalLabels: []string{"grpc.lb.locality"},
Default: false,
})
for example

Copy link

This issue is labeled as requiring an update from the reporter, and no update has been received after 6 days. If no update is provided in the next 7 days, this issue will be automatically closed.

@github-actions github-actions bot added the stale label Aug 22, 2024
@purnesh42H
Copy link
Contributor

@davinci26 did you try enabling the metrics from opentelemetry API https://github.com/grpc/grpc-go/blob/master/examples/features/opentelemetry/README.md ?

they are are probably be already being exported through opentelemetry

@github-actions github-actions bot removed the stale label Aug 26, 2024
@davinci26
Copy link
Author

Our infra doesnt really support opentelemetry so I was looking into how I can export this metrics into a format that is prometheus native. So I ended up seeing how otel is implemented and then create a prom integration based on that.

Basically you need to implement an estats.MetricsRecorder and then: register it as a MetricsRecorder

Copy link

github-actions bot commented Sep 1, 2024

This issue is labeled as requiring an update from the reporter, and no update has been received after 6 days. If no update is provided in the next 7 days, this issue will be automatically closed.

@github-actions github-actions bot added the stale label Sep 1, 2024
@arjan-bal arjan-bal added the Area: Documentation Includes examples and docs. label Sep 4, 2024
@github-actions github-actions bot removed the stale label Sep 4, 2024
Copy link

This issue is labeled as requiring an update from the reporter, and no update has been received after 6 days. If no update is provided in the next 7 days, this issue will be automatically closed.

@github-actions github-actions bot added the stale label Sep 10, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants