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

feat: add Prometheus support to Tabby. #838

Merged
merged 16 commits into from
Nov 19, 2023
Merged

Conversation

jpoisso
Copy link
Contributor

@jpoisso jpoisso commented Nov 19, 2023

  1. Added axum-prometheus to Cargo.toml

  2. Added metrics.rs as a simple route to produce a metrics endpoint with prometheus-formatted events

  3. Added /v1/metrics endpoint with API doc entry

  4. Added the PrometheusLayer to the root layers.

This change effectively allows for external Prometheus to scrape metrics from Tabby during execution in order to monitor operations (resources, timings and overall usage).

Metrics can be viewed from the API docs and by calling /v1/metrics on a running instance.

1) Added `axum-prometheus` to Cargo.toml

2) Added `metrics.rs` as a simple route to produce a metrics endpoint with prometheus-formatted events

3) Added `/v1/metrics` endpoint with API doc entry

4) Added the `PrometheusLayer` to the root layers.

This change effectively allows for external Prometheus to scrape metrics from Tabby during execution in order to monitor operations (resources, timings and overall usage).
Copy link
Member

@wsxiaoys wsxiaoys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, just one nit

crates/tabby/src/serve.rs Outdated Show resolved Hide resolved
@jpoisso jpoisso requested a review from wsxiaoys November 19, 2023 23:02
@wsxiaoys wsxiaoys enabled auto-merge (squash) November 19, 2023 23:38
@wsxiaoys wsxiaoys disabled auto-merge November 19, 2023 23:40
@wsxiaoys wsxiaoys merged commit 6dabecc into TabbyML:main Nov 19, 2023
4 of 5 checks passed
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

Successfully merging this pull request may close these issues.

2 participants