> ## Documentation Index
> Fetch the complete documentation index at: https://docs.powersync.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Metrics

> Collect PowerSync Service metrics via Prometheus-compatible endpoints.

# 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.

<Note>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.</Note>

### Configuration

1. To enable metrics, update your PowerSync YAML file to include the `prometheus_port` and set a port number.

```yaml service.yaml theme={null}
telemetry:
  # Set the port at which the Prometheus metrics will be exposed
  prometheus_port: 9090
```

2. Update your Docker compose file to forward the `prometheus_port`.

```yaml docker-compose.yaml theme={null}
ports:
  # Forward port 8080 for the PowerSync Service
  - 8080:8080
  # Forward port 9090 for Prometheus metrics
  - 9090:9090
```

Once enabled, restart the service and the metrics endpoint will return Prometheus-formatted metrics, as described in the [What is Collected](/maintenance-ops/self-hosting/telemetry#whatiscollected) section of the [Telemetry](/maintenance-ops/self-hosting/telemetry) docs.

<Note>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.</Note>
