Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

serve fastapi: expose /metrics endpoint for Prometheus #591

Closed
wants to merge 1 commit into from

Conversation

aguschin
Copy link
Contributor

@aguschin aguschin commented Jan 23, 2023

This PR adds an option to expose /metrics endpoint to be scraped by Prometheus, when a model is served with FastAPI.

related to #429 and #589

The result looks like
image

@aguschin aguschin added serve Serving models monitoring Enabling model monitoring - exposing stats to be collected by prometheus and other services labels Jan 23, 2023
@aguschin aguschin requested a review from a team January 23, 2023 08:52
@aguschin aguschin self-assigned this Jan 23, 2023
@aguschin aguschin temporarily deployed to internal January 23, 2023 08:52 — with GitHub Actions Inactive
@aguschin aguschin changed the title Expose /metrics endpoint for Prometheus serve fastapi: expose /metrics endpoint for Prometheus Jan 23, 2023
@aguschin aguschin closed this Mar 6, 2023
@aguschin aguschin deleted the feature/metrics branch March 6, 2023 06:13
aguschin added a commit that referenced this pull request Mar 25, 2023
…ometheus (#629)

did this in spare time instead of
#591

using https://github.com/trallnag/prometheus-fastapi-instrumentator

these middlewares can be enabled via CLI if referenced by their `type`
ClassVar:
```
$ mlem --tb serve fastapi --model ../emoji/lyrics2emoji --middlewares.0 prometheus_fastapi
```

---------

Co-authored-by: mike0sv <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
monitoring Enabling model monitoring - exposing stats to be collected by prometheus and other services serve Serving models
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant