Skip to main content
版本:v2.0.0

Prometheus connector

Audience: operators bridging EventMesh with Prometheus. Metrics bridge. Source scrapes a Prometheus /metrics endpoint on each poll and emits the exposition text as a CloudEvent; sink pushes metric samples (text exposition format) to a Pushgateway.


Classes

DirectionClassBehavior
Sourceorg.apache.eventmesh.connector.prometheus.source.PrometheusSourceConnectorGETs connector.metricsUrl each poll; the response body becomes one CloudEvent.
Sinkorg.apache.eventmesh.connector.prometheus.sink.PrometheusSinkConnectorMerges the batch's payloads into one text-exposition document and POSTs it to the Pushgateway; non-2xx throws → no ACK → redelivery.

Source configuration

KeyDefaultDescription
connector.metricsUrlhttp://localhost:9090/metricsMetrics endpoint to scrape

Sink configuration

KeyDefaultDescription
connector.pushgatewayUrlhttp://localhost:9091Pushgateway base URL
connector.jobeventmeshPushgateway job label
connector.instanceconnector-1Pushgateway instance label
connector.timeoutMs10000Push timeout in ms

Running

bin/start-connector.sh with -Dconnector.class=...PrometheusSinkConnector -Dconnector.mode=sink -Dconnector.pushgatewayUrl=http://pg:9091 -Dconnector.job=eventmesh