# Prometheus Integration

[Prometheus](https://github.com/prometheus) is an open-source systems monitoring and alerting toolkit that collects and stores its metrics as time series data. In other words, it stores metrics information with the timestamp at which the data was recorded, alongside optional key-value pairs called labels. Many organizations have adopted Prometheus as part of their observability stack.

This document walks you through how to set up a Prometheus integration with DeltaStream's metrics. It includes the DeltaStream metrics that are exposed. We use Grafana screenshots as the example of how to add the Prometheus integration.

{% hint style="info" %}
**Note** You can only scrape the DeltaStream metrics endpoint every 60 seconds.
{% endhint %}

## Step 1: Create DeltaStream Metrics Token

<https://docs.deltastream.io/reference/sql-syntax/ddl/create-metrics-integration>

## Step 2: Add new Prometheus Endpoint to Scrape DeltaStream Metrics

1. Add DeltaStream's metric endpoint generated from Step 1 as an additional scrape metric config in your Prometheus deployment.

```yaml
- job_name: deltastream-metrics
  metrics_path: /metrics
  scheme: https
  scrape_interval: 60s
  scrape_protocols: [ "PrometheusText0.0.4" ]
  authorization:
    type: Bearer
    credentials: <your Bearer token from Step 1>
  static_configs:
    - targets:
      - "api-atyo2.deltastream.io" # [ your URI from Step 1 ]
      labels:
         <your custom label> : "<your custom label value>"

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.deltastream.io/reference/metrics/prometheus-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
