The Metrics plugin provides the tools necessary to have Agents fetch metrics for nodes in the Knowledge Graph. This plugin does not get metrics itself—rather, it dispatches to various providers depending on the node type (for example when asked for metrics for an EC2 instance, it will get the metrics from the AWS Plugin, which calls out to Cloudwatch).

Configuration

Configure the Metrics plugin by running uv run unpage configure or by editing the ~/.unpage/profiles/<profile_name>/config.yaml file:
plugins:
  # ...
  metrics:
    enabled: true
You will also need to configure at least one provider that provides metrics for Knowledge Graph nodes, like AWS or Aptible.

Tools

The Metrics plugin provides the following tools to Agents and MCP Clients:

list_node_types_that_support_metrics

List the types of nodes that support metrics retrieval.Arguments NoneReturns list[string]: Node types in the format “source:type” (e.g., “aws:ec2_instance”, “kubernetes:pod”) that support metrics collection.

list_available_metrics_for_node

List the available metrics for a specific node.Arguments
node_id
string
required
The unique identifier of the node to check for available metrics.
Returns list[string] or string: List of available metric names for the node, or an error message if the node doesn’t support metrics.

get_metrics_for_node

Get metrics data for a resource using its node ID.Arguments
node_id
string
required
The unique identifier of the node to retrieve metrics for.
time_range_start
datetime
required
The starting time for the metrics range (ISO 8601 timestamp). A good starting point is one hour before the current time.
time_range_end
datetime
required
The ending time for the metrics range (ISO 8601 timestamp).
metric_names
list[string]
List of specific metric names to retrieve. If not provided, all available metrics for the node will be returned. Can also be provided as a JSON string array.
Returns list[dict] or string: Metric observations with timestamps and values, or an error/informational message.Note: Use list_available_metrics_for_node first to get valid metric names for the node.

get_anomalies_for_metrics

Detect anomalies in metric data using statistical analysis.Arguments
metrics
list[dict]
required
List of data points, where each entry contains a timestamp and value pair. Typically obtained from the results of get_metrics_for_node.
Returns list[dict]: Detected anomalies in the metric data, including anomaly details and confidence scores.