# Metrics & Telemetry

superglue exposes organization-scoped run metrics in the Prometheus text exposition format. Scrape the endpoint with Prometheus directly, or use the Prometheus receiver to send the same metrics through an OpenTelemetry Collector.

**Note:** **Enterprise feature** — Metrics and telemetry are available for superglue Enterprise deployments.
  [Contact us](https://cal.com/superglue/superglue-demo) to discuss access.

## Call the metrics endpoint

The cloud-hosted endpoint is:

```text
GET https://api.superglue.cloud/v1/metrics
```

Send a superglue API key as a bearer token. The key's organization determines which runs are included. The key's identity must have the `admin` or `member` base role.

```bash
curl "https://api.superglue.cloud/v1/metrics" \
  -H "Authorization: Bearer $SUPERGLUE_API_KEY"
```

The response uses `text/plain; version=0.0.4; charset=utf-8`.

Enterprise and self-hosted API hosts may vary. Replace `api.superglue.cloud` with the host configured for your deployment.

## Connect your collector

Store the API key in your secret manager. Where possible, mount it as a file. The file should contain only the API key.

```yaml
scrape_configs:
  - job_name: superglue
    scheme: https
    metrics_path: /v1/metrics
    static_configs:
      - targets: ["api.superglue.cloud"]
    authorization:
      type: Bearer
      credentials_file: /etc/prometheus/secrets/superglue-api-key
```

See the [Prometheus configuration reference](https://prometheus.io/docs/prometheus/latest/configuration/configuration/) for the complete scrape configuration.

  The OpenTelemetry Prometheus receiver accepts the same scrape configuration. Add it to your existing metrics pipeline. Use the exporter configured for your observability backend.

```yaml
receivers:
  prometheus:
    config:
      scrape_configs:
        - job_name: superglue
          scheme: https
          metrics_path: /v1/metrics
          static_configs:
            - targets: ["api.superglue.cloud"]
          authorization:
            type: Bearer
            credentials_file: /etc/otelcol/secrets/superglue-api-key

service:
  pipelines:
    metrics:
      receivers: [prometheus]
      exporters: [otlp]
```

The `otlp` exporter must already be configured for your backend. See the [OpenTelemetry Prometheus receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/prometheusreceiver) for supported configuration and deployment considerations.

  ## Available metrics

| Metric                               | Type    | Measures                                                                |
| ------------------------------------ | ------- | ----------------------------------------------------------------------- |
| `superglue_runs_total`               | Counter | Completed runs in retained run history, grouped by status and source    |
| `superglue_run_duration_seconds_p95` | Gauge   | p95 end-to-end duration for completed runs in the trailing five minutes |

Both metrics are scoped to the API key's organization. Responses are cached for up to 10 seconds.

### Run count

`superglue_runs_total` includes runs with `success`, `failed`, or `aborted` status.

| Label    | Values                                                                         |
| -------- | ------------------------------------------------------------------------------ |
| `status` | `success`, `failed`, `aborted`                                                 |
| `source` | `api`, `frontend`, `agent`, `scheduler`, `mcp`, `cli`, `tool-chain`, `webhook` |

**Note:** The counter reflects retained run records. Permanently deleting run history can reduce its value,
  which monitoring systems should treat like a counter reset.

### Run duration

`superglue_run_duration_seconds_p95` is calculated from completed runs in the previous 300 seconds. It exposes the same `source` values and a fixed `window="300s"` label.

A source with no completed run in that window has no time series.

## Useful queries

### Throughput by source

```txt
sum by (source) (increase(superglue_runs_total[5m]))
```

### Failure ratio

```txt
sum(increase(superglue_runs_total{status=~"failed|aborted"}[5m]))
/
clamp_min(sum(increase(superglue_runs_total[5m])), 1)
```

### Scheduled run failure

```txt
increase(superglue_runs_total{source="scheduler",status="failed"}[15m]) > 0
```

### Slow API runs

```txt
superglue_run_duration_seconds_p95{source="api"} > 10
```

When an alert fires, open [Runs](/docs/enterprise/run-history/) to inspect the affected execution, its step results, and the recorded failure.