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

Middleware const_labels argument #73

Merged
merged 4 commits into from Mar 10, 2022

Conversation

ngerakines
Copy link
Contributor

This minor addition to the Middleware class allows const_labels to be provided and passed to the counters created at construction.

Usage:

app = FastAPI()
app.add_middleware(MetricsMiddleware, const_labels={"app": "webapi"})

@claws
Copy link
Owner

claws commented Mar 5, 2022

Looks like it's just a style issue holding up the CI pipeline. Can you run make style, see: style, then push the changes to this branch?

@codecov-commenter
Copy link

Codecov Report

Merging #73 (d11f2c6) into master (b07f21c) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #73   +/-   ##
=======================================
  Coverage   95.50%   95.50%           
=======================================
  Files          17       17           
  Lines         778      779    +1     
  Branches      114      114           
=======================================
+ Hits          743      744    +1     
  Misses         19       19           
  Partials       16       16           
Impacted Files Coverage Δ
src/aioprometheus/asgi/middleware.py 87.50% <100.00%> (+0.19%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b07f21c...d11f2c6. Read the comment docs.

@claws claws merged commit 72d6bd2 into claws:master Mar 10, 2022
@claws
Copy link
Owner

claws commented Mar 10, 2022

Thanks

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.

None yet

3 participants