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

add hostname to the labels of the metrics; pull out calls to metrics … #707

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cachito/web/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ def init_metrics(app):
cachito_metrics["request_duration"] = request_duration


def requests_inc(state):
def requests_inc(state: str) -> None:
"""Increase the number of requests in given state."""
cachito_metrics["gauge_state"].labels(state=state, host=hostname).inc()


def requests_dec(state):
def requests_dec(state: str) -> None:
"""Decrease the number of requests in the given state."""
cachito_metrics["gauge_state"].labels(state=state, host=hostname).dec()
2 changes: 1 addition & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with python 3.10
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we keep running pip-compile using python 3.10 since it's the newest version? (if there is any difference between using 3.9 and 3.10). Apart from that, LGTM

# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile --generate-hashes --output-file=requirements-test.txt requirements-test.in
Expand Down
Loading