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

Add middlewares and one specific to expose /metrics endpoint for prometheus #629

Merged
merged 9 commits into from
Mar 25, 2023

Conversation

aguschin
Copy link
Contributor

@aguschin aguschin commented Mar 6, 2023

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

@aguschin aguschin self-assigned this Mar 6, 2023
@aguschin aguschin requested a review from a team March 6, 2023 06:14
@aguschin aguschin temporarily deployed to internal March 6, 2023 06:14 — with GitHub Actions Inactive
@aguschin aguschin temporarily deployed to internal March 6, 2023 06:29 — with GitHub Actions Inactive
@aguschin aguschin temporarily deployed to internal March 19, 2023 05:50 — with GitHub Actions Inactive
@aguschin aguschin temporarily deployed to internal March 19, 2023 09:48 — with GitHub Actions Inactive
@codecov
Copy link

codecov bot commented Mar 19, 2023

Codecov Report

Patch coverage: 88.52% and project coverage change: +0.01 🎉

Comparison is base (50f6d57) 85.97% compared to head (a39f74d) 85.99%.

❗ Current head a39f74d differs from pull request most recent head a01c051. Consider uploading reports for the commit a01c051 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #629      +/-   ##
==========================================
+ Coverage   85.97%   85.99%   +0.01%     
==========================================
  Files         107      109       +2     
  Lines        9770     9831      +61     
==========================================
+ Hits         8400     8454      +54     
- Misses       1370     1377       +7     
Impacted Files Coverage Δ
mlem/contrib/sagemaker/runtime.py 80.64% <ø> (ø)
mlem/ext.py 88.28% <ø> (ø)
mlem/contrib/fastapi.py 83.91% <73.33%> (-1.25%) ⬇️
mlem/runtime/middleware.py 90.90% <90.90%> (ø)
mlem/contrib/prometheus.py 95.23% <95.23%> (ø)
mlem/runtime/server.py 89.22% <100.00%> (+0.19%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@aguschin aguschin temporarily deployed to internal March 20, 2023 08:58 — with GitHub Actions Inactive
@aguschin aguschin temporarily deployed to internal March 20, 2023 11:53 — with GitHub Actions Inactive
@mike0sv mike0sv temporarily deployed to internal March 21, 2023 17:51 — with GitHub Actions Inactive
@aguschin aguschin merged commit 4c5be67 into main Mar 25, 2023
@aguschin aguschin deleted the feature/middlewares branch March 25, 2023 11:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants