-
Notifications
You must be signed in to change notification settings - Fork 79
Adds metrics endpoint #78
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
Conversation
pkg/metrics/prometheus_parser.go
Outdated
| } | ||
|
|
||
| // NewPrometheusParser creates a new Prometheus metrics parser | ||
| func NewPrometheusParser() *PrometheusParser { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get a 500 when visit the link but I assume its temporary. I'll take a look tomorrow, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah looks like pkg.go.dev was offline for a bit, seems back up now. I'd also advocate for less code we need to manage and test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed to use https://pkg.go.dev/github.com/prometheus/common/expfmt so I can use families, err := parser.TextToMetricFamilies(strings.NewReader(string(body)))
And then I can get metrics per family and add our labels.
Let me know what do you think 🙏
pkg/metrics/prometheus_parser.go
Outdated
| } | ||
|
|
||
| // NewPrometheusParser creates a new Prometheus metrics parser | ||
| func NewPrometheusParser() *PrometheusParser { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah looks like pkg.go.dev was offline for a bit, seems back up now. I'd also advocate for less code we need to manage and test.
- Remove custom prometheus_metrics.go - Use expfmt.TextParser for parsing and expfmt.NewEncoder for output
# Conflicts: # go.mod # pkg/inference/scheduling/scheduler.go
xenoscopic
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a few minor suggestions.
Signed-off-by: Dorin Geman <[email protected]>
Signed-off-by: Dorin Geman <[email protected]>
docs: update link to avoid redirect
This PR uses the llama.cpp metrics endpoint to collect and aggregate the metrics of all active runners.
No active runners:
An active runner with
completionsmode:An active runner with
embeddingsmode: