Prometheus metrics endpoint for the Port Agent
R
Robert Zahradníček
Unlike Ocean integrations, the Port Agent doesn't expose Prometheus metrics, so teams running it self-hosted for actions, workflows and automations can't see its backlog, failures or whether it's stuck, and have nothing to autoscale on. Expose a /metrics endpoint with counters for processed, failed and skipped events (
port_agent_events_total{source,outcome}
), webhook results including HTTP failures, timeouts and connection errors (port_agent_webhook_requests_total{status_class,outcome}
), authentication, connectivity and polling failures (port_agent_consume_errors_total{source,reason}
), and Port API calls for claiming, acknowledging, reporting status and sending run logs (port_agent_port_api_requests_total{operation,outcome}
). Add histograms for webhook latency with p95/p99 (port_agent_webhook_request_duration_seconds
) and time from event creation to processing start (port_agent_event_age_seconds{source}
), plus gauges for the last successful poll, including empty results (port_agent_last_successful_consume_timestamp_seconds{source}
), and Kafka backlog in Kafka mode (port_agent_kafka_consumer_lag{topic,partition}
). Without these, self-hosted agents end up over-provisioned or silently falling behind.