Skip to content

Commit

Permalink
change verb to method to match other k8s labels
Browse files Browse the repository at this point in the history
  • Loading branch information
dsschult committed Feb 7, 2025
1 parent 4485f31 commit fdd04b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions iceprod/prom_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class HistogramBuckets:


class PromRequestMixin:
PromHTTPHistogram = Histogram('http_request_duration_seconds', 'HTTP request duration in seconds', labelnames=('verb', 'handler', 'status'), buckets=HistogramBuckets.API)
PromHTTPHistogram = Histogram('http_request_duration_seconds', 'HTTP request duration in seconds', labelnames=('method', 'handler', 'status'), buckets=HistogramBuckets.API)

def prepare(self):
super().prepare()
Expand All @@ -46,7 +46,7 @@ def on_finish(self):
super().on_finish()
end_time = time.monotonic()
self.PromHTTPHistogram.labels(
verb=str(self.request.method),
method=str(self.request.method).lower(),
handler=f'{self.__class__.__module__.split(".")[-1]}.{self.__class__.__name__}',
status=str(self.get_status()),
).observe(end_time - self._prom_start_time)
Expand Down

0 comments on commit fdd04b6

Please sign in to comment.