Skip to Content
AgentShield
Operations

Prometheus

Every Prometheus metric AgentShield exports, their labels, scrape configuration, and example queries.

Each service exposes Prometheus text format at /metrics on a port separate from its API.

Endpoints

ServiceVariableFrom sourceIn the image
GatewayGATEWAY_METRICS_ADDR127.0.0.1:90810.0.0.0:9081
Control planeCONTROL_PLANE_METRICS_ADDR127.0.0.1:90800.0.0.0:9080
IntelligenceINTELLIGENCE_METRICS_ADDR127.0.0.1:90820.0.0.0:9082
Event relayRELAY_HTTP_ADDR127.0.0.1:80830.0.0.0:8083

Set a variable to off to disable that listener. A service refuses to start if its metrics address equals its API address.

Unauthenticated by design

Metrics endpoints have no authentication. They contain platform totals only, but keep them on a network that only your monitoring system can reach.

Metrics

Gateway

MetricTypeLabels
agentshield_gateway_http_requests_totalcounterroute (authorize, execute, health_live, health_ready, other), code
agentshield_gateway_http_request_duration_secondshistogramroute
agentshield_gateway_decisions_totalcounteroutcome
agentshield_gateway_executions_totalcountertool (registered adapter or unregistered), result (completed, timeout, or a failure code)
agentshield_gateway_adapter_duration_secondshistogramtool
agentshield_gateway_analysis_totalcounterstatus
agentshield_gateway_analysis_findings_totalcounterrule_id

Event relay

MetricTypeMeaning
agentshield_relay_events_published_totalcounterEvents acknowledged by JetStream
agentshield_relay_publish_failures_totalcounterDrains stopped by a publish failure
agentshield_relay_outbox_backloggaugeEvents waiting; -1 when unreadable
agentshield_relay_outbox_oldest_secondsgaugeAge of the oldest waiting event
agentshield_relay_evidence_totalcounterresult: written, duplicate, dropped, retry
agentshield_relay_reliability_rows_totalcounterReliability minute rows written

Control plane

MetricLabels
agentshield_control_plane_http_requests_totalmethod, route (Express pattern such as /api/v1/agents/:agentId, or unmatched), code
agentshield_control_plane_http_request_duration_secondsroute
agentshield_control_plane_nodejs_*Node.js runtime metrics

Intelligence engine

MetricLabels
agentshield_intelligence_http_requests_totalroute, code
agentshield_intelligence_analyze_duration_seconds—
agentshield_intelligence_items_total—
agentshield_intelligence_verdicts_totalverdict
agentshield_intelligence_findings_totalrule_id

Go processes also export go_* and process_*. Counters with a fixed label set are initialized at zero, so rate() and increase() see the first event.

Label safety

No metric carries an organization, agent, user, resource, or request id. Label values come from fixed sets; anything else is other or unregistered. Crafted paths and tool names cannot create new series.

Scrape configuration

prometheus.yml (excerpt)
scrape_configs:
  - job_name: gateway
    static_configs: [{ targets: ["gateway:9081"] }]
  - job_name: control-plane
    static_configs: [{ targets: ["control-plane:9080"] }]
  - job_name: intelligence
    static_configs: [{ targets: ["intelligence:9082"] }]
  - job_name: event-relay
    static_configs: [{ targets: ["event-relay:8083"] }]
rule_files: ["/etc/prometheus/alerts.yml"]

The repository's infrastructure/monitoring/prometheus.yml and alerts.yml are used by Compose. Validate rule changes with promtool:

docker run --rm --entrypoint promtool \
  -v "$PWD/infrastructure/monitoring:/m:ro" prom/prometheus:v3.1.0 check rules /m/alerts.yml

Example queries

# Share of denied decisions over 15 minutes
sum(rate(agentshield_gateway_decisions_total{outcome="deny"}[15m]))
  / sum(rate(agentshield_gateway_decisions_total[15m]))

# p95 adapter latency per tool
histogram_quantile(0.95, sum by (le, tool) (rate(agentshield_gateway_adapter_duration_seconds_bucket[5m])))

# Calls refused by an open circuit
sum by (tool) (increase(agentshield_gateway_executions_total{result="circuit_open"}[1h]))

# Injection findings by rule
sum by (rule_id) (increase(agentshield_gateway_analysis_findings_total{rule_id=~"PI.*"}[1h]))

Was this page helpful?

On this page