Metrics and monitoring

Each server exposes Prometheus metrics about its own operation: how many tool calls it handled, how long VCF took to answer, what was rejected and whether the audit log is being delivered. The metrics describe the server, not the monitored infrastructure. Infrastructure data belongs in VCF Operations.

Endpoint

ItemValue
AddressMETRICS_LISTEN_ADDRESS, :9090 by default
Path/metrics
FormatPrometheus text exposition format
AuthenticationNone inside the cluster network, or a bearer token with METRICS_AUTH_TOKEN
ExposureCluster-internal. The Helm chart doesn't publish this port through the ingress

With the Prometheus Operator, enable the ServiceMonitor:

metrics:
  enabled: true
  serviceMonitor:
    enabled: true
    interval: 30s
    labels:
      release: prometheus

Without the operator, scrape it directly:

scrape_configs:
  - job_name: vcf-mcp
    kubernetes_sd_configs:
      - role: pod
        namespaces:
          names: [vcf-mcp]
    relabel_configs:
      - source_labels: [__meta_kubernetes_pod_label_app_kubernetes_io_name]
        regex: vcf-mcp
        action: keep
      - source_labels: [__meta_kubernetes_pod_container_port_number]
        regex: "9090"
        action: keep

Metric catalogue

MetricTypeLabelsDescription
mcp_requests_totalcounterserver, tool, tool_type, identity_type, resultTool calls handled
mcp_request_duration_secondshistogramserver, toolTime to handle a tool call
mcp_tool_errors_totalcounterserver, tool, codeTool calls that ended with an error
mcp_policy_denials_totalcounterserver, tool, reasonCalls rejected by the policy engine
mcp_switch_denials_totalcounterserver, tool, groupCalls rejected by an operation switch
mcp_auth_failures_totalcounterserver, modeFailed client authentications
mcp_confirmations_totalcounterserver, tool, resultConfirmation tokens issued, confirmed, expired or rejected
mcp_confirmations_pendinggaugeserverConfirmation tokens issued and not yet used
mcp_upstream_requests_totalcounterserver, endpoint, statusCalls to a VCF API
mcp_upstream_duration_secondshistogramserver, endpointTime a VCF API took to answer
mcp_secret_fetch_totalcounterserver, source, resultCredential reads from vault or middleware
mcp_secret_fetch_duration_secondshistogramserver, sourceTime to read credentials
mcp_audit_events_totalcounterserver, destination, resultAudit records delivered
mcp_audit_queue_depthgaugeserver, destinationAudit records waiting in the buffer
mcp_audit_dropped_totalcounterserver, destinationAudit records lost because the buffer was full
mcp_sessions_activegaugeserver, transportOpen MCP sessions
mcp_tools_exposedgaugeserver, tool_typeTools currently listed, after switches and policy filtering
mcp_build_infogaugeserver, version, revisionAlways 1. Carries the release in its labels

Standard process metrics (process_cpu_seconds_total, process_resident_memory_bytes and the rest) are exposed as well.

Labels are deliberately low-cardinality: the tool name is a label, the identity of a user and the identifiers of VCF resources aren't. Per-user and per-resource questions are answered from the audit log, which is built for exactly that and doesn't degrade your Prometheus.

Grafana

A ready dashboard is available: vcf-mcp-grafana-dashboard.json. Import it in Grafana 10 or later and select your Prometheus data source.

RowPanels
TrafficCalls per second by server and tool type, call duration p50 and p95, active sessions
Errors and denialsError rate by tool, policy denials, switch denials, authentication failures
VCF endpointsUpstream request rate by status, upstream duration p95 by endpoint, failures by endpoint
Audit and secretsAudit records delivered by destination, buffer depth, dropped records, credential read duration
groups:
  - name: vcf-mcp
    rules:
      - alert: VcfMcpDown
        expr: up{job="vcf-mcp"} == 0
        for: 5m
        labels: { severity: critical }
        annotations: { summary: "VCF MCP server is not being scraped" }

      - alert: VcfMcpAuditRecordsDropped
        expr: increase(mcp_audit_dropped_total[15m]) > 0
        labels: { severity: critical }
        annotations: { summary: "Audit records were lost, leaving a gap in the audit trail" }

      - alert: VcfMcpToolErrorRate
        expr: |
          sum(rate(mcp_tool_errors_total[10m])) by (server)
            / sum(rate(mcp_requests_total[10m])) by (server) > 0.1
        for: 10m
        labels: { severity: warning }
        annotations: { summary: "More than 10% of tool calls are failing" }

      - alert: VcfMcpUpstreamSlow
        expr: |
          histogram_quantile(0.95,
            sum(rate(mcp_upstream_duration_seconds_bucket[10m])) by (le, server)) > 5
        for: 15m
        labels: { severity: warning }
        annotations: { summary: "VCF API responses are slow (p95 above 5s)" }

      - alert: VcfMcpAuthFailures
        expr: increase(mcp_auth_failures_total[10m]) > 20
        labels: { severity: warning }
        annotations: { summary: "Repeated authentication failures against an MCP server" }

      - alert: VcfMcpSecretFetchFailing
        expr: increase(mcp_secret_fetch_total{result="error"}[10m]) > 0
        for: 5m
        labels: { severity: critical }
        annotations: { summary: "Credentials cannot be read from the secret source" }

Health endpoints

EndpointReports ready when
/healthzThe process is running and able to serve requests
/readyzThe VCF endpoint answers, the secret source answers, and the policy engine answers when one is configured

Kubernetes uses /healthz as the liveness probe and /readyz as the readiness probe, so a server that has lost its VCF endpoint or its secret source is taken out of service instead of returning errors to assistants.