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

# Prometheus

> Prometheus provider allows integration with Prometheus for monitoring and alerting purposes.

## Authentication

This provider requires authentication.

* **url**: Prometheus server URL (required: True, sensitive: False)
* **username**: Prometheus username (required: False, sensitive: False)
* **password**: Prometheus password (required: False, sensitive: True)
* **verify**: Verify SSL certificates (required: False, sensitive: False)

Certain scopes may be required to perform specific actions or queries via the provider. Below is a summary of relevant scopes and their use cases:

* **connectivity**: Connectivity Test (mandatory)

## In workflows

This provider can be used in workflows.

As "step" to query data, example:

```yaml theme={null}
steps:
    - name: Query prometheus
      provider: prometheus
      config: "{{ provider.my_provider_name }}"
      with:
        query: {value}
```

Check the following workflow examples:

* [create\_service\_now\_ticket\_upon\_alerts.yml](https://github.com/keephq/keep/blob/main/examples/workflows/create_service_now_ticket_upon_alerts.yml)
* [enrich\_using\_structured\_output\_from\_deepseek.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/enrich_using_structured_output_from_deepseek.yaml)
* [enrich\_using\_structured\_output\_from\_openai.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/enrich_using_structured_output_from_openai.yaml)
* [enrich\_using\_structured\_output\_from\_vllm\_qwen.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/enrich_using_structured_output_from_vllm_qwen.yaml)
* [http\_enrich.yml](https://github.com/keephq/keep/blob/main/examples/workflows/http_enrich.yml)
* [multi-condition-cel.yml](https://github.com/keephq/keep/blob/main/examples/workflows/multi-condition-cel.yml)

## Connecting via Webhook (omnidirectional)

This provider takes advantage of configurable webhooks available with Prometheus Alertmanager. Use the following template to configure AlertManager:

```
route:
  receiver: "keep"
  group_by: ['alertname']
  group_wait:      15s
  group_interval:  15s
  repeat_interval: 1m
  continue: true

receivers:
- name: "keep"
  webhook_configs:
  - url: 'KEEP_BACKEND_URL/alerts/event/prometheus'
    send_resolved: true
    http_config:
      basic_auth:
        username: api_key
        password: {api_key}
```

## Connecting with the Provider

1. Set up a Prometheus server and make sure it's running.
2. Get the `prometheus_url` where your Prometheus instance is accessible.
3. (Optional) Obtain the API token from your Prometheus configuration if it's protected.
4. Provide these values in the provider configuration.

## Useful Links

-[Prometheus Querying API Documentation](https://prometheus.io/docs/prometheus/latest/querying/api/)
-[Prometheus Official Documentation](https://prometheus.io/docs/introduction/overview/)
