INNER CODE UNIT · Python

list_metrics

pab1it0/prometheus-mcp-server · src/prometheus_mcp_server/server.py:453

async def list_metrics(
    limit: Optional[int] = None,
    offset: int = 0,
    filter_pattern: Optional[str] = None,
    ctx: Context | None = None,
    refresh_cache: bool = False,
) -> Dict[str, Any]:
    """Retrieve a list of all metric names available in Prometheus.

    Args:
        limit: Maximum number of metrics to return (default: all metrics)
        offset: Number of metrics to skip for pagination (default: 0)
        filter_pattern: Optional substring to filter metric names (case-insensitive)
        refresh_cache: Force a cache refresh to pick up newly scraped metrics (default: False)

    Returns:
        Dictionary containing:
        - metrics: List of metric names

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…