# Prometheus

Follow the steps below to configure a service so as to extract its related alert data from Prometheus.

Squadcast will then process this information to create incidents for this service as per your preferences.

### Using Prometheus as an Alert Source

1. Navigate to **Services** -> **Service Overview** -> select or search for your Service. Expand the accordion -> In the Alert Sources section, click **Add**.

![](/files/ej4AI9zpOyFu5NZJCbwC)

2\. Select **Prometheus.** Copy the displayed **Webhook URL** to [configure](#create-a-squadcast-webhook-in-prometheus) it within **Prometheus**. Finish by clicking **Add Alert Source** -> **Done.**

![](/files/oVpdD8aCcClq2mLOO1oi)

{% hint style="warning" %}
**Important:**

When an alert source turns Active, it’ll show up under Configured Alert Sources, you can either generate a test alert from the integration or wait for a real-time alert to be generated by the Alert Source. An Alert Source is active if there is a recorded incident via that Alert Source for the Service.
{% endhint %}

### Create a Squadcast Webhook in Prometheus

Now open your Prometheus Alertmanager's Configuration file. (You need Prometheus Alertmanager to handle alerts generated by Prometheus. [Click here for more information ](https://prometheus.io/docs/alerting/alertmanager/))

Add a new webhook receiver and enter the URL obtained earlier as the webhook url.

![](/files/fyLb3TJrC81Hp9lRuudN)

Now you can use this receiver in any of your alert routes (You can also make it the default receiver, as per your requirements).

![](/files/CKQtDchs66vKvZZubaVj)

Also please make sure that your alerts has the severity under labels, and annotations has the summary & description fields configured in the alert rules file as shown below in the example rules config.

```yaml
serverFiles:
  alerts:
    groups:
    - name: gt.k8s.kafka.rules
      rules:
      - alert: GtK8sKafkaConsumerLag1Warning
        expr: kafka_consumergroup_lag > 500
        for: 120m
        labels:
          severity: warning
        annotations:
          description: "Kafka consumer { { $labels.consumergroup } } lags with { { $value } } messages in topic { { $labels.topic } }"
          summary: "Kafka affected in { { $labels.instance } }"
```

{% hint style="info" %}
**Important**:

We use the summary field along with Severity & Alert group name as incident message and the description field along with generator url as incident description. Hence, **severity (labels), summary & description (annotations)** are mandatory for integration with Squadcast.
{% endhint %}

{% hint style="info" %}
**Note**:

Any alert which gets resolved from Prometheus will automatically be resolved inside Squadcast as well, unless you have explicitly set **send\_resolved** to false in the config file.
{% endhint %}

*Have any questions?* [*Ask the community*](https://community.squadcast.com/view/home)*.*


---

# 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://support.squadcast.com/integrations/alert-source-integrations-native/prometheus.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.
