Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
16 changes: 15 additions & 1 deletion mcpgateway/services/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,26 @@

# Third-Party
from fastapi import Response, status
from prometheus_client import Gauge, REGISTRY
from prometheus_client import Counter, Gauge, REGISTRY
from prometheus_fastapi_instrumentator import Instrumentator

# First-Party
from mcpgateway.config import settings

# Global Metrics
# Exposed for import by services/plugins to increment counters
tool_timeout_counter = Counter(
"tool_timeout_total",
"Total number of tool invocation timeouts",
["tool_name"],
)

circuit_breaker_open_counter = Counter(
"circuit_breaker_open_total",
"Total number of times circuit breaker opened",
["tool_name"],
)


def setup_metrics(app):
"""
Expand Down
Loading
Loading