Skip to content

Commit

Permalink
Fix Prometheus exporter for management and health endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
ngosang committed Aug 3, 2023
1 parent d1588c1 commit 40bd1cb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/bottle_plugins/prometheus_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ def wrapper(*args, **kwargs):
def export_metrics(actual_response):
res = V1ResponseBase(actual_response)

if res.startTimestamp is None or res.endTimestamp is None:
# skip management and healthcheck endpoints
return

domain = "unknown"
if res.solution and res.solution.url:
parsed_url = urllib.parse.urlparse(res.solution.url)
Expand Down

0 comments on commit 40bd1cb

Please sign in to comment.