INNER CODE UNIT · Python
get_metric_metadata
pab1it0/prometheus-mcp-server · src/prometheus_mcp_server/server.py:598
async def get_metric_metadata(
metric: Optional[str] = None,
filter_pattern: Optional[str] = None,
limit: Optional[int] = None,
offset: int = 0,
) -> Union[List[Dict[str, Any]], Dict[str, Any]]:
"""Get metadata for one metric or bulk metadata for all metrics.
Args:
metric: Optional metric name. If provided, returns legacy list format.
filter_pattern: Optional substring filter on metric name and descriptions.
limit: Maximum number of metrics to return in bulk mode.
offset: Number of metrics to skip in bulk mode.
Returns:
If metric is provided: list of metadata entries for that metric.
If metric is not provided: dict with filtered metadata and pagination info.
"""