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

# Providers Provisioning

<Tip>For any questions or issues related to provider provisioning, please join our [Slack](https://slack.keephq.dev) community.</Tip>

Provider provisioning in Keep allows you to set up and manage data providers dynamically. This feature enables you to configure various data sources that Keep can interact with, such as monitoring systems, databases, or other services.

### Configuring Providers

To provision providers and deduplication rules for them, we can configure via the environment variable. This can be done in two ways:

1. Using `KEEP_PROVIDERS` environment variable which either contains a JSON string or a path to a JSON file that contains the providers configurations.
2. Using `KEEP_PROVIDERS_DIRECTORY` environment variable which contains a path to a directory that contains the providers configurations (configured via YAML files). This is the recommended approach.

<Note>
  Keep does not allow to use both `KEEP_PROVIDERS` and `KEEP_PROVIDERS_DIRECTORY` environment variables at the same time.
</Note>

<Note>
  Keep can automatically install webhooks for providers that support them. This behavior depends on the configuration and the provisioning method used.
</Note>

<Tip>Please note: Deduplication rules are not mandatory for provider distribution.</Tip>

### Providers provisioning using KEEP\_PROVIDERS

Providers provisioning JSON example:

```json theme={null}
{
  "keepVictoriaMetrics": {
    "type": "victoriametrics",
    "authentication": {
      "VMAlertHost": "http://localhost",
      "VMAlertPort": 1234
    },
    "install_webhook": true,
    "deduplication_rules": {
      "deduplication rule name example 1": {
        "description": "deduplication rule name example 1",
        "fingerprint_fields": ["fingerprint", "source", "service"],
        "full_deduplication": true,
        "ignore_fields": ["name", "lastReceived"]
      },
      "deduplication rule name example 2": {
        "description": "deduplication rule name example 2",
        "fingerprint_fields": ["fingerprint", "source", "service"],
        "full_deduplication": false,
      }
    }
  },
  "keepClickhouse1": {
    "type": "clickhouse",
    "authentication": {
      "host": "http://localhost",
      "port": 1234,
      "username": "keep",
      "password": "keep",
      "database": "keep-db"
    }
  }
}
```

Spin up Keep with this `KEEP_PROVIDERS` value:

```json theme={null}
# ENV
KEEP_PROVIDERS={"keepVictoriaMetrics":{"type":"victoriametrics","authentication":{"VMAlertHost":"http://localhost","VMAlertPort": 1234},"install_webhook":true},"keepClickhouse1":{"type":"clickhouse","authentication":{"host":"http://localhost","port":"4321","username":"keep","password":"1234","database":"keepdb"}}}
```

By default, when provisioning using `KEEP_PROVIDERS`, webhooks are automatically installed for providers that support them unless the `install_webhook` flag is set to `false`.

### Providers provisioning using KEEP\_PROVIDERS\_DIRECTORY

Specify the path to the directory containing the providers configurations:

```bash theme={null}
# ENV
KEEP_PROVIDERS_DIRECTORY=/path/to/providers
```

The directory should contain YAML files with the providers configurations.

Example of a provider configuration YAML file:

```yaml theme={null}
name: keepVictoriaMetrics
type: victoriametrics
authentication:
  VMAlertHost: http://localhost
  VMAlertPort: 1234
install_webhook: false
deduplication_rules:
  deduplication_rule_name_example_1:
    description: deduplication rule name example 1
    fingerprint_fields:
      - fingerprint
      - source
      - service
    full_deduplication: true
    ignore_fields:
      - name
      - lastReceived
```

The `install_webhook` field controls whether Keep sets up webhooks automatically for that provider. By default, when provisioning using `KEEP_PROVIDERS_DIRECTORY`, webhook installation is disabled unless explicitly set to `true`.

### Supported Providers

Keep supports a wide range of provider types. Each provider type has its own specific configuration requirements.
To see the full list of supported providers and their detailed configuration options, please refer to our comprehensive provider documentation.

### Update Provisioned Providers

#### Using KEEP\_PROVIDERS

Provider configurations can be updated dynamically by changing the `KEEP_PROVIDERS` environment variable.

On every restart, Keep reads this environment variable and determines which providers need to be added or removed.

This process allows for flexible management of data sources without requiring manual intervention. By simply updating the `KEEP_PROVIDERS` variable and restarting the application, you can efficiently add new providers, remove existing ones, or modify their configurations.

The high-level provisioning mechanism:

1. Keep reads the `KEEP_PROVIDERS` value.
2. Keep checks if there are any provisioned providers that are no longer in the `KEEP_PROVIDERS` value, and deletes them.
3. Keep installs all providers from the `KEEP_PROVIDERS` value.

#### Using KEEP\_PROVIDERS\_DIRECTORY

Provider configurations can be updated dynamically by changing the YAML files in the `KEEP_PROVIDERS_DIRECTORY` directory.

On every restart, Keep reads the YAML files in the `KEEP_PROVIDERS_DIRECTORY` directory and determines which providers need to be added or removed.

The high-level provisioning mechanism:

1. Keep reads the YAML files in the `KEEP_PROVIDERS_DIRECTORY` directory.
2. Keep checks if there are any provisioned providers that are no longer in the YAML files, and deletes them.
3. Keep installs all providers from the YAML files.
