Metrics Endpoint
PowerSync exposes instance metrics via a Prometheus-compatible endpoint. This allows you to integrate with Prometheus or other monitoring systems that scrape Prometheus endpoints.It’s not recommended to scrape the Prometheus endpoint manually, we suggest using Prometheus or other compatible tools. PowerSync does not currently support pushing to OpenTelemetry collectors.
Configuration
- To enable metrics, update your PowerSync YAML file to include the
prometheus_portand set a port number.
service.yaml
- Update your Docker compose file to forward the
prometheus_port.
docker-compose.yaml
If you’re running multiple containers (e.g. splitting up replication containers and API containers) you need to scrape the metrics separately for each container.
Sync Connection Outcomes
powersync_sync_connections_total counts sync streams as they close, plus connection attempts the Service rejects before a stream opens. Use it to see whether clients are disconnecting cleanly, failing mid-stream, or being turned away, and why. powersync_concurrent_connections remains the gauge for streams that are currently open.
The counter has four labels: outcome, close_reason, error_code and transport (http_stream or rsocket).
successmeans the stream ended without an error. Token expiry, a sync config switch and process shutdown all count as success. It says nothing about whether the client finished syncing.storage_errorandsync_config_errorare failures to load or parse the active sync config while setting up the stream.- Over HTTP,
concurrency_limitreturns a bare 429 with no PowerSync error code, soerror_codeisother. - Requests that fail authentication or validation are not counted.
PSYNC_ code.