Skip to content

Commit

Permalink
Update Prometheus files
Browse files Browse the repository at this point in the history
  • Loading branch information
mariangelapanunzio committed Dec 19, 2023
1 parent d9dd83e commit d411a87
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ scrape_configs:
- job_name: 'fastapi'
scrape_interval: 5s
static_configs:
- targets: ['127.0.0.1:5500']
- targets: ['localhost:5500']
7 changes: 4 additions & 3 deletions src/api/monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from prometheus_fastapi_instrumentator import Instrumentator, metrics
from prometheus_fastapi_instrumentator.metrics import Info

import logging

NAMESPACE = os.environ.get("METRICS_NAMESPACE", "fastapi")
SUBSYSTEM = os.environ.get("METRICS_SUBSYSTEM", "model")

Expand All @@ -14,7 +16,7 @@
should_instrument_requests_inprogress=True,
excluded_handlers=["/metrics"],
inprogress_name="fastapi_inprogress",
inprogress_labels=True,
inprogress_labels=True
)

# Metrics
Expand Down Expand Up @@ -90,5 +92,4 @@ def instrumentation(info: Info) -> None:

return instrumentation


instrumentator.add(segmentation_result_metric(metric_namespace=NAMESPACE, metric_subsystem=SUBSYSTEM))
instrumentator.add(segmentation_result_metric(metric_namespace=NAMESPACE, metric_subsystem=SUBSYSTEM))

0 comments on commit d411a87

Please sign in to comment.