` Whether this rule should be applied before or after the alert is standardized * `attribute` * Type: STRING * Default: \`\` * Usage: `--attribute` Event attribute name to extract from. * `regex` * Type: STRING * Default: \`\` * Usage: `--attribute ` The regex rule to extract by. Regex format should be like python regex pattern for group matching. * `condition` * Type: STRING * Default: \`\` * Usage: `--condition ` CEL based condition. * `help`: * Type: BOOL * Default: `false` * Usage: `--help` Show this message and exit. ## CLI Help ``` Usage: cli.py extraction create [OPTIONS] Create a extraction rule. Options: -n, --name TEXT The name of the extraction. [required] -d, --description TEXT The description of the extraction. -p, --priority INTEGER RANGE The priority of the extraction, higher priority means this rule will execute first. [0<=x<=100] --pre BOOLEAN Whether this rule should be applied before or after the alert is standardized. -a, --attribute TEXT Event attribute name to extract from. [required] -r, --regex TEXT The regex rule to extract by. Regex format should be like python regex pattern for group matching. [required] -c, --condition TEXT CEL based condition. [required] --help Show this message and exit. ``` # Extraction delete Source: https://docs.keephq.dev/cli/commands/extraction-delete Delete an extraction with a specified ID. ## Usage ``` Usage: keep extraction delete [OPTIONS] ``` ## Options * `extraction-id` * Type: STRING * Default: \`\` * Usage: `--extraction-id ` The ID of the extraction to delete. * `help`: * Type: BOOL * Default: `false` * Usage: `--help` Show this message and exit. ## CLI Help ``` Usage: cli.py extraction delete [OPTIONS] Delete a extraction with a specified ID. Options: --extraction-id INTEGER The ID of the extraction to delete. [required] --help Show this message and exit. ``` # Extractions list Source: https://docs.keephq.dev/cli/commands/extractions-list List extractions. ## Usage ``` Usage: keep extraction list [OPTIONS] ``` List mappings. ## Options * `help`: * Type: BOOL * Default: `false` * Usage: `--help` Show this message and exit. ## CLI Help ``` Usage: cli.py extraction list [OPTIONS] List extractions. Options: --help Show this message and exit. ``` # Mappings create Source: https://docs.keephq.dev/cli/commands/mappings-create Create a mapping rule. ## Usage ``` Usage: keep mappings create [OPTIONS] ``` ## Options * `name` * Type: STRING * Default: \`\` * Usage: `--name ` The name of the mapping. * `description` * Type: STRING * Default: \`\` * Usage: `--description ` The description of the mapping. * `file` * Type: STRING * Default: \`\` * Usage: `--file ` The mapping file. Must be a CSV file. * `matchers` * Type: STRING * Default: \`\` * Usage: `--matchers ` The matchers of the mapping, as a comma-separated list of strings. * `priority` * Type: INTEGER RANGE * Default: `0` * Usage: `--priority ` The priority of the mapping, higher priority means this rule will execute first. `0<=x<=100`. * `help`: * Type: BOOL * Default: `false` * Usage: `--help` Show this message and exit. ## CLI Help ``` Usage: keep mappings create [OPTIONS] Create a mapping rule. Options: -n, --name TEXT The name of the mapping. [required] -d, --description TEXT The description of the mapping. -f, --file PATH The mapping file. Must be a CSV file. [required] -m, --matchers TEXT The matchers of the mapping, as a comma- separated list of strings. [required] -p, --priority INTEGER RANGE The priority of the mapping, higher priority means this rule will execute first. [0<=x<=100] --help Show this message and exit. ``` # Mappings delete Source: https://docs.keephq.dev/cli/commands/mappings-delete Delete a mapping with a specified ID. ## Usage ``` Usage: keep mappings delete [OPTIONS] ``` ## Options * `mapping-id` * Type: STRING * Default: \`\` * Usage: `--mapping-id ` The ID of the mapping to delete. * `help`: * Type: BOOL * Default: `false` * Usage: `--help` Show this message and exit. ## CLI Help ``` Usage: keep mappings delete [OPTIONS] Delete a mapping with a specified ID Options: --mapping-id INTEGER The ID of the mapping to delete. [required] --help Show this message and exit. ``` # Mappings list Source: https://docs.keephq.dev/cli/commands/mappings-list List mappings. ## Usage ``` Usage: keep mappings [OPTIONS] ``` List mappings. ## Options * `help`: * Type: BOOL * Default: `false` * Usage: `--help` Show this message and exit. ## CLI Help ``` Usage: keep mappings list [OPTIONS] List mappings. Options: --help Show this message and exit. ``` # Provider connect Source: https://docs.keephq.dev/cli/commands/provider-connect Connect a provider. ## Usage ``` Usage: keep provider connect [OPTIONS] PROVIDER_TYPE [PARAMS]... ``` ## Options ## CLI Help ``` Usage: keep provider connect [OPTIONS] PROVIDER_TYPE [PARAMS]... Options: -h, --help Help on how to install this provider. -n, --provider-name TEXT Every provider shuold have a name. ``` # Provider delete Source: https://docs.keephq.dev/cli/commands/provider-delete Delete a provider. ## Usage ``` Usage: keep provider delete [OPTIONS] [PROVIDER_ID] ``` ## Options ## CLI Help ``` Usage: keep provider delete [OPTIONS] [PROVIDER_ID] Options: --help Show this message and exit. ``` # Provider list Source: https://docs.keephq.dev/cli/commands/provider-list List providers. ## Usage ``` Usage: keep provider list [OPTIONS] ``` ## Options * `available`: * Type: BOOL * Default: `false` * Usage: `--available -a` List provider that you can install. * `help`: * Type: BOOL * Default: `false` * Usage: `--help` Show this message and exit. ## CLI Help ``` Usage: keep provider list [OPTIONS] List providers. Options: -a, --available List provider that you can install. --help Show this message and exit. ``` # Runs list Source: https://docs.keephq.dev/cli/commands/runs-list List workflow executions. ## Usage ``` Usage: keep workflow runs list [OPTIONS] ``` ## Options * `help`: * Type: BOOL * Default: `false` * Usage: `--help` Show this message and exit. ## CLI Help ``` Usage: keep workflow runs list [OPTIONS] List workflow executions. Options: --help Show this message and exit. ``` # Runs logs Source: https://docs.keephq.dev/cli/commands/runs-logs Get workflow execution logs. ## Usage ``` Usage: keep workflow runs logs [OPTIONS] WORKFLOW_EXECUTION_ID ``` ## Options ## CLI Help ``` Usage: keep workflow runs logs [OPTIONS] WORKFLOW_EXECUTION_ID Get workflow execution logs. Options: --help Show this message and exit. ``` # Workflow apply Source: https://docs.keephq.dev/cli/commands/workflow-apply Apply a workflow. ## Usage ``` Usage: keep workflow apply [OPTIONS] ``` ## Options * `file` (REQUIRED): * Type: Path * Default: `none` * Usage: `--file -f` The workflow file * `help`: * Type: BOOL * Default: `false` * Usage: `--help` Show this message and exit. ## CLI Help ``` Usage: keep workflow apply [OPTIONS] Apply a workflow. Options: -f, --file PATH The workflow file [required] --help Show this message and exit. ``` # Workflow list Source: https://docs.keephq.dev/cli/commands/workflow-list List workflows. ## Usage ``` Usage: keep workflow list [OPTIONS] ``` ## Options * `help`: * Type: BOOL * Default: `false` * Usage: `--help` Show this message and exit. ## CLI Help ``` Usage: keep workflow list [OPTIONS] List workflows. Options: --help Show this message and exit. ``` # Workflow run Source: https://docs.keephq.dev/cli/commands/workflow-run Run a workflow with a specified ID and fingerprint. ## Usage ``` Usage: keep workflow run [OPTIONS] ``` ## Options * `workflow_id` (REQUIRED): * Type: STRING * Default: `none` * Usage: `--workflow-id` The ID (UUID or name) of the workflow to run * `fingerprint` (REQUIRED): * Type: STRING * Default: `none` * Usage: `--fingerprint` The fingerprint to query the payload * `help`: * Type: BOOL * Default: `false` * Usage: `--help` Show this message and exit. ## CLI Help ``` Usage: keep workflow run [OPTIONS] Run a workflow with a specified ID and fingerprint. Options: --workflow-id TEXT The ID (UUID or name) of the workflow to run [required] --fingerprint TEXT The fingerprint to query the payload [required] --help Show this message and exit. ``` # Workflow runs Source: https://docs.keephq.dev/cli/commands/workflow-runs Manage workflows executions. ## Usage ``` Usage: cli workflow runs [OPTIONS] COMMAND [ARGS]... ``` ## Options * `help`: * Type: BOOL * Default: `false` * Usage: `--help` Show this message and exit. ## CLI Help ``` Usage: cli workflow runs [OPTIONS] COMMAND [ARGS]... Manage workflows executions. Options: --help Show this message and exit. Commands: list List workflow executions. logs Get workflow execution logs. ``` # Sync Keep Workflows With Github Action Source: https://docs.keephq.dev/cli/github-actions This documentation provides a detailed guide on how to use the Keep CLI within a GitHub Actions workflow to synchronize and manage Keep workflows from a directory. This setup automates the process of uploading workflows to Keep, making it easier to maintain and update them. ### Configuration To set up this workflow in your repository: * Add the workflow YAML file to your repository under `.github/workflows/`. * Set your Keep API Key and URL as secrets in your repository settings if you haven't already. * Make changes to your workflows in the specified directory or trigger the workflow manually through the GitHub UI. * Change 'example/workflows/\*\*' to the directory you store your Keep Workflows. ### GitHub Action Workflow This GitHub Actions workflow automatically synchronizes workflows from a specified directory to Keep whenever there are changes. It also allows for manual triggering with optional parameters. ```yaml theme={null} # A workflow that sync Keep workflows from a directory name: "Sync Keep Workflows" on: push: paths: - 'examples/workflows/**' workflow_dispatch: inputs: keep_api_key: description: 'Keep API Key' required: false keep_api_url: description: 'Keep API URL' required: false default: 'https://api.keephq.dev' jobs: sync-workflows: name: Sync workflows to Keep runs-on: ubuntu-latest container: image: us-central1-docker.pkg.dev/keephq/keep/keep-cli:latest env: KEEP_API_KEY: ${{ secrets.KEEP_API_KEY || github.event.inputs.keep_api_key }} KEEP_API_URL: ${{ secrets.KEEP_API_URL || github.event.inputs.keep_api_url }} steps: - name: Check out the repo uses: actions/checkout@v2 - name: Run Keep CLI run: | keep workflow apply -f examples/workflows ``` # Installation Source: https://docs.keephq.dev/cli/installation Missing an installation? submit a new installation request and we will add it as soon as we can. We recommend to install Keep CLI with Python version 3.11 for optimal compatibility and performance. This choice ensures seamless integration with all dependencies, including pyarrow, which currently does not support Python 3.12 Need Keep CLI on other versions? Feel free to contact us! ## Clone and install (Option 1) ### Install First, clone Keep repository: ```shell theme={null} git clone https://github.com/keephq/keep.git && cd keep ``` Install Keep CLI with `pip`: ```shell theme={null} # MacOS if python or pip not present: # brew install python@3.11 # brew install postgresql pip3.11 install . ``` or with `poetry`: ```shell theme={null} poetry install ``` From now on, Keep should be installed locally and accessible from your CLI, test it by executing: ``` keep version ``` ### Configuration To get API key, check Keep UI -> your username (bottom left) -> Settings -> API Keys ``` keep config new --url http://backend.my_keep.my_awesome_org.com:backend_port --api-key your_personal_api_key ``` ### Test Now, ``` keep workflow apply -f examples/workflows/query_clickhouse.yml ``` Congrats 𼳠Check your UI for the new workflow uploaded from the YAML file. ## Docker image (Option 2) ### Install ``` docker run -v ${PWD}:/app -v ~/.keep.yaml:/root/.keep.yaml -it us-central1-docker.pkg.dev/keephq/keep/keep-cli keep config new --url http://backend.my_keep.my_awesome_org.com:backend_port --api-key your_personal_api_key ``` ### Test ``` docker run -v ${PWD}:/app -v ~/.keep.yaml:/root/.keep.yaml -it us-central1-docker.pkg.dev/keephq/keep/keep-cli workflow apply -f examples/workflows/query_clickhouse.yml ``` ## Enable Auto Completion Keep's CLI supports shell auto-completion, which can make your life a whole lot easier đ If you're using zsh ```shell title=~/.zshrc theme={null} eval "$(_KEEP_COMPLETE=zsh_source keep)" ``` If you're using bash ```bash title=~/.bashrc theme={null} eval "$(_KEEP_COMPLETE=bash_source keep)" ```Using eval means that the command is invoked and evaluated every time a shell is started, which can delay shell responsiveness. To speed it up, write the generated script to a file, then source that. # Overview Source: https://docs.keephq.dev/cli/overview Keep CLI allow you to manage Keep from CLI. Start by [installing](/cli/installation) Keep CLI and [running a workflow](/cli/commands/cli-run). ### Env variables | Env var | Purpose | Required | Default Value | Valid options | | :------------------------: | :-----------------------------------------: | :------: | :-----------: | :---------------: | | **KEEP\_CLI\_IGNORE\_SSL** | Ignore SSL while connecting to the KEEP API | No | false | "true" or "false" | # Auth0 Authentication Source: https://docs.keephq.dev/deployment/authentication/auth0-authKeep Cloud: â Keep supports multi-tenant environments through Auth0, enabling separate tenants to operate independently within the same Keep platform.
Keep Enterprise On-Premises: â
Keep Open Source: âď¸### When to Use * **Already using Auth0:** If you are already using Auth0 in your organization, you can leverage it as Keep authentication provider. * **SSO/SAML:** Auth0 supports various Single Sign-On (SSO) and SAML protocols, allowing you to integrate Keep with your existing identity management systems. ### Setup Instructions To start Keep with Auth0 authentication, set the following environment variables: #### Frontend Environment Variables | Environment Variable | Description | Required | Default Value | | --------------------- | --------------------------------------- | :------: | :-----------: | | AUTH\_TYPE | Set to 'AUTH0' for Auth0 authentication | Yes | - | | AUTH0\_DOMAIN | Your Auth0 domain | Yes | - | | AUTH0\_CLIENT\_ID | Your Auth0 client ID | Yes | - | | AUTH0\_CLIENT\_SECRET | Your Auth0 client secret | Yes | - | | AUTH0\_ISSUER | Your Auth0 API issuer | Yes | - | #### Backend Environment Variables | Environment Variable | Description | Required | Default Value | | ------------------------- | --------------------------------------- | :------: | :-----------: | | AUTH\_TYPE | Set to 'AUTH0' for Auth0 authentication | Yes | - | | AUTH0\_MANAGEMENT\_DOMAIN | Your Auth0 management domain | Yes | - | | AUTH0\_CLIENT\_ID | Your Auth0 client ID | Yes | - | | AUTH0\_CLIENT\_SECRET | Your Auth0 client secret | Yes | - | | AUTH0\_AUDIENCE | Your Auth0 API audience | Yes | - | ### Example configuration Use the `docker-compose-with-auth0.yml` for an easy setup, which includes necessary environment variables for enabling Auth0 authentication. # Azure AD Authentication Source: https://docs.keephq.dev/deployment/authentication/azuread-auth
Keep Cloud: â Keep supports enterprise authentication through Azure Entre ID (formerly known as Azure AD), enabling organizations to use their existing Microsoft identity platform for secure access management. ## When to Use * **Microsoft Environment:** If your organization uses Microsoft 365 or Azure services, Azure AD integration provides seamless authentication. * **Enterprise SSO:** Leverage Azure AD's Single Sign-On capabilities for unified access management. ## Setup Instructions (on Azure AD) ### Creating an Azure AD Application 1. Sign in to the [Azure Portal](https://portal.azure.com) 2. Navigate to **Microsoft Entra ID** > **App registrations** > **New registration**
Keep Enterprise On-Premises: â
Keep Open Source: âď¸3. Configure the application: * Name: "Keep"
Note that we are using "Register an application to integrate with Microsoft Entra ID (App you're developing)" since you're self-hosting Keep and need direct control over the authentication flow and permissions for your specific instance - unlike the cloud/managed version where Keep's team has already configured a centralized application registration. 4. Configure the application (continue) * Supported account types: "Single tenant"
We recommend using "Single tenant" for enhanced security as it restricts access to users within your organization only. While multi-tenant configuration is possible, it would allow users from any Azure AD directory to access your Keep instance, which could pose security risks unless you have specific cross-organization requirements. * Redirect URI: "Web" + your redirect URIWe use "Web" platform instead of "Single Page Application (SPA)" because Keep's backend handles the authentication flow using client credentials/secrets, which is more secure than the implicit flow used in SPAs. This prevents exposure of tokens in the browser and provides stronger security through server-side token validation and refresh token handling. For localhost, the redirect would be [http://localhost:3000/api/auth/callback/microsoft-entra-id](http://localhost:3000/api/auth/callback/microsoft-entra-id) For production, it should be something like http\://your\_keep\_frontend\_domain/api/auth/callback/microsoft-entra-id 5. Finally, click "register" ### Configure Authentication After we created the application, let's configure the authentication. 1. Go to "App Registrations" -> "All applications"
2. Click on your application -> "Add a certificate or secret"
3. Click on "New client secret" and give it a name
4. Keep the "Value", we will use it soon as `KEEP_AZUREAD_CLIENT_SECRET`
### Configure Groups Keep maps Azure AD groups to roles with two default groups: 1. Admin Group (read + write) 2. NOC Group (read only) To create those groups, go to Groups -> All groups and create two groups:
Keep the Object id of these groups and use it as `KEEP_AZUREAD_ADMIN_GROUP_ID` and `KEEP_AZUREAD_NOC_GROUP_ID`. ### Configure Group Claims 1. Navigate to **Token configuration**
2. Add groups claim: * Select "Security groups" and "Groups assigned to the application" * Choose "Group ID" as the claim value
![]()
### Configure Application Scopes 1. Go to "Expose an API" and click on "Add a scope"
2. Keep the default Application ID and click "Save and continue"
3. Add "default" as scope name, also give a display name and description
3. Finally, click "Add scope"
## Setup Instructions (on Keep) After you configured Azure AD you should have the following: 1. Azure AD Tenant ID 2. Azure AD Client ID How to get:
3. Azure AD Client Secret [See Configure Authentication](#configure-authentication). 4. Azure AD Group ID's for Admins and NOC (read only) [See Configure Groups](#configure-groups). ### Configuration #### Frontend | Environment Variable | Description | Required | Default Value | | ----------------------------- | -------------------------------------------- | :------: | :-----------: | | AUTH\_TYPE | Set to 'AZUREAD' for Azure AD authentication | Yes | - | | KEEP\_AZUREAD\_CLIENT\_ID | Your Azure AD application (client) ID | Yes | - | | KEEP\_AZUREAD\_CLIENT\_SECRET | Your client secret | Yes | - | | KEEP\_AZUREAD\_TENANT\_ID | Your Azure AD tenant ID | Yes | - | | NEXTAUTH\_URL | Your Keep application URL | Yes | - | | NEXTAUTH\_SECRET | Random string for NextAuth.js | Yes | - | #### Backend | Environment Variable | Description | Required | Default Value | | ------------------------------- | -------------------------------------------- | :------: | :-----------: | | AUTH\_TYPE | Set to 'AZUREAD' for Azure AD authentication | Yes | - | | KEEP\_AZUREAD\_TENANT\_ID | Your Azure AD tenant ID | Yes | - | | KEEP\_AZUREAD\_CLIENT\_ID | Your Azure AD application (client) ID | Yes | - | | KEEP\_AZUREAD\_ADMIN\_GROUP\_ID | The group ID of Keep Admins (read write) | Yes | - | | KEEP\_AZUREAD\_NOC\_GROUP\_ID | The group ID of Keep NOC (read only) | Yes | - | ## Features and Limitations #### Supported Features * Single Sign-On (SSO) * Role-based access control through Azure AD groups * Multi-factor authentication (when configured in Azure AD) #### Limitations See [Overview](/deployment/authentication/overview) # DB Authentication Source: https://docs.keephq.dev/deployment/authentication/db-auth For applications requiring user management and authentication, Keep supports basic authentication with username and password.
### When to Use * **Self-Hosted Deployments:** When you're deploying Keep for individual use or within an organization. * **Enhanced Security:** Provides a simple yet effective layer of security for your Keep instance. ### Setup Instructions To start Keep with DB authentication, set the following environment variables: | Environment Variable | Description | Required | Frontend/Backend | Default Value | | ------------------------------------- | :-------------------------------------: | :------: | :--------------: | :-----------: | | AUTH\_TYPE | Set to 'DB' for database authentication | Yes | Both | - | | KEEP\_JWT\_SECRET | Secret for JWT token generation | Yes | Backend | - | | KEEP\_DEFAULT\_USERNAME | Default admin username | No | Backend | keep | | KEEP\_DEFAULT\_PASSWORD | Default admin password | No | Backend | keep | | KEEP\_FORCE\_RESET\_DEFAULT\_PASSWORD | Override the current admin password | No | Backend | false | ### Example configuration Use the `docker-compose-with-auth.yml` for an easy setup, which includes necessary environment variables for enabling basic authentication. # Keycloak Authentication Source: https://docs.keephq.dev/deployment/authentication/keycloak-auth
Keep Cloud: â
Keep Enterprise On-Premises: â
Keep Open Source: âď¸Keep supports Keycloak in a "managed" way where Keep auto-provisions all resources (realm, client, etc.). Keep can also work with externally managed Keycloak. To learn how, please contact the team on [Slack](https://slack.keephq.dev). Keep integrates with Keycloak to provide a powerful and flexible authentication system for multi-tenant applications, supporting Single Sign-On (SSO) and SAML.### When to Use * **On Prem:** When deploying Keep on-premises and requiring a robust authentication system. * **OSS:** If you prefer using open-source software for your authentication needs. * **Enterprise Protocols:** When you need support for enterprise-level protocols like SAML and OpenID Connect. * **Fully Customized:** When you need a highly customizable authentication solution. * **RBAC:** When you require Role-Based Access Control for managing user permissions. * **User and Group Management:** When you need advanced user and group management capabilities. ### Setup Instructions To start Keep with Keycloak authentication, set the following environment variables: #### Frontend Environment Variables | Environment Variable | Description | Required | Default Value | | -------------------- | -------------------------------------------------------------------------------------------------------------------------- | :------: | :------------------: | | AUTH\_TYPE | Set to 'KEYCLOAK' for Keycloak authentication | Yes | - | | KEYCLOAK\_ID | Your Keycloak client ID (e.g. keep) | Yes | - | | KEYCLOAK\_ISSUER | Full URL to Your Keycloak issuer URL e.g. [http://localhost:8181/auth/realms/keep](http://localhost:8181/auth/realms/keep) | Yes | - | | KEYCLOAK\_SECRET | Your Keycloak client secret | Yes | keep-keycloak-secret | #### Backend Environment Variables | Environment Variable | Description | Required | Default Value | | ------------------------- | --------------------------------------------- | :------: | :--------------------------------------------------------: | | AUTH\_TYPE | Set to 'KEYCLOAK' for Keycloak authentication | Yes | - | | KEYCLOAK\_URL | Full URL to your Keycloak server | Yes | [http://localhost:8181/auth/](http://localhost:8181/auth/) | | KEYCLOAK\_REALM | Your Keycloak realm | Yes | keep | | KEYCLOAK\_CLIENT\_ID | Your Keycloak client ID | Yes | keep | | KEYCLOAK\_CLIENT\_SECRET | Your Keycloak client secret | Yes | keep-keycloak-secret | | KEYCLOAK\_ADMIN\_USER | Admin username for Keycloak | Yes | keep\_admin | | KEYCLOAK\_ADMIN\_PASSWORD | Admin password for Keycloak | Yes | keep\_admin | | KEYCLOAK\_AUDIENCE | Audience for Keycloak | Yes | realm-management | ### Example configuration To get a better understanding on how to use Keep together with Keycloak, you can: * See [Keycloak](https://github.com/keephq/keep/tree/main/keycloak) directory for configuration, realm.json, etc * See Keep + Keycloak [docker-compose example](https://github.com/keephq/keep/blob/main/keycloak/docker-compose.yaml) # No Authentication Source: https://docs.keephq.dev/deployment/authentication/no-auth
Using this configuration in production is not secure and strongly discouraged. Deploying Keep without authentication is the quickest way to get up and running, ideal for local development or internal tools where security is not a concern. ## Setup Instructions Either if you use docker-compose, kubernetes, openshift or any other deployment method, add the following environment variable: ``` # Frontend AUTH_TYPE=NOAUTH # Backend AUTH_TYPE=NOAUTH ``` ## Implications With `AUTH_TYPE=NOAUTH`: * Keep won't show any login page and will let you consume APIs without authentication. * Keep will use a JWT with "keep" as the tenant id, but will not validate it. * Any API key provided in the `x-api-key` header will be accepted without validation. This configuration essentially bypasses all authentication checks, making it unsuitable for production environments where security is a concern. # Example: OAuth2âProxy + Keep + GitLab SSO Source: https://docs.keephq.dev/deployment/authentication/oauth2-proxy-gitlab A **stepâbyâstep cookbook** for adding singleâsignâon to [Keep](https://github.com/keephq) with your **selfâhosted GitLab** using [oauth2âproxy](https://oauth2âproxy.github.io/) and the NGINX Ingress Controller. > **Conventions used below** > > * ``             ââŻpublic FQDN where users access Keep (e.g. `keep.example.com`) > * ` `           ââŻURL of your GitLab instance (e.g. `gitlab.example.com`) > * ` `         ââŻcontainer registry that stores images (omit if you use the public images) > * Kubernetes namespace **`keep`** â feel free to change it everywhere if you prefer another namespace. *** ## 1. Prerequisites | What | Why | | ------------------------------------------- | ----------------------------------------------------- | | Kubernetes cluster & `keep` namespace | Where Keep, oauth2âproxy and Services live | | **ingressânginx** (or compatible) | Provides the `auth_request` feature oauth2âproxy uses | | GitLab 15âŻ+ at `https:// ` | OpenIDâConnect issuer | | Helm 3.x & offline charts/images (optional) | If your cluster has no Internet egress | *** ## 2. Create the GitLab OAuth application 1. **GitLab â¸Â AdminâŻââŻApplicationsâŻââŻNew** 2. Name â `keepâsso` 3. Redirect URI â `https:// /oauth2/callback` 4. Scopes â `openid profile email` (+ `read_api` if you plan to gate access by group/project) 5. Save â copy the generated **ApplicationâŻID** and **Secret**. *** ## 3. Kubernetes secrets & config ```bash theme={null} # 3.1 Generate a 32âbyte cookie secret echo "$(openssl rand -base64 32 | head -c 32 | base64)" > cookie.b64 # 3.2 Store GitLab credentials and cookie secret kubectl -n keep create secret generic oauth2-proxy \ --from-literal=client-id= \ --from-literal=client-secret= \ --from-file=cookie-secret=cookie.b64 # 3.3 Add gitlab credentials and cookie secret using OAUTH2_PROXY ENV variables OAUTH2_PROXY_CLIENT_ID= OAUTH2_PROXY_CLIENT_SECRET= OAUTH2_PROXY_COOKIE_SECRET=cookie.b64 # (optional) store GitLabâs custom CA certificate kubectl -n keep create secret generic gitlab-ca \ --from-file=gitlab-ca.pem ``` ```yaml theme={null} # 3.4 oauth2_proxy.cfg (ConfigMap) apiVersion: v1 kind: ConfigMap metadata: name: oauth2-proxy namespace: keep data: oauth2_proxy.cfg: | email_domains = ["*"] upstreams = ["file:///dev/null"] # we only use authârequest mode provider = "gitlab" cookie_name = "keep-dev" #if empty, will use default cookie name: _oauth2_proxy cookie_secure = true ``` *** ## 4. Deploy **oauth2âproxy** (Helm) ```yaml theme={null} # values.oauth2-proxy.yaml â minimal baseline image: # replace with public image if desired repository: /oauth2-proxy/oauth2-proxy tag: v7.9.0 config: configFile: |- # content comes from the ConfigMap above extraArgs: oidc-issuer-url: https:// set-xauthrequest: "true" # add X-Auth-Request-*/X-Forwarded-* headers pass-authorization-header: "true" # add Authorization: Bearer # provider-ca-file: /ca/gitlab-ca.pem # enable if you mounted a corporate CA or use ssl-insecure-skip-verify: "true" to disable SSL check. extraVolumes: - name: gitlab-ca secret: secretName: gitlab-ca extraVolumeMounts: - name: gitlab-ca mountPath: /ca/gitlab-ca.pem subPath: gitlab-ca.pem readOnly: true service: type: ClusterIP ingress: enabled: false # we only need an internal Service ``` ```bash theme={null} helm repo add oauth2-proxy https://oauth2-proxy.github.io/manifests helm upgrade --install oauth2-proxy oauth2-proxy/oauth2-proxy \ -n keep -f values.oauth2-proxy.yaml ``` *Labâonly shortcut*: instead of mounting the CA you can temporarily add `ssl-insecure-skip-verify: "true"` under `extraArgs`. *** ## 5. Patch (or create) Keepâs Ingress resource Add **three** annotations so ingressânginx delegates auth to the Service: ```yaml theme={null} global: ingress: annotations: nginx.ingress.kubernetes.io/auth-url: "http://oauth2-proxy.keep.svc.cluster.local/oauth2/auth" nginx.ingress.kubernetes.io/auth-signin: "https:// /oauth2/start?rd=$request_uri" nginx.ingress.kubernetes.io/auth-response-headers: "authorization,x-auth-request-user,x-auth-request-email,x-forwarded-user,x-forwarded-email,x-forwarded-groups" ``` Redeploy Keep (or patch the Ingress manually). *** ## 6. Environment variables for Keep ```yaml theme={null} backend: env: - name: AUTH_TYPE value: OAUTH2PROXY - name: KEEP_OAUTH2_PROXY_USER_HEADER value: x-auth-request-email - name: KEEP_OAUTH2_PROXY_ROLE_HEADER value: x-auth-request-groups - name: KEEP_OAUTH2_PROXY_AUTO_CREATE_USER value: true - name: KEEP_OAUTH2_PROXY_ADMIN_ROLES value: - name: KEEP_OAUTH2_PROXY_NOC_ROLES value: frontend: env: # Public URL the **browser** should use - name: NEXTAUTH_URL value: "https:// " # URL the **serverâside** Next.js code can always reach - name: NEXTAUTH_URL_INTERNAL value: "http://keep-frontend.keep.svc.cluster.local:3000" # API URLs - name: API_URL_CLIENT # browser â ingress value: "/v2" - name: API_URL # server â backend Service (no authâproxy) value: "http://keep-backend.keep.svc.cluster.local:8080" #Oauth2-Proxy - name: AUTH_TYPE value: OAUTH2PROXY - name: KEEP_OAUTH2_PROXY_USER_HEADER value: x-auth-request-email - name: KEEP_OAUTH2_PROXY_ROLE_HEADER value: x-auth-request-groups ``` Roll out the frontend: ```bash theme={null} kubectl -n keep rollout restart deploy/keep-frontend ``` *** ## 7. Quick validation ```bash theme={null} # 7.1 Call auth endpoint without cookie â expect 401 curl -I http://oauth2-proxy.keep.svc.cluster.local/oauth2/auth # 7.2 Copy the keep-dev cookie from your browser session curl -I --cookie "keep-dev= " \ http://oauth2-proxy.keep.svc.cluster.local/oauth2/auth # expect 200 ``` Browser smokeâtest: * `https:// ` â redirect to GitLab â sign in â return to Keep. * DevTools â¸Â Network â `/api/auth/session` returns **200**. *** ## 8. Troubleshooting | Symptom | Common cause & remedy | | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | | **TLS error** `x509: certificate signed by unknown authority` | Mount your GitLab CA (`provider-ca-file`) or set `ssl-insecure-skip-verify=true` (dev only). | | Ingress logs `auth request unexpected status: 502` | `auth-url` is pointing at the external host â use the internal Service DNS (`http://oauth2-proxy.keep.svc.cluster.local`). | | Browser loops at `/signin?callbackUrl=âŚ` | â âŻ`set-xauthrequest` not enabled, or âĄâŻ`auth-response-headers` not set, or â˘âŻbackend receives calls through oauth2âproxy (`API_URL` wrong). | | Redirect to `0.0.0.0:3000` or pod name | `NEXTAUTH_URL` missing at **build time**; rebuild UI or override env. | | 401 from `/oauth2/auth` even with cookie | Cookie expired / clocks out of sync. Clear cookie and reâlogin. | *** ## 9. Cleanâup ```bash theme={null} helm -n keep uninstall oauth2-proxy helm -n keep uninstall keep # if you want to remove Keep kubectl -n keep delete secret oauth2-proxy gitlab-ca ``` *** ## Appendix A â Generate a 32âbyte cookie secret ```bash theme={null} openssl rand -hex 16 | xxd -r -p | base64 ``` ## Appendix B â Sync images to an offline registry (example) ```bash theme={null} skopeo copy docker://quay.io/oauth2-proxy/oauth2-proxy:v7.9.0 \ docker:// /oauth2-proxy/oauth2-proxy:v7.9.0 ``` # OAuth2Proxy Authentication Source: https://docs.keephq.dev/deployment/authentication/oauth2proxy-auth Keep Cloud: â Delegate authentication to Oauth2Proxy. ### When to Use * **oauth2-proxy user:** Use this authentication method if you want to delegate authentication to an external Oauth2Proxy service. ### Setup Instructions To start Keep with Oauth2Proxy authentication, set the following environment variables: #### Frontend Environment Variables | Environment Variable | Description | Required | Default Value | | --------------------------------- | --------------------------------------------------- | :------: | :----------------: | | AUTH\_TYPE | Set to 'OAUTH2PROXY' for OAUTH2PROXY authentication | Yes | - | | KEEP\_OAUTH2\_PROXY\_USER\_HEADER | Header for the authenticated user's email | Yes | x-forwarded-email | | KEEP\_OAUTH2\_PROXY\_ROLE\_HEADER | Header for the authenticated user's role | Yes | x-forwarded-groups | #### Backend Environment Variables | Environment Variable | Description | Required | Default Value | | --------------------------------------- | ---------------------------------------------------- | :------: | :----------------: | | AUTH\_TYPE | Set to 'OAUTH2PROXY' for OAUTH2PROXY authentication | Yes | - | | KEEP\_OAUTH2\_PROXY\_USER\_HEADER | Header for the authenticated user's email | Yes | x-forwarded-email | | KEEP\_OAUTH2\_PROXY\_ROLE\_HEADER | Header for the authenticated user's role | Yes | x-forwarded-groups | | KEEP\_OAUTH2\_PROXY\_AUTO\_CREATE\_USER | Automatically create user if not exists | No | true | | KEEP\_OAUTH2\_PROXY\_ADMIN\_ROLES | Role names for admin users | No | admin | | KEEP\_OAUTH2\_PROXY\_NOC\_ROLES | Role names for NOC (Network Operations Center) users | No | noc | | KEEP\_OAUTH2\_PROXY\_WEBHOOK\_ROLES | Role names for webhook users | No | webhook | # Okta Authentication Source: https://docs.keephq.dev/deployment/authentication/okta-auth This document provides comprehensive information about the Okta integration in Keep. ## Overview Keep supports Okta as an authentication provider, enabling: * Single Sign-On (SSO) via Okta * OAuth2/OIDC authentication flow * JWT token verification with JWKS * Role-based access control through token claims ## Environment Variables ### Backend Environment Variables | Variable | Description | Required | | -------------------- | --------------------------------------------------------------------------------------------------- | -------- | | `AUTH_TYPE` | Set to `"OKTA"` to enable Okta authentication | Yes | | `OKTA_DOMAIN` | Your Okta domain (e.g., `https://company.okta.com`) | Yes | | `OKTA_ISSUER` | The issuer URL for your Okta authorization server (e.g., `https://company.okta.com/oauth2/default`) | Yes | | `OKTA_CLIENT_ID` | Client ID of your Okta application | Yes | | `OKTA_CLIENT_SECRET` | Client Secret of your Okta application | Yes | | `OKTA_AUDIENCE` | Expected audience claim in the token. Falls back to `OKTA_CLIENT_ID` if not set | No | | `OKTA_JWKS_URL` | Explicit JWKS URL. If not set, derived from `OKTA_ISSUER` | No | | `OKTA_API_TOKEN` | Okta API token for management operations | No | ### Frontend Environment Variables | Variable | Description | Example | | -------------------- | ------------------------------------------------- | ----------------------------------------- | | `AUTH_TYPE` | Set to `"OKTA"` to enable Okta authentication | `OKTA` | | `OKTA_ISSUER` | The issuer URL for your Okta authorization server | `https://company.okta.com/oauth2/default` | | `OKTA_CLIENT_ID` | Client ID of your Okta application | `0oa1bcdef2ghijklm3n4` | | `OKTA_CLIENT_SECRET` | Client Secret of your Okta application | `abcd1234efgh5678` | ## Okta Configuration ### Creating an Okta Application 1. Sign in to your Okta Admin Console 2. Navigate to **Applications** > **Applications** 3. Click **Create App Integration** 4. Select **OIDC - OpenID Connect** as the sign-in method 5. Select **Web Application** as the application type 6. Click **Next** ### Application Settings 1. **App integration name**: Enter a name for your application (e.g., "Keep") 2. **Sign-in redirect URIs**: Add your callback URL: `https://your-keep-domain.com/api/auth/callback/okta` 3. **Sign-out redirect URIs**: Add your sign-out URL: `https://your-keep-domain.com` 4. **Assignments**: Assign the application to the appropriate users or groups 5. Click **Save** 6. Copy the **Client ID** and **Client Secret** from the application settings ### Role Mapping Keep extracts the user role from the JWT token. The role is determined in the following order: 1. `keep_role` claim in the token 2. `role` claim in the token 3. First entry in the `groups` claim 4. Falls back to `user` role To configure role mapping, add a custom claim to your Okta authorization server: 1. Navigate to **Security** > **API** > **Authorization Servers** 2. Select your authorization server (e.g., `default`) 3. Go to the **Claims** tab 4. Add a claim named `keep_role` or `groups` that maps to the user's Keep role # OneLogin Authentication Source: https://docs.keephq.dev/deployment/authentication/onelogin-auth This document provides comprehensive information about the OneLogin integration in Keep ## Overview Keep supports OneLogin as an authentication provider, enabling: * Single Sign-On (SSO) via OneLogin * OAuth2/OIDC authentication flow * Token refresh capabilities * Role-based access control through custom claims * Session management through NextAuth.js ## Environment Variables ### Backend Environment Variables | Variable | Description | Example | | --------------------------- | ----------------------------------------------------- | ------------------------------------- | | `AUTH_TYPE` | Set to `"ONELOGIN"` to enable OneLogin authentication | `ONELOGIN` | | `ONELOGIN_ISSUER` | The issuer URL for your OneLogin application | `https://company.onelogin.com/oidc/2` | | `ONELOGIN_CLIENT_ID` | Client ID of your OneLogin application | `abc123def456ghi789` | | `ONELOGIN_CLIENT_SECRET` | Client Secret of your OneLogin application | `abcd1234efgh5678ijkl9012` | | `ONELOGIN_ADMIN_ROLE` | Role to be mapped to a keep admin role | `KeepAdmin` | | `ONELOGIN_NOC_ROLE` | Role to be mapped to a keep noc role | `KeepNoc` | | `ONELOGIN_WEBHOOK_ROLE` | Role to be mapped to a keep webhook role | `KeepWebhook` | | `ONELOGIN_AUTO_CREATE_USER` | Whether to try and create autocreate users in keep | `True` | ### Frontend Environment Variables | Variable | Description | Example | | ------------------------ | ----------------------------------------------------- | ------------------------------------- | | `AUTH_TYPE` | Set to `"ONELOGIN"` to enable OneLogin authentication | `ONELOGIN` | | `ONELOGIN_ISSUER` | The issuer URL for your OneLogin application | `https://company.onelogin.com/oidc/2` | | `ONELOGIN_CLIENT_ID` | Client ID of your OneLogin application | `abc123def456ghi789` | | `ONELOGIN_CLIENT_SECRET` | Client Secret of your OneLogin application | `abcd1234efgh5678ijkl9012` | ## OneLogin Configuration ### Creating a OneLogin Application 1. Sign in to your OneLogin Admin Console 2. Navigate to **Applications** 3. Click **Add App** 4. Search for **OpenId Connect (OIDC)** and select it 5. Click **Save** ### Application Settings 1. **Display Name**: Enter a name for your application (e.g., "Keep") 2. **Redirect URIs**: Enter your app's callback URL, e.g., `https://your-keep-domain.com/api/auth/callback/onelogin` 3. **Login URL**: Enter your app's login URL, e.g., `https://your-keep-domain.com/signin` 4. **Role Mapping**: * Go to the Parameters tab * Map the groups to user roles or groups with the default value being semicolon delimited input values 5. Go to the **SSO** tab and configure: * **Application Type**: Web * **Token Endpoint**: Client Secret Post 6. **Access**: * Assign to appropriate roles or users 7. Click **Save** 8. Copy the client id, client secret and issuer URL from the SSO tab # Overview Source: https://docs.keephq.dev/deployment/authentication/overview
Keep Enterprise On-Premises: â
Keep Open Source: (experimental)For every authentication-related question or issue, please join our [Slack](https://slack.keephq.dev). Keep supports various authentication providers and architectures to accommodate different deployment strategies and security needs, from development environments to production setups. ### Authentication Providers * [**No Authentication**](/deployment/authentication/no-auth) - Quick setup for testing or internal use cases. * [**DB**](/deployment/authentication/db-auth) - Simple username/password authentication. Works well for small teams or for dev/stage environments. Users and hashed password are stored on DB. * [**Auth0**](/deployment/authentication/auth0-auth) - Utilize Auth0 for scalable, auth0-based authentication. * [**Keycloak**](/deployment/authentication/keycloak-auth) - Utilize Keycloak for enterprise authentication methods such as SSO/SAML/OIDC, advanced RBAC with custom roles, resource-level permissions, and integration with user directories (LDAP). * [**AzureAD**](/deployment/authentication/azuread-auth) - Utilize Azure AD for SSO/SAML/OIDC nterprise authentication. * [**Okta**](/deployment/authentication/okta-auth) - Utilize Okta for SSO/OIDC authentication. * [**OneLogin**](/deployment/authentication/onelogin-auth) - Utilize OneLogin for SSO/OIDC authentication. Choosing the right authentication strategy depends on your specific use case, security requirements, and deployment environment. You can read more about each authentication provider. ### Authentication Features Comparison | Identity Provider | RBAC | SAML/OIDC/SSO | LDAP | Resource-based permission | User Management | Group Management | On Prem | License | | :---------------: | :------------------------: | :-----------: | :--: | :-----------------------: | :-------------: | :--------------: | :-----: | :-----: | | **No Auth** | â | â | â | â | â | â | â | **OSS** | | **DB** | â
(Predefiend roles) | â | â | â | â | â | â | **OSS** | | **Auth0** | â
(Predefiend roles) | â | đ§ | đ§ | â | đ§ | â | **EE** | | **Keycloak** | â
(Custom roles) | â | â | â | â | â | â | **EE** | | **Oauth2Proxy** | â
(Predefiend roles) | â | â | â | N/A | N/A | â | **OSS** | | **Azure AD** | â
(Predefiend roles) | â | â | â | By Azure AD | By Azure AD | â | **EE** | | **Okta** | â
(Predefiend roles) | â | â | â | â | â | â | **OSS** | | **OneLogin** | â
(Predefiend roles) | â | â | â | â | â | â | **OSS** | ### How To ConfigureSome authentication providers require additional environment variables. These will be covered in detail on the specific authentication provider pages. The authentication scheme on Keep is controlled with environment variables both on the backend (Keep API) and the frontend (Keep UI). | Identity Provider | Environment Variable | Additional Variables Required | | ----------------- | ----------------------- | --------------------------------------------------------------------------------------- | | **No Auth** | `AUTH_TYPE=NOAUTH` | None | | **DB** | `AUTH_TYPE=DB` | `KEEP_JWT_SECRET` | | **Auth0** | `AUTH_TYPE=AUTH0` | `AUTH0_DOMAIN`, `AUTH0_CLIENT_ID`, `AUTH0_CLIENT_SECRET` | | **Keycloak** | `AUTH_TYPE=KEYCLOAK` | `KEYCLOAK_URL`, `KEYCLOAK_REALM`, `KEYCLOAK_CLIENT_ID`, `KEYCLOAK_CLIENT_SECRET` | | **Oauth2Proxy** | `AUTH_TYPE=OAUTH2PROXY` | `OAUTH2_PROXY_USER_HEADER`, `OAUTH2_PROXY_ROLE_HEADER`, `OAUTH2_PROXY_AUTO_CREATE_USER` | | **AzureAD** | `AUTH_TYPE=AZUREAD` | See [AzureAD Configuration](/deployment/authentication/azuread-auth) | | **Okta** | `AUTH_TYPE=OKTA` | `OKTA_DOMAIN`, `OKTA_CLIENT_ID`, `OKTA_CLIENT_SECRET` | | **OneLogin** | `AUTH_TYPE=ONELOGIN` | See [OneLogin Configuration](/deployment/authentication/onelogin-auth) | For more details on each authentication strategy, including setup instructions and implications, refer to the respective sections. # Configuration Source: https://docs.keephq.dev/deployment/configuration ## Background Keep is highly configurable through environment variables. This allows you to customize various aspects of both the backend and frontend components without modifying the code. Environment variables can be set in your deployment environment, such as in your Kubernetes configuration, Docker Compose file, or directly on your host system. ## Backend Environment Variables ### GeneralGeneral configuration variables control the core behavior of the Keep server. These settings determine fundamental aspects such as the server's host, port, and whether certain components like the scheduler and consumer are enabled. | Env var | Purpose | Required | Default Value | Valid options | | :-------------------------------------: | :---------------------------------------------------: | :------: | :----------------------------: | :--------------------------: | | **KEEP\_HOST** | Specifies the host for the Keep server | No | "0.0.0.0" | Valid hostname or IP address | | **PORT** | Specifies the port on which the backend server runs | No | 8080 | Any valid port number | | **SCHEDULER** | Enables or disables the workflow scheduler | No | "true" | "true" or "false" | | **CONSUMER** | Enables or disables the consumer | No | "true" | "true" or "false" | | **KEEP\_VERSION** | Specifies the Keep version | No | "unknown" | Valid version string | | **KEEP\_API\_URL** | Specifies the Keep API URL | No | Constructed from HOST and PORT | Valid URL | | **KEEP\_STORE\_RAW\_ALERTS** | Enables storing of raw alerts | No | "false" | "true" or "false" | | **TENANT\_CONFIGURATION\_RELOAD\_TIME** | Time in minutes to reload tenant configurations | No | 5 | Positive integer | | **KEEP\_LIVE\_DEMO\_MODE** | Keep will simulate incoming alerts and other activity | No | "false" | "true" or "false" | ### Logging and EnvironmentLogging and environment configuration determines how Keep generates and formats log output. These settings are crucial for debugging, monitoring, and understanding the behavior of your Keep instance in different environments. | Env var | Purpose | Required | Default Value | Valid options | | :--------------------: | :-----------------------------------------------------: | :------: | :---------------: | :---------------------------------------------: | | **LOG\_LEVEL** | Sets the logging level for the application | No | "INFO" | "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL" | | **ENVIRONMENT** | Specifies the environment the application is running in | No | "production" | "development", "staging", "production" | | **LOG\_FORMAT** | Specifies the log format | No | "open\_telemetry" | "open\_telemetry", "dev\_terminal" | | **LOG\_AUTH\_PAYLOAD** | Enables logging of authentication payload | No | "false" | "true" or "false" | ### DatabaseDatabase configuration is crucial for Keep's data persistence. Keep supports various database backends through SQLAlchemy, allowing flexibility in choosing and configuring your preferred database system. | Env var | Purpose | Required | Default Value | Valid options | | :------------------------------: | :-----------------------------------------------: | :------: | :-------------------------------: | :--------------------------------: | | **DATABASE\_CONNECTION\_STRING** | Specifies the database connection URL | Yes | None | Valid SQLAlchemy connection string | | **DATABASE\_POOL\_SIZE** | Sets the database connection pool size | No | 5 | Positive integer | | **DATABASE\_MAX\_OVERFLOW** | Sets the maximum overflow for the connection pool | No | 10 | Positive integer | | **DATABASE\_ECHO** | Enables SQLAlchemy echo mode for debugging | No | False | Boolean (True/False) | | **DB\_CONNECTION\_NAME** | Specifies the Cloud SQL connection name | No | "keephq-sandbox:us-central1:keep" | Valid Cloud SQL connection string | | **DB\_NAME** | Specifies the Cloud SQL database name | No | "keepdb" | Valid Cloud SQL database name | | **DB\_SERVICE\_ACCOUNT** | Service account for database impersonation | No | None | Valid service account email | | **DB\_IP\_TYPE** | Specifies the Cloud SQL IP type | No | "public" | "public", "private" or "psc" | | **SKIP\_DB\_CREATION** | Skips database creation and migrations | No | "false" | "true" or "false" | ### Resource ProvisioningResource provisioning settings control how Keep sets up initial resources. This configuration is particularly important for automating the setup process and ensuring that necessary resources are available when Keep starts. To elaborate on resource provisioning and its configuration, please see [provisioning docs](/deployment/provision/overview). | Env var | Purpose | Required | Default Value | Valid options | | :----------------------: | :---------------------------------------: | :------: | :-----------: | :---------------: | | **PROVISION\_RESOURCES** | Enables or disables resource provisioning | No | "true" | "true" or "false" | ### AuthenticationAuthentication configuration determines how Keep verifies user identities and manages access control. These settings are essential for securing your Keep instance and integrating with various authentication providers. For specific authentication type configuration, please see [authentication docs](/deployment/authentication/overview). | Env var | Purpose | Required | Default Value | Valid options | | :---------------------------------------: | :---------------------------------------------------------------: | :------: | :-----------: | :--------------------------------------------------------------------: | | **AUTH\_TYPE** | Specifies the authentication type | No | "NOAUTH" | "AUTH0", "KEYCLOAK", "DB", "NOAUTH", "OAUTH2PROXY", "OKTA", "ONELOGIN" | | **KEEP\_JWT\_SECRET** | Secret key for JWT token generation and validation (DB auth only) | Yes | None | Any strong secret string | | **KEEP\_DEFAULT\_USERNAME** | Default username for the admin user (DB auth only) | No | "keep" | Any valid username string | | **KEEP\_DEFAULT\_PASSWORD** | Default password for the admin user (DB auth only) | No | "keep" | Any strong password string | | **KEEP\_FORCE\_RESET\_DEFAULT\_PASSWORD** | Forces reset of default user password | No | "false" | "true" or "false" | | **KEEP\_DEFAULT\_API\_KEYS** | Comma-separated list of default API keys to provision | No | "" | Format: "name:role:secret,name:role:secret" | ### Service Mesh (Internal Alert Ingestion)These settings allow trusted services within the same Kubernetes cluster to POST alerts to Keep without requiring a Keep API key. This is intended for service-to-service communication where network-level authentication (e.g. Istio mTLS with AuthorizationPolicy) ensures only authorized callers can reach Keep's alert ingestion endpoints. | Env var | Purpose | Required | Default Value | Valid options | | :-------------------------------------: | :----------------------------------------------------------------: | :------: | :-----------: | :---------------: | | **KEEP\_ALLOW\_MESH\_ALERT\_INGESTION** | Allows unauthenticated POST requests to `/alerts/event*` endpoints | No | "false" | "true" or "false" | When `KEEP_ALLOW_MESH_ALERT_INGESTION` is set to `"true"`, requests to `/alerts/event*` that do not carry an API key or bearer token are accepted and authenticated as an internal service with the `webhook` role. Calling services can optionally set the `X-Service-Name` HTTP header to identify themselves in Keep's logs and audit trail: ```bash theme={null} curl -X POST http://keep-backend:8080/alerts/event \ -H "Content-Type: application/json" \ -H "X-Service-Name: my-service" \ -d '[{"id":"alert-1","name":"Example Alert","severity":"info","status":"firing","source":["my-service"]}]' ``` The authenticated entity will have: * **email**: `service:` (defaults to `service:unknown` if the header is not set) * **role**: `webhook` (grants `write:alert` and `write:incident` scopes) This feature bypasses API key authentication for the alert ingestion endpoints. You **must** pair it with network-level access control (such as Istio AuthorizationPolicy) to restrict which services can reach these endpoints. Without network-level enforcement, any client that can reach Keep's backend can POST alerts. ### Secrets ManagementSecrets Management configuration specifies how Keep handles sensitive information. This is crucial for securely storing and accessing confidential data such as API keys and integrations credentials. | Env var | Purpose | Required | Default Value | Valid options | | :----------------------------: | :-------------------------------------------------------------------: | :------: | :-----------: | :---------------------------------: | | **SECRET\_MANAGER\_TYPE** | Defines the type of secret manager to use | Yes | "FILE" | "FILE", "GCP", "K8S", "VAULT", "DB" | | **SECRET\_MANAGER\_DIRECTORY** | Directory for storing secrets when using file-based secret management | No | "/state" | Any valid directory path | ### OpenTelemetryOpenTelemetry configuration enables comprehensive observability for Keep. These settings allow you to integrate Keep with various monitoring and tracing systems, enhancing your ability to debug and optimize performance. | Env var | Purpose | Required | Default Value | Valid options | | :-----------------------------------------: | :--------------------------------------------: | :------: | :-----------: | :-----------------------: | | **OTEL\_SERVICE\_NAME** | OpenTelemetry service name | No | "keep-api" | Valid service name string | | **SERVICE\_NAME** | Alternative for OTEL\_SERVICE\_NAME | No | "keep-api" | Valid service name string | | **OTEL\_EXPORTER\_OTLP\_ENDPOINT** | OpenTelemetry collector endpoint | No | None | Valid URL | | **OTLP\_ENDPOINT** | Alternative for OTEL\_EXPORTER\_OTLP\_ENDPOINT | No | None | Valid URL | | **OTEL\_EXPORTER\_OTLP\_TRACES\_ENDPOINT** | OpenTelemetry traces endpoint | No | None | Valid URL | | **OTEL\_EXPORTER\_OTLP\_LOGS\_ENDPOINT** | OpenTelemetry logs endpoint | No | None | Valid URL | | **OTEL\_EXPORTER\_OTLP\_METRICS\_ENDPOINT** | OpenTelemetry metrics endpoint | No | None | Valid URL | | **CLOUD\_TRACE\_ENABLED** | Enables Google Cloud Trace exporter | No | "false" | "true" or "false" | | **METRIC\_OTEL\_ENABLED** | Enables OpenTelemetry metrics | No | "" | "true" or "false" | ### WebSocket Server (Pusher/Soketi)WebSocket server configuration controls real-time communication capabilities in Keep. These settings are important for enabling features that require instant updates and notifications. | Env var | Purpose | Required | Default Value | Valid options | | :---------------------: | :-------------------------------: | :-------------------: | :-----------: | :--------------------------: | | **PUSHER\_DISABLED** | Disables Pusher integration | No | "false" | "true" or "false" | | **PUSHER\_HOST** | Hostname of the Pusher server | No | None | Valid hostname or IP address | | **PUSHER\_PORT** | Port of the Pusher server | No | None | Any valid port number | | **PUSHER\_APP\_ID** | Pusher application ID | Yes (if using Pusher) | None | Valid Pusher App ID | | **PUSHER\_APP\_KEY** | Pusher application key | Yes (if using Pusher) | None | Valid Pusher App Key | | **PUSHER\_APP\_SECRET** | Pusher application secret | Yes (if using Pusher) | None | Valid Pusher App Secret | | **PUSHER\_USE\_SSL** | Enables SSL for Pusher connection | No | False | Boolean (True/False) | | **PUSHER\_CLUSTER** | Pusher cluster | No | None | Valid Pusher cluster name | ### OpenAIOpenAI configuration is used for integrating with OpenAI services. These settings are important if you're utilizing OpenAI capabilities within Keep for tasks such as natural language processing or AI-assisted operations. | Env var | Purpose | Required | Default Value | Valid options | Backend/Frontend | | :--------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------: | :------: | :-----------------: | :----------------------------------------------------------------: | :--------------: | | **OPENAI\_API\_KEY** | API key for OpenAI services | No | None | Valid OpenAI API key | Both | | **OPENAI\_MODEL\_NAME** | Model name to use for OpenAI requests | No | "gpt-4o-2024-08-06" | Valid OpenAI model name (e.g., "gpt-4o", "gpt-4o-mini", ...) | Both | | **OPEN\_AI\_ORGANIZATION\_ID** | Organization ID for OpenAI services | No | None | Valid OpenAI organization ID | Both | | **OPENAI\_BASE\_URL** | Base URL for OpenAI API (useful for LiteLLM proxy) | No | None | Valid URL (e.g., "[http://localhost:4000](http://localhost:4000)") | Both | | **KEEP\_AI\_DISABLE\_TEMPERATURE** | Omit the `temperature` parameter from AI requests (some models, e.g. reasoning models, only accept the default and reject explicit values) | No | false | true / false | Backend |For various different LLM based features, we also require to set these environment variables for Keep's frontend too. ### PosthogPosthog configuration controls Keep's integration with the Posthog analytics platform. These settings are useful for tracking usage patterns and gathering insights about how your Keep instance is being used. | Env var | Purpose | Required | Default Value | Valid options | | :-------------------: | :---------------------------: | :------: | :------------------------------------------------: | :-------------------: | | **POSTHOG\_API\_KEY** | API key for PostHog analytics | No | "phc\_muk9qE3TfZsX3SZ9XxX52kCGJBclrjhkP9JxAQcm1PZ" | Valid PostHog API key | | **POSTHOG\_DISABLED** | Disables PostHog integration | No | "false" | "true" or "false" | ### SentrySentry configuration controls Keep's integration with Sentry for error monitoring and reporting. These settings are important for maintaining the stability and reliability of your Keep instance. | Env var | Purpose | Required | Default Value | Valid options | | :------------------: | :-------------------------: | :------: | :-----------: | :---------------: | | **SENTRY\_DISABLED** | Disables Sentry integration | No | "false" | "true" or "false" | ### NgrokNgrok configuration enables secure tunneling to your Keep instance. These settings are particularly useful for development or when you need to expose your local Keep instance to the internet securely. | Env var | Purpose | Required | Default Value | Valid options | | :--------------------: | :----------------------------: | :------: | :-----------: | :--------------------: | | **USE\_NGROK** | Enables ngrok for tunneling | No | "false" | "true" or "false" | | **NGROK\_AUTH\_TOKEN** | Authentication token for ngrok | No | None | Valid ngrok auth token | | **NGROK\_DOMAIN** | Custom domain for ngrok | No | None | Valid domain name | ### ElasticsearchElasticsearch configuration controls Keep's integration with Elasticsearch for advanced search capabilities. These settings are important if you're using Elasticsearch to enhance Keep's search functionality and performance. | Env var | Purpose | Required | Default Value | Valid options | | :------------------------: | :-----------------------------------------: | :--------------------------: | :-----------: | :---------------------------: | | **ELASTIC\_ENABLED** | Enables Elasticsearch integration | No | "false" | "true" or "false" | | **ELASTIC\_API\_KEY** | API key for Elasticsearch | Yes (if using Elasticsearch) | None | Valid Elasticsearch API key | | **ELASTIC\_HOSTS** | Comma-separated list of Elasticsearch hosts | Yes (if using Elasticsearch) | None | Valid Elasticsearch host URLs | | **ELASTIC\_USER** | Username for Elasticsearch basic auth | No | None | Valid username | | **ELASTIC\_PASSWORD** | Password for Elasticsearch basic auth | No | None | Valid password | | **ELASTIC\_INDEX\_SUFFIX** | Suffix for Elasticsearch index names | Yes (for single tenant) | None | Any valid string | ### RedisRedis configuration specifies the connection details for Keep's Redis instance. Redis is used for various caching and queueing purposes, making these settings important for optimizing Keep's performance and scalability. | Env var | Purpose | Required | Default Value | Valid options | | :-----------------: | :-------------------: | :------: | :-----------: | :--------------------------: | | **REDIS** | Redis enabled | No | false | true or false | | **REDIS\_HOST** | Redis server hostname | No | "localhost" | Valid hostname or IP address | | **REDIS\_PORT** | Redis server port | No | 6379 | Valid port number | | **REDIS\_DB** | Redis database slot | No | 0 | Valid DB number | | **REDIS\_USERNAME** | Redis username | No | None | Valid username string | | **REDIS\_PASSWORD** | Redis password | No | None | Valid password string | ### Redis SentinelRedis sentinel configuration specifies the connection details for Keep's Redis sentinel instance. Redis sentinel is used when you have a redis cluster and it acts as a broker. | Env var | Purpose | Required | Default Value | Valid options | | :--------------------------------: | :-------------------------: | :------: | :---------------: | :-----------------------------------------: | | **REDIS** | Redis enabled | No | false | true or false | | **REDIS\_SENTINEL\_HOSTS** | Redis sentinel server(s) | No | "localhost:26379" | "host1:port1,host2:port2" (comma-separated) | | **REDIS\_SENTINEL\_SERVICE\_NAME** | Redis sentinel service name | No | "mymaster" | Valid service name string | | **REDIS\_DB** | Redis database slot | No | 0 | Valid DB number | | **REDIS\_USERNAME** | Redis username | No | None | Valid username string | | **REDIS\_PASSWORD** | Redis password | No | None | Valid password string | ### ARQARQ (Asynchronous Task Queue) configuration controls Keep's background task processing. These settings are crucial for managing how Keep handles long-running or scheduled tasks, ensuring efficient resource utilization and responsiveness. | Env var | Purpose | Required | Default Value | Valid options | | :----------------------------: | :-------------------------------------------------: | :------: | :-----------: | :------------------: | | **ARQ\_BACKGROUND\_FUNCTIONS** | Comma-separated list of background functions to run | No | None | Valid function names | | **ARQ\_KEEP\_RESULT** | Duration to keep job results (in seconds) | No | 3600 | Positive integer | | **ARQ\_EXPIRES** | Default job expiration time (in seconds) | No | 3600 | Positive integer | | **ARQ\_EXPIRES\_AI** | AI job expiration time (in seconds) | No | 3600000 | Positive integer | ### Rate LimitingRate limiting configuration controls how many requests can be made to Keep's API endpoints within a specified time period. This helps prevent abuse and ensures system stability. | Env var | Purpose | Required | Default Value | Valid options | | :--------------------------: | :-----------------------------------: | :------: | :-----------: | :-----------------------------------------------------------------: | | **KEEP\_USE\_LIMITER** | Enables or disables rate limiting | No | "false" | "true" or "false" | | **KEEP\_LIMIT\_CONCURRENCY** | Sets the rate limit for API endpoints | No | "100/minute" | Format: "/" where interval can be "second", "minute", "hour", "day" |Currently, rate limiting is applied to the following endpoints: * POST `/alerts/event` - Generic event ingestion endpoint * POST `/alerts/{provider_type}` - Provider-specific event ingestion endpoints These endpoints are rate-limited according to the `KEEP_LIMIT_CONCURRENCY` setting when `KEEP_USE_LIMITER` is enabled. ### Maintenance WindowsThe strategy enables the ability to manage how the alerts are handled in case of a match with the Maintenance Windows Rules. | Env var | Purpose | Required | Default Value | Valid options | | :-------------------------------: | :-----------------------------------------: | :------: | :-----------: | :--------------------------------------: | | **MAINTENANCE\_WINDOW\_STRATEGY** | Choose the strategy | No | "default" | "default" or "recover\_previous\_status" | | **WATCHER\_LAPSED\_TIME** | Time in seconds to execute the alert review | No | 60 | Valid positive integer | ## Frontend Environment VariablesFrontend configuration variables control the behavior and features of Keep's user interface. These settings are crucial for customizing the frontend's appearance, functionality, and integration with the backend services. ### General | Env var | Purpose | Required | Default Value | Valid options | | ------------------------------------- | ------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------- | -------------------- | | **API\_URL** | Specifies the URL of the Keep backend API | Yes | None | Valid URL | | **AUTH\_SESSION\_TIMEOUT** | Specifies user session timeout in seconds. Default is 30 days. | No | 2592000 | Value in seconds | | **KEEP\_HIDE\_SENSITIVE\_FIELDS** | Hides sensitive fields | No | None | "true", "false" | | **HIDE\_NAVBAR\_CORRELATION** | Hides the correlation page from the navigation bar in the UI | No | None | "true" | | **HIDE\_NAVBAR\_WORKFLOWS** | Hides the workflows page from the navigation bar in the UI | No | None | "true" | | **HIDE\_NAVBAR\_SERVICE\_TOPOLOGY** | Hides the service topology page from the navigation bar in the UI | No | None | "true" | | **HIDE\_NAVBAR\_MAPPING** | Hides the mapping page from the navigation bar in the UI | No | None | "true" | | **HIDE\_NAVBAR\_EXTRACTION** | Hides the extraction page from the navigation bar in the UI | No | None | "true" | | **HIDE\_NAVBAR\_MAINTENANCE\_WINDOW** | Hides the maintenance window page from the navigation bar in the UI | No | None | "true" | | **HIDE\_NAVBAR\_AI\_PLUGINS** | Hides the AI plugins page from the navigation bar in the UI | No | None | "true" | | **KEEP\_WF\_LIST\_EXTENDED\_INFO** | Use a list instead a button to show the complete execution list | No | "true" | "true", "false" | | **ALERT\_SIDEBAR\_FIELDS** | Specifies a list of fields to show in the sidebar. | No | service,source,description,message,fingerprint,url,incidents,timeline,relatedServices | Valid list of fields | ### AuthenticationAuthentication configuration determines how Keep verifies user identities and manages access control. These settings are essential for securing your Keep instance and integrating with various authentication providers. | Env var | Purpose | Required | Default Value | Valid options | | :------------------: | :-------------------------------: | :------: | :-----------: | :--------------------------------------------------------------------: | | **AUTH\_TYPE** | Specifies the authentication type | No | "NOAUTH" | "AUTH0", "KEYCLOAK", "DB", "NOAUTH", "OAUTH2PROXY", "OKTA", "ONELOGIN" | | **NEXTAUTH\_URL** | URL for NextAuth authentication | Yes | None | Valid URL | | **NEXTAUTH\_SECRET** | Secret key for NextAuth | Yes | None | Strong secret string | ### Posthog | Env var | Purpose | Required | Default Value | Valid options | | :---------------: | :------------------------------------: | :------: | :-----------: | :-------------------: | | **POSTHOG\_KEY** | PostHog API key for frontend analytics | No | None | Valid PostHog API key | | **POSTHOG\_HOST** | PostHog Host for frontend analytics | No | None | Valid PostHog Host | ### PusherPusher configuration is essential for enabling real-time updates and communication in Keep's frontend. These settings allow the frontend to establish a WebSocket connection with the Pusher server, facilitating instant updates and notifications. | Env var | Purpose | Required | Default Value | Valid options | | :------------------: | :---------------------------: | :---------------------: | :-----------: | :--------------------------: | | **PUSHER\_DISABLED** | Disables Pusher integration | No | "false" | "true" or "false" | | **PUSHER\_HOST** | Hostname of the Pusher server | No | "localhost" | Valid hostname or IP address | | **PUSHER\_PORT** | Port of the Pusher server | No | 6001 | Valid port number | | **PUSHER\_APP\_KEY** | Pusher application key | Yes (if Pusher enabled) | "keepappkey" | Valid Pusher App Key | | **PUSHER\_CLUSTER** | Pusher cluster | No | None | Valid Pusher cluster name | # Docker Source: https://docs.keephq.dev/deployment/docker ### Spin up Keep with docker-compose latest images The easiest way to start keep is is with docker-compose: ```shell theme={null} curl https://raw.githubusercontent.com/keephq/keep/main/start.sh | sh ``` ```bash start.sh theme={null} #!/bin/bash # Keep install script for docker compose set -e echo "Creating state directory." mkdir -p state test -e state || echo "Unable to create folder" echo "Changing directory ownership to non-privileged user." chown -R 999:999 state || echo "Unable to change directory ownership, changing permissions instead." && chmod -R 0777 state which curl &> /dev/null || echo "curl not installed" curl https://raw.githubusercontent.com/keephq/keep/main/docker-compose.yml --output docker-compose.yml curl https://raw.githubusercontent.com/keephq/keep/main/docker-compose.common.yml --output docker-compose.common.yml docker compose up -d ``` The docker-compose.yml contains 3 services: * [keep-backend](https://console.cloud.google.com/artifacts/docker/keephq/us-central1/keep/keep-api?project=keephq) - a fastapi service that as the API server. * [keep-frontend](https://console.cloud.google.com/artifacts/docker/keephq/us-central1/keep/keep-ui?project=keephq) - a nextjs app that serves as Keep UI interface. * [keep-websocket-server](https://docs.soketi.app/getting-started/installation/docker) - Soketi (a pusher compatible websocket server) for real time alerting. ### Reinstall Keep with the option to refresh from scratch `Caution:` This usage context will refresh from the beginning and Keep's data and settings will be erased. Even other containers on this host are also erased. So please consider when using the steps below. For cases where you need to test many different options or simply want to reinstall Keep from scratch using docker compose without spending a lot of time, that is, without repeating the steps of installing docker, downloading the installer.. .. run the commands according to the previous instructions. Follow these steps #### Step1: Stop, Clear container, network, volume, image. In the directory containing the docker compose file you downloaded, say `/root/` ``` docker-compose down docker-compose down --rmi all docker-compose down -v docker system prune -a --volumes ``` #### Step2: Clear Config db, config file in state folder. ``` rm -rf state/* ``` #### Step 3: Run again ``` docker compose up -d ``` # AWS ECS Source: https://docs.keephq.dev/deployment/ecs ## Step 1: Login to AWS Console * Open your web browser and navigate to the AWS Management Console. * Log in using your AWS account credentials. ## Step 2: Navigate to ECS * Click on the "Services" dropdown menu in the top left corner. * Select "ECS" from the list of services. ## Step 3: Create 3 Task Definitions * In the ECS dashboard, navigate to the "Task Definitions" section in the left sidebar.* Click on "Create new Task Definition".
### Task Definition 1 (Frontend - KeepUI): * Task Definition Family: keep-frontend
* Configure your container definitions as below: * Infrastructure Requirements: * Launch Type: AWS Fargate * OS, Architecture, Network mode: Linux/X86\_64 * Task Size: * CPU: 1 vCPU * Memory: 2 GB * Task Role and Task Execution Role are optional if you plan on using secrets manager for example then create a task execution role to allow access to the secret manager you created.
* Container Details: * Name: keep-frontend * Image URI: us-central1-docker.pkg.dev/keephq/keep/keep-api:latest * Ports Mapping: * Container Port: 3000 * Protocol: TCP
* Environment Variables: (This can be static or you can use parameter store or secrets manager) * DATABASE\_CONNECTION\_STRING * AUTH\_TYPE * KEEP\_JWT\_SECRET * KEEP\_DEFAULT\_USERNAME * KEEP\_DEFAULT\_PASSWORD * SECRET\_MANAGER\_TYPE * SECRET\_MANAGER\_DIRECTORY * USE\_NGROK * KEEP\_API\_URL (The below variable is optional if you don't want to use websocket) * PUSHER\_DISABLED (The below variables are optional if you want to use websocket) * PUSHER\_APP\_ID * PUSHER\_APP\_KEY * PUSHER\_APP\_SECRET * PUSHER\_HOST * PUSHER\_PORT
* Review and create your task definition. ### Task Definition 2 (Backend - keepAPI): * Configure your container definitions as below: * Task Definition Family: keep-frontend
* Infrastructure Requirements: * Launch Type: AWS Fargate * OS, Architecture, Network mode: Linux/X86\_64 * Task Size: * CPU: 1 vCPU * Memory: 2 GB * Task Role and Task Execution Role are optional if you plan on using secrets manager for example then create a task execution role to allow access to the secret manager you created.
* Container Details: * Name: keep-backend * Image URI: us-central1-docker.pkg.dev/keephq/keep/keep-api:latest * Ports Mapping: * Container Port: 8080 * Protocol: TCP
* Environment Variables: (This can be static or you can use parameter store or secrets manager) * DATABASE\_CONNECTION\_STRING * AUTH\_TYPE * KEEP\_JWT\_SECRET * KEEP\_DEFAULT\_USERNAME * KEEP\_DEFAULT\_PASSWORD * SECRET\_MANAGER\_TYPE * SECRET\_MANAGER\_DIRECTORY * USE\_NGROK * KEEP\_API\_URL (The below variable is optional if you don't want to use websocket) * PUSHER\_DISABLED (The below variables are optional if you want to use websocket) * PUSHER\_APP\_ID * PUSHER\_APP\_KEY * PUSHER\_APP\_SECRET * PUSHER\_HOST * PUSHER\_PORT
* Storage: * Volume Name: keep-efs * Configuration Type: Configure at task definition creation * Volume type: EFS * Storage configurations: * File system ID: Select an existing EFS filesystem or create a new one * Root Directory: /
* Container mount points: * Container: select the container you just created * Source volume: keep-efs * Container path: /app * Make sure that Readonly is not selected
* Review and create your task definition. ### Task Definition 3 (Websocket): (This step is optional if you want to have automatic refresh of the alerts feed) * Configure your container definitions as below: * Task Definition Family: keep-frontend
* Infrastructure Requirements: * Launch Type: AWS Fargate * OS, Architecture, Network mode: Linux/X86\_64 * Task Size: * CPU: 0.25 vCPU * Memory: 1 GB * Task Role and Task Execution Role are optional if you plan on using secrets manager for example then create a task execution role to allow access to the secret manager you created.
* Container Details: * Name: keep-websocket * Image URI: quay.io/soketi/soketi:1.4-16-debian * Ports Mapping: * Container Port: 6001 * Protocol: TCP
* Environment Variables: (This can be static or you can use parameter store or secrets manager) * SOKETI\_DEBUG * SOKETI\_DEFAULT\_APP\_ID * SOKETI\_DEFAULT\_APP\_KEY * SOKETI\_DEFAULT\_APP\_SECRET * SOKETI\_USER\_AUTHENTICATION\_TIMEOUT
* Review and create your task definition. ## Step 4: Create Keep Service * In the ECS dashboard, navigate to the "Clusters" section in the left sidebar. * Select the cluster you want to deploy your service to. * Click on the "Create" button next to "Services". * Configure your service settings. * Review and create your service. ## Step 5: Monitor Your Service * Once your service is created, monitor its status in the ECS dashboard. * You can view task status, service events, and other metrics to ensure your service is running correctly. # Architecture Source: https://docs.keephq.dev/deployment/kubernetes/architecture ## High Level Architecture Keep architecture composes of two main components: 1. **Keep API** - A FastAPI-based backend server that handles business logic and API endpoints. 2. **Keep Frontend** - A Next.js-based frontend interface for user interaction. 3. **Websocket Server** - A Soketi server for real-time updates without page refreshes. 4. **Database Server** - A database used to store and manage persistent data. Supported databases include SQLite, PostgreSQL, MySQL, and SQL Server. ## Kubernetes Architecture Keep uses a single unified NGINX ingress controller to route traffic to all components (frontend, backend, and websocket). The ingress handles path-based routing: By default: * `/` routed to **Frontend** (configurable via `global.ingress.frontendPrefix`) * `/v2` routed to **Backend** (configurable via `global.ingress.backendPrefix`) * `/websocket` routed to **WebSocket** (configurable via `global.ingress.websocketPrefix`) ### General Components
Keep uses kubernetes secret manager to store secrets such as integrations credentials. | Kubernetes Resource | Purpose | Required/Optional | Source | | :-----------------: | :----------------------------------------------------------------------------------------------------------------: | :---------------: | :----------------------------------------------------------------------------------------------------------------------------------------: | | ServiceAccount | Provides an identity for processes that run in a Pod. Used mainly for Keep API to access kubernetes secret manager | Required | [serviceaccount.yaml](https://github.com/keephq/helm-charts/blob/main/charts/keep/templates/serviceaccount.yaml) | | Role | Defines permissions for the ServiceAccount to manage secrets | Required | [role-secret-manager.yaml](https://github.com/keephq/helm-charts/blob/main/charts/keep/templates/role-secret-manager.yaml) | | RoleBinding | Associates the Role with the ServiceAccount | Required | [role-binding-secret-manager.yaml](https://github.com/keephq/helm-charts/blob/main/charts/keep/templates/role-binding-secret-manager.yaml) | | Secret Deletion Job | Cleans up Keep-related secrets when the Helm release is deleted | Required | [delete-secret-job.yaml](https://github.com/keephq/helm-charts/blob/main/charts/keep/templates/delete-secret-job.yaml) | ### Ingress Component | Kubernetes Resource | Purpose | Required/Optional | Source | | :------------------: | :---------------------------------------------: | :---------------: | :------------------------------------------------------------------------------------------------------------: | | Shared NGINX Ingress | Routes all external traffic via one entry point | Optional | [nginx-ingress.yaml](https://github.com/keephq/helm-charts/blob/main/charts/keep/templates/nginx-ingress.yaml) | ### Frontend Components | Kubernetes Resource | Purpose | Required/Optional | Source | | :------------------------------: | :-----------------------------------------------------------: | :---------------: | :------------------------------------------------------------------------------------------------------------------: | | Frontend Deployment | Manages the frontend application containers | Required | [frontend.yaml](https://github.com/keephq/helm-charts/blob/main/charts/keep/templates/frontend.yaml) | | Frontend Service | Exposes the frontend deployment within the cluster | Required | [frontend-service.yaml](https://github.com/keephq/helm-charts/blob/main/charts/keep/templates/frontend-service.yaml) | | Frontend Route (OpenShift) | Exposes the frontend service to external traffic on OpenShift | Optional | [frontend-route.yaml](https://github.com/keephq/helm-charts/blob/main/charts/keep/templates/frontend-route.yaml) | | Frontend HorizontalPodAutoscaler | Automatically scales the number of frontend pods | Optional | [frontend-hpa.yaml](https://github.com/keephq/helm-charts/blob/main/charts/keep/templates/frontend-hpa.yaml) | #### Backend Components | Kubernetes Resource | Purpose | Required/Optional | Source | | :-----------------------------: | :----------------------------------------------------------: | :---------------------------: | :----------------------------------------------------------------------------------------------------------------: | | Backend Deployment | Manages the backend application containers | Required (if backend enabled) | [backend.yaml](https://github.com/keephq/helm-charts/blob/main/charts/keep/templates/backend.yaml) | | Backend Service | Exposes the backend deployment within the cluster | Required (if backend enabled) | [backend-service.yaml](https://github.com/keephq/helm-charts/blob/main/charts/keep/templates/backend-service.yaml) | | Backend Route (OpenShift) | Exposes the backend service to external traffic on OpenShift | Optional | [backend-route.yaml](https://github.com/keephq/helm-charts/blob/main/charts/keep/templates/backend-route.yaml) | | Backend HorizontalPodAutoscaler | Automatically scales the number of backend pods | Optional | [backend-hpa.yaml](https://github.com/keephq/helm-charts/blob/main/charts/keep/templates/backend-hpa.yaml) | #### Database ComponentsDatabase components are optional. You can spin up Keep with your own database. | Kubernetes Resource | Purpose | Required/Optional | Source | | :----------------------------: | :------------------------------------------------------: | :------------------------------: | :------------------------------------------------------------------------------------------------------: | | Database Deployment | Manages the database containers (e.g. MySQL or Postgres) | Optional | [db.yaml](https://github.com/keephq/helm-charts/blob/main/charts/keep/templates/db.yaml) | | Database Service | Exposes the database deployment within the cluster | Required (if deployment enabled) | [db-service.yaml](https://github.com/keephq/helm-charts/blob/main/charts/keep/templates/db-service.yaml) | | Database PersistentVolume | Provides persistent storage for the database | Optional | [db-pv.yaml](https://github.com/keephq/helm-charts/blob/main/charts/keep/templates/db-pv.yaml) | | Database PersistentVolumeClaim | Claims the persistent storage for the database | Optional | [db-pvc.yaml](https://github.com/keephq/helm-charts/blob/main/charts/keep/templates/db-pvc.yaml) | #### WebSocket ComponentsWebSocket components are optional. You can spin up Keep with your own *Pusher compatible* WebSocket server. | Kubernetes Resource | Purpose | Required/Optional | Source | | :-------------------------------: | :------------------------------------------------------------: | :-----------------------------: | :----------------------------------------------------------------------------------------------------------------------------------: | | WebSocket Deployment | Manages the WebSocket server containers (Soketi) | Optional | [websocket-server.yaml](https://github.com/keephq/helm-charts/blob/main/charts/keep/templates/websocket-server.yaml) | | WebSocket Service | Exposes the WebSocket deployment within the cluster | Required (if WebSocket enabled) | [websocket-server-service.yaml](https://github.com/keephq/helm-charts/blob/main/charts/keep/templates/websocket-server-service.yaml) | | WebSocket Route (OpenShift) | Exposes the WebSocket service to external traffic on OpenShift | Optional | [websocket-server-route.yaml](https://github.com/keephq/helm-charts/blob/main/charts/keep/templates/websocket-server-route.yaml) | | WebSocket HorizontalPodAutoscaler | Automatically scales the number of WebSocket server pods | Optional | [websocket-server-hpa.yaml](https://github.com/keephq/helm-charts/blob/main/charts/keep/templates/websocket-server-hpa.yaml) | These tables provide a comprehensive overview of the Kubernetes resources used in the Keep architecture, organized by component type. Each table describes the purpose of each resource, indicates whether it's required or optional, and provides a direct link to the source template in the Keep Helm charts GitHub repository. ### Kubernetes ConfigurationThis sections covers only kubernetes-specific configuration. To learn about Keep-specific configuration, controlled by environment variables, see [Keep Configuration](/deployment/configuration) Each of these components can be customized via the `values.yaml` file in the Helm chart. Below are key configurations that can be adjusted for each component. #### 1. Frontend Configuration ```yaml theme={null} frontend: enabled: true # Enable or disable the frontend deployment. replicaCount: 1 # Number of frontend replicas. image: repository: us-central1-docker.pkg.dev/keephq/keep/keep-ui pullPolicy: Always # Image pull policy (Always, IfNotPresent). tag: latest serviceAccount: create: true # Create a new service account. name: "" # Service account name (empty for default). podAnnotations: {} # Annotations for frontend pods. podSecurityContext: {} # Security context for the frontend pods. securityContext: {} # Security context for the containers. service: type: ClusterIP # Service type (ClusterIP, NodePort, LoadBalancer). port: 3000 # Port on which the frontend service is exposed. ``` #### 2. Backend Configuration ```yaml theme={null} backend: enabled: true # Enable or disable the backend deployment. replicaCount: 1 # Number of backend replicas. image: repository: us-central1-docker.pkg.dev/keephq/keep/keep-api pullPolicy: Always # Image pull policy (Always, IfNotPresent). serviceAccount: create: true # Create a new service account. name: "" # Service account name (empty for default). podAnnotations: {} # Annotations for backend pods. podSecurityContext: {} # Security context for backend pods. securityContext: {} # Security context for containers. service: type: ClusterIP # Service type (ClusterIP, NodePort, LoadBalancer). port: 8080 # Port on which the backend API is exposed. ``` #### 3. WebSocket Server Configuration Keep uses Soketi as its websocket server. To learn how to configure it, please see [Soketi docs](https://github.com/soketi/charts/tree/master/charts/soketi). #### 4. Database Configuration Keep supports plenty of database (e.g. postgresql, mysql, sqlite, etc). It is out of scope to describe here how to deploy all of them to k8s. If you have specific questions - [contact us](https://slack.keephq.dev) and we will be happy to help. # Installation Source: https://docs.keephq.dev/deployment/kubernetes/installationThe recommended way to install Keep on Kubernetes is via Helm Chart. # Prerequisites ## Helm CLI See the [Helm documentation](https://helm.sh/docs/intro/install/) for instructions about installing helm. ## Ingress Controller (Optional)
Follow these steps to set it up.You can skip this step if: 1. You already have **ingress-nginx** installed. 2. You don't need to expose Keep to the internet/network. ### Overview An ingress controller is essential for managing external access to services in your Kubernetes cluster. It acts as a smart router and load balancer, allowing you to expose multiple services through a single entry point while handling SSL termination and routing rules. **Keep works best with both** [ingress-nginx](https://github.com/kubernetes/ingress-nginx) **and** [HAProxy Ingress](https://haproxy-ingress.github.io/) **controllers, but you can customize the helm chart for other ingress controllers too.** ### Nginx Ingress Controller #### Check ingress-nginx Installed You check if you already have ingress-nginx installed: ```bash theme={null} # By default, the ingress-nginx will be installed under the ingress-nginx namespace kubectl -n ingress-nginx get pods NAME READY STATUS RESTARTS AGE ingress-nginx-controller-d49697d5f-hjhbj 1/1 Running 0 4h19m # Or check for the ingress class kubectl get ingressclass NAME CONTROLLER PARAMETERS AGE nginx k8s.io/ingress-nginx4h19m ``` #### Install ingress-nginx To read about more installation options, see [ingress-nginx installation docs](https://kubernetes.github.io/ingress-nginx/deploy/). Since ingress-nginx 4.12, you'll need to add ``` --set controller.config.annotations-risk-level=Critical ``` See [https://github.com/kubernetes/ingress-nginx/issues/12618#issuecomment-2566084202](https://github.com/kubernetes/ingress-nginx/issues/12618#issuecomment-2566084202) ```bash theme={null} # simplest way to install # we set snippet-annotations to true to allow rewrites # see https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#allow-snippet-annotations helm upgrade --install ingress-nginx ingress-nginx \ --repo https://kubernetes.github.io/ingress-nginx \ --set controller.config.allow-snippet-annotations=true \ --set controller.config.annotations-risk-level=Critical \ --namespace ingress-nginx --create-namespace ``` Verify installation: ```bash theme={null} kubectl get ingressclass NAME CONTROLLER PARAMETERS AGE nginx k8s.io/ingress-nginx4h19m ``` Verify if snippet annotations are enabled: ```bash theme={null} kubectl get configmap -n ingress-nginx ingress-nginx-controller -o yaml | grep allow-snippet-annotations allow-snippet-annotations: "true" ``` ### HAProxy Ingress Controller #### Install ingress-haproxy To read about more installation options, see [haproxy-ingress installation docs](https://haproxy-ingress.github.io/docs/getting-started/). ```bash theme={null} # simplest way to install helm upgrade --install haproxy-ingress haproxy-ingress \ --repo https://haproxy-ingress.github.io/charts \ --namespace ingress-haproxy --create-namespace ``` Verify installation: ```bash theme={null} kubectl get ingressclass NAME CONTROLLER PARAMETERS AGE haproxy haproxy-ingress.github.io/controller4h19m ``` Verify if controller is running: ```bash theme={null} kubectl get pods -n ingress-haproxy -l app.kubernetes.io/instance=haproxy-ingress NAME READY STATUS RESTARTS AGE haproxy-ingress-controller-x4n2z 1/1 Running 0 4h19m ``` ## Installation ### With Ingress-NGINX (Recommended) ```bash theme={null} # Add the Helm repository helm repo add keephq https://keephq.github.io/helm-charts # Install Keep with ingress enabled helm install keep keephq/keep -n keep --create-namespace ``` ### With Ingress-HAProxy (Recommended) ```bash theme={null} # Add the Helm repository helm repo add keephq https://keephq.github.io/helm-charts # Install Keep with ingress enabled helm install keep keephq/keep -n keep --create-namespace --set global.ingress.className=haproxy ``` ### Without Ingress (Not Recommended) ```bash theme={null} # Add the Helm repository helm repo add keephq https://keephq.github.io/helm-charts # Install Keep without ingress enabled. # You won't be able to access Keep from the network. helm install keep keephq/keep -n keep --create-namespace \ --set global.ingress.enabled=false ``` ## Accessing Keep ### Ingress If you installed Keep with ingress, you should be able to access Keep. ```bash theme={null} kubectl -n keep get ingress NAME CLASS HOSTS ADDRESS PORTS AGE keep-ingress nginx * X.X.X.X 80 4h16m ``` Keep is available at [http://X.X.X.X](http://X.X.X.X) :) ### Without Ingress (Port-Forwarding) Use the following commands to access Keep locally without ingress: ```bash theme={null} # Forward the UI kubectl port-forward svc/keep-frontend 3000:3000 -n keep & # Forward the Backend kubectl port-forward svc/keep-backend 8080:8080 -n keep & # Forward WebSocket server (optional) kubectl port-forward svc/keep-websocket 6001:6001 -n keep & ``` Keep is available at [http://localhost:3000](http://localhost:3000) :) ## Configuring HTTPS ### Prerequisites 1. Domain Name: Example - keep.yourcompany.com 2. TLS Certificate: Private key (tls.key) and certificate (tls.crt) ### Create the TLS Secret Assuming: * `tls.crt` contains the certificate. * `tls.key` contains the private key. ```bash theme={null} # create the secret with kubectl kubectl create secret tls keep-tls --cert=./tls.crt --key=./tls.key -n keep ``` ### Update Helm Values for TLS ```bash theme={null} helm upgrade -n keep keep keephq/keep \ --set "global.ingress.hosts[0].host=keep.example.com" \ --set "global.ingress.tls[0].hosts[0]=keep.example.com" \ --set "global.ingress.tls[0].secretName=keep-tls" ``` Alternatively, update your `values.yaml`: ```bash theme={null} ... global: ingress: hosts: - host: keep.example.com tls: - hosts: - keep.example.com secretName: keep-tls ... ``` ## Uninstallation To remove Keep and clean up: ```bash theme={null} helm uninstall keep -n keep kubectl delete namespace keep ``` # Openshift Source: https://docs.keephq.dev/deployment/kubernetes/openshift Keep's Helm Chart also supports Openshift installation. Simply follow the Kubernetes set-up guide, but make sure to modify the following lines under frontend(/backend).route in the values.yaml file as follows: ``` enabled: true host: path: # should be / for default tls: wildcardPolicy: ``` # Overview Source: https://docs.keephq.dev/deployment/kubernetes/overview If you need help deploying Keep on Kubernetes or have any feedback or suggestions, feel free to open a ticket in our [GitHub repo](https://github.com/keephq/keep) or say hello in our [Slack](https://slack.keephq.dev). Keep is designed as a Kubernetes-native application. We maintain an opinionated, batteries-included Helm chart, but you can customize it as needed. ## Next steps * Install Keep on [Kubernetes](/deployment/kubernetes/installation). * Keep's [Helm Chart](https://github.com/keephq/helm-charts). * Keep with [Kubernetes Secret Manager](/deployment/secret-store#kubernetes-secret-manager) * Deep dive to Keep's kubernetes [Architecture](/deployment/kubernetes/architecture). * Install Keep on [OpenShift](/deployment/kubernetes/openshift). # Running Keep with LiteLLM Source: https://docs.keephq.dev/deployment/local-llm/keep-with-litellmThis guide is for users who want to run Keep with locally hosted LLM models. If you encounter any issues, please talk to us at our (Slack community)\[[https://slack.keephq.dev](https://slack.keephq.dev)]. ## Overview This guide will help you set up Keep with LiteLLM, a versatile tool that supports over 100 LLM providers. LiteLLM acts as a proxy that adheres to OpenAI standards, allowing seamless integration with Keep. By following this guide, you can easily configure Keep to work with various LLM providers using LiteLLM. ### Motivation Incorporating LiteLLM with Keep allows organizations to run local models in on-premises and air-gapped environments. This setup is particularly beneficial for leveraging AIOps capabilities while ensuring that sensitive data does not leave the premises. By using LiteLLM as a proxy, you can seamlessly integrate with Keep and access a wide range of LLM providers without compromising data security. This approach is ideal for organizations that prioritize data privacy and need to comply with strict regulatory requirements. ## Prerequisites ### Running LiteLLM locally 1. Ensure you have Python and pip installed on your system. 2. Install LiteLLM by running the following command: ```bash theme={null} pip install litellm ``` 3. Start LiteLLM with your desired model. For example, to use the HuggingFace model: ```bash theme={null} litellm --model huggingface/bigcode/starcoder ``` This will start the proxy server on `http://0.0.0.0:4000`. ### Running LiteLLM with Docker To run LiteLLM using Docker, you can use the following command: ```bash theme={null} docker run -p 4000:4000 litellm/litellm --model huggingface/bigcode/starcoder ``` This command will start the LiteLLM proxy in a Docker container, exposing it on port 4000. ## Configuration | Env var | Purpose | Required | Default Value | Valid options | | :----------------------------: | :-----------------------------------------: | :------: | :-----------: | :----------------------------------------------------------------: | | **OPEN\_AI\_ORGANIZATION\_ID** | Organization ID for OpenAI/LiteLLM services | Yes | None | Valid organization ID string | | **OPEN\_AI\_API\_KEY** | API key for OpenAI/LiteLLM services | Yes | None | Valid API key string | | **OPENAI\_BASE\_URL** | Base URL for the LiteLLM proxy | Yes | None | Valid URL (e.g., "[http://localhost:4000](http://localhost:4000)") |These environment variables should be set on both Keep **frontend** and **backend**. ## Additional Resources * [LiteLLM Documentation](https://docs.litellm.ai/) By following these steps, you can leverage the power of multiple LLM providers with Keep, using LiteLLM as a flexible and powerful proxy. # Monitoring Source: https://docs.keephq.dev/deployment/monitoring # Healthchecks Keep's Backend healthcheck url: ``` {BACKEND_API_URL}/healthcheck ``` Keep's Frontend healthcheck url: ``` {FRONTEND_URL}/api/healthcheck ``` # Prometheus Metrics (TBD) > Please note that /api/metrics are not designed for production instance's health monitoring, but for usage monitoring by a specific tenant. # Dashboard Provisioning Source: https://docs.keephq.dev/deployment/provision/dashboard Provisioning dashboards in Keep allows you to configure and manage visual representations of your data. This section will guide you through the steps required to set up and provision dashboards. ### Dashboard Provisioning Overview Dashboards in Keep are configured using JSON strings that define the layout, data sources, and visual components. These configurations can be managed through environment variables or configuration files. ### Environment Variables To provision dashboards, you need to set the following environment variable: | Environment Variable | Purpose | | -------------------- | ----------------------------------------------- | | `KEEP_DASHBOARDS` | JSON string containing dashboard configurations | ### Example Configuration Here is an example of how to set the `KEEP_DASHBOARDS` environment variable (dumped from the database): ```json theme={null} [ { "dashboard_name": "My Dashboard", "dashboard_config": { "layout": [ { "i": "w-1728223503577", "x": 0, "y": 0, "w": 3, "h": 3, "minW": 2, "minH": 2, "static": false } ], "widget_data": [ { "i": "w-1728223503577", "x": 0, "y": 0, "w": 3, "h": 3, "minW": 2, "minH": 2, "static": false, "thresholds": [ { "value": 0, "color": "#22c55e" }, { "value": 20, "color": "#ef4444" } ], "preset": { "id": "11111111-1111-1111-1111-111111111111", "name": "feed", "options": [ { "label": "CEL", "value": "(!deleted && !dismissed)" }, { "label": "SQL", "value": { "sql": "(deleted=false AND dismissed=false)", "params": {} } } ], "created_by": null, "is_private": false, "is_noisy": false, "should_do_noise_now": false, "alerts_count": 98, "static": true, "tags": [] }, "name": "Test" } ] } } ] ``` Please read more at [https://github.com/react-grid-layout/react-grid-layout](https://github.com/react-grid-layout/react-grid-layout) for more information on the layout configuration options. # Mapping Rule Provisioning Source: https://docs.keephq.dev/deployment/provision/mappingFor any questions or issues related to mapping rule provisioning, please join our [Slack](https://slack.keephq.dev) community. Mapping rule provisioning in Keep allows you to manage CSV-style alert enrichment rules in version control rather than the UI. This is useful when you want to track mapping changes alongside the rest of your infrastructure-as-code. ### Configuring Mapping Rules To provision mapping rules, follow these steps: 1. Set the `KEEP_MAPPINGS_DIRECTORY` environment variable to the path of your mapping configuration directory. 2. Create one YAML manifest per mapping rule in that directory. Example directory structure: ``` /path/to/mappings/ âââ prometheus-by-namespace.yaml âââ cloudwatch-by-team.yaml âââ service-topology.yaml ``` ### Manifest format Each YAML manifest describes one mapping rule. Fields mirror the fields accepted by the REST `POST /mapping` endpoint: ```yaml theme={null} name: example-prometheus-mapping description: optional description priority: 0 type: csv matchers: - [namespace] rows: - { namespace: monitoring, team: platform } - { namespace: default, team: platform } ``` | Field | Required | Notes | | ------------------- | ------------- | -------------------------------------------------------------------------- | | `name` | yes | Lookup key â must be unique across the tenant | | `description` | no | Human-readable description | | `priority` | no | Integer, default `0`. Higher = evaluated first | | `type` | no | `csv` (default) or `topology` | | `matchers` | yes | List of attribute groups. Within a list: AND. Between lists: OR | | `rows` | yes for `csv` | List of `{key: value}` dicts; rows match against incoming alert attributes | | `is_multi_level` | no | Default `false` | | `new_property_name` | no | Required if `is_multi_level` is `true` | | `prefix_to_remove` | no | Optional, used with multi-level mappings | ### Update Provisioned Mapping Rules On every restart, Keep reads the `KEEP_MAPPINGS_DIRECTORY` environment variable and determines which mapping rules need to be added, removed, or updated. The high-level provisioning mechanism: 1. Keep reads the `KEEP_MAPPINGS_DIRECTORY` value. 2. Keep lists all `.yaml`/`.yml` files under the directory (other files are skipped). 3. For each manifest: lookup an existing rule by `name`. If found, update it and mark `is_provisioned=True`. If not, create a new provisioned rule. 4. Provisioned rules whose source file is no longer present in the directory are deprovisioned (deleted). 5. UI-created rules (`is_provisioned=False`) whose name does not appear in any manifest are untouched. ### Adoption of existing UI rules If a mapping rule already exists in the UI with the same `name` as one of your manifests, the next provisioning run **adopts** it: `is_provisioned` flips to `True`, the rule's `provisioned_file` is recorded, and its content is overwritten from the manifest. The database id is preserved, so any external references to that rule (URLs, dashboards) continue to work. Fields not present in the manifest schema (`disabled`, `override`, `condition`) are reset to their model defaults on adoption â the manifest is the source of truth, so a rule that was disabled via the UI will be re-enabled when adopted. ### Removing all provisioned mapping rules If `KEEP_MAPPINGS_DIRECTORY` is unset on a Keep instance that previously had provisioned rules, all of them are deprovisioned (deleted) on the next restart. UI-only rules are unaffected. ### Per-manifest failures A malformed manifest (invalid YAML, missing required fields, validation errors) is logged and skipped. Other manifests in the directory still process normally. Each successful manifest is committed in its own transaction, so a later failure does not roll back earlier work. # Overview Source: https://docs.keephq.dev/deployment/provision/overview Keep supports various deployment and provisioning strategies to accommodate different environments and use cases, from development setups to production deployments. ### Provisioning Options Keep offers four main provisioning options: 1. [**Provider Provisioning**](/deployment/provision/provider) - Set up and manage data providers with their deduplication rules for Keep. 2. [**Workflow Provisioning**](/deployment/provision/workflow) - Configure and manage workflows within Keep. 3. [**Dashboard Provisioning**](/deployment/provision/dashboard) - Configure and manage dashboards within Keep. 4. [**Mapping Rule Provisioning**](/deployment/provision/mapping) - Configure and manage CSV-style alert enrichment rules within Keep. Choosing the right provisioning strategy depends on your specific use case, deployment environment, and scalability requirements. You can read more about each provisioning option in their respective sections. ### How To Configure ProvisioningSome provisioning options require additional environment variables. These will be covered in detail on the specific provisioning pages. Provisioning in Keep is controlled through environment variables and configuration files. The main environment variables for provisioning are: | Provisioning Type | Environment Variable | Purpose | | ----------------- | -------------------------- | ----------------------------------------------------------------------- | | **Provider** | `KEEP_PROVIDERS` | JSON string containing provider configurations with deduplication rules | | **Workflow** | `KEEP_WORKFLOW` | One workflow to provision right from the env variable. | | **Workflows** | `KEEP_WORKFLOWS_DIRECTORY` | Directory path containing workflow configuration files | | **Dashboard** | `KEEP_DASHBOARDS` | JSON string containing dashboard configurations | | **Mapping Rules** | `KEEP_MAPPINGS_DIRECTORY` | Directory path containing mapping rule YAML manifests | Hint: use the script to get 1-liner from the workflow file for KEEP\_WORKFLOW: ``` Use `cat workflow_file.yaml | awk '{printf "%s\\n", $0}' | tr -d '\n'; echo` to get the workflow in 1-string format. ``` For more details on each provisioning strategy, including setup instructions and implications, refer to the respective sections. # Providers Provisioning Source: https://docs.keephq.dev/deployment/provision/providerFor any questions or issues related to provider provisioning, please join our [Slack](https://slack.keephq.dev) community. 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.Keep does not allow to use both `KEEP_PROVIDERS` and `KEEP_PROVIDERS_DIRECTORY` environment variables at the same time. Keep can automatically install webhooks for providers that support them. This behavior depends on the configuration and the provisioning method used. Please note: Deduplication rules are not mandatory for provider distribution. ### 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. # Workflow Provisioning Source: https://docs.keephq.dev/deployment/provision/workflowFor any questions or issues related to workflow provisioning, please join our [Slack](https://slack.keephq.dev) community. Workflow provisioning in Keep allows you to set up and manage workflows dynamically. This feature enables you to configure various automated processes and tasks within your Keep deployment. ### Configuring Workflows To provision workflows, follow these steps: 1. Set the `KEEP_WORKFLOWS_DIRECTORY` environment variable to the path of your workflow configuration directory. 2. Create workflow configuration files in the specified directory. Example directory structure: ``` /path/to/workflows/ âââ workflow1.yaml âââ workflow2.yaml âââ workflow3.yaml ``` ### Update Provisioned Workflows On every restart, Keep reads the `KEEP_WORKFLOWS_DIRECTORY` environment variable and determines which workflows need to be added, removed, or updated. This process allows for flexible management of workflows without requiring manual intervention. By simply updating the workflow files in the `KEEP_WORKFLOWS_DIRECTORY` and restarting the application, you can efficiently add new workflows, remove existing ones, or modify their configurations. The high-level provisioning mechanism: 1. Keep reads the `KEEP_WORKFLOWS_DIRECTORY` value. 2. Keep lists all workflow files under the `KEEP_WORKFLOWS_DIRECTORY` directory. 3. Keep compares the current workflow files with the previously provisioned workflows: * New workflow files are provisioned. * Missing workflow files are deprovisioned. * Updated workflow files are re-provisioned with the new configuration. 4. Keep updates its internal state to reflect the current set of provisioned workflows. # Secret Store Source: https://docs.keephq.dev/deployment/secret-store ## OverviewSecret Manager selection is crucial for securing your application. Different modes can be set up depending on the deployment type. Our system supports four primary secret manager types. ## Secret Manager Factory The `SecretManagerFactory` is a utility class used to create instances of different types of secret managers. It leverages the Factory design pattern to abstract the creation logic based on the type of secret manager required. The factory supports creating instances of File, GCP, Kubernetes, and Vault Secret Managers. The `SECRET_MANAGER_TYPE` environment variable plays a crucial role in the SecretManagerFactory for determining the default type of secret manager to be instantiated when no specific type is provided in the method call. **Functionality**: **Default Secret Manager**: If the `SECRET_MANAGER_TYPE` environment variable is set, its value dictates the default type of secret manager that the factory will create. The value of this variable should correspond to one of the types defined in SecretManagerTypes enum (`FILE`, `AWS`, `GCP`, `K8S`, `VAULT`, `DB`). **Example Configuration**: Setting `SECRET_MANAGER_TYPE=GCP` in the environment will make the factory create instances of GcpSecretManager by default. If `SECRET_MANAGER_TYPE` is not set or is set to `FILE`, the factory defaults to creating instances of FileSecretManager. This environment variable provides flexibility and ease of configuration, allowing different secret managers to be used in different environments or scenarios without code changes. ## File Secret Manager The `FileSecretManager` is a concrete implementation of the BaseSecretManager for managing secrets stored in the file system. It uses a specified directory (defaulting to ./) to read, write, and delete secret files. Configuration: Set the environment variable `SECRET_MANAGER_DIRECTORY` to specify the directory where secrets are stored. If not set, defaults to the current directory (./). Usage: * Secrets are stored as files in the specified directory. * Reading a secret involves fetching content from a file. * Writing a secret creates or updates a file with the given content. * Deleting a secret removes the corresponding file. ## AWS Secret Manager The `AwsSecretManager` integrates with Amazon Web Services' Secrets Manager service for secure secret management. It provides a robust solution for storing and managing secrets in AWS environments. Configuration: Required environment variables: * `AWS_REGION`: The AWS region where your secrets are stored * For local development: * `AWS_ACCESS_KEY_ID`: Your AWS access key * `AWS_SECRET_ACCESS_KEY`: Your AWS secret access key Optional: * `AWS_KMS_KEY_ID`: The KMS key ID to use for encrypting secrets * `AWS_SECRET_MANAGER_TAGS`: Comma-separated list of tags to add to the secret in AWS Secrets Manager, e.g. `key=value,key2=value2` * `AWS_SECRET_ROTATION_ENABLED`: Set to `true` to enable automatic rotation of secrets (default: `false`) * `AWS_SECRET_ROTATION_DAYS`: Number of days between automatic rotations (default: `30`) * `AWS_SECRET_ROTATION_LAMBDA_ARN`: ARN of the Lambda function to use for secret rotation, required if rotation is enabled Usage: * Manages secrets using AWS Secrets Manager service * Supports creating, updating, reading, and deleting secrets * Can automatically configure secret rotation policies when creating new secrets ### AWS Secret Rotation Secret rotation is a security best practice that automatically updates secrets at regular intervals. When enabled, Keep will configure newly created secrets with a rotation schedule. To use secret rotation: 1. Create a Lambda function for rotating your secrets (AWS provides blueprints for common rotation scenarios) 2. Set `AWS_SECRET_ROTATION_ENABLED=true` in your environment 3. Set `AWS_SECRET_ROTATION_LAMBDA_ARN` to the ARN of your rotation Lambda function 4. Optionally set `AWS_SECRET_ROTATION_DAYS` to customize the rotation interval Example Lambda ARN format: `arn:aws:lambda:region:account-id:function:function-name` Note: Different secret types (database credentials, API keys, etc.) require different rotation logic. Make sure your Lambda function is appropriate for the type of secrets you're storing. ## Kubernetes Secret Manager ### Overview The `KubernetesSecretManager` interfaces with Kubernetes' native secrets system. It manages secrets within a specified Kubernetes namespace and is designed to operate within a Kubernetes cluster. ### Configuration * `SECRET_MANAGER_TYPE=k8s` * `K8S_NAMESPACE=keep` - environment variable to specify the Kubernetes namespace. Defaults to `.metadata.namespace` if not set. Assumes Kubernetes configurations (like service account tokens) are properly set up when running within a cluster. * `K8S_VERIFY_SSL_CERT=true` - environment variable to specify whether to verify the SSL certificate of the Kubernetes API. Defaults to `true`. Usage: * Secrets are stored as Kubernetes Secret objects. * Provides functionalities to create, retrieve, and delete Kubernetes secrets. * Handles base64 encoding and decoding as required by Kubernetes. ### Environment Variables From Secrets The Kubernetes Secret Manager integration allows Keep to fetch environment variables from Kubernetes Secrets. For sensitive environment variables, such as `DATABASE_CONNECTION_STRING`, it is recommended to store as a secret: #### Creating Database Connection Secret ```bash theme={null} # Create the base64 encoded string without newline CONNECTION_STRING_B64=$(echo -n "mysql+pymysql://user:password@host:3306/dbname" | base64) # Create the Kubernetes secret kubectl create secret generic keep-db-secret \ --namespace=keep \ --from-literal=connection_string=$(echo -n "mysql+pymysql://user:password@host:3306/dbname" | base64) # Or using a YAML file: cat <If you are using Keep and have performance issues, we will be more than happy to help you. Just join our [slack](https://slack.keepqh.dev) and shoot a message on the **#help** channel. ## Overview Spec and stress testing are crucial to ensuring the robust performance and scalability of Keep. This documentation outlines the key areas of focus for testing Keep under different load conditions, considering both the simplicity of setup for smaller environments and the scalability mechanisms for larger deployments. Keep was initially designed to be user-friendly for setups handling less than 10,000 alerts. However, as alert volumes increase, users can leverage advanced features such as Elasticsearch for document storage and Redis + ARQ for queue-based alert ingestion. While these advanced configurations are not fully documented here, they are supported and can be discussed further in our Slack community. ## How To Reproduce To reproduce the stress testing scenarios mentioned above, please refer to the [STRESS.md](https://github.com/keephq/keep/blob/main/STRESS.md) file in Keep's repository. This document provides step-by-step instructions on how to set up, run, and measure the performance of Keep under different load conditions. ## Performance Testing ### Factors Affecting Specifications The primary parameters that affect the specification requirements for Keep are: 1. **Alerts Volume**: The rate at which alerts are ingested into the system. 2. **Total Alerts**: The cumulative number of alerts stored in the system. 3. **Number of Workflows**: How many automation run as a result of alert. ### Main Components: * **Keep Backend** - API and business logic. A container that serves FastAPI on top of gunicorn. * **Keep Frontend** - Web app. A container that serves the react app. * **Database** - Stores the alerts and any other operational data. * **Elasticsearch** (opt out by default) - Stores alerts as document for better search performance. * **Redis** (opt out by default) - Used, together with ARQ, as an alerts queue. ### Testing Scenarios: * **Low Volume (\< 10,000 total alerts, hundreds of alerts per day)**: * **Setup**: Use a standard relational database (e.g., MySQL, PostgreSQL) with default configurations. * **Expectations**: Keep should handle queries and alert ingestion with minimal resource usage. * **Medium Volume (10,000 - 100,000 total alerts, thousands of alerts per day)**: * **Setup**: Scale the database to larger instances or clusters. Adjust best practices to the DB (e.g. increasing innodb\_buffer\_pool\_size) * **Expectations**: CPU and RAM usage should increase proportionally but remain within acceptable limits. 3. **High Volume (100,000 - 1,000,000 total alerts, >five thousands of alerts per day)**: * **Setup**: Deploy Keep with Elasticsearch for storing alerts as documents. * **Expectations**: The system should maintain performance levels despite the large alert volume, with increased resource usage managed through scaling strategies. 4. **Very High Volume (> 1,000,000 total alerts, tens of thousands of alerts per day)**: * **Setup**: Deploy Keep with Elasticsearch for storing alerts as documents. * **Setup #2**: Deploy Keep with Redis and with ARQ to use Redis as a queue. ## Recommended Specifications by Alert Volume | **Number of Alerts** | **Keep Backend** | **Keep Database** | **Redis** | **Elasticsearch** | | --------------------- | ----------------- | ---------------------------------------------- | ---------------- | ---------------------------- | | **\< 10,000** | 1 vCPUs, 2GB RAM | 2 vCPUs, 8GB RAM | Not required | Not required | | **10,000 - 100,000** | 4 vCPUs, 8GB RAM | 8 vCPUs, 32GB RAM, optimized indexing | Not required | Not required | | **100,000 - 500,000** | 8 vCPUs, 16GB RAM | 8 vCPUs, 32GB RAM, advanced indexing | 4 vCPUs, 8GB RAM | 8 vCPUs, 32GB RAM, 2-3 nodes | | **> 500,000** | 8 vCPUs, 16GB RAM | 8 vCPUs, 32GB RAM, advanced indexing, sharding | 4 vCPUs, 8GB RAM | 8 vCPUs, 32GB RAM, 2-3 nodes | ## Performance by Operation Type, Load, and Specification | **Operation Type** | **Load** | **Specification** | **Execution Time** | | ------------------ | ------------------------ | ------------------------- | ------------------ | | Digest Alert | 100 alerts per minute | 4 vCPUs, 8GB RAM | \~0.5 seconds | | Digest Alert | 500 alerts per minute | 8 vCPUs, 16GB RAM | \~1 second | | Digest Alert | 1,000 alerts per minute | 16 vCPUs, 32GB RAM | \~1.5 seconds | | Run Workflow | 10 workflows per minute | 4 vCPUs, 8GB RAM | \~1 second | | Run Workflow | 50 workflows per minute | 8 vCPUs, 16GB RAM | \~2 seconds | | Run Workflow | 100 workflows per minute | 16 vCPUs, 32GB RAM | \~3 seconds | | Ingest via Queue | 100 alerts per minute | 4 vCPUs, 8GB RAM, Redis | \~0.3 seconds | | Ingest via Queue | 500 alerts per minute | 8 vCPUs, 16GB RAM, Redis | \~0.8 seconds | | Ingest via Queue | 1,000 alerts per minute | 16 vCPUs, 32GB RAM, Redis | \~1.2 seconds | ### Table Explanation: * **Operation Type**: The specific operation being tested (e.g., digesting alerts, running workflows). * **Load**: The number of operations per minute being processed (e.g., number of alerts per minute). * **Specification**: The CPU, RAM, and additional services used for the operation. * **Execution Time**: Approximate time taken to complete the operation under the given load and specification. ## Fine Tuning As any deployment has its own characteristics, such as the balance between volume vs. total count of alerts or volume vs. number of workflows, Keep can be fine-tuned with the following parameters: 1. **Number of Workers**: Adjust the number of Gunicorn workers to handle API requests more efficiently. You can also start additional API servers to distribute the load. 2. **Distinguish Between API Server Workers and Digesting Alerts Workers**: Separate the workers dedicated to handling API requests from those responsible for digesting alerts, ensuring that each set of tasks is optimized according to its specific needs. 3. **Add More RAM to the Database**: Increasing the RAM allocated to your database can help manage larger datasets and improve query performance, particularly when dealing with high volumes of alerts. 4. **Optimize Database Configuration**: Keep was mainly tested on MySQL and PostgreSQL. Different database may have different fine tuning mechanisms. 5. **Horizontal Scaling**: Consider deploying additional instances of the API and database services to distribute the load more effectively. ## FAQ ### 1. How do I estimate the spec I need for Keep? To estimate the specifications required for Keep, consider both the number of alerts per minute and the total number of alerts you expect to handle. Refer to the **Recommended Specifications by Alert Volume** table above to match your expected load with the appropriate resources. ### 2. How do I know if I need Elasticsearch? Elasticsearch is typically needed when you are dealing with more than 50,000 total alerts or if you require advanced search and query capabilities that are not efficiently handled by a traditional relational database. If your systemâs performance degrades significantly as alert volume increases, it may be time to consider Elasticsearch. ### 3. How do I know if I need Redis? Redis is recommended when your alert ingestion rate exceeds 1,000 alerts per minute or when you notice that the API is becoming a bottleneck due to high ingestion rates. Redis, combined with ARQ (Asynchronous Redis Queue), can help manage and distribute the load more effectively. ### 4. What should I do if Keep's performance is still inadequate? If you have scaled according to the recommendations and are still facing performance issues, consider: * **Optimizing your database configuration**: Indexing, sharding, and query optimization can make a significant difference. * **Horizontal scaling**: Distribute the load across multiple instances of the API and database services. * **Reach out to our Slack community**: For personalized support, reach out to us on Slack, and weâll help you troubleshoot and optimize your Keep deployment. For any additional questions or tailored advice, feel free to join our Slack community where our team and other users are available to assist you. # Keep with an external URL Source: https://docs.keephq.dev/development/external-url ## Introduction Several features in Keep necessitate an external URL that is accessible from the internet. This is particularly crucial for functionalities like Webhook Integration when installing providers. Keep uses its API URL to establish itself as a webhook connector during this process. When an alert is triggered, the corresponding Provider attempts to activate the webhook, delivering the alert payload. Consequently, the webhook must be accessible over the internet for this process to work effectively. ## Utilizing NGROK for External Accessibility Keep supports the use of NGROK to create an accessible external URL. By starting Keep with the environment variable USE\_NGROK=true, Keep will automatically initiate an NGROK tunnel and utilize this URL for webhook installations. While `USE_NGROK` is convenient for development or testing, it's important to note that each restart of Keep results in a new NGROK URL. This change in the URL means that providers configured with the old URL will no longer be able to communicate with Keep. For production environments, it's advisable to either: * Expose Keep with a permanent, internet-accessible URL. * Set up a static NGROK tunnel. Subsequently, configure Keep to use this stable URL by setting the KEEP\_API\_URL environment variable. # Getting started Source: https://docs.keephq.dev/development/getting-started ### Docker-compose dev images You can use `docker-compose.dev.yaml` to start Keep in a development mode. First, clone the Keep repo: ``` git clone https://github.com/keephq/keep.git && cd keep ``` Next, run ``` docker compose -f docker-compose.dev.yml up ``` ### Install Keep CLI First, clone Keep repository: ```shell theme={null} git clone https://github.com/keephq/keep.git && cd keep ``` Install Keep CLI ```shell theme={null} poetry install ``` To access the Keep CLI activate the environment, and access from shell. ```shell theme={null} poetry shell ``` From now on, Keep should be installed locally and accessible from your CLI, test it by executing: ``` keep version ``` ## Enable Auto Completion **Keep's CLI supports shell auto-completion, which can make your life a whole lot easier đ** If you're using zsh ```shell title=~/.zshrc theme={null} eval "$(_KEEP_COMPLETE=zsh_source keep)" ``` If you're using bash ```bash title=~/.bashrc theme={null} eval "$(_KEEP_COMPLETE=bash_source keep)" ``` > Using eval means that the command is invoked and evaluated every time a shell is started, which can delay shell responsiveness. To speed it up, write the generated script to a file, then source that. ### Testing Run unittests: ```bash theme={null} poetry run coverage run --branch -m pytest --ignore=tests/e2e_tests/ ``` Run E2E tests (run Keep locally before): ```bash theme={null} poetry run playwright install; poetry run coverage run --branch -m pytest -s tests/e2e_tests/ ``` ### Migrations Migrations are automatically executed on a server startup. To create a migration: ```bash theme={null} alembic -c keep/alembic.ini revision --autogenerate -m "Your message" ``` Hint: make sure your models are imported at `./api/models/db/migrations/env.py` for autogenerator to pick them up. ## VS Code (or Cursor) Run Keep from your VS Code (or Cursor) after cloning the repo by adding this configurations to your `.vscode/launch.json`: ```json theme={null} { "version": "0.2.0", "configurations": [ { "name": "Keep Backend", "type": "debugpy", "request": "launch", "program": "keep/cli/cli.py", "console": "integratedTerminal", "justMyCode": false, "python": "venv/bin/python", "args": ["--json", "api","--multi-tenant"], "env": { "PYDEVD_DISABLE_FILE_VALIDATION": "1", "PYTHONPATH": "${workspaceFolder}/", "PUSHER_APP_ID": "1", "SECRET_MANAGER_DIRECTORY": "./state/", "PUSHER_HOST": "localhost", "PUSHER_PORT": "6001", "PUSHER_APP_KEY": "keepappkey", "PUSHER_APP_SECRET": "keepappsecret", "LOG_FORMAT": "dev_terminal", } }, { "name": "Keep Simulate Alerts", "type": "debugpy", "request": "launch", "program": "scripts/simulate_alerts.py", "console": "integratedTerminal", "justMyCode": false, "python": "venv/bin/python", "env": { "PYDEVD_DISABLE_FILE_VALIDATION": "1", "PYTHONPATH": "${workspaceFolder}/", "KEEP_API_URL": "http://localhost:8080", "KEEP_API_KEY": "some-api-key" } }, { "name": "Keep Frontend", "type": "node-terminal", "request": "launch", "command": "npm run dev", "cwd": "${workspaceFolder}/keep-ui", } ] } ``` Install dependencies: ``` python3.11 -m venv venv; source venv/bin/activate; pip install poetry; poetry install; cd keep-ui && npm i && cd ..; ``` Set frontend envs: ``` cp keep-ui/.env.local.example keep-ui/.env.local; echo "\n\n\n\nNEXTAUTH_SECRET="$(openssl rand -hex 32) >> keep-ui/.env.local; ``` Launch Pusher ([soketi](https://soketi.app/)) container in parallel: ```bash theme={null} docker run -d -p 6001:6001 -p 9601:9601 -e SOKETI_USER_AUTHENTICATION_TIMEOUT=3000 -e SOKETI_DEFAULT_APP_KEY=keepappkey -e SOKETI_DEFAULT_APP_SECRET=keepappsecret -e SOKETI_DEFAULT_APP_ID=1 quay.io/soketi/soketi:1.4-16-debian ``` ## VS Code (or Cursor) + DockerFor this guide to work, the [VS Code Docker](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker) extension is required. In air-gapped environments, you might consider building the container on an internet-connected computer, exporting the image using docker save, transferring it with docker load in the air-gapped environment, and then using the run configuration. In cases where you want to develop Keep but are unable to run it directly on your local laptop (e.g., with Windows), or if you lack access to all of its dependencies (e.g., in air-gapped environments), you can still accomplish this using VS Code (or Cursor) and Docker. To achieve this, follow these steps: 1. Clone Keep and open it with VS Code (or Cursor) 2. Create a tasks.json file to build and run the Keep API and Keep UI containers. 3. Create a launch.json configuration to start the containers and attach a debugger to them. 4. Profit. ### Clone Keep and open it with VS Code (or Cursor) ``` git clone https://github.com/keephq/keep.git && cd keep code . ``` ### Create tasks.json #### including building the containers ``` { "version": "2.0.0", "tasks": [ // The API and UI containers needs to be in the same docker network { "label": "docker-create-network", "type": "shell", "command": "docker network create keep-network || true", "problemMatcher": [] }, // Build the api container { "label": "docker-build-api-dev", "type": "docker-build", "dockerBuild": { "context": "${workspaceFolder}", "dockerfile": "${workspaceFolder}/Docker/Dockerfile.dev.api", "tag": "keep-api-dev:latest" } }, // Run the api container { "label": "docker-run-api-dev", "type": "docker-run", "dependsOn": [ "docker-build-api-dev", "docker-create-network" ], "python": { "args": [ "api" ], "file": "./keep/cli/cli.py" }, "dockerRun": { "network": "keep-network", "image": "keep-api-dev:latest", "containerName": "keep-api", "ports": [ { "containerPort": 8080, "hostPort": 8080 } ], "env": { "DEBUG": "1", "SECRET_MANAGER_TYPE": "FILE", "USE_NGROK": "false", "AUTH_TYPE": "DB" }, "volumes": [ { "containerPath": "/app", "localPath": "${workspaceFolder}" } ] } }, // Build the UI container { "label": "docker-build-ui", "type": "docker-build", "dockerBuild": { "context": "${workspaceFolder}", "dockerfile": "${workspaceFolder}/Docker/Dockerfile.dev.ui", "tag": "keep-ui-dev:latest" } }, // Run the UI container { "type": "docker-run", "label": "docker-run-ui", "dependsOn": [ "docker-build-ui", "docker-create-network" ], "dockerRun": { "network": "keep-network", "image": "keep-ui-dev:latest", "containerName": "keep-ui", "env": { // Uncomment for fully debug // "DEBUG": "*", "NODE_ENV": "development", "API_URL": "http://keep-api:8080", "AUTH_TYPE": "DB", }, "volumes": [ { "containerPath": "/app", "localPath": "${workspaceFolder}/keep-ui" } ], "ports": [ { "containerPort": 9229, "hostPort": 9229 }, { "containerPort": 3000, "hostPort": 3000 } ], "command": "npm run dev", }, "node": { "package": "${workspaceFolder}/keep-ui/package.json", "enableDebugging": true } } ] } ``` #### without building the containersTo start Keep without building the containers, you'll need to have `keep-api-dev` and `keep-ui-dev` images loaded into your docker. ``` { "version": "2.0.0", "tasks": [ # The API and the UI needs to be in the same docker network { "label": "docker-create-network", "type": "shell", "command": "docker network create keep-network || true", "problemMatcher": [] }, # Run the API container { "label": "docker-run-api-dev", "type": "docker-run", "dependsOn": [ "docker-create-network" ], "python": { "args": [ "api" ], "file": "./keep/cli/cli.py" }, "dockerRun": { "network": "keep-network", "image": "keep-api-dev:latest", "containerName": "keep-api", "ports": [ { "containerPort": 8080, "hostPort": 8080 } ], "env": { "DEBUG": "1", "SECRET_MANAGER_TYPE": "FILE", "USE_NGROK": "false", "AUTH_TYPE": "DB" }, "volumes": [ { "containerPath": "/app", "localPath": "${workspaceFolder}" } ] } }, # Run the UI container { "type": "docker-run", "label": "docker-run-ui", "dependsOn": [ "docker-create-network" ], "dockerRun": { "network": "keep-network", "image": "keep-ui-dev:latest", "containerName": "keep-ui", "env": { // Uncomment for fully debug // "DEBUG": "*", "NODE_ENV": "development", "API_URL": "http://keep-api:8080", "AUTH_TYPE": "DB" }, "volumes": [ { "containerPath": "/app", "localPath": "${workspaceFolder}/keep-ui" } ], "ports": [ { "containerPort": 9229, "hostPort": 9229 }, { "containerPort": 3000, "hostPort": 3000 } ], "command": "npm run dev", }, "node": { "package": "${workspaceFolder}/keep-ui/package.json", "enableDebugging": true } } ] } ``` ### Create launch.json ``` { "name": "Docker: Keep API", "type": "docker", "request": "launch", "preLaunchTask": "docker-run-api-dev", "removeContainerAfterDebug": true, "containerName": "keep-api", "python": { "pathMappings": [ { "localRoot": "${workspaceFolder}", "remoteRoot": "/app" } ], "module": "keep.cli.cli" } }, { "name": "Docker: Keep UI", "type": "docker", "request": "launch", "removeContainerAfterDebug": true, "preLaunchTask": "docker-run-ui", "containerName": "keep-api", "platform": "node", "node": { "package": "${workspaceFolder}/keep-ui/package.json", "localRoot": "${workspaceFolder}/keep-ui" } }, ``` # Facets Source: https://docs.keephq.dev/incidents/facets Faceted search is a powerful mechanism for enhancing search functionality, allowing users to filter and refine search results dynamically using multiple dimensions or "facets." These facets are predefined categories or attributes of the data. In Keep, the Incidents page supports faceted search by incident attributes. ### Predefined Incident Facets These are predefined Incident facets that can be used to filter incidents: * **Status**: Filter by Incident status * **Severity**: Filter by Incident severity * **Assignee**: Filter by Incident assignee * **Source**: Filter by alert source * **Service**: Filter by the service the Incident relates to ### Custom Facets Creation Keep also supports custom facets creation. Here is how to do this: 1. Click the "Add facet" button in the filtering panel. 2. Enter the Facet name. This is the name that will be displayed in the filter panel. 3. Enter the Facet property path the facet will filter by. 4. Click "Create".### Supported Properties to create Facets for Incident supports facets by direct Incident fields and also by Alert's data linked to the Incident. Here is a list of properties you can create facets for: * **name**: Incident name * **summary**: Incident summary * **creation\_time**: Incident creation time * **start\_time**: Incident start time * **end\_time**: Incident end time * **last\_seen\_time**: Incident last seen time * **is\_predicted**: Whether the Incident is predicted * **is\_candidate**: Whether the Incident is candidate * **alerts\_count**: Number of alerts associated with the Incident * **merged\_at**: When the Incident was merged * **merged\_by**: Who merged the Incident * **hasLinkedIncident**: Whether the Incident has past incident linked * **alert.**\*: Refers to alert properties in the Incident. Examples: alert.labels.monitor, alert.monitor, etc. # Overview Source: https://docs.keephq.dev/incidents/overview Keep's incident management system provides a comprehensive solution for handling, tracking, and resolving operational incidents. This system helps teams effectively manage incidents from detection through resolution, ensuring minimal downtime and efficient collaboration.
### (1) Incident Severity Displays the severity of the incident, helping teams prioritize and focus on the most critical issues. ### (2) Incident Name The unique name or identifier of the incident for easy reference and tracking. ### (3) Incident Summary (+ AI Summary) A brief overview of the incident, optionally enhanced with AI-generated summaries to provide deeper insights. ### (4) Link Similar Incidents Connects related incidents for better visibility into recurring or interconnected issues. ### (5) Involved Services Lists the services affected by the incident, allowing teams to understand the scope of the impact. ### (6) Affected Environments Specifies the environments (e.g., production, staging) impacted by the incident. ### (7) Run Workflow Quickly initiate workflows to address the incident, such as creating tickets, notifying teams, or executing remediation steps.
### (8) Edit Incident Allows modification of incident details, such as severity, name, or involved services, to keep information up-to-date.
### (9) Incident Status Indicates the current status of the incident (e.g., open, resolved, acknowledged). ### (10) Incident Last Seen At Records the most recent timestamp when the incident was observed, providing context for its activity. ### (11) Incident Started At Indicates when the incident was first detected, helping establish timelines for resolution. ### (12) Incident Assignee Displays the individual or team responsible for resolving the incident, promoting accountability. ### (13) Incident Group By Value Groups incidents based on a specific attribute, such as service, environment, or severity, for better organization. ### (14) Incident Related Alerts Lists all alerts linked to the incident, offering a complete view of its underlying causes. ### (15) Incident Activity Tracks all activities and updates related to the incident, enabling detailed audits and reviews.
### (16) Incident Timeline Provides a chronological view of the incident's lifecycle, including updates, actions, and status changes.
### (17) Incident Topology Visualizes the relationships between affected components, services, and infrastructure in a topology map.
### (18) Incident Workflows Lists workflows associated with the incident, showing actions taken or available options for resolution. ### (19) Incident Chat with AI (Incident Copilot) Engage with AI-powered chat for guidance, insights, or recommended actions related to the incident.
### (20) Incident Alert List Displays a detailed list of alerts contributing to the incident, with metadata for each alert. ### (21) Incident Alert Link Provides quick access to the original monitoring tool for a specific alert. ### (22) Incident Alert Status Shows the current status of each alert, such as acknowledged, resolved, or firing. ### (23) Incident Correlation Type Indicates how the incident was correlated: manually, via AI, or by rule-based logic. ### (24) Incident Alert Unlink Enables unlinking specific alerts from the incident if they are found to be unrelated. *** # AI Correlation Source: https://docs.keephq.dev/overview/ai-correlation
Keep Cloud: â Keep's AI correlation engine provides a distinctive approach to fully AI-driven alert correlation. By using historical alert data as its training dataset, the system intelligently classifies new alerts and assigns them to appropriate incidents. The AI correlator runs on cycles, each iteration cycle completes in 5-15 minutes: 1. Model trained based on historical data. 2. Model is evaluated. 3. All unassigned alerts are clustered and added to incidents when their confidence score exceeds the threshold. Configuration UI:
Keep Enterprise On-Premises: â
Keep Open Source: âď¸Incident with alerts correlated by AI:
Check the demo on a playground: [https://playground.keephq.dev/ai](https://playground.keephq.dev/ai) To activate the feature for your on-premises tenant, please [talk to us](https://www.keephq.dev/meet-keep). ## Frequent questions: **Model used:** proprietary model developed and hosted by Keep.
**Training dataset:** tenant's alerts and incidents.
**Privacy:** tenant's data is used only for training of the model for the same tenant. Data is not mixed between tenants for training. # AI in Workflows Source: https://docs.keephq.dev/overview/ai-in-workflowsKeep Cloud: â AI in workflows enables you to integrate third-party AI providers as "steps" and "actions" within your workflows. Could be useful for: 1. Human input normalization. 2. Routing. 3. Severity definition. 4. Summorization. Supported providers include DeepSeek, OpenAI, Anthropic, Grok, Gemini, Ollama, Llama.cpp, vLLM, and more. Check the "AI" filter on the "Providers" page for a complete list. Blogpost with examples: [https://www.keephq.dev/blog/launch-week-ai-powered-workflows](https://www.keephq.dev/blog/launch-week-ai-powered-workflows) ## Frequent questions: **Model used:** client's own 3'rd party LLM provider. Could be cloud or self-hosted.
Keep Enterprise On-Premises: â
Keep Open Source: â
**Privacy:** Data stays within Keep unless it's explicitly processed wia workflow to an explicitly connected 3'rd party provider. Data flow is defined by user. # AI Incident Assistant Source: https://docs.keephq.dev/overview/ai-incident-assistantKeep Cloud: â The AI incident assistant is a chat feature embedded in the incident page. It streamlines all incident contextâincluding alerts, descriptions, and impacted topologyâto the LLM, helping on-call engineers gather information faster and resolve incidents more efficiently. Users can ask for root cause analysis and even execute commands on third-party services ([read more about provider methods](/providers/provider-methods#via-ai-assistant)).
Keep Enterprise On-Premises: â
Keep Open Source: (experimental)## Frequent questions: **Model used:** OpenAI, a model hosted by Keep, or other.
**Data flow:** Data is shared between LLM provider and Keep whether the LLM provider may vary depending on the contract. # AI Semi Automatic Correlation Source: https://docs.keephq.dev/overview/ai-semi-automatic-correlationKeep Cloud: â The Semi-Automatic Incident Engine is a powerful tool designed for teams handling a moderate volume of alerts (fewer than 100 per day). It helps you quickly identify critical issues among numerous alertsâfinding the needle in the haystack. How to use: 1. Navigate to the Feed section 2. Select a few alerts 3. Click the "Create Incidents With AI" button Once activated, the system will process your alerts through its LLM (Large Language Model) and present you with potential incident candidates for review.
Keep Enterprise On-Premises: â
Keep Open Source: (experimental)## Frequent questions: **Model used:** OpenAI, a model hosted by Keep, or other.
**Data flow:** Data is shared between LLM provider and Keep whether the LLM provider may vary depending on the contract. # AI Workflow Builder Assistant Source: https://docs.keephq.dev/overview/ai-workflow-assistantKeep Cloud: â AI-driven workflow builder (don't confuse it with [AI in workflows](./ai-in-workflows)) is a chat-like UI to build workflows using natural language. It works in the âhuman in the loopâ paradigm, proposing changes and applying them only after the user's explicit consent. It simplifies workflow-building routines and helps a broader group of engineers within the organization adopt workflows. Go to "Workflows" -> "+ Create Workflow" to find the AI Assistant:
Keep Enterprise On-Premises: â
Keep Open Source: (experimental)Launch Blogpost: [https://www.keephq.dev/blog/launch-week-ai-workflow-builder](https://www.keephq.dev/blog/launch-week-ai-workflow-builder) ## Frequent questions: **Model used:** OpenAI, a model hosted by Keep, or other.
**Data flow:** Data is shared between LLM provider and Keep whether the LLM provider may vary depending on the contract. # Alerts Severity and Status Source: https://docs.keephq.dev/overview/alertseverityandstatus In Keep, alerts are treated as first-class citizens, with clearly defined severities and statuses to aid in quick and efficient response. ## Alert Severity Alert severity in Keep is classified into five categories, helping teams prioritize their response based on the urgency and impact of the alert. | Severity Level | Description | Expected Value | | -------------- | --------------------------------------------------- | -------------- | | CRITICAL | Requires immediate action. | "critical" | | HIGH | Needs to be addressed soon. | "high" | | WARNING | Indicates a potential problem. | "warning" | | INFO | Provides information, no immediate action required. | "info" | | LOW | Minor issues or lowest priority. | "low" | ## Alert Status The status of an alert in Keep reflects its current state in the alert lifecycle. | Status | Description | Expected Value | | ------------ | --------------------------------------------------------------- | -------------- | | FIRING | Active alert indicating an ongoing issue. | "firing" | | RESOLVED | The issue has been resolved, and the alert is no longer active. | "resolved" | | ACKNOWLEDGED | The alert has been acknowledged but not resolved. | "acknowledged" | | SUPPRESSED | Alert is suppressed due to various reasons. | "suppressed" | | PENDING | No Data or insufficient data to determine the alert state. | "pending" | ## Provider Alert Mappings Different providers might have their specific ways of defining and handling alert severity and status. Keep standardizes these variations by mapping them to the defined enums (AlertSeverity and AlertStatus). Here's how various providers align with Keep's alert system: | Provider | Severity Mapping | Status Mapping | | ---------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | | CloudWatch | N/A | ALARM -> FIRING, OK -> RESOLVED, INSUFFICIENT\_DATA -> PENDING | | Prometheus | "critical" -> CRITICAL "warning" -> WARNING, "info" -> INFO, "low" -> LOW | "firing" -> FIRING, "resolved" -> RESOLVED | | Datadog | "P4" -> INFO, "P3" -> WARNING, "P2" -> HIGH, "P1" -> CRITICAL | "Triggered" -> FIRING, "Recovered" -> RESOLVED, "Muted" -> SUPPRESSED | | PagerDuty | "P1" -> CRITICAL, "P2" -> HIGH, "P3" -> WARNING, "P4" -> INFO | "triggered" -> FIRING, "acknowledged" -> ACKNOWLEDGED, "resolved" -> RESOLVED | | Pingdom | N/A | "down" -> FIRING, "up" -> RESOLVED, "paused" -> SUPPRESSED | | Dynatrace | "critical" -> CRITICAL, "warning" -> WARNING, "info" -> INFO | "open" -> FIRING, "closed" -> RESOLVED, "acknowledged" -> ACKNOWLEDGED | | Grafana | "critical" -> CRITICAL, "high" -> HIGH, "warning" -> WARNING, "info" -> INFO | "ok" -> RESOLVED, "paused" -> SUPPRESSED, "alerting" -> FIRING, "pending" -> PENDING, "no\_data" -> PENDING | | New Relic | "critical" -> CRITICAL, "warning" -> WARNING, "info" -> INFO | "open" -> FIRING, "closed" -> RESOLVED, "acknowledged" -> ACKNOWLEDGED | | Sentry | "fatal" -> CRITICAL, "error" -> HIGH, "warning" -> WARNING, "info" -> INFO, "debug" -> LOW | "resolved" -> RESOLVED, "unresolved" -> FIRING, "ignored" -> SUPPRESSED | | Zabbix | "not\_classified" -> LOW, "information" -> INFO, "warning" -> WARNING, "average" -> WARNING, "high" -> HIGH, "disaster" -> CRITICAL | "problem" -> FIRING, "ok" -> RESOLVED, "acknowledged" -> ACKNOWLEDGED, "suppressed" -> SUPPRESSED | # Common Expression Language (CEL) Source: https://docs.keephq.dev/overview/celIt worth reading [CEL official docs](https://cel.dev) to learn about the language and its syntax. Keep utilizes **CEL (Common Expression Language)** as a powerful and flexible tool to evaluate and filter alerts against predefined rules. CEL enables users to write precise expressions that define conditions under which alerts are processed, displayed, or acted upon. This capability enhances alert management by allowing granular control over visibility and response to incoming alerts. ## How Keep Uses CEL ### Alert Filtering Alerts are dynamically evaluated against CEL expressions to determine which alerts meet the specified criteria. This real-time filtering ensures only the most relevant alerts are surfaced. ### Rule Evaluation CEL expressions can be embedded in rules to enforce specific actions, such as escalating an alert or triggering a workflow. ### Presets Users can save frequently used CEL expressions as presets for quick and consistent application across different alert views or teams. ## Examples ### Filter Alerts from a Specific Service ```cel theme={null} service.contains("database") ``` ### Combine Multiple Conditions ```cel theme={null} severity == "critical" && source == "prometheus" ``` ### Exclude Specific Alerts ```cel theme={null} !(service == "auth" && severity == "low") ``` # Comparison Source: https://docs.keephq.dev/overview/comparisons It's often easier to grasp a tool's features by comparing it to others in the same ecosystem. Here, we'll explain how Keep interacts with and compares to these tools. ## Keep vs IRM (PagerDuty, OpsGenie, etc.) Incident management tools aim to notify the right person at the right time, simplify reporting, and set up efficient war rooms. "Keep" focuses on the alert lifecycle, noise reduction, and AI-driven alert-incident correlation. Essentially, Keep acts as an 'intelligent layer before the IRM,' managing millions of alerts before they reach your IRM tool. Keep offers high-quality integrations with PagerDuty, OpsGenie, Grafana OnCall, and more. ## Keep vs AIOps in Observability (Elastic, Splunk, etc.) Keep is different because itâs able to correlate alerts between different observability platforms. | | Keep | Alternative | | ------------------------------------------ | ---- | ----------- | | Aggregates alerts from one platform | â | â | | Aggregates alerts from multiple platforms | â | â | | Correlates alerts between multiple sources | â | â | | Alerts enrichment | â | â | | Open source | â | â | | Workflow automation | â | â | ## Keep vs AIOps platforms (BigPanda, Moogsoft, etc.) Keep is an alternative to platforms like BigPanda and Moogsoft. Customers who have used both traditional platforms and Keep notice a significant improvement in alert correlation. Unlike the manual methods of other platforms, Keep uses advanced state-of-the-art AI models for easier and more effective alert correlation. | | Keep | Alternative | | ----------------------------- | ----------------------------------------------- | ---------------------------- | | Aggregation of alerts | â | â | | Integrations | â (Bi-directional) | â (Webhooks) | | Alerts enrichment | â | â | | Open source | â | â | | Workflow automation | â (GitHub Actions-like, infrastructure as code) | â | | Managed version | â | â | | On-Premises | â | â | | Noise reduction & correlation | â (AI) | â (Rule-based in some cases) | # Manual Correlation Rules Source: https://docs.keephq.dev/overview/correlation-rules The Keep Correlation Engine is a versatile tool for correlating and consolidating alerts into incidents or incident-candidates. This guide explains the core concepts, usage, and best practices for effectively utilizing the rule engine.## Core Concepts * **Rule definition**: A rule in Keep is a set of conditions that, when met, creates an incident or incident-candidate. * **Alert attributes**: These are characteristics or data points of an alert, such as source, severity, or any attribute an alert might have. * **Conditions and logic**: Rules are built by defining conditions based on alert attributes, using logical operators (like AND/OR) to combine multiple conditions. ## Creating Correlation Rules Creating a rule involves defining the conditions under which an alert should be categorized or actions should be grouped. 1. **Accessing the Correlation Engine**: Navigate to the Correlation section in the Keep platform. 2. **Defining rule criteria**: * **Name the rule**: Assign a descriptive name that reflects its purpose. * **Set conditions**: Use alert attributes to create conditions. For example, a rule might specify that an alert with a severity of 'critical' and a source of 'Prometheus' should be categorized as 'High Priority'. * **Logical grouping**: Combine conditions using logical operators to form comprehensive rules. * **Manual approve**: Create Incident-candidate or full-fledged incident. ## Dynamic Incident Naming The correlation engine supports dynamic incident naming based on alert attributes. This allows you to create more meaningful and context-aware incident names that reflect the actual alert data. ### Template Variables You can use template variables in your incident name using the `{{ alert.attribute }}` syntax. These variables are replaced with actual values from the alerts. For example: * `{{alert.labels.host}}` - References the host from alert labels * `{{alert.service}}` - References the service name from the alert ### Behavior with Multiple Alerts When an incident contains multiple alerts: * Values from all alerts are automatically concatenated with commas * Duplicate values are automatically deduplicated * If a new alert adds a unique value, the incident name is updated to include it #### Dynamic Name Example **Template:** "Service Issue on `{{alert.labels.host}}`" **First alert** ``` { ... { "labels": { "host": "host1" } } ... } ``` **Second alert** ``` { ... { "labels": { "host": "host2" } } ... } ``` **Incident Name** Service Issue on host1,host2 ## Examples * **Metric-based alerts**: Construct a rule to pinpoint alerts associated with specific metrics, such as high CPU usage on servers. This can be achieved by grouping alerts that share a common attribute, like a 'CPU usage' tag, ensuring you quickly identify and address performance issues. * **Feature-related alerts**: Establish rules to create incident by specific features or services. For instance, you can start incident based on a 'service' or 'URL' tag. This approach is particularly useful for tracking and managing alerts related to distinct functionalities or components within your application. * **Team-based alert management**: Implement rules to create incidents according to team responsibilities. This might involve grouping based on the systems or services a particular team oversees. Such a strategy ensures that alerts are promptly directed to the appropriate team, enhancing response times and efficiency. # Topology Correlation Source: https://docs.keephq.dev/overview/correlation-topology The Topology Processor is a core component of Keep that helps correlate alerts based on your infrastructure's topology, creating meaningful incidents that reflect the relationships between your services and applications. It automatically analyzes incoming alerts and their relationship to your infrastructure topology, creating incidents when multiple related services or components of an application are affected. Read more about [Service Topology](/overview/servicetopology).
![]()
The Topology Processor is disabled by default. To enable it, set the environment variable `KEEP_TOPOLOGY_PROCESSOR=true`. ## How It Works 1. **Service Discovery**: The processor maintains a map of your infrastructure's topology, including: * Services and their relationships * Applications and their constituent services * Dependencies between different components 2. **Alert Processing**: Every few seconds, the processor: * Analyzes recent alerts * Maps alerts to services in your topology * Creates or updates incidents based on application-level impact 3. **Incident Creation**: When multiple services within an application have active alerts: * Creates a new application-level incident * Groups related alerts under this incident * Provides context about the affected application and its services ## Configuration ### Environment Variables | Variable | Description | Default | | ------------------------------------------ | --------------------------------------------------- | ------- | | `KEEP_TOPOLOGY_PROCESSOR` | Enable/disable the topology processor | `false` | | `KEEP_TOPOLOGY_PROCESSOR_INTERVAL` | Interval for processing alerts (in seconds) | `10` | | `KEEP_TOPOLOGY_PROCESSOR_LOOK_BACK_WINDOW` | Look back window for alert correlation (in minutes) | `15` | ## Incident Management ### Creation When the processor detects alerts affecting multiple services within an application: * Creates a new incident with type "topology" * Names it "Application incident: " * Automatically confirms the incident * Links all related alerts to the incident ### Resolution Incidents can be configured to resolve automatically when: * All related alerts are resolved * Specific resolution criteria are met ## Best Practices 1. **Service Mapping** * Ensure services in alerts match your topology definitions * Maintain up-to-date topology information 2. **Application Definition** * Group related services into logical applications * Define clear service boundaries 3. **Alert Configuration** * Include service information in your alerts * Use consistent service naming across monitoring tools ## Example If you have an application "payment-service" consisting of multiple microservices: ```json theme={null} { "application": "payment-service", "services": ["payment-api", "payment-processor", "payment-database"] } ``` When alerts come in for both `payment-api` and `payment-database`, the Topology Processor will: 1. Recognize these services belong to the same application 2. Create a single incident for "payment-service" 3. Group both alerts under this incident 4. Provide application-level context in the incident description ## Limitations * Currently supports only application-based incident creation * One active incident per application at a time * Requires service information in alerts for correlation # Deduplication Source: https://docs.keephq.dev/overview/deduplication Alert deduplication is a crucial feature in Keep that helps reduce noise and streamline incident management by grouping similar alerts together. This process ensures that your team isn't overwhelmed by a flood of notifications for what is essentially the same issue, allowing for more efficient and focused incident response.## Glossary * **Deduplication Rule**: A set of criteria used to determine if alerts should be grouped together. * **Partial Deduplication**: Correlates instances of alerts into single alerts, considering the case of the same alert with different statuses (e.g., firing and resolved). This is the default mode where specified fields are used to identify and group related alerts. * **Fingerprint Fields**: Specific alert attributes used to identify similar alerts. * **Full Deduplication**: A mode where alerts are considered identical if all fields match exactly (except those explicitly ignored). This helps avoid system overload by discarding duplicate alerts. * **Ignore Fields**: In full deduplication mode, these are fields that are not considered when comparing alerts. ## Deduplication Types ### Partial Deduplication Partial deduplication allows you to specify certain fields (fingerprint fields) that are used to identify similar alerts. Alerts with matching values in these specified fields are considered duplicates and are grouped together. This method is flexible and allows for fine-tuned control over how alerts are deduplicated. Every provider integrated with Keep comes with pre-built partial deduplication rule tailored to that provider's specific alert format and common use cases. The default fingerprint fields defined using `FINGERPRINT_FIELDS` attributes in the provider code (e.g. [datadog provider](https://github.com/keephq/keep/blob/main/keep/providers/datadog_provider/datadog_provider.py#L188) or [gcp monitoring provider](https://github.com/keephq/keep/blob/main/keep/providers/gcpmonitoring_provider/gcpmonitoring_provider.py#L52)). ### Full Deduplication When full deduplication is enabled, Keep will also discard exact same events (excluding ignore fields). This mode considers all fields of an alert when determining duplicates, except for explicitly ignored fields. By default, exact similar events excluding lastReceived time are fully deduplicated and discarded. This helps prevent system overload from repeated identical alerts. ## Real Examples of Alerts and Results ### Example 1: Partial Deduplication **Rule** - Deduplicate based on 'service' and 'error\_message' fields. ```json theme={null} # alert 1 { "service": "payment", "error_message": "Database connection failed", "severity": "high", "lastReceived": "2023-05-01T10:00:00Z" } # alert 2 { "service": "payment", "error_message": "Database connection failed", "severity": "critical", "lastReceived": "2023-05-01T10:05:00Z" } # alert 3 { "service": "auth", "error_message": "Invalid token", "severity": "medium", "lastReceived": "2023-05-01T10:10:00Z" } ``` **Result**: * Alerts 1 and 2 are deduplicated into a single alert, fields are updated. * Alert 3 remains separate as it has a different service and error message. ### Example 2: Full Deduplication **Rule**: Full deduplication with 'timestamp' as an ignore field **Incoming Alerts**: ```json theme={null} # alert 1 { service: "api", error: "Rate limit exceeded", user_id: "12345", lastReceived: "2023-05-02T14:00:00Z" } # alert 2 (discarded as its identical) { service: "api", error: "Rate limit exceeded", user_id: "12345", lastReceived: "2023-05-02T14:01:00Z" } # alert 3 { service: "api", error: "Rate limit exceeded", user_id: "67890", lastReceived: "2023-05-02T14:02:00Z" } ``` **Result**: * Alerts 1 and 2 are deduplicated as they are identical except for the ignored timestamp field. * Alert 3 remains separate due to the different user\_id. ## How It Works Keep's deduplication process follows these steps: 1. **Alert Ingestion**: Every alert received by Keep is first ingested into the system. 2. **Enrichment**: After ingestion, each alert undergoes an enrichment process. This step adds additional context or information to the alert, enhancing its value and usefulness. 3. **Deduplication**: Following enrichment, Keep's alert deduplicator comes into play. It applies the defined deduplication rules to the enriched alerts. # Extraction Source: https://docs.keephq.dev/overview/enrichment/extraction Keep's Alert Extraction enrichment feature enables dynamic extraction of data from incoming alerts using regular expressions. This powerful tool allows users to define extraction rules that identify and extract data based on patterns, enriching alerts with additional structured data derived directly from alert content.
## Introduction Handling a variety of alert formats and extracting relevant information can be challenging. Keep's Alert Extraction feature simplifies this process by allowing users to define regex-based rules that automatically extract key pieces of information from alerts. This capability is crucial for standardizing alert data and enhancing alert context, which facilitates more effective monitoring and response strategies. ## How It Works 1. **Rule Definition**: Users create extraction rules specifying the regex patterns to apply to certain alert attributes. 2. **Attribute Specification**: Each rule defines which attribute of the alert should be examined by the regex. 3. **Data Extraction**: When an alert is received, the system applies the regex to the specified attribute. If the pattern matches, named groups within the regex define new attributes to be extracted and added to the alert. 4. **First Match Enforcement**: The extraction process is designed to stop after the first successful match. Once a rule successfully applies and enriches the alert, no further rules are processed. This ensures efficiency and prevents overlapping or redundant data extraction. 5. **Alert Enrichment**: Extracted values are added to the alert, enhancing its data with additional attributes for improved analysis. ## Practical Example Suppose you receive alerts with a message attribute formatted as "Error 404: Not Found - \[UserID: 12345]". You can define an extraction rule with a regex such as `Error (?P
\d+): (?P .+) - \[UserID: (?P \d+)\]` to extract `error_code`, `error_message`, and `user_id` as separate attributes in the alert. ## Core Concepts * **Regex (Regular Expression)**: A powerful pattern-matching syntax used to identify specific patterns within text. In the context of extraction rules, regex is used to define how data should be extracted from alert attributes. It is crucial that regex patterns adhere to [Python's regex syntax](https://docs.python.org/3.11/library/re.html#match-objects), especially concerning group matching using named groups. * **Attribute**: The part of the alert data (e.g., message, description) that the regex is applied to. * **Named Groups**: Part of the regex pattern that specifies placeholders for extracting specific data points into new alert attributes. ## Creating an Extraction Rule To create an alert extraction rule: 1. **Select the Attribute**: Choose which attribute of the alert should be examined by the regex. 2. **Define the Regex**: Write a regex pattern with named groups that specify what information to extract. Ensure the regex is valid according to Pythonâs regex standards, particularly for group matching. 3. **Configure Conditions**: Optionally, specify conditions under which this rule should apply, using CEL (Common Expression Language) for complex logic. ## Best Practices * **Test Regex Patterns**: Before deploying a new extraction rule, thoroughly test the regex pattern to ensure it correctly matches and extracts data according to Python's regex standards. * **Monitor Extraction Performance**: Keep track of how extraction rules are performing and whether they are enriching alerts as expected. Adjust patterns as necessary based on incoming alert data. * **Use Specific Conditions**: When applicable, define conditions to limit when extraction rules apply, reducing unnecessary processing and focusing on relevant alerts. # Mapping Source: https://docs.keephq.dev/overview/enrichment/mapping Keep's Alert Mapping enrichment feature provides a powerful mechanism for dynamically enhancing alert data by leveraging external data sources, such as CSV files and topology data. This feature allows for the matching of incoming alerts to specific records in a CSV file or topology data based on predefined attributes (matchers) and enriching those alerts with additional information from the matched records.
## Introduction In complex monitoring environments, the need to enrich alert data with additional context is critical for effective alert analysis and response. Keep's Alert Mapping and Enrichment enables users to define rules that match alerts to rows in a CSV file or topology data, appending or modifying alert attributes with the values from matching rows. This process adds significant value to each alert, providing deeper insights and enabling more precise and informed decision-making. ## How It Works ## Mapping with CSV Files 1. **Rule Definition**: Users define mapping rules that specify which alert attributes (matchers) should be used for matching alerts to rows in a CSV file. 2. **CSV File Specification**: A CSV file is associated with each mapping rule. This file contains additional data that should be added to alerts matching the rule. 3. **Alert Matching**: When an alert is received, the system checks if it matches the conditions of any mapping rule based on the specified matchers. 4. **Data Enrichment**: If a match is found, the alert is enriched with additional data from the corresponding row in the CSV file. CVS file will look like: | region | responsible\_team | severity\_override | | ------------ | ----------------- | ------------------ | | us-east-1 | team-alpha | high | | us-west-2 | team-beta | medium | | eu-central-1 | team-gamma | low | ## Mapping with Topology Data 1. **Rule Definition**: Users define mapping rules that specify which alert attributes (matchers) should be used for matching alerts to topology data. 2. **Topology Data Specification**: Topology data is associated with each mapping rule. This data contains additional information about the components and their relationships in your environment. 3. **Alert Matching**: When an alert is received, the system checks if it matches the conditions of any mapping rule based on the specified matchers. 4. **Data Enrichment**: If a match is found, the alert is enriched with additional data from the corresponding topology data. ## Practical Example Imagine you have a CSV file with columns representing different aspects of your infrastructure, such as `region`, `responsible_team`, and `severity_override`. By creating a mapping rule that matches alerts based on `service` and `region`, you can automatically enrich alerts with the responsible team and adjust severity based on the matched row in the CSV file. Similarly, you can use topology data to enrich alerts. For example, if an alert is related to a specific service, you can use topology data to find related components and their statuses, providing a more comprehensive view of the issue. ## Core Concepts * **Matchers**: Attributes within the alert used to identify matching rows within the CSV file or topology data. Common matchers include identifiers like `service` or `region`. * **CSV File**: A structured file containing rows of data. Each column represents a potential attribute that can be added to an alert. * **Topology Data**: Information about the components and their relationships in your environment. This data can be used to enrich alerts with additional context. * **Enrichment**: The process of adding new attributes or modifying existing ones in an alert based on the data from a matching CSV row or topology data. ## Creating a Mapping Rule To create an alert mapping and enrichment rule:
1. **Define the Matchers**: Specify which alert attributes will be used to match rows in the CSV file or topology data. 2. **Specify the Data Source**: Provide the CSV file or specify the topology data to be used for enrichment. 3. **Configure the Rule**: Set additional parameters, such as whether the rule should override existing alert attributes. ## Best Practices * **Keep CSV Files and Topology Data Updated**: Regularly update the CSV files and topology data to reflect the current state of your infrastructure and operational data. * **Use Specific Matchers**: Define matchers that are unique and relevant to ensure accurate matching. * **Monitor Rule Performance**: Review the application of mapping rules to ensure they are working as expected and adjust them as necessary.
# FAQ Source: https://docs.keephq.dev/overview/faq ## FAQ ### 1. "Failed to copy alert/fingerprint. Please check your browser permissions" Modern browsers block clipboard access from insecure ("http") origins for security reasons. To confirm the root cause of the issue, check your website settings in the browser:
If you see the "Blocked to protect your privacy" message or similar text under clipboard settings, this confirms the error is due to an insecure origin:
To resolve this: * For production: Configure HTTPS for your Keep deployment * For local development: Use "localhost" which browsers treat as a secure origin * If using a custom domain locally: Enable HTTPS or switch to "localhost" If you're accessing Keep from a secure origin and still experiencing this issue, please [reach out](https://slack.keephq.dev) to us. # Fingerprints Source: https://docs.keephq.dev/overview/fingerprints Fingerprints are unique identifiers associated with alert instances in Keep. Every provider declares the fields fingerprints are calculated upon
Fingerprints defaults to Alert Name if the provider does not declare fingerprint fields. Fingerprints serve several important purposes in the context of alerting within Keep: ### De-Duplication Alert fingerprints are used to prevent the duplication of enrichments/workflows triggering for the same underlying alert. When Keep receives an alert, it calculates a fingerprint based on the configured fields declared within the Provider. If two alerts have the same fingerprint, Keep considers them to be duplicates and will present one of them. This helps reduce alert noise and prevent unnecessary workflow triggers/enrichments. ### Grouping Keep uses alert fingerprints to group related alerts together. Alerts with the same fingerprint are considered to be part of the same group, indicating that they are triggered by the same underlying condition or problem. Grouping alerts makes it easier for operators to understand relations between different alert-sources, the root cause of an issue and take appropriate action faster. ### Silencing Alert fingerprints are used in third-party tools to manage silences/mutes. Silencing allows operators to temporarily suppress alerts with specific fingerprints, providing a way to acknowledge and handle known issues without generating additional notifications/triggers. ### Visualization Alert fingerprints can also be used for visualization and analysis purposes. They help in tracking the history and status of alerts over time and provide a means to correlate alerts with specific conditions or changes in the monitored system. The process of generating a fingerprint involves hashing the fields configured in the provider and their values associated an alert instance. This results in a fixed-length, hexadecimal string that uniquely identifies that alert. When Keep receives/gets an alert, it calculates the fingerprint for each alert to determine if it should trigger a workflow, be grouped, or is silenced. In summary, Keep alert fingerprints are essential for managing and organizing alerts in every third-party system. They help prevent duplicates, group related alerts, enable silencing, and facilitate analysis and visualization of alert data, ultimately aiding in the effective operation and maintenance of monitored systems. ### Examples This is the base provider class implementation for fingerprint fields: ```python base_provider.py theme={null} class BaseProvider(metaclass=abc.ABCMeta): OAUTH2_URL = None PROVIDER_SCOPES: list[ProviderScope] = [] PROVIDER_METHODS: list[ProviderMethod] = [] FINGERPRINT_FIELDS: list[str] = [] ``` This is Datadog's provider implementation for fingerprint fields, where we calculate fingerprint based on the event groups and monitor id, as an example: ```python datadog_provider.py theme={null} class DatadogProvider(BaseProvider): """ Datadog provider class. """ PROVIDER_SCOPES = [ ... ] PROVIDER_METHODS = [ ... ] FINGERPRINT_FIELDS = ["groups", "monitor_id"] ```Keep allows for customization in anything related with fingerprints. If you want to change the way a specific provider calculates the fingerprint of an alert, you can simply configure the fields you require. # Glossary Source: https://docs.keephq.dev/overview/glossary ## Alert An alert is an event that is triggered when something bad happens or going to happen. The term "alert" can sometimes be interchanged with "alarm" (e.g. in CloudWatch) or "monitor" (Datadog). ## Incident An incident is a group of alerts that are related to each other. ## Provider A provider can be a module that pulls alerts into Keep or pushes data out of keep by interacting with external systems. ### Provider as a data source Within the context of a Workflow, a Provider can: * Query data - query Datadog's API or run a SQL query against a database. * Push data - send a Slack message or create a PagerDuty incident. ### Provider as an alert source When you connect a Provider, Keep begins to read and process alerts from that Provider. For example, after connecting your Prometheus instance, you'll start seeing your Prometheus alerts in Keep. A Provider can either push alerts into Keep, or Keep can pull alerts from the Provider. #### Push alerts to Keep (Manual) You can configure your alert source to push alerts into Keep. For example, consider Prometheus. If you want to push alerts from Prometheus to Keep, you'll need to configure Prometheus Alertmanager to send the alerts to '[https://api.keephq.dev/alerts/event/prometheus](https://api.keephq.dev/alerts/event/prometheus)' using API key authentication. Each Provider implements Push mechanism and is documented under the specific Provider page. #### Push alerts to Keep (Automatic) In compatible tools, Keep can automatically integrate with the alerting policy of the source tool and add itself as an alert destination. You can learn more about Webhook Integration [here](/providers/overview). Please note that this will slightly modify your monitors/notification policy. ### Pull alerts by Keep Keep also integrates with the alert APIs of various tools and can automatically pull alerts. While pulling is easier to set up (requiring only credentials), pushing is preferable when automation is involved. ## Workflow Workflows consist of a list of [Steps](/workflows/overview#steps) and [Actions](/workflows/overview#actions). A workflow can be triggered in the following ways: * When an Alert is triggered. * In a predefined interval. * Manually. Workflows are commonly used to: 1. Enrich your alerts with more context. 2. Automate the response to alert. 3. Create multi-step alerts. ## API first Keep is an API-first platform, meaning that anything you can do via the UI can also be accomplished through the [API](https://api.keephq.dev/redoc) This gives you the flexibility to integrate Keep with your existing stack and to automate alert remediation and enrichment processes. # Push vs Pull alerts Source: https://docs.keephq.dev/overview/howdoeskeepgetmyalerts There are primarily two ways to get alerts into Keep:We strongly recommend using the push method for alerting, as pulling does not include a lot of the features, like workflow automation. It is mainly used for a quick way to get alerts into Keep and start exploring the value. ### Push When you connect a [Provider](/providers), Keep automatically instruments the tools to send alerts to Keep via webhook. As an example, when you connect Grafana, Keep will automatically create a new Webhook contact point in Grafana, and a new Notification Policy to send all alerts to Keep. You can configure which providers you want to push from by checking the `Install Webhook` checkbox in the provider settings.### Pull When you connect a [Provider](/providers), Keep will start pulling alerts from the tool automatically. Pulling interval is defined by the `KEEP_PULL_INTERVAL` environment variable and defaults to 7 days (in minutes) and can be completely turned off by using the `KEEP_PULL_DATA_ENABLED` environment variable. You can also configure which providers you want to pull from by checking the `Pulling Enabled` checkbox in the provider settings.
# Introduction Source: https://docs.keephq.dev/overview/introduction Keep is an open-source alert management and AIOps platform that is a swiss-knife for alerting, automation, and noise reduction.
Keep has a new playground! Visit the [Playground](https://playground.keephq.dev) to explore its powerful features, experiment with configurations, and test AIOps techniques in a sandbox environment. Once you're ready to start using Keep in your environment, head over to the [Platform](https://platform.keephq.dev) to set up your tenant and get started. Don't forget to join our [Slack community](https://slack.keephq.dev) for help and to share your feedback. ## What's AIOps? In simple words, AI for IT Operations (aka AIOps) is about automating repetitive tasks, reducing noise from monitoring tools, and helping teams overcome alert fatigue by turning overwhelming data into actionable insights. With AIOps, teams can eliminate noise, prioritize critical issues, and focus on solving real problems rather than constantly firefighting alerts. ## Why do we build Keep? Working with current tools such as BigPanda, Splunk ITSI, or ServiceNow ITOM, we identified a gap: * **No Open Source Solution:** We have Grafana for visualization and Prometheus for metrics, but nothing for AIOps. Keep fills this gap as the first open-source solution for AIOps. * **Not DevOps/SRE Friendly:** Current tools are enterprise-focused but not in a good way. If you're an SRE team lead or head of IT operations in a company with \~100 employees, the existing tools won't work for you. They're too expensive, and their UX requires a dedicated team just for setup and maintenance. Keep is enterprise-ready (scaling, SSO, etc.) but also designed for small teams that want to adopt AIOps practices. * **A "Post LLM Era" AIOps:** Existing tools were built in a different technical era. Keep is designed to leverage the advancements of the large language model (LLM) era, integrating AI more seamlessly into IT operations. ## Our Philosophy * **Easy to start** â Whether locally or on Kubernetes, we provide one-click solutions like `helm install` and `docker-compose` so you can quickly spin up Keep and start exploring its capabilities. * **Easy to extend** â Keep is designed with extensibility in mind, making it straightforward to add new integrations or functionality to meet your specific needs. * **Easy to deploy** â Every aspect of Keep can be provisioned as code, enabling seamless automation of deployments and integration into your CI/CD pipelines. * **Easy to collaborate** â As an open-source project, we truly believe in the power of community and collaboration. We actively listen to user feedback and strive to continuously improve Keep based on the needs and insights of our users. ## Our Vision Keep is built so every team can benefit from AIOps. Whether you're a small team looking for a Kubernetes-local single pane of glass for your Prometheus alerts, or an enterprise with dozens of tools generating alerts and needing to sync with your ServiceNow tickets, Keep is for you. Our vision is to democratize AIOps, making it accessible and practical for teams of all sizes. ## What you should read next * [Key Concepts](/overview/glossary): Understand the foundational ideas behind Keep. * [Use Cases](/overview/usecases): Learn how Keep can solve specific IT operations challenges. * [Playground](/overview/playground): Explore Keep's playground. # Maintenance Windows Source: https://docs.keephq.dev/overview/maintenance-windows Keep's Maintenance Windows feature provides a critical mechanism for managing alert noise during scheduled maintenance periods or other planned events. By defining Maintenance Window rules, users can suppress alerts that are irrelevant during these times, ensuring that only actionable alerts reach the operations team.## Introduction In dynamic IT environments, it's common to have periods where certain alerts are expected and should not trigger incident responses. Keep's Maintenance Windows feature allows users to define specific rules that temporarily suppress alerts based on various conditions, such as time windows or alert attributes. This helps prevent unnecessary alert fatigue and ensures that teams can focus on critical issues. ## How It Works 1. **Maintenance Window Rule Definition**: Users define Maintenance Window rules specifying the conditions under which alerts should be suppressed. 2. **Condition Specification**: A CEL (Common Expression Language) query is associated with each Maintenance Window rule to define the conditions for suppression. 3. **Time Window Configuration**: Maintenance Window rules can be set for specific start and end times, or based on a relative duration. 4. **Alert Suppression**: During the active period of a Maintenance Window rule, any alerts matching the defined conditions are either suppressed and **not shown in alerts feed** or shown in the feed in suppressed status (**this is configurable**). ## Practical Example Suppose your team schedules a database upgrade that could trigger numerous non-critical alerts. You can create a Maintenance Window rule that suppresses alerts from the database service during the upgrade window. This ensures that your operations team isn't overwhelmed by non-actionable alerts, allowing them to focus on more critical issues. ## Core Concepts * **Maintenance Window Rules**: Configurations that define when and which alerts should be suppressed based on time windows and conditions. * **CEL Query**: A query language used to specify the conditions under which alerts should be suppressed. For example, a CEL query might suppress alerts where the source is a specific service during a maintenance window. * **Time Window**: The specific start and end times or relative duration during which the Maintenance Window rule is active. * **Alert Suppression**: The process of ignoring alerts that match the Maintenance Window rule's conditions during the specified time window. ## Status-Based Filtering in Maintenance Windows In Keep, certain alert statuses are automatically ignored by Maintenance Window rules. Specifically, alerts with the statuses RESOLVED and ACKNOWLEDGED are not suppressed by Maintenance Window rules. This is intentional to ensure that resolving alerts can still be processed and appropriately close or update active incidents. ### Why Are Some Statuses Ignored? ⢠RESOLVED Alerts: These alerts indicate that an issue has been resolved. By allowing these alerts to bypass Maintenance Window rules, Keep ensures that any active incidents related to the alert can be properly closed, maintaining the integrity of the alert lifecycle. ⢠ACKNOWLEDGED Alerts: These alerts have been acknowledged by an operator, signaling that they are being addressed. Ignoring these alerts in Maintenance Windows ensures that operators can track the progress of incidents and take necessary actions without interference. By excluding these statuses from Maintenance Window suppression, Keep allows for the continuous and accurate management of alerts, even during Maintenance Window periods, ensuring that resolution processes are not disrupted. ## Creating a Maintenance Window Rule To create a Maintenance Window rule:
1. **Define the Maintenance Window Name and Description**: Provide a name and optional description for the Maintenance Window rule to easily identify its purpose. 2. **Specify the CEL Query**: Use CEL to define the conditions under which alerts should be suppressed (e.g., `source == "database"`). 3. **Set the Time Window**: Choose a specific start and end time, or define a relative duration for the Maintenance Window. 4. **Enable the Rule**: Decide whether the rule should be active immediately or scheduled for future use. ## Best Practices * **Plan Maintenance Windows in Advance**: Schedule Maintenance Window periods in advance for known maintenance windows to prevent unnecessary alerts. * **Use Specific Conditions**: Define precise CEL queries to ensure only the intended alerts are suppressed. * **Review and Update Maintenance Windows**: Regularly review active Maintenance Window rules to ensure they are still relevant and adjust them as necessary. ## Strategies In order to handle the alerts during Maintenance Windows, Keep provides some Strategies to handle how these alerts are treated: ### 1. Default The default behaviour of Maintenance Windows is to **Suppressed** alerts that match the defined conditions. ### 2. Recover status This strategy relies on the following premise:
An alert received inside the Maintenance Window must be inhibited and once the Maintenance Window is over, the alert must recover its previous flow. The following actions will therefore be taken with a new alert: * When an alert is received, it will be checked against the Maintenance Window rules. * If the alert matches any Maintenance Window rule, its status will be set to **Maintenance**. * Workflows and Incidents handling are skipped. Every WATCHER\_LAPSED\_TIME seconds, the watcher will check whether there is any active Maintenance Window for every alert with a Maintenance status. If so, the following actions will be taken: * The alert will swap its status, and previous status. * Workflows, Incidents handling, Pusher and Presets notifications will be launched in the same way as a new alert. #### 2.1 What is an expired Maintenance Window? For a maintenance window to be considered expired, the following conditions must be met: * The **End Time** must be earlier than the current time. * The **Enabled** flag must be set to **False**. #### 2.2 What are the specific conditions to use the Recover Status Strategy? * Set **MAINTENANCE\_WINDOW\_STRATEGY** environment variable to **recover\_previous\_status**. * "Alerts will show in suppressed status" option must be set to **True** in the Maintenance Window rule configuration. * **Enabled** flag must be set to **True** in the Maintenance Window rule configuration. # Playground Source: https://docs.keephq.dev/overview/playground Dive into Keep's [sandbox environment](https://playground.keephq.dev) to experience the full range of its AIOps capabilities.Use Keep's [playground](https://playground.keephq.dev) to explore, experiment, and understand how Keep streamlines operations and reduces noise, enabling you to gain clarity and control over your IT ecosystem. What to look at: * [Alerts](#alerts) * [Incidents](#incidents) * [Providers](#providers) * [Workflows](#workflows) * [AIOps Techniques](#aiops-techniques) ## Alerts Get a single pane of glass view for all your alerts with customizable presets. Use CEL (Common Expression Language) syntax for precise filtering, configure the alerts table layout to match your workflow, and explore facets for quick insights into alert patterns and metrics. ## Incidents Examine incidents in detail, including their associated alerts and timelines. Test correlation logic and mapping configurations that group related alerts into incidents, and validate your suppression or resolution strategies. ## Providers Integrate with external data sources or alert providers like Prometheus, Datadog, or GCP Monitoring. Configure and test mappings to ensure proper ingestion and normalization of data from various sources into Keep's unified schema. ## Workflows Build and test automated workflows to manage alerts and incidents with precision. Experiment with both an intuitive UI builder and advanced scripting capabilities to trigger actions, notifications, or external integrations based on dynamic conditions. ## AIOps Techniques Test and refine deduplication, enrichment, mapping, and extraction rules to optimize alert handling. Experiment with these techniques to transform raw alerts into actionable data and reduce noise effectively. # Service Topology Source: https://docs.keephq.dev/overview/servicetopology The Service Topology feature in Keep provides a visual representation of your service dependencies, allowing you to quickly understand the relationships between various components in your system. By mapping services and their interactions, you can gain insights into how issues in one service may impact others, enabling faster root-cause analysis and more effective incident resolution.
## Key Concepts * **Nodes**: Represent individual services, applications, or infrastructure components. * **Edges**: Show the dependencies and interactions between nodes. ## Supported Providers
## Features ### Visualizing Dependencies The service topology graph helps you: * Identify critical dependencies between services. * Understand how failures in one service propagate through the system. * Highlight single points of failure or bottlenecks. ### Real-Time Health Indicators Nodes and edges are enriched with health indicators derived from alerts and metrics. This allows you to: * Quickly spot issues in your architecture. * Prioritize incident resolution based on affected dependencies. ### Filter and Focus Use filters to focus on specific parts of the topology, such as: * A particular environment (e.g., production, staging). * A service group (e.g., all database-related services). * Alerts of a specific severity or type. ### Incident Integration Service topology integrates seamlessly with Keep's incident management features. When an incident is triggered, you can: * View the affected nodes and their dependencies directly on the topology graph. * Analyze how alerts related to the incident are propagating through the system. * Use this information to guide remediation efforts. ### Manually adding Topology This features allows you to create and manipulate your services and the dependencies between them. * Click on `+ Add Node` to add a new service to your map. } /> } /> } /> } /> } /> } /> * Field `Service` and `Display Name` are mandatory fields and rest of the fields are optional. (Note: `Tags` accepts CSV) * Click `Save`, this adds a new service to your map.
* You can add multiple such services and add connections/dependencies between them. * You can select on or more manually created services (holding Ctrl select multiple services), and delete them all at once using the `Delete Services` option.
* You can click any service and use `Update Service` button to update a service.
* To add a dependency drag from any service's right handle (source) to another service's left handle (target).
* You can remove a dependency by dragging away a dependency from it's target handle and leave it.
* To add a protocol to your dependency: click the dependency > Click `Edit Dependency` > Fill in the protocol in the popup > Click `OK`.
![]()
![]()
![]()
* You can only manipulate the services that are created manually. * Creating or updating a dependency is only possible between two manually created services. ### Importing and Exporting topology You can Import/Export topology data: services + applications + dependencies to/from keep using this feature. * Click the menu item to get the Import/Export option.* Data is Imported and Exported in YAML Format. * Below is a sample YAML: ```yaml theme={null} applications: - description: 'A sample application for monitoring and management' id: 398e7b9a-bc0f-487a-b6d7-049a16e500e4 name: monitoring-app repository: 'https://github.com/sample-org/monitoring-app' services: - 556041 - 556061 dependencies: - depends_on_service_id: 556051 id: 6219 protocol: HTTP service_id: 556041 - depends_on_service_id: 556081 id: 6220 protocol: HTTPS service_id: 556051 - depends_on_service_id: 556041 id: 6221 protocol: GRPC service_id: 556061 - depends_on_service_id: 556071 id: 6222 protocol: TCP service_id: 556061 - depends_on_service_id: 556051 id: 6223 protocol: UDP service_id: 556071 services: - id: 556041 display_name: Auth Service service: PAH3VXB category: Backend description: 'Handles user authentication and session management' email: 'auth-team@example.com' environment: production ip_address: '192.168.1.10' is_manual: false mac_address: '00:1A:2B:3C:4D:5E' manufacturer: 'Dell' namespace: 'auth' repository: 'https://github.com/sample-org/auth-service' slack: '#auth-alerts' source_provider_id: ebe062c4814f483cb2c5d556fbb9395c tags: ['authentication', 'security'] team: 'Auth Team' - id: 556051 display_name: Log Aggregator service: PFRKUOO category: Monitoring description: 'Main service responsible for collecting and aggregating logs' email: 'logs-team@example.com' environment: staging ip_address: '192.168.1.11' is_manual: false mac_address: '00:1A:2B:3C:4D:5F' manufacturer: 'HP' namespace: 'logs' repository: 'https://github.com/sample-org/log-aggregator' slack: '#logs-alerts' source_provider_id: ebe062c4814f483cb2c5d556fbb9395c tags: ['monitoring', 'logging'] team: 'Logs Team' - id: 556061 display_name: Core API service: PWKXGRK category: API description: 'Main business logic service for processing user data' email: 'backend-team@example.com' environment: production ip_address: '192.168.1.12' is_manual: false mac_address: '00:1A:2B:3C:4D:60' manufacturer: 'Cisco' namespace: 'api' repository: 'https://github.com/sample-org/core-api' slack: '#backend-alerts' source_provider_id: ebe062c4814f483cb2c5d556fbb9395c tags: ['api', 'backend'] team: 'Backend Team' - id: 556071 display_name: Database Service service: PFEIHAU category: Storage description: 'Handles database operations and caching' email: 'db-team@example.com' environment: production ip_address: '192.168.1.13' is_manual: false mac_address: '00:1A:2B:3C:4D:61' manufacturer: 'IBM' namespace: 'db' repository: 'https://github.com/sample-org/database-service' slack: '#db-alerts' source_provider_id: ebe062c4814f483cb2c5d556fbb9395c tags: ['database', 'storage'] team: 'Database Team' - id: 556081 display_name: Service Mesh service: PC8HHE7 category: Infrastructure description: 'Handles networking and service discovery' email: 'infra-team@example.com' environment: production ip_address: '192.168.1.14' is_manual: false mac_address: '00:1A:2B:3C:4D:62' manufacturer: 'Juniper' namespace: 'mesh' repository: 'https://github.com/sample-org/service-mesh' slack: '#infra-alerts' source_provider_id: ebe062c4814f483cb2c5d556fbb9395c tags: ['networking', 'mesh'] team: 'Infra Team' ``` # Support Source: https://docs.keephq.dev/overview/support ## Overview You can use the following methods to ask for support/help with anything related with Keep:
# Use Cases Source: https://docs.keephq.dev/overview/usecases Keep is a versatile platform that adapts to the needs of various roles and scenarios in IT operations. Whether you're a DevOps engineer managing infrastructure, an SRE ensuring uptime, or a NOC team lead handling alert noise, Keep provides tailored solutions. The platform also addresses a broad range of use cases, from centralizing alert management to automating responses and ensuring SLA compliance. Explore how Keep can simplify your workflows and improve operational efficiency, no matter your role or challenge. *** ## By Role ### For DevOps Keep enables DevOps engineers to centralize alert management, automate responses, and fine-tune alert configurations. With integrations to tools like Prometheus and Grafana, you can streamline monitoring workflows, reduce noise, and focus on delivering reliable infrastructure. ### For SREs Site Reliability Engineers can benefit from Keepâs ability to correlate alerts across systems, enrich them with contextual data, and automate remediation steps. Use Keep to maintain service uptime and reduce the burden of on-call duties by ensuring actionable alerts. ### For Software Engineers Software engineers can use Keep to understand the context of alerts that impact their services. By integrating alert enrichment and automated workflows, they can quickly identify and resolve issues without sifting through raw logs or multiple monitoring tools. ### For Engineering Managers Keep helps engineering managers track and manage the overall health of their systems. Gain insights into alert trends, manage noise reduction strategies, and ensure your teams focus on critical issues with Keepâs centralized dashboard and analytics. ### For NOC Team Leads Keep empowers NOC teams with advanced alert visualization, centralized management, and actionable insights. Use features like throttling, muting, and faceted search to streamline incident handling and minimize alert fatigue. ### For Heads of IT Operations For heads of IT operations, Keep provides an enterprise-ready yet flexible solution for managing complex environments. Gain visibility into system health, ensure compliance with SLAs, and scale your operations with Keepâs automation and alert correlation capabilities. *** ## By Use Case ### Central Alert Management No more navigating between multiple Prometheus instances and dealing with per-region, per-account CloudWatch settings. By linking your alert-triggering tools to Keep, you gain a centralized dashboard for managing all your alerts. Review, throttle, mute, and fine-tune alerts from a single console. ### Alerts Enrichment Keep allows you to enrich alerts with additional context from observability tools, databases, and ticketing systems. Need enterprise-specific alert triggers or want to include extra details about customer impact? Keep makes it easy to augment alerts for better decision-making. ### Automate Alert Response Automate responses to common alerts, reducing the time spent on repetitive tasks. For example, confirm a 502 error on an endpoint with an additional query or check if an issue affects a low-priority customer before escalating it to your team. ### Multi-Environment Monitoring Centralize alerts across multiple environments, such as staging, production, and testing. Keep helps you manage environment-specific rules while providing a unified view of your system health. ### Noise Reduction Use deduplication, throttling, and muting to significantly reduce noise from excessive or redundant alerts. Keep ensures your teams are only notified of critical issues. ### SLA Compliance Track alert resolution times and ensure compliance with SLAs. Keepâs automation and reporting features enable you to monitor and meet contractual obligations seamlessly. ### Incident Correlation Correlate related alerts to identify the root cause of incidents quickly. Use Keepâs workflows and mapping rules to group alerts and provide actionable insights for resolution. ### Ticketing Integration Sync alerts with ticketing tools like Jira and ServiceNow. Automate ticket creation, track updates, and ensure seamless workflows between operations and development teams. *** # Workflows Source: https://docs.keephq.dev/overview/workflow-automation Workflow automation designed to transform how you manage alerts and incidents. It allows you to automate responses, integrate seamlessly with your existing tools, and build complex workflows tailored to your needs. With workflow automation, you can reduce manual effort, improve response times, and ensure consistent handling of recurring scenarios. You can use the [Keep Slack community](https://slack.keephq.dev) to get support. You can use [support@keephq.dev](mailto:support@keephq.dev) to send inquiries. This section provides an abstract overview of workflows in Keep. To dive deeper into creating and managing workflows, refer to the dedicated [Workflow Documentation](#workflow-documentation) and explore our [GitHub repository](https://github.com/keephq/keep/tree/main/examples/workflows) for ready-to-use examples. ## Why Workflow Automation is Core Every alert, incident, or integration can be part of a workflow. Whether itâs auto-creating tickets, sending Slack notifications, or enriching alerts with external data, workflows are central to making Keep a powerful and flexible tool for your IT operations. ## Explore Further ### 1. Detailed Workflow Documentation Explore [Workflow Documentation](#workflow-documentation) to learn: * How to define triggers, actions, and steps. * Best practices for designing efficient workflows. * Advanced use cases, such as conditional branching and multi-step automation. ### 2. Workflow Examples on GitHub Check out our [GitHub repository](https://github.com/keephq/keep/tree/main/examples/workflows) for: * Pre-built workflows ready to use in your environment. * Examples for common use cases, such as auto-remediation, alert enrichment, and multi-channel notifications. * Contributions from the community, showcasing innovative ways to use Keep workflows. *** Workflow automation is at the heart of Keepâs mission to make AIOps accessible and actionable. Use this as a starting point, and explore the rich resources available to master workflows and revolutionize your alert management. # Adding a new Provider Source: https://docs.keephq.dev/providers/adding-a-new-provider This guide explains how to create a new provider for Keep. Providers are integrations that allow Keep to interact with external services for alerting, querying data, managing incidents, or building topology maps. ## Table of contents * [Provider structure](#provider-structure) * [Step-by-step implementation](#step-by-step-implementation) * [Provider attributes](#provider-attributes) * [Abstract methods](#abstract-methods) * [Provider types and capabilities](#provider-types-and-capabilities) * [Authentication configuration](#authentication-configuration) * [Testing your provider](#testing-your-provider) * [Best practices](#best-practices) * [Common patterns](#common-patterns) * [Complete provider example](#complete-provider-example) * [Checklist](#checklist) ## Provider structure Each provider in Keep follows a specific structure: ``` keep/providers/ âââ yourservice_provider/ â âââ __init__.py â âââ yourservice_provider.py ``` **Important Notes:** * Keep's ProvidersFactory automatically discovers providers based on the directory naming convention (`*_provider`). * You don't need to register them explicitly - just follow the naming pattern. * The provider type is automatically extracted from the class name (for example, `ServiceNowProvider` â `servicenow`). ## Step-by-step implementation ### 1. Create provider directory Create a new directory under `keep/providers/` with the pattern `{service}_provider`: ```bash theme={null} mkdir keep/providers/yourservice_provider ``` ### 2. Create the provider module Create `yourservice_provider.py` with the following structure: ```python theme={null} """ YourService Provider is a class that allows integration with YourService. """ import dataclasses import json import os from typing import Optional, List, Dict, Any import pydantic import requests from keep.api.models.alert import AlertDto, AlertSeverity, AlertStatus from keep.contextmanager.contextmanager import ContextManager from keep.providers.base.base_provider import BaseProvider from keep.providers.models.provider_config import ProviderConfig, ProviderScope from keep.providers.models.provider_method import ProviderMethod @pydantic.dataclasses.dataclass class YourserviceProviderAuthConfig: """YourService authentication configuration.""" api_endpoint: str = dataclasses.field( metadata={ "required": True, "description": "YourService API endpoint URL", "validation": "https_url", # Optional: validates HTTPS URLs } ) api_key: str = dataclasses.field( metadata={ "required": True, "description": "API key for YourService", "sensitive": True, # Marks field as sensitive in UI } ) region: str = dataclasses.field( default="us-east-1", metadata={ "required": False, "description": "YourService region", "type": "select", "options": ["us-east-1", "eu-west-1", "ap-south-1"], } ) class YourserviceProvider(BaseProvider): """Send alerts and fetch data from YourService.""" # Required: Display name shown in UI PROVIDER_DISPLAY_NAME = "YourService" # Required: Categories for provider classification PROVIDER_CATEGORY = ["Monitoring"] # Optional: Tags for searchability PROVIDER_TAGS = ["alert", "data"] # Optional: Define required scopes/permissions PROVIDER_SCOPES = [ ProviderScope( name="read:alerts", description="Read alerts from YourService", mandatory=True, documentation_url="https://docs.yourservice.com/permissions", alias="Read Alerts", ), ProviderScope( name="write:alerts", description="Create and update alerts", mandatory=False, mandatory_for_webhook=True, # Required only for webhook setup ), ] # Optional: OAuth2 URL (MUST be set as class attribute, not in __init__) OAUTH2_URL = None # Or os.environ.get("YOURSERVICE_OAUTH2_URL") def __init__( self, context_manager: ContextManager, provider_id: str, config: ProviderConfig ): super().__init__(context_manager, provider_id, config) # Initialize any client libraries or state here # Note: Logger is automatically available as self.logger # Context manager provides access to: # - self.context_manager.tenant_id: Current tenant ID # - self.context_manager.workflow_id: Current workflow ID # - self.context_manager.workflow_execution_id: Current execution ID # - self.context_manager.get_full_context(): Full workflow context def validate_config(self): """ Validates required configuration for YourService provider. This is an abstract method that MUST be implemented. """ self.authentication_config = YourserviceProviderAuthConfig( **self.config.authentication ) def dispose(self): """ Cleanup any resources when provider is disposed. This is an abstract method that MUST be implemented, even if it just passes. """ pass ``` ### 3. Create the **init**.py File Create `keep/providers/yourservice_provider/__init__.py`: ```python theme={null} from keep.providers.yourservice_provider.yourservice_provider import ( YourserviceProvider, YourserviceProviderAuthConfig ) __all__ = ["YourserviceProvider", "YourserviceProviderAuthConfig"] ``` ### 4. Add provider documentation Create `docs/providers/documentation/yourservice-provider.mdx` following the documentation template.
Provider configuration fields are automatically documented through auto-generated snippets. Keep generates the snippet files in `docs/snippets/providers/` from the provider's AuthConfig metadata and includes them in the documentation automatically. ## Provider architecture ### Abstract methods Every provider must implement these two abstract methods from BaseProvider: 1. **`validate_config(self)`** - Validates and processes the provider configuration 2. **`dispose(self)`** - Clean up resources when the provider is disposed of ### Provider capabilities Providers expose capabilities through standard methods: * **`_notify(**kwargs)`** - Send notifications or alerts * **`_query(**kwargs)`** - Query data from the provider * **`_get_alerts()`** - Fetch alerts for monitoring * **`setup_webhook(...)`** - Configure webhook endpoints * **`validate_scopes()`** - Check provider permissions * **`expose()`** - Return parameters calculated during execution for use in workflowsThe public methods `notify()` and `query()` wrap the private implementations (`_notify()` and `_query()`) with additional capabilities like enrichment and error handling. Always implement the private methods. ### Provider discovery Keep automatically discovers providers based on naming conventions: * Location: `keep/providers/` directory * Directory naming: Must end with `_provider` (for example, `slack_provider`) * Main file: Must match directory name with `.py` extension (for example, `slack_provider.py`) * No explicit registration needed - just follow the naming convention ### Implementation examples #### Validate\_config() ```python theme={null} def validate_config(self): """Validate and process provider configuration.""" self.authentication_config = YourserviceProviderAuthConfig( **self.config.authentication ) ``` #### Dispose() ```python theme={null} def dispose(self): """Cleanup any resources.""" # Close connections, cleanup clients, etc. # Can just pass if no cleanup needed pass ``` ### Provider type extraction The provider type is automatically extracted from your class name: * `YourserviceProvider` â `yourservice` * `ServiceNowProvider` â `service.now` * `DatadogProvider` â `datadog` This happens via the `_extract_type()` method in BaseProvider. ### Provider attributes Providers should define the following class attributes: * `PROVIDER_DISPLAY_NAME`: String used for UI display (for example, "Slack") * `PROVIDER_CATEGORY`: List of categories from the allowed values (see Provider Categories section) * `PROVIDER_COMING_SOON`: Boolean flag to mark providers as not ready (default: False) * `WEBHOOK_INSTALLATION_REQUIRED`: Boolean to make webhook setup mandatory in UI (default: False) * `PROVIDER_TAGS`: List of tags describing provider capabilities (for example, \["alert", "messaging"]) * `PROVIDER_SCOPES`: List of ProviderScope objects defining required permissions * `PROVIDER_METHODS`: List of ProviderMethod objects for additional capabilities (see [Provider Methods](/providers/provider-methods)) * `FINGERPRINT_FIELDS`: List of field names used to calculate alert fingerprints * `OAUTH2_URL`: OAuth 2.0 authorization URL if provider supports OAuth 2.0 authentication ### Provider categories Providers must specify one or more categories from the following list: ```python theme={null} PROVIDER_CATEGORY: list[Literal[ "AI", "Monitoring", "Incident Management", "Cloud Infrastructure", "Ticketing", "Identity", "Developer Tools", "Database", "Identity and Access Management", "Security", "Collaboration", "Organizational Tools", "CRM", "Queues", "Orchestration", "Others" ]] ``` ### Provider tags Valid options for `PROVIDER_TAGS`: * `"alert"` - Provider handles alerts * `"ticketing"` - Provider manages tickets * `"messaging"` - Provider sends messages * `"data"` - Provider queries data * `"queue"` - Provider manages queues * `"topology"` - Provider provides topology data * `"incident"` - Provider manages incidents ### Provider scope ```python theme={null} @dataclass class ProviderScope: """ Provider scope model. Args: name (str): The name of the scope. description (Optional[str]): The description of the scope. mandatory (bool): Whether the scope is mandatory. mandatory_for_webhook (bool): Whether the scope is mandatory for webhook auto installation. documentation_url (Optional[str]): The documentation url of the scope. alias (Optional[str]): Another alias of the scope. """ name: str description: Optional[str] = None mandatory: bool = False mandatory_for_webhook: bool = False documentation_url: Optional[str] = None alias: Optional[str] = None ``` ### Provider config ```python theme={null} @dataclass class ProviderConfig: """ Provider configuration model. Args: description (Optional[str]): The description of the provider. authentication (dict): The configuration for the provider. """ authentication: Optional[dict] name: Optional[str] = None description: Optional[str] = None def __post_init__(self): if not self.authentication: return for key, value in self.authentication.items(): if ( isinstance(value, str) and value.startswith("{{") and value.endswith("}}") ): self.authentication[key] = chevron.render(value, {"env": os.environ}) ``` ### Base provider ```python theme={null} """ Base class for all providers. """ class BaseProvider(metaclass=abc.ABCMeta): OAUTH2_URL = None PROVIDER_SCOPES: list[ProviderScope] = [] PROVIDER_METHODS: list[ProviderMethod] = [] FINGERPRINT_FIELDS: list[str] = [] PROVIDER_TAGS: list[ Literal["alert", "ticketing", "messaging", "data", "queue", "topology", "incident"] ] = [] PROVIDER_DISPLAY_NAME: str = None PROVIDER_CATEGORY: list[str] = [] PROVIDER_COMING_SOON: bool = False WEBHOOK_INSTALLATION_REQUIRED: bool = False def __init__( self, context_manager: ContextManager, provider_id: str, config: ProviderConfig, webhook_template: Optional[str] = None, webhook_description: Optional[str] = None, webhook_markdown: Optional[str] = None, provider_description: Optional[str] = None, ): """ Initialize a provider. Args: provider_id (str): The provider id. **kwargs: Provider configuration loaded from the provider yaml file. """ self.provider_id = provider_id self.config = config self.webhook_template = webhook_template self.webhook_description = webhook_description self.provider_description = provider_description self.context_manager = context_manager self.logger = context_manager.get_logger() self.validate_config() self.logger.debug( "Base provider initalized", extra={"provider": self.__class__.__name__} ) self.provider_type = self._extract_type() self.results = [] # tb: we can have this overriden by customer configuration, when initializing the provider self.fingerprint_fields = self.FINGERPRINT_FIELDS def _extract_type(self): """ Extract the provider type from the provider class name. Returns: str: The provider type. """ name = self.__class__.__name__ name_without_provider = name.replace("Provider", "") name_with_spaces = ( re.sub("([A-Z])", r" \1", name_without_provider).lower().strip() ) return name_with_spaces.replace(" ", ".") @abc.abstractmethod def dispose(self): """ Dispose of the provider. """ raise NotImplementedError("dispose() method not implemented") @abc.abstractmethod def validate_config(self): """ Validate provider configuration. """ raise NotImplementedError("validate_config() method not implemented") def validate_scopes(self) -> dict[str, bool | str]: """ Validate provider scopes. Returns: dict: where key is the scope name and value is whether the scope is valid (True boolean) or string with error message. """ return {} def notify(self, **kwargs): """ Output alert message. Args: **kwargs (dict): The provider context (with statement) """ # trigger the provider results = self._notify(**kwargs) self.results.append(results) # if the alert should be enriched, enrich it enrich_alert = kwargs.get("enrich_alert", []) if not enrich_alert or not results: return results if results else None self._enrich(enrich_alert, results) return results def _enrich(self, enrichments, results, audit_enabled=True): """ Enrich alert or incident with provider specific data. This method replaces the deprecated _enrich_alert method and supports both alert and incident enrichment. Args: enrichments: List of enrichment configurations results: Results from the provider action audit_enabled: Whether to audit the enrichment operation (default: True) """ self.logger.debug("Extracting the fingerprint from the alert") if "fingerprint" in results: fingerprint = results["fingerprint"] elif self.context_manager.foreach_context.get("value", {}): # TODO: if it's zipped, we need to extract the fingerprint from the zip (i.e. multiple foreach) fingerprint = self.context_manager.foreach_context.get("value", {}).get( "fingerprint" ) # else, if we are in an event context, use the event fingerprint elif self.context_manager.event_context: # TODO: map all cases event_context is dict and update them to the DTO # and remove this if statement if isinstance(self.context_manager.event_context, dict): fingerprint = self.context_manager.event_context.get("fingerprint") # Alert DTO else: fingerprint = self.context_manager.event_context.fingerprint else: fingerprint = None if not fingerprint: self.logger.error( "No fingerprint found for alert enrichment", extra={"provider": self.provider_id}, ) raise Exception("No fingerprint found for alert enrichment") self.logger.debug("Fingerprint extracted", extra={"fingerprint": fingerprint}) _enrichments = {} # enrich only the requested fields for enrichment in enrichments: try: if enrichment["value"].startswith("results."): val = enrichment["value"].replace("results.", "") parts = val.split(".") r = copy.copy(results) for part in parts: r = r[part] _enrichments[enrichment["key"]] = r else: _enrichments[enrichment["key"]] = enrichment["value"] except Exception: self.logger.error( f"Failed to enrich alert - enrichment: {enrichment}", extra={"fingerprint": fingerprint, "provider": self.provider_id}, ) continue self.logger.info("Enriching alert", extra={"fingerprint": fingerprint}) try: enrich_alert(self.context_manager.tenant_id, fingerprint, _enrichments) except Exception as e: self.logger.error( "Failed to enrich alert in db", extra={"fingerprint": fingerprint, "provider": self.provider_id}, ) raise e self.logger.info("Alert enriched", extra={"fingerprint": fingerprint}) def _notify(self, **kwargs): """ Output alert message. Args: **kwargs (dict): The provider context (with statement) """ raise NotImplementedError("notify() method not implemented") def _query(self, **kwargs: dict): """ Query the provider using the given query Args: kwargs (dict): The provider context (with statement) Raises: NotImplementedError: _description_ """ raise NotImplementedError("query() method not implemented") def query(self, **kwargs: dict): # just run the query results = self._query(**kwargs) # now add the type of the results to the global context if results and isinstance(results, list): self.context_manager.dependencies.add(results[0].__class__) elif results: self.context_manager.dependencies.add(results.__class__) enrich_alert = kwargs.get("enrich_alert", []) if enrich_alert: self._enrich(enrich_alert, results) # and return the results return results @staticmethod def _format_alert( event: dict | list[dict], provider_instance: "BaseProvider" = None ) -> AlertDto | list[AlertDto]: """ Format incoming event(s) into AlertDto object(s). Args: event: Single event dict or list of event dicts provider_instance: Optional provider instance for context Returns: AlertDto or list of AlertDto objects """ raise NotImplementedError("format_alert() method not implemented") @classmethod def format_alert(cls, event: dict) -> AlertDto | list[AlertDto]: logger = logging.getLogger(__name__) logger.debug("Formatting alert") formatted_alert = cls._format_alert(event) logger.debug("Alert formatted") return formatted_alert @staticmethod def get_alert_fingerprint(alert: AlertDto, fingerprint_fields: list = []) -> str: """ Get the fingerprint of an alert. Args: event (AlertDto): The alert to get the fingerprint of. fingerprint_fields (list, optional): The fields we calculate the fingerprint upon. Defaults to []. Returns: str: hexdigest of the fingerprint or the event.name if no fingerprint_fields were given. """ if not fingerprint_fields: return alert.name fingerprint = hashlib.sha256() event_dict = alert.dict() for fingerprint_field in fingerprint_fields: fingerprint_field_value = event_dict.get(fingerprint_field, None) if isinstance(fingerprint_field_value, (list, dict)): fingerprint_field_value = json.dumps(fingerprint_field_value) if fingerprint_field_value: fingerprint.update(str(fingerprint_field_value).encode()) return fingerprint.hexdigest() def get_alerts_configuration(self, alert_id: Optional[str] = None): """ Get configuration of alerts from the provider. Args: alert_id (Optional[str], optional): If given, gets a specific alert by id. Defaults to None. """ # todo: we'd want to have a common alert model for all providers (also for consistent output from GPT) raise NotImplementedError("get_alerts() method not implemented") def deploy_alert(self, alert: dict, alert_id: Optional[str] = None): """ Deploy an alert to the provider. Args: alert (dict): The alert to deploy. alert_id (Optional[str], optional): If given, deploys a specific alert by id. Defaults to None. """ raise NotImplementedError("deploy_alert() method not implemented") def _get_alerts(self) -> list[AlertDto]: """ Get alerts from the provider. """ raise NotImplementedError("get_alerts() method not implemented") def get_alerts(self) -> list[AlertDto]: """ Get alerts from the provider. """ with tracer.start_as_current_span(f"{self.__class__.__name__}-get_alerts"): alerts = self._get_alerts() # enrich alerts with provider id for alert in alerts: alert.providerId = self.provider_id return alerts def get_alerts_by_fingerprint(self, tenant_id: str) -> dict[str, list[AlertDto]]: """ Get alerts from the provider grouped by fingerprint, sorted by lastReceived. Returns: dict[str, list[AlertDto]]: A dict of alerts grouped by fingerprint, sorted by lastReceived. """ alerts = self.get_alerts() if not alerts: return {} # get alerts, group by fingerprint and sort them by lastReceived with tracer.start_as_current_span(f"{self.__class__.__name__}-get_last_alerts"): get_attr = operator.attrgetter("fingerprint") grouped_alerts = { fingerprint: list(alerts) for fingerprint, alerts in itertools.groupby( sorted( alerts, key=get_attr, ), get_attr, ) } # enrich alerts with tracer.start_as_current_span(f"{self.__class__.__name__}-enrich_alerts"): pulled_alerts_enrichments = get_enrichments( tenant_id=tenant_id, fingerprints=grouped_alerts.keys(), ) for alert_enrichment in pulled_alerts_enrichments: if alert_enrichment: alerts_to_enrich = grouped_alerts.get( alert_enrichment.alert_fingerprint ) for alert_to_enrich in alerts_to_enrich: parse_and_enrich_deleted_and_assignees( alert_to_enrich, alert_enrichment.enrichments ) for enrichment in alert_enrichment.enrichments: # set the enrichment setattr( alert_to_enrich, enrichment, alert_enrichment.enrichments[enrichment], ) return grouped_alerts def setup_webhook( self, tenant_id: str, keep_api_url: str, api_key: str, setup_alerts: bool = True ) -> dict | None: """ Setup a webhook for the provider. Args: tenant_id (str): The tenant ID keep_api_url (str): The Keep API URL for webhook callbacks api_key (str): The API key for authentication setup_alerts (bool, optional): Whether to setup alerts. Defaults to True. Returns: dict | None: Dictionary of secrets to be saved if any, None otherwise Raises: NotImplementedError: If not implemented by the provider """ raise NotImplementedError("setup_webhook() method not implemented") @staticmethod def get_alert_schema() -> dict: """ Get the alert schema description for the provider. e.g. How to define an alert for the provider that can be pushed via the API. Returns: str: The alert format description. """ raise NotImplementedError( "get_alert_format_description() method not implemented" ) @staticmethod def oauth2_logic(**payload) -> dict: """ Logic for oauth2 authentication. For example, in Slack oauth2, we need to get the code from the payload and exchange it for a token. return: dict: The secrets to be saved as the provider configuration. (e.g. the Slack access token) """ raise NotImplementedError("oauth2_logic() method not implemented") @staticmethod def parse_event_raw_body(raw_body: bytes | dict) -> dict: """ Parse the raw body of an event and create an ingestible dict from it. For instance, in parseable, the "event" is just a string > b'Alert: Server side error triggered on teststream1\nMessage: server reporting status as 500\nFailing Condition: status column equal to abcd, 2 times' and we want to return an object > {'alert': 'Server side error triggered on teststream1', 'message': 'server reporting status as 500', 'failing_condition': 'status column equal to abcd, 2 times'} If this method is not implemented for a provider, it should convert the raw body to a dict. Args: raw_body (bytes | dict): The raw body of the incoming event (can be bytes or dict) Returns: dict: Ingestible event dictionary """ if isinstance(raw_body, dict): return raw_body return raw_body def get_logs(self, limit: int = 5) -> list: """ Get logs from the provider. Args: limit (int): The number of logs to get. """ raise NotImplementedError("get_logs() method not implemented") def expose(self): """Expose parameters that were calculated during query time. Each provider can expose parameters that were calculated during query time. E.g. parameters that were supplied by the user and were rendered by the provider. A concrete example is the "_from" and "to" of the Datadog Provider which are calculated during execution. """ # TODO - implement dynamically using decorators and return {} def start_consume(self): """Get the consumer for the provider. should be implemented by the provider if it has a consumer. for an example, see Kafka Provider Returns: Consumer: The consumer for the provider. """ return def status(self) -> bool: """Return the status of the provider. Returns: bool: The status of the provider. """ return { "status": "should be implemented by the provider if it has a consumer", "error": "", } @property def is_consumer(self) -> bool: """Return consumer if the inherited class has a start_consume method. Returns: bool: _description_ """ return self.start_consume.__qualname__ != "BaseProvider.start_consume" def _push_alert(self, alert: dict): """ Push an alert to the provider. Args: alert (dict): The alert to push. """ # if this is not a dict, try to convert it to a dict if not isinstance(alert, dict): try: alert_data = json.loads(alert) except Exception: alert_data = alert_data else: alert_data = alert # if this is still not a dict, we can't push it if not isinstance(alert_data, dict): self.logger.warning( "We currently support only alert represented as a dict, dismissing alert", extra={"alert": alert}, ) return # now try to build the alert model # we will have a lot of default values here to support all providers and all cases, the # way to fine tune those would be to use the provider specific model or enforce that the event from the queue will be casted into the fields alert_model = AlertDto( id=alert_data.get("id", str(uuid.uuid4())), name=alert_data.get("name", "alert-from-event-queue"), status=alert_data.get("status", AlertStatus.FIRING), lastReceived=alert_data.get("lastReceived", datetime.datetime.now()), environment=alert_data.get("environment", "alert-from-event-queue"), isDuplicate=alert_data.get("isDuplicate", False), duplicateReason=alert_data.get("duplicateReason", None), service=alert_data.get("service", "alert-from-event-queue"), source=alert_data.get("source", [self.provider_type]), message=alert_data.get("message", "alert-from-event-queue"), description=alert_data.get("description", "alert-from-event-queue"), severity=alert_data.get("severity", AlertSeverity.INFO), pushed=alert_data.get("pushed", False), event_id=alert_data.get("event_id", str(uuid.uuid4())), url=alert_data.get("url", None), fingerprint=alert_data.get("fingerprint", None), ) # push the alert to the provider url = f'{os.environ["KEEP_API_URL"]}/alerts/event' headers = { "Content-Type": "application/json", "Accept": "application/json", "X-API-KEY": self.context_manager.api_key, } response = requests.post(url, json=alert_model.dict(), headers=headers) try: response.raise_for_status() self.logger.info("Alert pushed successfully") except Exception: self.logger.error( f"Failed to push alert to {self.provider_id}: {response.content}" ) ``` ## Provider types and capabilities ### Base provider types Keep supports several base provider types, each with specific capabilities: 1. **BaseProvider** (`keep/providers/base/base_provider.py`) * Basic provider capabilities * Methods: `_notify()`, `_query()`, `_get_alerts()` * Use for: General integrations 2. **BaseTopologyProvider** (`keep/providers/base/base_provider.py`) * Extends BaseProvider * Methods: `pull_topology()` * Use for: Services that provide infrastructure topology data * Example: Datadog Provider (`keep/providers/datadog_provider/datadog_provider.py`) 3. **BaseIncidentProvider** (`keep/providers/base/base_provider.py`) * Extends BaseProvider * Methods: `_get_incidents()`, `_format_incident()` (static), `format_incident()` (classmethod), `setup_incident_webhook()` * Use for: Incident management systems * Example: PagerDuty Provider (`keep/providers/pagerduty_provider/pagerduty_provider.py`) ### Common capabilities #### 1. Notification (`_notify`) Send alerts or messages to external services: ```python theme={null} def _notify(self, title: str, description: str = "", **kwargs) -> dict: # Implementation ``` #### 2. Query (`_query`) Fetch data from external services: ```python theme={null} def _query(self, query: str, **kwargs) -> list: # Implementation ``` #### 3. Alert Fetching (`_get_alerts`) Pull alerts for monitoring: ```python theme={null} def _get_alerts(self) -> List[AlertDto]: # Implementation ``` #### 4. Webhook support Handle incoming webhooks: ```python theme={null} @staticmethod def parse_event_raw_body(raw_body: bytes | str) -> dict: # Parse webhook payload @staticmethod def _format_alert(event: dict, provider_instance: "BaseProvider" = None) -> AlertDto | list[AlertDto]: # Format webhook events into alerts ``` #### 5. OAuth 2.0 support Handle OAuth 2.0 authentication: ```python theme={null} # IMPORTANT: Define OAUTH2_URL as a class attribute at the class level, NOT in __init__ class YourserviceProvider(BaseProvider): OAUTH2_URL = os.environ.get("YOURSERVICE_OAUTH2_URL") # Must be at class level @staticmethod def oauth2_logic(**payload) -> dict: # OAuth 2.0 implementation ``` #### 6. Consumer providers For providers that consume messages from queues or streams: ```python theme={null} def start_consume(self): """ Start consuming messages from the provider. This method is called when Keep starts the provider as a consumer. Implement long-running consumption logic here. """ # Example: Kafka consumer while True: message = self.consumer.poll() if message: self._push_alert(message) @property def is_consumer(self) -> bool: """Provider is automatically detected as consumer if start_consume is implemented.""" return True # Automatically set if start_consume is overridden def status(self) -> dict: """Return the status of the consumer.""" return { "status": "running" if self.consumer_active else "stopped", "error": self.last_error if hasattr(self, 'last_error') else "" } ``` ### Specialized base classes Keep provides specialized base classes for specific provider types: #### Base topology provider For providers that manage infrastructure topology and service dependencies: ```python theme={null} from keep.providers.base.base_topology_provider import BaseTopologyProvider class MyTopologyProvider(BaseTopologyProvider): def pull_topology(self) -> tuple[list[TopologyServiceInDto], dict]: """ Pull topology data from the provider. Returns: tuple: A tuple of (services list, edges dict) """ # Implement topology fetching logic pass ``` #### BaseIncidentProvider For providers that manage incidents and incident response: ```python theme={null} from keep.providers.base.base_incident_provider import BaseIncidentProvider class MyIncidentProvider(BaseIncidentProvider): def _get_incidents(self) -> list[IncidentDto]: """ Fetch incidents from the provider (abstract method). Returns: list[IncidentDto]: List of incidents """ # Implement incident fetching logic pass @staticmethod def _format_incident( event: dict, provider_instance: "BaseProvider" = None ) -> IncidentDto | list[IncidentDto]: """ Format raw incident data into IncidentDto objects. Args: event: Raw incident data from webhook or API provider_instance: Optional provider instance for context Returns: IncidentDto or list of IncidentDto objects """ # Implement incident formatting logic pass def setup_incident_webhook( self, tenant_id: str, keep_api_url: str, api_key: str, setup_alerts: bool = True, ) -> dict | None: """ Setup webhook for incident updates. Args: tenant_id: Tenant identifier keep_api_url: Keep API URL for callbacks api_key: API key for authentication setup_alerts: Whether to also setup alert webhooks Returns: dict | None: Secrets to save if any """ # Implement webhook setup logic pass ``` Note: The `get_incidents()` method is automatically provided by the base class and wraps `_get_incidents()`. The `format_incident()` class method handles provider loading and calls `_format_incident()`. ### Authentication configuration Providers should define an authentication configuration class as a dataclass with proper field types and validation: ```python theme={null} import dataclasses import pydantic from keep.validation.fields import HttpsUrl, NoSchemeUrl, UrlPort @pydantic.dataclasses.dataclass class MyProviderAuthConfig: """Configuration for MyProvider authentication.""" api_key: str = dataclasses.field( metadata={ "required": True, "description": "API Key for authentication", "sensitive": True, # Masks the field value in UI } ) api_url: HttpsUrl = dataclasses.field( default="https://api.example.com", metadata={ "required": False, "description": "API endpoint URL (HTTPS only)", "documentation_url": "https://docs.example.com/api", "validation": "https_url", # Maps to HttpsUrl validator } ) host: NoSchemeUrl = dataclasses.field( metadata={ "required": True, "description": "Service hostname", "hint": "example.com or 192.168.1.1", "validation": "no_scheme_url", # Maps to NoSchemeUrl validator } ) port: UrlPort = dataclasses.field( default=443, metadata={ "required": False, "description": "Service port", "validation": "port", # Validates port range 1-65535 } ) workspace_id: str = dataclasses.field( metadata={ "required": True, "description": "Workspace identifier", "hint": "Can be found in Settings > Workspace", } ) region: str = dataclasses.field( default="us-east-1", metadata={ "required": False, "description": "Service region", "type": "select", # Renders as dropdown in UI "options": ["us-east-1", "eu-west-1", "ap-south-1"], } ) ``` #### Field validation Keep provides built-in field validation through custom Pydantic field types: | Validation Type | Field Type | Description | Example | | --------------------------- | ---------------------- | -------------------------------- | ----------------------------------- | | `"https_url"` | `HttpsUrl` | Validates HTTPS URLs only | `https://api.example.com` | | `"any_http_url"` | `pydantic.AnyHttpUrl` | Validates any HTTP/HTTPS URL | `http://example.com` | | `"no_scheme_url"` | `NoSchemeUrl` | Validates URLs without scheme | `example.com:8080` | | `"port"` | `UrlPort` | Validates port numbers (1-65535) | `443` | | `"multihost_url"` | `MultiHostUrl` | Validates multi-host URLs | `mongodb://host1:27017,host2:27017` | | `"no_scheme_multihost_url"` | `NoSchemeMultiHostUrl` | Multi-host URLs without scheme | `host1:9092,host2:9092` | To use validation: 1. Import the appropriate field type from `keep.validation.fields` 2. Use it as the field type annotation 3. Add the corresponding validation string in metadata Example implementations: ```python theme={null} # HTTPS-only webhook URL webhook_url: HttpsUrl = dataclasses.field( metadata={ "required": True, "description": "Webhook endpoint (HTTPS required)", "sensitive": True, "validation": "https_url", } ) # Database connection with multiple hosts connection_string: MultiHostUrl = dataclasses.field( metadata={ "required": True, "description": "Database connection string", "hint": "mongodb://host1:27017,host2:27017/dbname", "validation": "multihost_url", } ) # SSH connection ssh_host: NoSchemeUrl = dataclasses.field( metadata={ "required": True, "description": "SSH hostname or IP", "validation": "no_scheme_url", } ) ssh_port: UrlPort = dataclasses.field( default=22, metadata={ "required": False, "description": "SSH port", "validation": "port", } ) ``` #### Metadata fields reference * `required`: Whether the field is mandatory * `description`: Field description shown in UI * `sensitive`: Whether to mask the field value (for secrets) * `hidden`: Whether to hide the field in UI * `documentation_url`: Link to relevant documentation * `hint`: Help text for users * `validation`: Validation type string (see preceding table) * `type`: UI input type (for example, "select" for dropdown) * `options`: List of valid options for select fields * `config_main_group`: Group name for organizing fields in UI * `config_sub_group`: Sub-group name for nested organizationThe validation system ensures that configuration values are valid before Keep instantiates the provider. Invalid values are rejected with clear error messages, improving the user experience and preventing runtime errors. ## Testing your provider ### 1. Unit test Create `tests/test_yourservice_provider.py`: ```python theme={null} import pytest from keep.providers.yourservice_provider.yourservice_provider import YourserviceProvider from keep.providers.models.provider_config import ProviderConfig from keep.contextmanager.contextmanager import ContextManager def test_yourservice_provider_init(): """Test provider initialization.""" config = ProviderConfig( authentication={ "api_endpoint": "https://api.yourservice.com", "api_key": "test-key", } ) context_manager = ContextManager(tenant_id="test", workflow_id="test") provider = YourserviceProvider( context_manager=context_manager, provider_id="test", config=config ) assert provider.authentication_config.api_endpoint == "https://api.yourservice.com" assert provider.authentication_config.api_key == "test-key" @pytest.fixture def mock_requests(monkeypatch): """Mock requests module.""" import requests class MockResponse: def __init__(self, json_data, status_code=200): self.json_data = json_data self.status_code = status_code def json(self): return self.json_data def raise_for_status(self): pass def mock_post(*args, **kwargs): return MockResponse({"success": True}) def mock_get(*args, **kwargs): return MockResponse({"alerts": []}) monkeypatch.setattr(requests, "post", mock_post) monkeypatch.setattr(requests, "get", mock_get) def test_yourservice_notify(mock_requests): """Test notification sending.""" config = ProviderConfig( authentication={ "api_endpoint": "https://api.yourservice.com", "api_key": "test-key", } ) context_manager = ContextManager(tenant_id="test", workflow_id="test") provider = YourserviceProvider( context_manager=context_manager, provider_id="test", config=config ) result = provider.notify(message="Test message") assert result["success"] is True ``` ### 2. Integration test Test with the provider factory: ```python theme={null} def test_provider_factory_loading(): """Test that provider loads correctly through factory.""" from keep.providers.providers_factory import ProvidersFactory # Get provider class provider_class = ProvidersFactory.get_provider_class("yourservice") assert provider_class.__name__ == "YourserviceProvider" # Get all providers all_providers = ProvidersFactory.get_all_providers() yourservice = next((p for p in all_providers if p.type == "yourservice"), None) assert yourservice is not None assert yourservice.display_name == "YourService" ``` ### 3. Manual testing You can test your provider by running it directly: ```bash theme={null} cd keep python -m keep.providers.yourservice_provider.yourservice_provider ``` The `if __name__ == "__main__":` block allows you to test provider initialization and basic capabilities. Add a test block to your provider for direct execution: ```python theme={null} if __name__ == "__main__": # Test the provider directly import logging logging.basicConfig(level=logging.DEBUG, handlers=[logging.StreamHandler()]) context_manager = ContextManager( tenant_id="singletenant", workflow_id="test", ) # Initialize the provider with test config config = ProviderConfig( authentication={ "api_endpoint": "https://api.yourservice.com", "api_key": "test-key", } ) provider = YourserviceProvider( context_manager=context_manager, provider_id="test", config=config ) # Test provider methods print("Provider initialized successfully!") # Test specific functionality try: result = provider._query("test query") print(f"Query result: {result}") except Exception as e: print(f"Query failed: {e}") ``` ## Best practices ### 1. Error handling Always handle API errors gracefully: ```python theme={null} from keep.exceptions.provider_exception import ProviderException try: response = requests.get(url) response.raise_for_status() except requests.exceptions.RequestException as e: raise ProviderException(f"Failed to fetch data: {str(e)}") ``` ### 2. Logging Use the provider's logger: ```python theme={null} self.logger.info("Fetching alerts from YourService") self.logger.error(f"Failed to connect: {str(e)}") ``` ### 3. Configuration validation Validate configuration in `validate_config()`: ```python theme={null} def validate_config(self): self.authentication_config = YourserviceProviderAuthConfig( **self.config.authentication ) # Additional validation if not self.authentication_config.api_endpoint.startswith("https://"): raise ValueError("API endpoint must use HTTPS") ``` ### 4. Alert formatting When returning alerts, use Keep's standard format: ```python theme={null} from keep.api.models.alert import AlertDto, AlertSeverity, AlertStatus alert = AlertDto( id="unique-alert-id", name="Alert Title", description="Detailed description", severity=AlertSeverity.HIGH, status=AlertStatus.FIRING, lastReceived=datetime.now().isoformat(), source=["yourservice"], fingerprint="unique-fingerprint", labels={"key": "value"}, annotations={"runbook": "https://docs.example.com"}, ) ``` ### 5. Secrets management Never hardcode secrets. Use environment variables or configuration: ```python theme={null} client_id = os.environ.get("YOURSERVICE_CLIENT_ID") if not client_id: raise ProviderException("YOURSERVICE_CLIENT_ID environment variable not set") ``` ## Common patterns ### 1. Provider health checks Implement health monitoring using the `ProviderHealthMixin`: ```python theme={null} from keep.providers.base.base_provider import BaseProvider, ProviderHealthMixin class YourserviceProvider(BaseProvider, ProviderHealthMixin): HAS_HEALTH_CHECK = True # The mixin provides automatic health checking for: # - Topology coverage validation # - Spammy alerts detection # - Alerting rule usage monitoring ```The health check mixin is particularly useful for monitoring providers that collect topology data or handle high volumes of alerts. ### 2. Pagination Handle paginated API responses: ```python theme={null} def _get_all_items(self): items = [] page = 1 while True: response = self._query_page(page) items.extend(response["items"]) if not response.get("has_next"): break page += 1 return items ``` ### 3. Rate limiting Respect API rate limits: ```python theme={null} import time from typing import Any def _rate_limited_request(self, url: str, **kwargs) -> Any: max_retries = 3 for attempt in range(max_retries): try: response = requests.get(url, **kwargs) if response.status_code == 429: # Rate limited retry_after = int(response.headers.get("Retry-After", 60)) self.logger.warning(f"Rate limited, waiting {retry_after}s") time.sleep(retry_after) continue response.raise_for_status() return response.json() except Exception as e: if attempt == max_retries - 1: raise time.sleep(2 ** attempt) # Exponential backoff ``` ### 4. Caching Cache frequently accessed data: ```python theme={null} from datetime import datetime, timedelta class YourserviceProvider(BaseProvider): def __init__(self, context_manager, provider_id, config): super().__init__(context_manager, provider_id, config) self._cache = {} self._cache_ttl = timedelta(minutes=5) def _get_cached_data(self, key: str) -> Any: if key in self._cache: data, timestamp = self._cache[key] if datetime.now() - timestamp < self._cache_ttl: return data return None def _set_cached_data(self, key: str, data: Any): self._cache[key] = (data, datetime.now()) ``` ### 5. Webhook signature verification Verify webhook authenticity: ```python theme={null} import hmac import hashlib @staticmethod def verify_webhook_signature(raw_body: bytes, signature: str, secret: str) -> bool: expected = hmac.new( secret.encode(), raw_body, hashlib.sha256 ).hexdigest() return hmac.compare_digest(expected, signature) ``` ### 6. Exposing runtime parameters Use the `expose()` method to make runtime-calculated values available to workflows: ```python theme={null} class YourserviceProvider(BaseProvider): def __init__(self, context_manager, provider_id, config): super().__init__(context_manager, provider_id, config) self._from_timestamp = None self._to_timestamp = None def _query(self, metric: str, from_time: str = "1h", **kwargs): # Calculate actual timestamps self._to_timestamp = datetime.now() self._from_timestamp = self._to_timestamp - parse_duration(from_time) # Query with calculated timestamps return self._fetch_metrics(metric, self._from_timestamp, self._to_timestamp) def expose(self): """Expose calculated parameters for workflow use.""" exposed = {} if self._from_timestamp: exposed["from"] = self._from_timestamp.isoformat() if self._to_timestamp: exposed["to"] = self._to_timestamp.isoformat() return exposed ``` This allows workflows to access the actual timestamps used in queries, not just the relative time strings. ## Complete provider example Here's a minimal example of a complete provider implementation: ```python theme={null} from keep.providers.base.base_provider import BaseProvider from keep.providers.models.provider_config import ProviderConfig from keep.contextmanager.contextmanager import ContextManager class MyProvider(BaseProvider): PROVIDER_DISPLAY_NAME = "My Service" PROVIDER_CATEGORY = ["Monitoring", "Incident Management"] PROVIDER_TAGS = ["alert", "messaging"] def __init__( self, context_manager: ContextManager, provider_id: str, config: ProviderConfig, webhook_template: Optional[str] = None, webhook_description: Optional[str] = None, webhook_markdown: Optional[str] = None, provider_description: Optional[str] = None, ): super().__init__( context_manager, provider_id, config, webhook_template, webhook_description, webhook_markdown, provider_description ) def validate_config(self): # Validate the provider configuration pass def dispose(self): # Clean up resources pass def _query(self, **kwargs): # Implement query logic pass def _notify(self, **kwargs): # Implement notification logic pass ``` ## File references * **Base Provider Classes**: `keep/providers/base/base_provider.py` * **Provider Models**: `keep/providers/models/` * **Provider Factory**: `keep/providers/providers_factory.py` * **Provider Exceptions**: `keep/exceptions/provider_exception.py` * **Example Providers**: * Simple: `keep/providers/slack_provider/slack_provider.py` * Complex: `keep/providers/datadog_provider/datadog_provider.py` * Database: `keep/providers/clickhouse_provider/clickhouse_provider.py` * Incident: `keep/providers/pagerduty_provider/pagerduty_provider.py` * Topology: `keep/providers/datadog_provider/datadog_provider.py` * **Tests**: `tests/test_*_provider.py` * **Documentation**: `docs/providers/documentation/` * **Additional Docs**: * `docs/providers/adding-a-new-provider.mdx` * `docs/providers/provider-methods.mdx` * `docs/providers/linked-providers.mdx` ## Checklist * [ ] Create provider directory and files * [ ] Implement AuthConfig class with proper metadata * [ ] Implement provider class with required methods * [ ] Add provider to `__init__.py` * [ ] Set appropriate PROVIDER\_DISPLAY\_NAME, PROVIDER\_CATEGORY, and PROVIDER\_TAGS * [ ] Implement `validate_config()` and `dispose()` * [ ] Add at least one capability (`_notify`, `_query`, or `_get_alerts`) * [ ] Create documentation in `docs/providers/documentation/` * [ ] Write unit tests * [ ] Test with provider factory * [ ] Handle errors gracefully * [ ] Add logging statements * [ ] Validate in Keep UI * [ ] If supporting webhooks, implement `_format_alert()` static method * [ ] If supporting OAuth 2.0, set OAUTH2\_URL as class attribute * [ ] Consider implementing `validate_scopes()` for scope validation * [ ] Consider implementing `get_provider_metadata()` for provider versioning ## Getting help * Review existing providers for examples * Check the base provider classes for available methods * Look at test files for testing patterns * Ask in Keep's GitHub discussions or issues * Review the [Provider Methods documentation](/providers/provider-methods) for advanced capabilities * Understand [Linked vs Connected Providers](/providers/linked-providers) # Airflow Source: https://docs.keephq.dev/providers/documentation/airflow-provider The Airflow provider integration allows you to send alerts (e.g. DAG failures) from Airflow to Keep via webhooks. ## Overview [Apache Airflow](https://airflow.apache.org/docs/apache-airflow/stable/index.html) is an open-source tool for programmatically authoring, scheduling, and monitoring data pipelines. Airflow's extensible Python framework enables you to build workflows that connect with virtually any technology. When working with Airflow, it's essential to monitor the health of your DAGs and tasks to ensure that your data pipelines run smoothly. The Airflow Provider integration allows seamless communication between Airflow and Keep, so you can forward alerts, such as task failures, directly to Keep via webhook configurations.## Connecting Airflow to Keep ### Alert Integration via Webhook To connect Airflow to Keep, configure Airflow to send alerts using Keep's webhook. You must provide: * **Keep Webhook URL**: The webhook URL provided by Keep (for example, `https://api.keephq.dev/alerts/event/airflow`). * **Keep API Key**: The API key generated on Keep's platform, which is used for authentication. A common method to integrate Airflow with Keep is by configuring alerts through [Airflow Callbacks](https://airflow.apache.org/docs/apache-airflow/stable/administration-and-deployment/logging-monitoring/callbacks.html). For instance, when an Airflow task fails, a callback can send an alert to Keep via the webhook. There are several steps to implement this: ### Step 1: Define Keep's Alert Information Structure your alert payload with the following information: ```python theme={null} data = { "name": "Airflow Task Failure", "description": "Task keep_task failed in DAG keep_dag", "status": "firing", "service": "pipeline", "severity": "critical", } ``` ### Step 2: Configure Keep's Webhook Credentials To send alerts to Keep, configure the webhook URL and API key. Below is an example of how to send an alert using Python: > **Note**: You need to set up the `KEEP_API_KEY` environment variable with your Keep API key. ```python theme={null} import os import requests def send_alert_to_keep(dag_id, task_id, execution_date, error_message): # Replace with your specific Keep webhook URL if different. keep_webhook_url = "https://api.keephq.dev/alerts/event/airflow" api_key = os.getenv("KEEP_API_KEY") headers = { "Content-Type": "application/json", "Accept": "application/json", "X-API-KEY": api_key, } data = { "name": f"Airflow Task Failure: {task_id}", "message": f"Task {task_id} failed in DAG {dag_id} at {execution_date}", "status": "firing", "service": "pipeline", "severity": "critical", "description": str(error_message), } response = requests.post(keep_webhook_url, headers=headers, json=data) response.raise_for_status() ``` ### Step 3: Configure the Airflow Callback Function Now, configure the callback so that an alert is sent to Keep when a task fails. You can attach this callback to one or more tasks in your DAG as shown below: ```python theme={null} import os import requests from datetime import datetime from datetime import timedelta from airflow import DAG from airflow.operators.bash_operator import BashOperator default_args = { 'owner': 'airflow', 'depends_on_past': False, 'email_on_failure': False, 'email_on_retry': False, 'retries': 1, 'retry_delay': timedelta(minutes=5), } def send_alert_to_keep(dag_id, task_id, execution_date, error_message): # Replace with your specific Keep webhook URL if different. keep_webhook_url = "https://api.keephq.dev/alerts/event/airflow" api_key = os.getenv("KEEP_API_KEY") headers = { "Content-Type": "application/json", "Accept": "application/json", "X-API-KEY": api_key, } data = { "name": f"Airflow Task Failure: {task_id}", "message": f"Task {task_id} failed in DAG {dag_id} at {execution_date}", "status": "firing", "service": "pipeline", "severity": "critical", "description": str(error_message), } response = requests.post(keep_webhook_url, headers=headers, json=data) response.raise_for_status() def task_failure_callback(context): send_alert_to_keep( dag_id=context["dag"].dag_id, task_id=context["task_instance"].task_id, execution_date=context["execution_date"], error_message=context.get("exception", "Unknown error"), ) dag = DAG( dag_id="keep_dag", default_args=default_args, description="A simple DAG with Keep integration", schedule_interval=None, start_date=datetime(2025, 1, 1), catchup=False, ) task = BashOperator( task_id="keep_task", bash_command="exit 1", dag=dag, on_failure_callback=task_failure_callback, ) ``` ### Step 4: Observe Alerts in Keep After setting up the above configuration, any failure in your Airflow tasks will trigger an alert that is sent to Keep via the configured webhook. You can then view, manage, and respond to these alerts using the Keep dashboard.
## In workflows This provider can't be used as a "step" or "action" in workflows. If you want to use it, please let us know by creating an issue in the [GitHub repository](https://github.com/keephq/keep/issues). ## Useful Links * [Airflow Documentation](https://airflow.apache.org/docs/apache-airflow/stable/index.html) * [Airflow Callbacks](https://airflow.apache.org/docs/apache-airflow/stable/administration-and-deployment/logging-monitoring/callbacks.html) * [Airflow Connection](https://airflow.apache.org/docs/apache-airflow/stable/howto/connection.html) # Azure AKS Source: https://docs.keephq.dev/providers/documentation/aks-provider Azure AKS provider to view kubernetes resources. ## Connecting with the Provider To connect to Azure AKS, follow below steps: 1. Log in to your [Azure](https://azure.microsoft.com/) account. 2. Go to your kubernetes service page and click on `Connect` button and then click on `Open Cloud Shell`. 3. Run `az ad sp create-for-rbac --role owner --scopes /subscriptions/
` in the cloud shell, you will get response similar to: ``` { "appId": "xxxxxx-xxxxx-xxxxxx-xxxx", "displayName": "azure-cli-2023-11-06-13-00-52", "password": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "tenant": "xxxxx-xxxxx-xxxx-xxxxx" } ``` In above JSON object, the `appId` is `client_id`, `password` is `client_secret` and `tenant` is `tenant_id` ## Notes * This provider allows you to interact with Azure AKS to query resources in kubernetes cluster. ## Authentication This provider requires authentication. * **subscription\_id**: The azure subscription id (required: True, sensitive: True) * **client\_id**: The azure client id (required: True, sensitive: True) * **client\_secret**: The azure client secret (required: True, sensitive: True) * **tenant\_id**: The azure tenant id (required: True, sensitive: True) * **resource\_group\_name**: The azure aks resource group name (required: True, sensitive: True) * **resource\_name**: The azure aks cluster name (required: True, sensitive: True) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query aks provider: aks config: "{{ provider.my_provider_name }}" with: command_type: {value} # The command type to operate on the k8s cluster (`get_pods`, `get_pvc`, `get_node_pressure`). ``` Check the following workflow example: * [aks\_basic.yml](https://github.com/keephq/keep/blob/main/examples/workflows/aks_basic.yml) ## Useful Links * [Azure AKS List Cluster User Creds](https://learn.microsoft.com/en-us/rest/api/aks/managed-clusters/list-cluster-user-credentials?view=rest-aks-2023-08-01\&tabs=HTTP) * [Azure AKS Doc](https://learn.microsoft.com/en-us/azure/aks/) # AmazonSQS Provider Source: https://docs.keephq.dev/providers/documentation/amazonsqs-provider The AmazonSQS provider enables you to pull & push alerts to the Amazon SQS Queue. ## Overview The **AmazonSQS Provider** facilitates Consuming SQS messages as alerts Notifying/Pushing messages to SQS Queue ## Authentication This provider requires authentication. * **region\_name**: Region name (required: True, sensitive: False) * **sqs\_queue\_url**: SQS Queue URL (required: True, sensitive: False) * **access\_key\_id**: Access Key Id (Leave empty if using IAM role at EC2) (required: False, sensitive: False) * **secret\_access\_key**: Secret access key (Leave empty if using IAM role at EC2) (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: * **authenticated**: Key-Id pair is valid and working (mandatory) * **sqs::read**: Required privileges to receive alert from SQS. If you only want to give read scope to your key-secret pair the permission policy: AmazonSQSReadOnlyAccess. (mandatory) * **sqs::write**: Required privileges to push messages to SQS. If you only want to give read & write scope to your key-secret pair the permission policy: AmazonSQSFullAccess. ## In workflows This provider can be used in workflows. As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query amazonsqs provider: amazonsqs config: "{{ provider.my_provider_name }}" with: message: {value} group_id: {value} dedup_id: {value} ``` If you need workflow examples with this provider, please raise a [GitHub issue](https://github.com/keephq/keep/issues). ## Inputs for AmazonSQS Action * `message`: str: Body/Message for the notification * `group_id`: str | None: Mandatory only if Queue is of type FIFO, ignored incase of a normal Queue. * `dedup_id`: str | None: Mandatory only if Queue is of type FIFO, ignored incase of a normal Queue. * \*\*kwargs: dict | None: You can pass additional key-value pairs, that will be sent as MessageAttributes in the notification. ## Output for AmazonSQS Action For more detail, visit [sqs-documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sqs/client/send_message.html#). ```json theme={null} { 'MD5OfMessageBody': 'string', 'MD5OfMessageAttributes': 'string', 'MD5OfMessageSystemAttributes': 'string', 'MessageId': 'string', 'SequenceNumber': 'string' } ``` * When using the AmazonSQS action, if your queue is fifo, then it is **mandatory** to pass a dedup\_id & group\_id. * All the extra fields present in the MessageAttribute is stored in alert.label as a key-value pair dictionary. * You can pass these attributes in the SQS Queue message and keep will extract and use these field for the alert * name * status: Possible values 'firing' | 'resolved' | 'acknowledged' | 'suppressed' | 'pending' defaults to 'firing'. * severity: Possible values 'critical' | 'high' | 'warning' | 'info' | 'low' defaults to 'high' * description Permissions needed for the key-id pair are: 1. AmazonSQSFullAccess: If you want to notify + receive, this is sqs::read + sqs::write scope. 2. AmazonSQSReadOnlyAccess: If you want to just receive, this is the sqs::read scope. You can find these under: IAM > Users > \[YOUR\_USER] > Permission > Add Permissions > Add Permissions > Attach policies directly > Search for SQS. To create key-id pair, follow this: 1. Search IAM in AWS console, press enter. 2. Go to users 3. Select the user that you want to 4. Click on `Create access key` 5. Select `Third party service`, Click `Next` 6. Add `Description Tag` click `Next` 7. Copy/Download the key-id pair. ## Useful Links * [AmazonSQS Boto3 Examples](https://docs.aws.amazon.com/code-library/latest/ug/python_3_sqs_code_examples.html) * [Boto3 SQS Documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sqs.html) # Anthropic Provider Source: https://docs.keephq.dev/providers/documentation/anthropic-provider The Anthropic Provider allows for integrating Anthropic's Claude language models into Keep.The Anthropic Provider supports querying Claude language models for prompt-based interactions. ## Outputs Currently, the Claude Provider outputs the response from the model based on the prompt provided. ## Connecting with the Provider To connect to Claude, you'll need to obtain an API Key: 1. Log in to your Anthropic account at [Anthropic Console](https://console.anthropic.com). 2. Navigate to the **API Keys** section. 3. Click on **Create Key** to generate a new API key for Keep. Use the generated API key in the `authentication` section of your Claude Provider configuration. ## Authentication This provider requires authentication. * **api\_key**: Anthropic API Key (required: True, sensitive: True) * **model**: Claude model to use (required: False, sensitive: False) * **system\_prompt**: System prompt that sets Claude's role for all requests in this provider. (required: False, sensitive: False) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query anthropic provider: anthropic config: "{{ provider.my_provider_name }}" with: prompt: {value} # The prompt to query the model with. model: {value} # The model to query (overrides provider config). max_tokens: {value} # The maximum number of tokens to generate. system_prompt: {value} # System prompt override for this call. structured_output_format: {value} # The structured output format to use. ``` If you need workflow examples with this provider, please raise a [GitHub issue](https://github.com/keephq/keep/issues). # AppDynamics Source: https://docs.keephq.dev/providers/documentation/appdynamics-provider AppDynamics provider allows you to get AppDynamics `alerts/actions` via webhook installation ## Authentication This provider requires authentication. * **appDynamicsAccountName**: AppDynamics Account Name (required: True, sensitive: False) * **appId**: AppDynamics appId (required: True, sensitive: False) * **host**: AppDynamics host (required: True, sensitive: False) * **appDynamicsAccessToken**: AppDynamics Access Token (required: False, sensitive: False) * **appDynamicsUsername**: Username (required: False, sensitive: False) * **appDynamicsPassword**: Password (required: False, sensitive: True) 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: * **authenticated**: User is Authorized (mandatory) * **administrator**: Administrator privileges (mandatory) ## In workflows This provider can't be used as a "step" or "action" in workflows. If you want to use it, please let us know by creating an issue in the [GitHub repository](https://github.com/keephq/keep/issues). ## Connecting with the Provider 1. Ensure you have a AppDynamics account with the necessary [permissions](https://docs.appdynamics.com/accounts/en/cisco-appdynamics-on-premises-user-management/roles-and-permissions). The basic permissions required are `Account Owner` or `Administrator`. Alternatively you can create an account [instructions](https://docs.appdynamics.com/accounts/en/global-account-administration/access-management/manage-user-accounts) ## Provider configuration 1. Find your account name [here](https://accounts.appdynamics.com/overview). 2. Get the appId of the Appdynamics instance in which you wish to install the webhook into. 3. Determine the Host [here](https://accounts.appdynamics.com/overview). ### Basic Auth authentication 1. Obtain AppDynamics **Username** and **Password** 2. Go to **Basic Auth** tab under **Authentication** section 3. Enter **Username** and **Password**### Access Token authentication 1. Log in to the **Controller UI** as an **Account Owner** or other roles with the **Administer users**, **groups**, **roles** permission. 2. Go to **Administration**
3. Go to **API Client** tab
4. Click **+ Create**
5. Fill Client **Name** and **Description** 6. Click **Generate Secret**
![]()
This API Client secret is not an authentication token yet 7. Add **Account Owner** and/or **Administrator** roles8. Click **Save**
9. Click **Generate Temporary Token**
![]()
This token is not persistent, but since Keep uses it just once to install Webhook, we will use it without oAuth 10. Click **Save** one againThis is important. Otherwise generated token will not be saved and authentication will fail 11. Copy generated token12. Go to **Access Token** tab under **Authentication** section
13. Enter Access Token ## Connecting provider 1. Ensure **Install webhook** is checked 2. Click **Connect** ## Webhook Integration Modifications The webhook integration adds Keep as an alert monitor within the AppDynamics instance. It can be found under the "Alerts & Respond" section. The integration automatically gains access to the following scopes within AppDynamics: * `administrator` * `authenticated` ## Useful Links * [AppDynamics HTTP Action Templates](https://docs.appdynamics.com/appd/24.x/24.3/en/extend-cisco-appdynamics/cisco-appdynamics-apis/configuration-import-and-export-api#id-.ConfigurationImportandExportAPIv24.2-ImportHTTPActionTemplatesintoanAccount) * [AppDynamics Permissions and Roles](https://docs.appdynamics.com/accounts/en/cisco-appdynamics-on-premises-user-management/roles-and-permissions) * [AppDynamics User Accounts](https://docs.appdynamics.com/accounts/en/global-account-administration/access-management/manage-user-accounts) # ArgoCD Provider Source: https://docs.keephq.dev/providers/documentation/argocd-provider The ArgoCD provider enables you to pull topology and Application data. ## Overview The **ArgoCD Provider** facilitates pulling Topology and Application data from ArgoCD. ArgoCD Applications are mapped to Keep Services ArgoCD ApplicationSets are mapped to Keep Applcations ## Authentication This provider requires authentication. * **argocd\_access\_token**: Argocd Access Token (required: True, sensitive: True) * **deployment\_url**: Deployment Url (required: True, 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: * **authenticated**: User is Authorized (mandatory) ## In workflows This provider can't be used as a "step" or "action" in workflows. If you want to use it, please let us know by creating an issue in the [GitHub repository](https://github.com/keephq/keep/issues). ## Topology This provider pulls [topology](/overview/servicetopology) to Keep. It could be used in [correlations](/overview/correlation-topology) and [mapping](/overview/enrichment/mapping#mapping-with-topology-data), and as a context for [alerts](/alerts/sidebar#7-alert-topology-view) and [incidents](/overview#17-incident-topology). ## Connecting with the Provider 1. Obtain the **access token** from your ArgoCD instance by following `Generate auth token` from [ArgoCD's User management docs](https://argo-cd.readthedocs.io/en/stable/operator-manual/user-management/#manage-users). 2. Set the **deployment URL** to your ArgoCD instance's base URL (e.g., `https://localhost:8080`). ## Features The **ArgoCD Provider** supports the following key features: * **Topology**: Configures the Topology usin the applications from ArgoCD. * **Applications**: Creates Applications using the ApplicationSets from ArgoCD. ## Useful Links * [ArgoCD API Documentation](https://argo-cd.readthedocs.io/en/stable/developer-guide/api-docs) * [ArgoCD User Management](https://argo-cd.readthedocs.io/en/stable/operator-manual/user-management/#local-usersaccounts) # Asana Source: https://docs.keephq.dev/providers/documentation/asana-provider Asana Provider allows you to create and update tasks in Asana ## Authentication This provider requires authentication. * **pat\_token**: Personal Access Token for Asana. (required: True, sensitive: True) 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: * **authenticated**: User is authenticated to Asana. (mandatory) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query asana provider: asana config: "{{ provider.my_provider_name }}" with: task_id: {value} # Task ID. # Apart from the above parameters, you can also provide few other parameters. Refer to the [Asana API documentation](https://developers.asana.com/docs/update-a-task) for more details. ``` As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query asana provider: asana config: "{{ provider.my_provider_name }}" with: name: {value} # Task Name. projects: {value} # List of Project IDs. # Apart from the above parameters, you can also provide few other parameters. Refer to the [Asana API documentation](https://developers.asana.com/docs/update-a-task) for more details. ``` Check the following workflow examples: * [create-task-in-asana.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/create-task-in-asana.yaml) * [update-task-in-asana.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/update-task-in-asana.yaml) ## Connecting with the Provider 1. Go to [Asana](https://app.asana.com/0/developer-console)
2. Click on `Create New Personal Access Token`.
3. Give it a name and click on `Create`. 4. Copy the generated token. This will be used as the `Personal Access Token` in the provider settings.
## Useful Links * [Asana](https://asana.com) # Auth0 Source: https://docs.keephq.dev/providers/documentation/auth0-provider Auth0 provider allows interaction with Auth0 APIs for authentication and user management. ## Authentication This provider requires authentication. * **domain**: Auth0 Domain (required: True, sensitive: False) * **token**: Auth0 API Token (required: True, sensitive: True) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query auth0 provider: auth0 config: "{{ provider.my_provider_name }}" with: log_type: {value} previous_users: {value} ``` Check the following workflow example: * [new-auth0-users-monitor.yml](https://github.com/keephq/keep/blob/main/examples/workflows/new-auth0-users-monitor.yml) ## Connecting with the Provider The Auth0 provider connects to both the **Authentication API** and the **Management API**, enabling functionality such as token-based authentication and user management. Depending on your needs, you can: * Use the **Authentication API** to obtain access tokens, manage user profiles, or handle multi-factor authentication. * Use the **Management API** to automate the configuration of your Auth0 environment, register applications, manage users, and more. ## Useful Links -[Auth0 API Documentation](https://auth0.com/docs/api) -[Auth0 as an authentication method for keep](https://docs.keephq.dev/deployment/authentication/auth0-auth) # Axiom Provider Source: https://docs.keephq.dev/providers/documentation/axiom-provider Axiom Provider is a class that allows to ingest/digest data from Axiom. ## Authentication This provider requires authentication. * **api\_token**: Axiom API Token (required: True, sensitive: True) * **organization\_id**: Axiom Organization ID (required: False, sensitive: False) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query axiom provider: axiom config: "{{ provider.my_provider_name }}" with: dataset: {value} datasets_api_url: {value} organization_id: {value} startTime: {value} endTime: {value} query: {value} # command to execute ``` If you need workflow examples with this provider, please raise a [GitHub issue](https://github.com/keephq/keep/issues). ## Connecting with the Provider To connect to Axiom, you need to create an API token from your Axiom account. Follow these steps: 1. Log in to your Axiom account. 2. Go to the **API Access** page under the **Settings** menu. 3. Click the **Create Token** button and enter a name for the token. 4. Copy the token value and keep it safe. 5. Add the token value to the `authentication` section in the Axiom Provider configuration. To access datasets, you need to provide the organization ID. You can find your organization ID in the URL of the Axiom web app. For example, if your Axiom URL is `https://app.axiom.co/organizations/1234`, then your organization ID is `1234`. ## Notes * This provider supports a limited set of features provided by the Axiom API. * The `startTime` and `endTime` parameters use ISO-8601 format. * The `query` function returns the response in JSON format from the Axiom API. ## Webhook Integration 1. In Axiom, go to the `Monitors` tab in the Axiom dashboad.
2. Click on `Notifiers` in the left sidebar and create a new notifier.
3. Give it a name and select `Custom Webhook` as kind of notifier. Enter the webhook url as [https://api.keephq.dev/alerts/event/axiom](https://api.keephq.dev/alerts/event/axiom).
4. Follow the below steps to create a new API key in Keep. 5. Go to Keep dashboard and click on the profile icon in the botton left corner and click `Settings`.
6. Select `Users and Access` tab and then select `API Keys` tab and create a new API key.
7. Give name and select the role as `webhook` and click on `Create API Key`.
8. Copy the API key.
9. Add a new header with key as `X-API-KEY` and create a new API key in Keep and paste it as the value and save the webhook.
10. Go to `Monitors` tab and click on the `Monitors` in the left sidebar and create a new monitor.
11. Create a new monitor and select the notifier created in the previous step as per your requirement. Refer [Axiom Monitors](https://axiom.co/docs/monitor-data/monitors) to create a new monitor.
![]()
12. Save the monitor. Now, you will receive the alerts in Keep. ## Useful Links * [Axiom API Documentation](https://axiom.co/docs/restapi/introduction) # Azure Monitor Source: https://docs.keephq.dev/providers/documentation/azuremonitoring-provider Azure Monitorg provider allows you to get alerts from Azure Monitor via webhooks. ## Overview The Azure Monitor Provider integrates Keep with Azure Monitor, allowing you to receive alerts within Keep's platform. By setting up a webhook in Azure, you can ensure that critical alerts are sent to Keep, allowing for efficient monitoring and response. ## Connecting Azure Monitor to Keep Connecting Azure Monitor to Keep involves creating an Action Group in Azure, adding a webhook action, and configuring the Alert Rule to use the new Action Group. ### Step 1: Navigate an Action Group 1. Log in to your Azure portal. 2. Navigate to **Monitor** > **Alerts** > **Action groups**.
### Step 2: Create new Action Group 1. Click on **+ Create**.
### Step 3: Fill Action Group details 1. Choose the Subscription and Resource Group. 2. Give the Action Group an indicative name.
### Step 4: Go to "Action" and add Keep as a Webhook
### Step 5: Test Keep Webhook action
![]()
### Step 6: View the alert in Keep
## In workflows This provider can't be used as a "step" or "action" in workflows. If you want to use it, please let us know by creating an issue in the [GitHub repository](https://github.com/keephq/keep/issues). ## Connecting via Webhook (omnidirectional) This provider supports webhooks. To send alerts from Azure Monitor to Keep, Use the following webhook url to configure Azure Monitor send alerts to Keep: 1. In Azure Monitor, create a new Action Group. 2. In the Action Group, add a new action of type "Webhook". 3. In the Webhook action, configure the webhook with the following settings. * **Name**: keep-azuremonitoring-webhook-integration * **URL**: Your Keep Backend URL 4. Save the Action Group. 5. In the Alert Rule, configure the Action Group to use the Action Group created in step 1. 6. Save the Alert Rule. 7. Test the Alert Rule to ensure that the alerts are being sent to Keep. ## Useful Links * [Azure Monitor alert webhook](https://learn.microsoft.com/en-us/azure/azure-monitor/alerts/alerts-webhooks) * [Azure Monitor alert payload](https://learn.microsoft.com/en-us/azure/azure-monitor/alerts/alerts-payload-samples) * [Azure Monitor action groups](https://learn.microsoft.com/en-us/azure/azure-monitor/alerts/action-groups) # Bash Source: https://docs.keephq.dev/providers/documentation/bash-provider Bash provider allows executing Bash commands in a workflow, with a limitation for cloud execution. ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query bash provider: bash config: "{{ provider.my_provider_name }}" with: timeout: {value} command: {value} shell: {value} ``` Check the following workflow example: * [bash\_example.yml](https://github.com/keephq/keep/blob/main/examples/workflows/bash_example.yml) ## Connecting with the Provider The Bash provider allows you to run Bash commands or scripts in your workflow. You can pass in any valid Bash command, and it will be executed in a local environment. ### **Cloud Limitation** This provider is disabled for cloud environments and can only be used in local or self-hosted environments. ## Usefull Links -[Bash Documentation](https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html) # BigQuery Source: https://docs.keephq.dev/providers/documentation/bigquery-provider BigQuery provider allows interaction with Google BigQuery for querying and managing datasets. ## Authentication This provider requires authentication. * **service\_account\_json**: The service account JSON with container.viewer role (required: True, sensitive: True) * **project\_id**: Google Cloud project ID. If not provided, it will try to fetch it from the environment variable 'GOOGLE\_CLOUD\_PROJECT' (required: False, sensitive: False) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query bigquery provider: bigquery config: "{{ provider.my_provider_name }}" with: query: {value} ``` Check the following workflow examples: * [bigquery.yml](https://github.com/keephq/keep/blob/main/examples/workflows/bigquery.yml) * [failed-to-login-workflow.yml](https://github.com/keephq/keep/blob/main/examples/workflows/failed-to-login-workflow.yml) ## Connecting with the Provider 1. Create a Google Cloud project and enable the BigQuery API. 2. Create a service account in your Google Cloud project and download the JSON key file. 3. Share the necessary datasets with the service account. 4. Configure your provider using the `service_account_key`, `project_id`, and `dataset`. # Centreon Source: https://docs.keephq.dev/providers/documentation/centreon-provider Centreon allows you to monitor your infrastructure with ease. ## Authentication This provider requires authentication. * **host\_url**: Centreon Host URL (required: True, sensitive: False) * **api\_token**: Centreon API Token (required: True, sensitive: True) 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: * **authenticated**: User is authenticated ## In workflows This provider can't be used as a "step" or "action" in workflows. If you want to use it, please let us know by creating an issue in the [GitHub repository](https://github.com/keephq/keep/issues). ## Connecting with the Provider 1. Centreon can be SaaS or On-premises. You need to have an instance of Centreon running. 2. Go to Administration > API Tokens and create a new token for an admin user. 3. Use the URL of your Centreon instance and the API token to configure the provider. ## Usefull Links * [Centreon](https://www.centreon.com/) ## Note * Centreon only supports the following [host state](https://docs.centreon.com/docs/api/rest-api-v1/#realtime-information) (UP = 0, DOWN = 2, UNREA = 3) # Checkly Source: https://docs.keephq.dev/providers/documentation/checkly-provider Checkly allows you to receive alerts from Checkly using API endpoints as well as webhooks ## Authentication This provider requires authentication. * **checklyApiKey**: Checkly API Key (required: True, sensitive: True) * **accountId**: Checkly Account ID (required: True, sensitive: True) 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: * **read\_alerts**: Read alerts from Checkly ## In workflows This provider can't be used as a "step" or "action" in workflows. If you want to use it, please let us know by creating an issue in the [GitHub repository](https://github.com/keephq/keep/issues). ## Connecting Checkly to Keep 1. Open Checkly dashboard and click on your profile picture in the top right corner. 2. Click on `User Settings`.
3. Open the `API Keys` tab and click on `Create API Key` to generate a new API key.
4. Copy the API key. 5. Open `General` tab under Account Settings and copy the `Account ID`.
6. Go to Keep, add Checkly as a provider and enter the API key and Account ID in the respective fields and click on `Connect`. ## Webhooks Integration 1. Open Checkly dashboard and open `Alerts` tab in the left sidebar.
2. Click on `Add more channels`
3. Select `Webhook` from the list of available channels.
4. Enter a name for the webhook, select the method as `POST` 5. Enter [https://api.keephq.dev/alerts/event/checkly](https://api.keephq.dev/alerts/event/checkly) as the URL. 6. Copy the below snippet and paste in the `Body` of Webhook. Refer the screenshot below for reference. ```json theme={null} { "event": "{{ALERT_TITLE}}", "alert_type": "{{ALERT_TYPE}}", "check_name": "{{CHECK_NAME}}", "group_name": "{{GROUP_NAME}}", "check_id": "{{CHECK_ID}}", "check_type": "{{CHECK_TYPE}}", "check_result_id": "{{CHECK_RESULT_ID}}", "check_error_message": "{{CHECK_ERROR_MESSAGE}}", "response_time": "{{RESPONSE_TIME}}", "api_check_response_status_code": "{{API_CHECK_RESPONSE_STATUS_CODE}}", "api_check_response_status_text": "{{API_CHECK_RESPONSE_STATUS_TEXT}}", "run_location": "{{RUN_LOCATION}}", "ssl_days_remaining": "{{SSL_DAYS_REMAINING}}", "ssl_check_domain": "{{SSL_CHECK_DOMAIN}}", "started_at": "{{STARTED_AT}}", "tags": "{{TAGS}}", "link": "{{RESULT_LINK}}", "region": "{{REGION}}", "uuid": "{{$UUID}}" } ```
7. Go to Headers tab and add a new header with key as `X-API-KEY` and create a new API key in Keep and paste it as the value and save the webhook.
8. Follow the below steps to create a new API key in Keep. 9. Go to Keep dashboard and click on the profile icon in the botton left corner and click `Settings`.
10. Select `Users and Access` tab and then select `API Keys` tab and create a new API key.
11. Give name and select the role as `webhook` and click on `Create API Key`.
12. Use the generated API key in the `X-API-KEY` header of the webhook created in Checkly. ## Useful Links * [Checkly Website](https://www.checklyhq.com/) # Checkmk Source: https://docs.keephq.dev/providers/documentation/checkmk-provider Checkmk provider allows you to get alerts from Checkmk via webhooks. ## Overview The Checkmk provider enables seamless integration between Keep and Checkmk. It allows you to get alerts from Checkmk to Keep via webhooks making it easier to manage your infrastructure and applications in one place. ## Connecting Checkmk to Keep To connect Checkmk to Keep, you need to configure it as a webhook from Checkmk. Follow the steps below to set up the integration: 1. Keep webhook script need to installed on the Checkmk server. 2. You can download the Keep webhook script using the following command: ```bash theme={null} wget -O webhook-keep.py https://github.com/keephq/keep/blob/main/keep/providers/checkmk_provider/webhook-keep.py?raw=true ``` 3. Copy the downloaded script to the following path on the Checkmk server: If you are using Checkmk Docker container, then copy it to the following path according to your docker volume mapping: ```bash theme={null} cp webhook-keep.py /omd/sites/
/local/share/check_mk/notifications/webhook-keep.py cd /omd/sites/ /local/share/check_mk/notifications ``` If you are using Checkmk installed on the server, then copy it to the following path: ```bash theme={null} cp webhook-keep.py ~/local/share/check_mk/notifications/webhook-keep.py cd ~/local/share/check_mk/notifications ``` 4. Make the script executable: ```bash theme={null} chmod +x webhook-keep.py ``` 5. Now go to the Checkmk web interface and navigate to Setup 6. Click on Notifications under Events
6. Click on Add rule
7. In the Notifications method method, select "webhook-keep" as the notification method.
8. Configure the Rule properties, Contact selections, and Conditions according to your requirements. 9. The first parameter is the Webhook URL of Keep which is `https://api.keephq.dev/alerts/event/checkmk`. 10. The second parameter is the API Key of Keep which you can generate in the [Keep settings](https://platform.keephq.dev/settings?selectedTab=users\&userSubTab=api-keys). 11. Click on Save to save the configuration. 12. Now you will start receiving alerts from Checkmk to Keep via webhooks when the configured conditions are met. ## Useful Links * [Checkmk](https://checkmk.com/) ## In workflows This provider can't be used as a "step" or "action" in workflows. If you want to use it, please let us know by creating an issue in the [GitHub repository](https://github.com/keephq/keep/issues). # Cilium Source: https://docs.keephq.dev/providers/documentation/cilium-provider Cilium provider enables topology discovery by analyzing network flows between services in your Kubernetes cluster using Hubble. ## Authentication This provider requires authentication. * **cilium\_base\_endpoint**: The base endpoint of the cilium hubble relay (required: True, sensitive: False) * **use\_tls**: Connect to the hubble relay over TLS (required: False, sensitive: False) * **ca\_certificate**: CA certificate (PEM) used to verify the hubble relay server (required: False, sensitive: True) * **client\_certificate**: Client certificate (PEM) for mutual TLS (required: False, sensitive: True) * **client\_key**: Client private key (PEM) for mutual TLS (required: False, sensitive: True) ## In workflows This provider can't be used as a "step" or "action" in workflows. If you want to use it, please let us know by creating an issue in the [GitHub repository](https://github.com/keephq/keep/issues). ## Topology This provider pulls [topology](/overview/servicetopology) to Keep. It could be used in [correlations](/overview/correlation-topology) and [mapping](/overview/enrichment/mapping#mapping-with-topology-data), and as a context for [alerts](/alerts/sidebar#7-alert-topology-view) and [incidents](/overview#17-incident-topology). ## Overview
Cilium provider is in Beta and is not working with authentication yet. The current way to pull topology data from your kubernetes cluster, is to run: ```bash theme={null} # hubble-relay usually installed at kube-system, but it depends on your cluster. kubectl port-forward -n kube-system svc/hubble-relay 4245:80 ``` and then use `localhost:4245` to pull topology data. If you need help with connecting Cilium provider, [reach out](https://slack.keephq.dev). The Cilium provider leverages Hubble's network flow data to automatically discover service dependencies and build a topology map of your Kubernetes applications.## Authentication Parameters | Parameter | Description | Example | | ---------------------- | ----------------------------------------------------------- | ----------------------------- | | `cilium_base_endpoint` | The base endpoint of the Cilium Hubble relay | `localhost:4245` | | `use_tls` | Connect to the Hubble relay over TLS | `true` | | `ca_certificate` | CA certificate (PEM) used to verify the Hubble relay server | `-----BEGIN CERTIFICATE-----` | | `client_certificate` | Client certificate (PEM) for mutual TLS | `-----BEGIN CERTIFICATE-----` | | `client_key` | Client private key (PEM) for mutual TLS | `-----BEGIN PRIVATE KEY-----` | ## Outputs The provider returns topology information including: * Service names and their dependencies * Namespace information * Pod labels and cluster metadata * Network-based relationships between services ## Service Discovery Logic The provider identifies services using the following hierarchy: 1. Workload name (if available) 2. Kubernetes labels (`k8s:app=` or `k8s:app.kubernetes.io/name=`) 3. Pod name (stripped of deployment suffixes) ## Requirements * A running Kubernetes cluster with Cilium installed * Hubble enabled and accessible via gRPC * Network visibility (flow logs) enabled in Cilium ## Limitations * Only captures active network flows between pods * Service discovery is limited to pods with proper Kubernetes labels * Requires direct access to the Hubble relay endpoint ## Useful Links * [Cilium Documentation](https://docs.cilium.io/) * [Hubble Documentation](https://docs.cilium.io/en/stable/hubble/) * [Kubernetes Network Policies](https://kubernetes.io/docs/concepts/services-networking/network-policies/) ## Google Kubernetes Engine specific If you are using a GKE cluster, you cannot connect Keep to the Google-managed hubble-relay directly because: * hubble-relay operates only in secure mode, * hubble-relay requires client certificate authentication. However, Keep does not currently support these features. To work around this, you can add an NGINX Pod that listens on a plaintext HTTP port and proxies requests to hubble-relay secure port using hubble-relay certificates.
You need a GKE cluster with [dataplane v2](https://cloud.google.com/kubernetes-engine/docs/concepts/dataplane-v2) . [Dataplane v2 observability](https://cloud.google.com/kubernetes-engine/docs/how-to/configure-dpv2-observability) must be enabled. Here is an example of running a plaintext NGINX proxy: ```yaml theme={null} --- apiVersion: v1 kind: ConfigMap metadata: name: hubble-relay-insecure-nginx namespace: gke-managed-dpv2-observability data: nginx.conf: | user nginx; worker_processes auto; error_log /dev/stdout notice; pid /var/run/nginx.pid; events { worker_connections 1024; } http { log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /dev/stdout main; server { listen 80; http2 on; location / { grpc_pass grpcs://hubble-relay.gke-managed-dpv2-observability.svc.cluster.local:443; grpc_ssl_certificate /etc/nginx/certs/client.crt; grpc_ssl_certificate_key /etc/nginx/certs/client.key; grpc_ssl_trusted_certificate /etc/nginx/certs/hubble-relay-ca.crt; } } } --- kind: Deployment apiVersion: apps/v1 metadata: name: hubble-relay-insecure namespace: gke-managed-dpv2-observability labels: k8s-app: hubble-relay-insecure app.kubernetes.io/name: hubble-relay-insecure app.kubernetes.io/part-of: cilium spec: replicas: 1 selector: matchLabels: k8s-app: hubble-relay-insecure template: metadata: labels: k8s-app: hubble-relay-insecure app.kubernetes.io/name: hubble-relay-insecure app.kubernetes.io/part-of: cilium spec: securityContext: fsGroup: 1000 seccompProfile: type: RuntimeDefault containers: - name: frontend image: nginx:alpine ports: - name: http containerPort: 80 volumeMounts: - name: hubble-relay-insecure-nginx-conf mountPath: /etc/nginx/ readOnly: true - name: hubble-relay-client-certs mountPath: /etc/nginx/certs/ readOnly: true volumes: - configMap: name: hubble-relay-insecure-nginx name: hubble-relay-insecure-nginx-conf - name: hubble-relay-client-certs projected: defaultMode: 0400 sources: - secret: name: hubble-relay-client-certs items: - key: ca.crt path: hubble-relay-ca.crt - key: tls.crt path: client.crt - key: tls.key path: client.key --- kind: Service apiVersion: v1 metadata: name: hubble-relay-insecure namespace: gke-managed-dpv2-observability labels: k8s-app: hubble-relay-insecure app.kubernetes.io/name: hubble-relay-insecure app.kubernetes.io/part-of: cilium spec: type: ClusterIP selector: k8s-app: hubble-relay-insecure ports: - name: http port: 80 targetPort: 80 ``` Now you can connect Keep with google-managed hubble-relay by adding Cilium provider using `hubble-relay-insecure.gke-managed-dpv2-observability:80` address. # ClickHouse Source: https://docs.keephq.dev/providers/documentation/clickhouse-provider ClickHouse provider allows you to interact with ClickHouse database. ## Overview ClickHouse is an open-source column-oriented DBMS for online analytical processing that allows users to generate analytical reports using SQL queries in real-time. ## Authentication This provider requires authentication. * **username**: Clickhouse username (required: True, sensitive: False) * **password**: Clickhouse password (required: True, sensitive: True) * **host**: Clickhouse hostname (required: True, sensitive: False) * **port**: Clickhouse port (required: True, sensitive: False) * **database**: Clickhouse database name (required: False, sensitive: False) * **protocol**: Protocol ('clickhouses' for SSL, 'clickhouse' for no SSL, 'http' or 'https') (required: True, sensitive: False) * **verify**: Enable SSL verification (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: * **connect\_to\_server**: The user can connect to the server (mandatory) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query clickhouse provider: clickhouse config: "{{ provider.my_provider_name }}" with: query: {value} single_row: {value} ``` As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query clickhouse provider: clickhouse config: "{{ provider.my_provider_name }}" with: query: {value} single_row: {value} ``` Check the following workflow examples: * [clickhouse\_multiquery.yml](https://github.com/keephq/keep/blob/main/examples/workflows/clickhouse_multiquery.yml) * [query\_clickhouse.yml](https://github.com/keephq/keep/blob/main/examples/workflows/query_clickhouse.yml) ## Connecting with the ClickHouse provider 1. Obtain the required authentication parameters. 2. Add ClickHouse provider to your keep account and configure with the above authentication parameters. ## Useful Links * [ClickHouse](https://clickhouse.com/) * [ClickHouse Statements](https://clickhouse.com/docs/en/sql-reference/statements/) # CloudWatch Source: https://docs.keephq.dev/providers/documentation/cloudwatch-provider CloudWatch provider enables seamless integration with AWS CloudWatch for alerting and monitoring, directly pushing alarms into Keep. ## Overview The CloudWatch Provider offers a direct integration with AWS CloudWatch, enabling Keep users to receive CloudWatch alarms within the Keep platform. This integration centralizes the monitoring and alerting capabilities, allowing for timely responses to changes in the infrastructure or application health. ### Key Features: * **Webhook Integration**: Facilitates automatic subscription to AWS SNS topics linked with CloudWatch alarms, ensuring that Keep is notified of all relevant alarms. * **Support for Custom SNS Topics**: Allows the use of both pre-existing SNS topics and the specification of custom SNS topics for alarm notifications. * **Broad Monitoring Scope**: Utilizes CloudWatch's comprehensive alarm system to monitor application and infrastructure health. * **Adaptable Authentication**: Accommodates both permanent and temporary AWS credentials to suit various security and operational requirements. ## Connecting with the Provider To integrate CloudWatch with Keep, you'll need the following: * An AWS account with permissions to access CloudWatch and SNS services. * A configured Keep account with API access. * Appropriate AWS IAM permissions for the CloudWatch provider. ## Setting Up the IntegrationFor a seamless setup process, ensure your AWS IAM roles are properly configured with the necessary permissions for CloudWatch and SNS access. ## Authentication This provider requires authentication. * **region**: AWS region (required: True, sensitive: False) * **access\_key**: AWS access key (Leave empty if using IAM role at EC2) (required: False, sensitive: True) * **access\_key\_secret**: AWS access key secret (Leave empty if using IAM role at EC2) (required: False, sensitive: True) * **session\_token**: AWS Session Token (required: False, sensitive: True) * **cloudwatch\_sns\_topic**: AWS Cloudwatch SNS Topic \[ARN or name] (required: False, sensitive: False) * **protocol**: Protocol to use for the webhook (required: True, 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: * **cloudwatch:DescribeAlarms**: Required to retrieve information about alarms. (mandatory) ([Documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarms.html)) * **cloudwatch:PutMetricAlarm**: Required to update information about alarms. This mainly use to add Keep as an SNS action to the alarm. ([Documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutMetricAlarm.html)) * **sns:ListSubscriptionsByTopic**: Required to list all subscriptions of a topic, so Keep will be able to add itself as a subscription. ([Documentation](https://docs.aws.amazon.com/sns/latest/dg/sns-access-policy-language-api-permissions-reference.html)) * **logs:GetQueryResults**: Part of CloudWatchLogsReadOnlyAccess role. Required to retrieve the results of CloudWatch Logs Insights queries. ([Documentation](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_GetQueryResults.html)) * **logs:DescribeQueries**: Part of CloudWatchLogsReadOnlyAccess role. Required to describe the results of CloudWatch Logs Insights queries. ([Documentation](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeQueries.html)) * **logs:StartQuery**: Part of CloudWatchLogsReadOnlyAccess role. Required to start CloudWatch Logs Insights queries. ([Documentation](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_StartQuery.html)) * **iam:SimulatePrincipalPolicy**: Allow Keep to test the scopes of the current user/role without modifying any resource. ([Documentation](https://docs.aws.amazon.com/IAM/latest/APIReference/API_SimulatePrincipalPolicy.html)) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query cloudwatch provider: cloudwatch config: "{{ provider.my_provider_name }}" with: log_group: {value} log_groups: {value} remove_ptr_from_results: {value} query: {value} hours: {value} ``` Check the following workflow examples: * [retrieve\_cloudwatch\_logs.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/retrieve_cloudwatch_logs.yaml) * [slack\_basic.yml](https://github.com/keephq/keep/blob/main/examples/workflows/slack_basic.yml) * [slack\_basic\_cel.yml](https://github.com/keephq/keep/blob/main/examples/workflows/slack_basic_cel.yml) ### Steps: 1. **Configure AWS IAM Roles**: Ensure the IAM role used by the CloudWatch provider has permissions for `cloudwatch:DescribeAlarms`, `cloudwatch:PutMetricAlarm`, `sns:ListSubscriptionsByTopic`, and other relevant actions. 2. **Specify Authentication Details**: In the Keep platform, enter the AWS Access Key, Secret, and Region details in the CloudWatch provider configuration. 3. **Set Up SNS Topic (Optional)**: If using a custom SNS topic, specify its ARN or name in the provider configuration. Keep will use this topic to listen for alarm notifications. 4. **Activate the Provider**: Finalize the setup in Keep to start receiving CloudWatch alarms. ## Troubleshooting * Ensure the AWS credentials provided have the correct permissions and are not expired. * Verify that the SNS topics are correctly configured to send notifications to Keep. * Check the CloudWatch alarms to ensure they are active and correctly configured to trigger under the desired conditions. ## Webhook Integration Modifications The webhook integration for CloudWatch adds Keep as a subscriber to the SNS topics associated with CloudWatch alarms. This integration allows Keep to receive notifications for all alarms triggered within the AWS environment. The integration automatically gains access to the following scopes within CloudWatch: * `cloudwatch:DescribeAlarms` ## Useful Links * [AWS CloudWatch Documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatch.html) * [AWS SNS Documentation](https://docs.aws.amazon.com/sns/latest/dg/welcome.html) # Console Source: https://docs.keephq.dev/providers/documentation/console-provider Console provider is sort of a mock provider that projects given alert message to the console. ## Inputs * message: The alert message to print to the console ## Outputs This provider has no outputs ## Authentication Parameters This provider has no authentication ## Connecting with the Provider This provider doesn't require any connection ## Notes *No information yet, feel free to contribute it using the "Edit this page" link the buttom of the page* ## Useful Links *No information yet, feel free to contribute it using the "Edit this page" link the buttom of the page* ## Example ```python theme={null} config = { "description": "Console Output Provider", "authentication": {}, } provider = ProvidersFactory.get_provider( provider_id='mock', provider_type="console", provider_config=config ) provider.notify( message="Simple alert showing context with name: {name}".format( name="John Doe" ) ) ```## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query console provider: console config: "{{ provider.my_provider_name }}" with: message: {value} logger: {value} severity: {value} ``` As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query console provider: console config: "{{ provider.my_provider_name }}" with: message: {value} # The message to be printed in to the console logger: {value} # Whether to use the logger or not severity: {value} # The severity of the message if logger is True ``` Check the following workflow examples: * [aks\_basic.yml](https://github.com/keephq/keep/blob/main/examples/workflows/aks_basic.yml) * [change.yml](https://github.com/keephq/keep/blob/main/examples/workflows/change.yml) * [complex-conditions-cel.yml](https://github.com/keephq/keep/blob/main/examples/workflows/complex-conditions-cel.yml) * [console\_example.yml](https://github.com/keephq/keep/blob/main/examples/workflows/console_example.yml) * [consts\_and\_dict.yml](https://github.com/keephq/keep/blob/main/examples/workflows/consts_and_dict.yml) * [eks\_advanced.yml](https://github.com/keephq/keep/blob/main/examples/workflows/eks_advanced.yml) * [eks\_basic.yml](https://github.com/keephq/keep/blob/main/examples/workflows/eks_basic.yml) * [fluxcd\_example.yml](https://github.com/keephq/keep/blob/main/examples/workflows/fluxcd_example.yml) * [gke.yml](https://github.com/keephq/keep/blob/main/examples/workflows/gke.yml) * [ifelse.yml](https://github.com/keephq/keep/blob/main/examples/workflows/ifelse.yml) * [incident-enrich.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/incident-enrich.yaml) * [incident\_example.yml](https://github.com/keephq/keep/blob/main/examples/workflows/incident_example.yml) * [inputs\_example.yml](https://github.com/keephq/keep/blob/main/examples/workflows/inputs_example.yml) * [multi-condition-cel.yml](https://github.com/keephq/keep/blob/main/examples/workflows/multi-condition-cel.yml) * [mustache-paths-example.yml](https://github.com/keephq/keep/blob/main/examples/workflows/mustache-paths-example.yml) * [openshift\_basic.yml](https://github.com/keephq/keep/blob/main/examples/workflows/openshift_basic.yml) * [openshift\_monitoring\_and\_remediation.yml](https://github.com/keephq/keep/blob/main/examples/workflows/openshift_monitoring_and_remediation.yml) * [openshift\_pod\_restart.yml](https://github.com/keephq/keep/blob/main/examples/workflows/openshift_pod_restart.yml) * [pattern-matching-cel.yml](https://github.com/keephq/keep/blob/main/examples/workflows/pattern-matching-cel.yml) * [severity\_changed.yml](https://github.com/keephq/keep/blob/main/examples/workflows/severity_changed.yml) * [webhook\_example.yml](https://github.com/keephq/keep/blob/main/examples/workflows/webhook_example.yml) * [webhook\_example\_foreach.yml](https://github.com/keephq/keep/blob/main/examples/workflows/webhook_example_foreach.yml) # Coralogix Source: https://docs.keephq.dev/providers/documentation/coralogix-provider Coralogix provider allows you to send alerts from Coralogix to Keep using webhooks. ## Overview Coralogix is a modern observability platform delivers comprehensive visibility into all your logs, metrics, traces and security events with end-to-end monitoring. ## Connecting Coralogix to Keep To connect Coralogix to Keep, you need to configure it as a webhook from Coralogix. Follow the steps below to set up the integration: 1. From the Coralogix toolbar, navigate to Data Flow > Outbound Webhooks.
2. In the Outbound Webhooks section, click Generic Webhook.
3. Click Add New.
4. Enter a webhook name and set the URL to `https://api.keephq.dev/alerts/event/coralogix`. 5. Select HTTP method (POST).
6. Generate an API key with webhook role from the [Keep settings](https://platform.keephq.dev/settings?selectedTab=api-key). Copy the API key and paste it in the request header in the next step.
7. Add a request header with the key "x-api-key" and API key as the value in coralogix webhook configuration.
8. Edit the body of the messages that will be sent when the webhook is triggered (optional). 9. Save the configuration. ## Useful Links * [Coralogix Website](https://coralogix.com/) ## In workflows This provider can't be used as a "step" or "action" in workflows. If you want to use it, please let us know by creating an issue in the [GitHub repository](https://github.com/keephq/keep/issues). # Dash0 Source: https://docs.keephq.dev/providers/documentation/dash0-provider Dash0 provider allows you to get events from Dash0 using webhooks. ## Overview Dash0 is modern OpenTelemetry Native Observability, built on CNCF Open Standards such as PromQL, Perses and OTLP with full cost control. ## Connecting Dash0 to Keep To connect Dash0 to Keep, you need to create a webhook in Dash0. 1. Go to Dash0 dashboard and click on Organization settings.
2. Click on `Notification Channels` and create a New notification channel of type `Webhook`.
3. Give a name to the webhook and enter [https://api.keephq.dev/alerts/event/dash0](https://api.keephq.dev/alerts/event/dash0) as the URL. 4. Follow the below steps to create a new API key in Keep. 5. Go to Keep dashboard and click on the profile icon in the botton left corner and click `Settings`.
6. Select `Users and Access` tab and then select `API Keys` tab and create a new API key.
7. Give name and select the role as `webhook` and click on `Create API Key`.
8. Copy the API key.
9. Add a new request header with key `X-API-KEY` and value as the API key copied from Keep and save the webhook.
10. Go to `Notifications` under `Alerting` and create a new notification rule if required or change the existing notification rule to use the webhook created.
11. Go to `Checks` under `Alerting` and create a new check or edit an existing check to use the notification rule created.
![]()
12. Now you will start receiving events in Keep from Dash0. ## Useful Links * [Dash0](https://dash0.com/) ## In workflows This provider can't be used as a "step" or "action" in workflows. If you want to use it, please let us know by creating an issue in the [GitHub repository](https://github.com/keephq/keep/issues). # Databend Source: https://docs.keephq.dev/providers/documentation/databend-provider Databend provider allows you to query databases ## Overview Databend is an open-source, serverless, cloud-native data lakehouse built on object storage with a decoupled storage and compute architecture. It delivers exceptional performance and rapid elasticity, aiming to be the open-source alternative to Snowflake. ## Useful Links * [Databend](https://www.databend.com/) ## Authentication This provider requires authentication. * **host\_url**: Databend host\_url (required: True, sensitive: False) * **username**: Databend username (required: True, sensitive: False) * **password**: Databend password (required: True, sensitive: True) 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: * **connect\_to\_server**: The user can connect to the server (mandatory) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query databend provider: databend config: "{{ provider.my_provider_name }}" with: query: {value} ``` Check the following workflow example: * [query-databend.yml](https://github.com/keephq/keep/blob/main/examples/workflows/query-databend.yml) # Datadog Source: https://docs.keephq.dev/providers/documentation/datadog-provider Datadog provider allows you to query Datadog metrics and logs for monitoring and analytics. ## Authentication This provider requires authentication. * **api\_key**: Datadog Api Key (required: True, sensitive: True) * **app\_key**: Datadog App Key (required: True, sensitive: True) * **domain**: Datadog API domain (required: False, sensitive: False) * **environment**: Topology environment name (required: False, sensitive: False) * **oauth\_token**: For OAuth flow (required: False, sensitive: True) 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: * **events\_read**: Read events data. (mandatory) * **monitors\_read**: Read monitors (mandatory) ([Documentation](https://docs.datadoghq.com/account_management/rbac/permissions/#monitors)) * **monitors\_write**: Write monitors ([Documentation](https://docs.datadoghq.com/account_management/rbac/permissions/#monitors)) * **create\_webhooks**: Create webhooks integrations * **metrics\_read**: View custom metrics. * **logs\_read**: Read log data. * **apm\_read**: Read APM data for Topology creation. * **apm\_service\_catalog\_read**: Read APM service catalog for Topology creation. ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query datadog provider: datadog config: "{{ provider.my_provider_name }}" with: query: {value} timeframe: {value} query_type: {value} ``` Check the following workflow examples: * [complex-conditions-cel.yml](https://github.com/keephq/keep/blob/main/examples/workflows/complex-conditions-cel.yml) * [datadog-log-monitor.yml](https://github.com/keephq/keep/blob/main/examples/workflows/datadog-log-monitor.yml) * [db\_disk\_space\_monitor.yml](https://github.com/keephq/keep/blob/main/examples/workflows/db_disk_space_monitor.yml) * [service-error-rate-monitor-datadog.yml](https://github.com/keephq/keep/blob/main/examples/workflows/service-error-rate-monitor-datadog.yml) ## Topology This provider pulls [topology](/overview/servicetopology) to Keep. It could be used in [correlations](/overview/correlation-topology) and [mapping](/overview/enrichment/mapping#mapping-with-topology-data), and as a context for [alerts](/alerts/sidebar#7-alert-topology-view) and [incidents](/overview#17-incident-topology). ## Provider Methods The provider exposes the following [Provider Methods](/providers/provider-methods#via-ai-assistant). They are available in the [AI Assistant](/overview/ai-incident-assistant). * **mute\_monitor** Mute a monitor (action, scopes: monitors\_write) * **unmute\_monitor** Unmute a monitor (action, scopes: monitors\_write) * **get\_monitor\_events** Get all events related to this monitor (view, scopes: events\_read) * **get\_trace** Get trace by ID (view, scopes: apm\_read) * **create\_incident** Create an incident (action, scopes: incidents\_write) * **resolve\_incident** Resolve an active incident (action, scopes: incidents\_write) * **add\_incident\_timeline\_note** Add a note to an incident timeline (action, scopes: incidents\_write) ## Connecting with the Provider ### API Key To obtain the Datadog API key, follow these steps: 1. Log in to your Datadog account. 2. Navigate to the "Integrations" section. 3. Click on the "API" tab. 4. Generate a new API Key. ### App Key To obtain the Datadog App Key, follow these steps: 1. Log in to your Datadog account. 2. Navigate to the "Integrations" section. 3. Click on the "API" tab. 4. Generate a new App Key or use an existing one. ## Fingerprinting Fingerprints in Datadog are calculated based on the `groups` and `monitor_id` fields of an incoming/pulled event. ## Notes *No information yet, feel free to contribute it using the "Edit this page" link at the bottom of the page* ## Useful Links * [Datadog API Documentation](https://docs.datadoghq.com/api/) * [Datadog Query Language](https://docs.datadoghq.com/dashboards/querying/) ## Webhook Integration Modifications The webhook integration adds Keep as a monitor within Datadog. It can be found under the "Monitors" section. The integration automatically gains access to the following scopes within Datadog: * `monitors_read` * `monitors_write` * `create_webhooks` # DeepSeek Provider Source: https://docs.keephq.dev/providers/documentation/deepseek-provider The DeepSeek Provider enables integration of DeepSeek's language models into Keep.
The DeepSeek Provider supports querying DeepSeek language models for prompt-based interactions. ## Authentication This provider requires authentication. * **api\_key**: DeepSeek API Key (required: True, sensitive: True) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query deepseek provider: deepseek config: "{{ provider.my_provider_name }}" with: prompt: {value} # The user query. model: {value} # The model to use for the query. max_tokens: {value} # The maximum number of tokens to generate. system_prompt: {value} # The system prompt to use. structured_output_format: {value} # The structured output format. ``` Check the following workflow example: * [enrich\_using\_structured\_output\_from\_deepseek.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/enrich_using_structured_output_from_deepseek.yaml) ## Connecting with the Provider To connect to DeepSeek, you'll need to obtain an API Key: 1. Sign up for an account at [DeepSeek](https://platform.deepseek.com) 2. Navigate to your account settings 3. Generate an API key for Keep Use the generated API key in the `authentication` section of your DeepSeek Provider configuration. # Discord Source: https://docs.keephq.dev/providers/documentation/discord-provider Discord provider is a provider that allows to send notifications to Discord ## Authentication This provider requires authentication. * **webhook\_url**: Discord Webhook Url (required: True, sensitive: True) ## In workflows This provider can be used in workflows. As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query discord provider: discord config: "{{ provider.my_provider_name }}" with: content: {value} # The content of the message. components: {value} # The components of the message. ``` Check the following workflow example: * [discord\_basic.yml](https://github.com/keephq/keep/blob/main/examples/workflows/discord_basic.yml) ## Connecting with the Provider * Open the Discord server where you want to create the webhook. * Click on the settings icon next to the server name, and select "Server Settings." * In the left-hand menu, click on "Integrations," and then click on "Webhooks." * Click the "Create Webhook" button, and give your webhook a name. ## Useful Links * [https://discord.com/developers/docs/resources/webhook#execute-webhook](https://discord.com/developers/docs/resources/webhook#execute-webhook) # Dynatrace Source: https://docs.keephq.dev/providers/documentation/dynatrace-provider Dynatrace provider allows integration with Dynatrace for monitoring, alerting, and collecting metrics. ## Authentication This provider requires authentication. * **environment\_id**: Dynatrace's environment ID (required: True, sensitive: False) * **api\_token**: Dynatrace's API token (required: True, sensitive: True) * **alerting\_profile**: Dynatrace's alerting profile for the webhook integration. Defaults to 'Default' (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: * **problems.read**: Read access to Dynatrace problems (mandatory) * **settings.read**: Read access to Dynatrace settings \[for webhook installation] * **settings.write**: Write access to Dynatrace settings \[for webhook installation] ## In workflows This provider can't be used as a "step" or "action" in workflows. If you want to use it, please let us know by creating an issue in the [GitHub repository](https://github.com/keephq/keep/issues). ## Connecting with the Provider 1. Log in to your Dynatrace account and navigate to "Settings" â "Integration" â "Dynatrace API." 2. Generate an API token with appropriate permissions (e.g., Read metrics). 3. Get your environment's Dynatrace URL. 4. Configure the Dynatrace provider using the API token and Dynatrace URL. ## Useful Links -[Dynatrace API Documentation](https://docs.dynatrace.com/docs/dynatrace-api) # EKS Provider Source: https://docs.keephq.dev/providers/documentation/eks-provider EKS provider integrates with AWS EKS and let you interatct with kubernetes clusters hosted on EKS. ## Authentication This provider requires authentication. * **region**: AWS region where the EKS cluster is located (required: True, sensitive: False) * **cluster\_name**: Name of the EKS cluster (required: True, sensitive: False) * **access\_key**: AWS access key (Leave empty if using IAM role at EC2) (required: False, sensitive: True) * **secret\_access\_key**: AWS secret access key (Leave empty if using IAM role at EC2) (required: False, sensitive: True) 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: * **eks:DescribeCluster**: Required to get cluster information (mandatory) ([Documentation](https://docs.aws.amazon.com/eks/latest/APIReference/API_DescribeCluster.html)) * **eks:ListClusters**: Required to list available clusters (mandatory) ([Documentation](https://docs.aws.amazon.com/eks/latest/APIReference/API_ListClusters.html)) * **pods:delete**: Required to delete/restart pods ([Documentation](https://kubernetes.io/docs/reference/access-authn-authz/rbac/)) * **deployments:scale**: Required to scale deployments ([Documentation](https://kubernetes.io/docs/reference/access-authn-authz/rbac/)) * **pods:list**: Required to list pods ([Documentation](https://kubernetes.io/docs/reference/access-authn-authz/rbac/)) * **pods:get**: Required to get pod details ([Documentation](https://kubernetes.io/docs/reference/access-authn-authz/rbac/)) * **pods:logs**: Required to get pod logs ([Documentation](https://kubernetes.io/docs/reference/access-authn-authz/rbac/)) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query eks provider: eks config: "{{ provider.my_provider_name }}" with: command_type: {value} # Type of query to execute # Additional arguments for the query ``` Check the following workflow examples: * [eks\_advanced.yml](https://github.com/keephq/keep/blob/main/examples/workflows/eks_advanced.yml) * [eks\_basic.yml](https://github.com/keephq/keep/blob/main/examples/workflows/eks_basic.yml) ## Provider Methods The provider exposes the following [Provider Methods](/providers/provider-methods#via-ai-assistant). They are available in the [AI Assistant](/overview/ai-incident-assistant). * **get\_pods** List all pods in a namespace or across all namespaces (view, scopes: pods:list, pods:get) * `namespace`: The namespace to list pods from. If None, lists pods from all namespaces. * **get\_pvc** List all PVCs in a namespace or across all namespaces (view, scopes: pods:list) * `namespace`: The namespace to list pods from. If None, lists pods from all namespaces. * **get\_node\_pressure** Get pressure metrics for all nodes (view, scopes: pods:list) * **exec\_command** Execute a command in a pod (action, scopes: pods:exec) * `namespace`: Namespace of the pod * `pod_name`: Name of the pod * `command`: Command to execute (string or array) * `container`: Name of the container (optional, defaults to first container) * **restart\_pod** Restart a pod by deleting it (action, scopes: pods:delete) * `namespace`: Namespace of the pod * `pod_name`: Name of the pod * **get\_deployment** Get deployment information (view, scopes: pods:list) * `deployment_name`: Name of the deployment to get * `namespace`: Target namespace (defaults to âdefaultâ) * **scale\_deployment** Scale a deployment to specified replicas (action, scopes: deployments:scale) * `deployment_name`: Name of the deployment to get * `namespace`: Target namespace (defaults to âdefaultâ) * `replicas`: Number of replicas to scale to * **get\_pod\_logs** Get logs from a pod (view, scopes: pods:logs) * `namespace`: Namespace of the pod * `pod_name`: Name of the pod * `container`: Name of the container (optional) * `tail_lines`: Number of lines to fetch from the end of logs (default: 100) ## Connecting with the Provider To connect to Amazon EKS, follow these steps: 1. Log in to your [AWS Console](https://aws.amazon.com/) 2. Create an IAM user with EKS permissions: ```bash theme={null} aws iam create-user --user-name eks-user ``` 3. Attach required policies: ```bash theme={null} aws iam attach-user-policy --user-name eks-user --policy-arn arn:aws:iam::aws:policy/AmazonEKSClusterPolicy aws iam attach-user-policy --user-name eks-user --policy-arn arn:aws:iam::aws:policy/AmazonEKSServicePolicy ``` 4. Create access keys ```bash theme={null} aws iam create-access-key --user-name eks-user ``` You should get: ``` { "AccessKey": { "AccessKeyId": "AKIAXXXXXXXXXXXXXXXX", "SecretAccessKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Status": "Active" } } ``` The `AccessKeyId` is your `access_key` and `SecretAccessKey` is your `secret_access_key`. 5. Note your cluster name and region from the EKS console or using: ```bash theme={null} aws eks list-clusters --region``` ## Required Permissions The AWS IAM user needs these permissions: 1. **eks:DescribeCluster** 2. **eks:ListClusters** Additional permissions for specific operations: 3. **eks:AccessKubernetesApi** for pod/deployment operations 4. **eks:UpdateCluster** for scaling operations | Command | AWS IAM Permissions | | ------------------- | ------------------------------------------------------ | | `get_pods` | `eks:DescribeCluster`
`eks:AccessKubernetesApi` | | `get_pvc` | `eks:DescribeCluster`
`eks:AccessKubernetesApi` | | `get_node_pressure` | `eks:DescribeCluster`
`eks:AccessKubernetesApi` | | `get_deployment` | `eks:DescribeCluster`
`eks:AccessKubernetesApi` | | `scale_deployment` | `eks:DescribeCluster`
`eks:AccessKubernetesApi` | | `exec_command` | `eks:DescribeCluster`
`eks:AccessKubernetesApi` | | `restart_pod` | `eks:DescribeCluster`
`eks:AccessKubernetesApi` | | `get_pod_logs` | `eks:DescribeCluster`
`eks:AccessKubernetesApi` | # Elastic Source: https://docs.keephq.dev/providers/documentation/elastic-provider Elastic provider is a provider used to query Elasticsearch (tested with elastic.co) ## Authentication This provider requires authentication. * **host**: Elasticsearch host (required: False, sensitive: False) * **cloud\_id**: Elasticsearch cloud id (required: False, sensitive: False) * **verify**: Enable SSL verification (required: False, sensitive: False) * **api\_key**: Elasticsearch API Key (required: False, sensitive: True) * **username**: Elasticsearch username (required: False, sensitive: False) * **password**: Elasticsearch password (required: False, sensitive: True) 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: * **connect\_to\_server**: The user can connect to the server (mandatory) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query elastic provider: elastic config: "{{ provider.my_provider_name }}" with: query: {value} # The body of the query index: {value} # The index to search in ``` Check the following workflow examples: * [create\_alerts\_from\_elastic.yml](https://github.com/keephq/keep/blob/main/examples/workflows/create_alerts_from_elastic.yml) * [elastic\_basic.yml](https://github.com/keephq/keep/blob/main/examples/workflows/elastic_basic.yml) * [elastic\_enrich\_example.yml](https://github.com/keephq/keep/blob/main/examples/workflows/elastic_enrich_example.yml) ## Connecting with the Provider ### API Key To obtain the Elastic API key, follow these steps: 1. Log in to your elastic.co account 2. Go to the "Elasticsearch Service" section 3. Click on the "API Key" button 4. Generate a new API Key ### Cloud ID To obtain the Elastic Cloud ID, follow these steps: 1. Log in to your elastic.co account 2. Go to the "Elasticsearch Service" section 3. Find the "Cloud ID" in the Overview page. # Flashduty Source: https://docs.keephq.dev/providers/documentation/flashduty-provider Flashduty docs## Authentication This provider requires authentication. * **integration\_key**: Flashduty integration key (required: True, sensitive: True) ## In workflows This provider can be used in workflows. As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query flashduty provider: flashduty config: "{{ provider.my_provider_name }}" with: title: {value} # The title of the incident event_status: {value} # The status of the incident, one of: Info, Warning, Critical, Ok description: {value} # The description of the incident alert_key: {value} # Alert identifier, used to update or automatically recover existing alerts. If you're reporting a recovery event, this value must exist. labels: {value} # The labels of the incident ``` Check the following workflow example: * [flashduty\_example.yml](https://github.com/keephq/keep/blob/main/examples/workflows/flashduty_example.yml) ## Integration Key Generation The Flashduty gets integration key as an authentication method 1.Enter the Flashduty console, select Integration Center => Alert Events to enter the integration selection page
2.Select Keep integration 3.Define a name for the current integration 4.Configure default routing and select the corresponding channel 5.Copy the integration Key to Keep 6.Complete the integration configuration
## Useful Links * [https://docs.flashcat.cloud/en/flashduty/keep-alert-integration-guide?nav=01JCQ7A4N4WRWNXW8EWEHXCMF5](https://docs.flashcat.cloud/en/flashduty/keep-alert-integration-guide?nav=01JCQ7A4N4WRWNXW8EWEHXCMF5) # Flux CD Source: https://docs.keephq.dev/providers/documentation/fluxcd-provider Flux CD Provider enables integration with Flux CD for GitOps topology and alerts. ## Authentication This provider requires authentication. * **kubeconfig**: Kubeconfig file content (required: False, sensitive: True) * **context**: Kubernetes context to use (required: False, sensitive: False) * **namespace**: Namespace where Flux CD is installed (required: False, sensitive: False) * **api\_server**: Kubernetes API server URL (required: False, sensitive: False) * **token**: Kubernetes API token (required: False, sensitive: True) * **insecure**: Skip TLS verification (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: * **authenticated**: User is Authorized (mandatory) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query fluxcd provider: fluxcd config: "{{ provider.my_provider_name }}" with: **_: {value} # Additional arguments (ignored) ``` As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query fluxcd provider: fluxcd config: "{{ provider.my_provider_name }}" with: action: {value} # The action to perform. Supported actions are: - reconcile: Trigger a reconciliation for a FluxCD resource. # Additional arguments for the action. ``` Check the following workflow example: * [fluxcd\_example.yml](https://github.com/keephq/keep/blob/main/examples/workflows/fluxcd_example.yml) ## Topology This provider pulls [topology](/overview/servicetopology) to Keep. It could be used in [correlations](/overview/correlation-topology) and [mapping](/overview/enrichment/mapping#mapping-with-topology-data), and as a context for [alerts](/alerts/sidebar#7-alert-topology-view) and [incidents](/overview#17-incident-topology). ## Provider Methods The provider exposes the following [Provider Methods](/providers/provider-methods#via-ai-assistant). They are available in the [AI Assistant](/overview/ai-incident-assistant). * **get\_fluxcd\_resources** Get resources from Flux CD (, scopes: no additional scopes) ## Overview Flux CD is a GitOps tool for Kubernetes that provides continuous delivery through automated deployment, monitoring, and management of applications. This provider allows you to integrate Flux CD with Keep to get a single pane of glass for monitoring your GitOps deployments. ## Features ### Topology The Flux CD provider pulls topology data from the following Flux CD resources: * GitRepositories * HelmRepositories * HelmCharts * OCIRepositories * Buckets * Kustomizations * HelmReleases The topology shows the relationships between these resources, allowing you to visualize the GitOps deployment process. Resources are categorized as: * **Source**: GitRepositories, HelmRepositories, OCIRepositories, Buckets * **Deployment**: Kustomizations, HelmReleases ### Alerts The Flux CD provider gets alerts from two sources: 1. Kubernetes events related to Flux CD controllers 2. Status conditions of Flux CD resources (GitRepositories, Kustomizations, HelmReleases) Alerts include: * Failed GitRepository operations * Failed Kustomization operations * Failed HelmRelease operations * Non-ready resources Alert severity is determined based on: * **Critical**: Events with "failed", "error", "timeout", "backoff", or "crash" in the reason * **High**: Other warning events * **Info**: Normal events ## Connecting with the Provider The Flux CD provider supports multiple authentication methods: 1. **Kubeconfig file content** (recommended for external access) 2. **API server URL and token** 3. **In-cluster configuration** (when running inside a Kubernetes cluster) 4. **Default kubeconfig file** (from \~/.kube/config) ### Using Kubeconfig ```yaml theme={null} apiVersion: keep.sh/v1 kind: Provider metadata: name: flux-cd spec: type: fluxcd authentication: kubeconfig: | apiVersion: v1 kind: Config clusters: - name: my-cluster cluster: server: https://kubernetes.example.com certificate-authority-data: BASE64_ENCODED_CA_CERT users: - name: my-user user: token: MY_TOKEN contexts: - name: my-context context: cluster: my-cluster user: my-user current-context: my-context context: my-context namespace: flux-system ``` ### Using API Server and Token ```yaml theme={null} apiVersion: keep.sh/v1 kind: Provider metadata: name: flux-cd spec: type: fluxcd authentication: api-server: https://kubernetes.example.com token: MY_TOKEN namespace: flux-system ``` > Note: Both `api-server` and `api_server` formats are supported for backward compatibility. ### Using In-Cluster Configuration ```yaml theme={null} apiVersion: keep.sh/v1 kind: Provider metadata: name: flux-cd spec: type: fluxcd authentication: namespace: flux-system ``` ## Comparison with ArgoCD Provider Keep supports both Flux CD and ArgoCD for GitOps deployments. Here's a comparison of the two providers: | Feature | Flux CD | ArgoCD | | ---------------- | --------------------------------------------------------------- | ------------------------ | | Topology | â | â | | Alerts | â | â | | Resource Types | GitRepositories, HelmRepositories, Kustomizations, HelmReleases | Applications, Projects | | Authentication | Kubeconfig, API Server, In-Cluster | Username/Password, Token | | Deployment Model | Kubernetes Controllers | Server + Controllers | | UI Integration | No (CLI only) | Yes (Web UI) | ## Related Resources * [Flux CD Documentation](https://fluxcd.io/docs/) * [Flux CD GitHub Repository](https://github.com/fluxcd/flux2) * [Keep Documentation](https://docs.keephq.dev) # GCP Monitoring Source: https://docs.keephq.dev/providers/documentation/gcpmonitoring-provider GCP Monitoring provider allows you to get alerts and logs from GCP Monitoring via webhooks and log queries. ## Overview The GCP Monitoring Provider enables seamless integration between Keep and GCP Monitoring, allowing alerts from GCP Monitoring to be directly sent to Keep through webhook configurations. In addition to alerts, the provider now supports querying log entries from GCP Logging, enabling a comprehensive view of alerts and associated logs within Keep's platform. ## Connecting GCP Monitoring to Keep ### Alert Integration via Webhook To connect GCP Monitoring alerts to Keep, configure a webhook as a notification channel in GCP Monitoring and link it to the desired alert policy. ### Step 1: Access Notification Channels Log in to the Google Cloud Platform console. Navigate to **Monitoring > Alerting > Notification channels**.
### Step 2: Add a New Webhook Within the Webhooks section, click on **ADD NEW**.
### Step 3: Configure the Webhook In the Endpoint URL field, enter the webhook URL provided by Keep. * **Display Name**: keep-gcpmonitoring-webhook-integration * Enable **Use HTTP Basic Auth** and input the following credentials: * **Auth Username**: `api_key` * **Auth Password**: `%YOURAPIKEY%`
### Step 4: Save the Webhook Configuration * Click **Save** to store the webhook configuration. ### Step 5: Associate the Webhook with an Alert Policy Navigate to the alert policy you wish to send notifications from to Keep. * Click **Edit**. * Under "Notifications and name," find the **Notification Channels** section and select the `keep-gcpmonitoring-webhook-integration` channel you created. * Save the changes by clicking on **SAVE POLICY**.
![]()
### Step 6: Review the Alert in Keep Once the setup is complete, alerts from GCP Monitoring will start appearing in Keep.
## Log Query Integration The GCP Monitoring Provider also supports querying logs from GCP Logging, allowing you to fetch log entries based on specific filters. This is helpful for enriching alert data with related logs or for monitoring specific events in Keep. ### Authentication Requirements To enable log querying, you need to provide a service account JSON file with the `logs.viewer` role. This service account should be configured in the `authentication` section of your GCP Monitoring Provider configuration. ### Querying Logs The providerâs `query` function supports filtering logs based on criteria such as resource type, severity, or specific keywords. You can specify a time range for querying logs using `timedelta_in_days`, and control the number of entries with `page_size`. #### Example Usage Hereâs an example of how you might use the provider to query log entries: ```python theme={null} query(filter='resource.type="cloud_run_revision" AND severity="ERROR"', timedelta_in_days=1) ``` This will return logs of severity âERRORâ related to Cloud Run revisions from the past day. #### Post Installation Validation To validate both alerts and logs, follow these steps: 1. Alert Validation: Test the webhook by triggering an alert in GCP Monitoring and confirm it appears in Keep. 2. Log Query Validation: Execute a simple log query and verify that log entries are returned as expected. ### Useful Links * [GCP Monitoring Notification Channels](https://cloud.google.com/monitoring/support/notification-options) * [GCP Monitoring Alerting](https://cloud.google.com/monitoring/alerts) ## Authentication This provider requires authentication. * **service\_account\_json**: A service account JSON with logging viewer role (required: True, sensitive: True) 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: * **roles/logs.viewer**: Read access to GCP logging (mandatory) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query gcpmonitoring provider: gcpmonitoring config: "{{ provider.my_provider_name }}" with: filter: {value} timedelta_in_days: {value} page_size: {value} raw: {value} project: {value} ``` Check the following workflow examples: * [gcp\_logging\_open\_ai.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/gcp_logging_open_ai.yaml) * [slack-message-reaction.yml](https://github.com/keephq/keep/blob/main/examples/workflows/slack-message-reaction.yml) ## Provider Methods The provider exposes the following [Provider Methods](/providers/provider-methods#via-ai-assistant). They are available in the [AI Assistant](/overview/ai-incident-assistant). * **execute\_query** Query the GCP logs (view, scopes: no additional scopes) # Gemini Provider Source: https://docs.keephq.dev/providers/documentation/gemini-provider The Gemini Provider allows for integrating Google's Gemini language models into Keep.
The Gemini Provider supports querying Gemini language models for prompt-based interactions. ## Authentication This provider requires authentication. * **api\_key**: Google AI API Key (required: True, sensitive: True) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query gemini provider: gemini config: "{{ provider.my_provider_name }}" with: prompt: {value} model: {value} max_tokens: {value} structured_output_format: {value} ``` If you need workflow examples with this provider, please raise a [GitHub issue](https://github.com/keephq/keep/issues). ## Connecting with the Provider To connect to Gemini, you'll need to obtain an API Key: 1. Go to [Google AI Studio](https://makersuite.google.com/app/apikey). 2. Click on **Create API Key** or use an existing one. 3. Copy your API key for Keep. Use the generated API key in the `authentication` section of your Gemini Provider configuration. # GitHub Source: https://docs.keephq.dev/providers/documentation/github-provider GitHub provider allows integration with GitHub for managing repositories, issues, pull requests, and more. ## Authentication This provider requires authentication. * **access\_token**: GitHub Access Token (required: True, sensitive: True) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query github provider: github config: "{{ provider.my_provider_name }}" with: repository: {value} previous_stars_count: {value} last_stargazer: {value} ``` As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query github provider: github config: "{{ provider.my_provider_name }}" with: run_action: {value} # The action to run. workflow: {value} # The workflow to run. repo_name: {value} # The repository name. repo_owner: {value} # The repository owner. ref: {value} # The ref to use. inputs: {value} # The inputs to use. ``` Check the following workflow examples: * [datadog-log-monitor.yml](https://github.com/keephq/keep/blob/main/examples/workflows/datadog-log-monitor.yml) * [db\_disk\_space\_monitor.yml](https://github.com/keephq/keep/blob/main/examples/workflows/db_disk_space_monitor.yml) * [new\_github\_stars.yml](https://github.com/keephq/keep/blob/main/examples/workflows/new_github_stars.yml) * [run-github-workflow.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/run-github-workflow.yaml) * [service-error-rate-monitor-datadog.yml](https://github.com/keephq/keep/blob/main/examples/workflows/service-error-rate-monitor-datadog.yml) * [update\_workflows\_from\_http.yml](https://github.com/keephq/keep/blob/main/examples/workflows/update_workflows_from_http.yml) * [zoom\_chat\_example.yml](https://github.com/keephq/keep/blob/main/examples/workflows/zoom_chat_example.yml) ## Provider Methods The provider exposes the following [Provider Methods](/providers/provider-methods#via-ai-assistant). They are available in the [AI Assistant](/overview/ai-incident-assistant). * **get\_last\_commits** Get the N last commits from a GitHub repository (view, scopes: no additional scopes) * `repository`: The GitHub repository to get the commits from. * `n`: The number of commits to get. * **get\_last\_releases** Get the N last releases and their changelog from a GitHub repository (view, scopes: no additional scopes) * `repository`: The GitHub repository to get the releases from. * `n`: The number of releases to get. ## Connecting with the Provider 1. Go to your GitHub account and navigate to **Settings > Developer Settings > Personal Access Tokens**. 2. Generate a token with the required permissions (e.g., `repo`, `workflow`, etc.). 3. Copy the token and provide it as `github_token` in the provider configuration. ## Useful Links * [GitHub REST API Documentation](https://docs.github.com/en/rest?apiVersion=2022-11-28) # Github Workflows Source: https://docs.keephq.dev/providers/documentation/github_workflows_provider GithubWorkflowProvider is a provider that interacts with Github Workflows API. ## Authentication This provider requires authentication. * **personal\_access\_token**: Github Personal Access Token (required: True, sensitive: True) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query github_workflows provider: github_workflows config: "{{ provider.my_provider_name }}" with: url: {value} method: {value} ``` As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query github_workflows provider: github_workflows config: "{{ provider.my_provider_name }}" with: github_url: {value} github_method: {value} ``` If you need workflow examples with this provider, please raise a [GitHub issue](https://github.com/keephq/keep/issues). ## Connecting with the Provider Create your personal access token (classic) in github * In the upper-right corner of any page, click your profile photo, then click **Settings**. * In the left sidebar, click **Developer settings**. * In the left sidebar, under Personal access tokens, click **Tokens (classic)**. * Select Generate new token, then click Generate new **token (classic)**. * In the "Note" field, give your token a descriptive name. * To give your token an expiration, select **Expiration**, then choose a default option or click **Custom** to enter a date. * Select the scopes you'd like to grant this token. * Click **Generate token**. * Optionally, to copy the new token to your clipboard, click copy button. See bellow for more info. ## Useful Links * [Workflows](https://docs.github.com/en/rest/actions/workflows) * [Workflows runs](https://docs.github.com/en/rest/actions/workflow-runs) * [Workflows jobs](https://docs.github.com/en/rest/actions/workflow-jobs) * [Managing your personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) # GitLab Provider Source: https://docs.keephq.dev/providers/documentation/gitlab-provider GitLab provider is a provider used for creating issues in GitLab ## Authentication This provider requires authentication. * **host**: GitLab Host (required: True, sensitive: False) * **personal\_access\_token**: GitLab Personal Access Token (required: True, sensitive: True) 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: * **api**: Authenticated with api scope (mandatory) ## In workflows This provider can be used in workflows. As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query gitlab provider: gitlab config: "{{ provider.my_provider_name }}" with: id: {value} title: {value} description: {value} labels: {value} issue_type: {value} ``` If you need workflow examples with this provider, please raise a [GitHub issue](https://github.com/keephq/keep/issues). ## Connecting with the Provider 1. Go to [Personal Access Token](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#create-a-personal-access-token) to see how to create a personal\_access\_token. 2. Get `host`, eg: if you're using Cloud GitLab, use: `https://gitlab.com` or use your `host` if you're using onPrem. ## Useful Links * [GitLab PAT](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#create-a-personal-access-token) * [GitLab Create New Issue](https://docs.gitlab.com/ee/api/issues.html#new-issue) * [GitLab Scopes](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#personal-access-token-scopes) # GitLab Pipelines Source: https://docs.keephq.dev/providers/documentation/gitlabpipelines-provider GitLab Pipelines Provider is a provider that interacts with GitLab Pipelines API. ## Authentication This provider requires authentication. * **access\_token**: GitLab Access Token (required: True, sensitive: True) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query gitlabpipelines provider: gitlabpipelines config: "{{ provider.my_provider_name }}" with: url: {value} method: {value} ``` As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query gitlabpipelines provider: gitlabpipelines config: "{{ provider.my_provider_name }}" with: gitlab_url: {value} gitlab_method: {value} ``` If you need workflow examples with this provider, please raise a [GitHub issue](https://github.com/keephq/keep/issues). ## Connecting with the Provider Create your personal access token in GitLab * On the left sidebar, select your avatar. * Select **Edit profile**. * On the left sidebar, select **Access Tokens**. * Select Add **new token**. * Enter a **name** and **expiry date** for the token. * Select the desired scopes. * Select Create **personal access token**. ## Useful Links * [GitLab PAT](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#create-a-personal-access-token) * [GitLab Pipelines API](https://docs.gitlab.com/ee/api/pipelines.html) # Google Kubernetes Engine Source: https://docs.keephq.dev/providers/documentation/gke-provider Google Kubernetes Engine provider allows managing Google Kubernetes Engine clusters and related resources. ## Authentication This provider requires authentication. * **cluster\_name**: The name of the cluster (required: True, sensitive: False) * **service\_account\_json**: The service account JSON with container.viewer role. Leave empty to use Application Default Credentials (e.g. GKE Workload Identity) (required: False, sensitive: True) * **region**: The GKE cluster region (required: False, sensitive: False) * **project\_id**: The GCP project id (defaults to the service account project or the Application Default Credentials project) (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: * **roles/container.viewer**: Read access to GKE resources (mandatory) * **pods:delete**: Required to delete/restart pods ([Documentation](https://kubernetes.io/docs/reference/access-authn-authz/rbac/)) * **deployments:scale**: Required to scale deployments ([Documentation](https://kubernetes.io/docs/reference/access-authn-authz/rbac/)) * **pods:list**: Required to list pods ([Documentation](https://kubernetes.io/docs/reference/access-authn-authz/rbac/)) * **pods:get**: Required to get pod details ([Documentation](https://kubernetes.io/docs/reference/access-authn-authz/rbac/)) * **pods:logs**: Required to get pod logs ([Documentation](https://kubernetes.io/docs/reference/access-authn-authz/rbac/)) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query gke provider: gke config: "{{ provider.my_provider_name }}" with: command_type: {value} # Type of query to execute # Additional arguments will be passed to the query method ``` Check the following workflow example: * [gke.yml](https://github.com/keephq/keep/blob/main/examples/workflows/gke.yml) ## Provider Methods The provider exposes the following [Provider Methods](/providers/provider-methods#via-ai-assistant). They are available in the [AI Assistant](/overview/ai-incident-assistant). * **get\_pods** List all pods in a namespace or across all namespaces (view, scopes: pods:list, pods:get) * **get\_pvc** List all PVCs in a namespace or across all namespaces (view, scopes: pods:list) * **get\_node\_pressure** Get pressure metrics for all nodes (view, scopes: pods:list) * **exec\_command** Execute a command in a pod (action, scopes: pods:exec) * **restart\_pod** Restart a pod by deleting it (action, scopes: pods:delete) * **get\_deployment** Get deployment information (view, scopes: pods:list) * **scale\_deployment** Scale a deployment to specified replicas (action, scopes: deployments:scale) * **get\_pod\_logs** Get logs from a pod (view, scopes: pods:logs) ## Connecting with the Provider 1. Obtain Google Cloud credentials by following the steps in [Google Cloud's service account guide](https://cloud.google.com/iam/docs/creating-managing-service-account-keys). 2. Ensure your service account has the necessary permissions to manage GKE clusters (`roles/container.admin`). 3. Provide the `gcp_credentials`, `project_id`, and `zone` in your provider configuration. Alternatively, leave `service_account_json` empty to authenticate with [Application Default Credentials](https://cloud.google.com/docs/authentication/application-default-credentials), for example a GKE [Workload Identity](https://cloud.google.com/kubernetes-engine/docs/concepts/workload-identity) service account. The project is resolved automatically and can be overridden with `project_id`. ## Usefull Links -[Google Kubernetes Engine Documentation](https://cloud.google.com/kubernetes-engine/docs) # Google Chat Source: https://docs.keephq.dev/providers/documentation/google_chat-provider Google Chat provider is a provider that allows to send messages to Google Chat ## Authentication This provider requires authentication. * **webhook\_url**: Google Chat Webhook Url (required: True, sensitive: True) ## In workflows This provider can be used in workflows. As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query google_chat provider: google_chat config: "{{ provider.my_provider_name }}" with: message: {value} # The text message to send. ``` If you need workflow examples with this provider, please raise a [GitHub issue](https://github.com/keephq/keep/issues). ## Connecting with the Provider 1. Open Google Chat 2. Open the space to which you want to add a webhook 3. Next to the space title, click the expand more arrow, and then click "Apps & Integrations" 4. Click "+ Add webhooks" 5. In the Name field, enter "Quickstart Webhook" 6. In the Avatar URL field, enter [https://developers.google.com/chat/images/chat-product-icon.png](https://developers.google.com/chat/images/chat-product-icon.png) 7. Click Save 8. To copy the webhook URL, click "More", and then click "Copy link". ## Useful Links * [https://developers.google.com/chat/how-tos/webhooks](https://developers.google.com/chat/how-tos/webhooks) # Grafana Provider Source: https://docs.keephq.dev/providers/documentation/grafana-provider Grafana Provider allows either pull/push alerts and pull Topology Map from Grafana to Keep.Grafana currently supports pulling/pushing alerts & Topology Map. We will add querying and notifying soon. ## Authentication This provider requires authentication. * **token**: Token (required: True, sensitive: True) * **host**: Grafana host (required: True, sensitive: False) * **datasource\_uid**: Datasource UID (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: * **alert.rules:read**: Read Grafana alert rules in a folder and its subfolders. (mandatory) ([Documentation](https://grafana.com/docs/grafana/latest/administration/roles-and-permissions/access-control/custom-role-actions-scopes/)) * **alert.provisioning:read**: Read all Grafana alert rules, notification policies, etc via provisioning API. ([Documentation](https://grafana.com/docs/grafana/latest/administration/roles-and-permissions/access-control/custom-role-actions-scopes/)) * **alert.provisioning:write**: Update all Grafana alert rules, notification policies, etc via provisioning API. ([Documentation](https://grafana.com/docs/grafana/latest/administration/roles-and-permissions/access-control/custom-role-actions-scopes/)) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query grafana provider: grafana config: "{{ provider.my_provider_name }}" with: datasource_uid: {value} # uid of the datasource to query (required). query: {value} # full query object for datasource specific fields, merged last so it overrides the arguments below. expr: {value} # query expression for Prometheus-style datasources. raw_sql: {value} # SQL statement for SQL datasources. start: {value} # start of the Grafana time range, absolute or relative such as now-1h. end: {value} # end of the Grafana time range, absolute or relative such as now. instant: {value} # run a Prometheus instant query instead of a range query. max_data_points: {value} # cap on the number of returned points. ``` Check the following workflow examples: * [create-new-incident-grafana-incident.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/create-new-incident-grafana-incident.yaml) * [create\_service\_now\_ticket\_upon\_alerts.yml](https://github.com/keephq/keep/blob/main/examples/workflows/create_service_now_ticket_upon_alerts.yml) * [query\_grafana\_loki.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/query_grafana_loki.yaml) * [update-incident-grafana-incident.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/update-incident-grafana-incident.yaml) ## Topology This provider pulls [topology](/overview/servicetopology) to Keep. It could be used in [correlations](/overview/correlation-topology) and [mapping](/overview/enrichment/mapping#mapping-with-topology-data), and as a context for [alerts](/alerts/sidebar#7-alert-topology-view) and [incidents](/overview#17-incident-topology). ## Connecting via Webhook (omnidirectional) This provider supports webhooks. If your Grafana is unreachable from Keep, you can use the following webhook url to configure Grafana to send alerts to Keep: 1. In Grafana, go to the Alerting tab in the Grafana dashboard. 2. Click on Contact points in the left sidebar and create a new one. 3. Give it a name and select Webhook as kind of contact point with webhook url as KEEP\_BACKEND\_URL/alerts/event/grafana. 4. Add 'X-API-KEY' as the request header . 5. Save the webhook. 6. Click on Notification policies in the left sidebar 7. Click on "New child policy" under the "Default policy" 8. Remove all matchers until you see the following: "If no matchers are specified, this notification policy will handle all alert instances." 9. Chose the webhook contact point you have just created under Contact point and click "Save Policy" ## Legacy vs Unified Alerting Keep supports both Grafana's legacy alerting system and the newer Unified Alerting system. Here are the key differences: ### Legacy Alerting * Uses notification channels for alert delivery * Configured at the dashboard level * Uses a different API endpoint (`/api/alerts` and `/api/alert-notifications`) * Simpler setup but fewer features * Alerts are tightly coupled with dashboard panels ### Unified Alerting (Default from Grafana 9.0) * Uses alert rules and contact points * Configured centrally in the Alerting section * Uses the newer `/api/v1/alerts` endpoint * More powerful features including label-based routing * Supports multiple data sources in a single alert ruleIf you're using Grafana 8.x or earlier, or have explicitly enabled legacy alerting in newer versions, make sure to configure Keep accordingly using the legacy alerting configuration. ## Connecting with the Provider To connect to Grafana, you need to create an API Token: 1. Log in to your Grafana account. 2. Go to the **Service Accounts** page (cmd+k -> service). 3. Click the **Add service account** button and provide a name for your service account. 4. Grant "alerting" permissions:5. Now generate Service Account Token:
6. Use the token value in the `authentication` section in the Grafana Provider configuration. ## Post Installation Validation You can check that the Grafana Provider works by testing Keep's contact point (which was installed via the webhook integration). 1. Go to **Contact Points** (cmd k -> contact). 2. Find the **keep-grafana-webhook-integration**:
3. Click on the **View contact point**:
4. Click on **Test**:
5. Go to Keep - you should see an alert from Grafana! **Alternative Validation Methods (When Keep is Not Accessible Externally):** If Keep is not accessible externally and the webhook cannot be created, you can manually validate the Grafana provider setup using the following methods: 1. **Manual Test Alerts in Grafana:** * Create a manual test alert in Grafana. * Set up a contact point within Grafana that would normally send alerts to Keep. * Trigger the alert and check Grafana's logs for errors or confirmation that the alert was sent. 2. **Check Logs in Grafana:** * Access Grafana's log files or use the **Explore** feature to query logs related to the alerting mechanism. * Ensure there are no errors related to the webhook integration and that alerts are processed correctly. 3. **Verify Integration Status:** * Navigate to the **Alerting** section in Grafana. * Confirm that the integration status shows as active or functioning. * Monitor any outbound HTTP requests to verify that Grafana is attempting to communicate with Keep. 4. **Network and Connectivity Check:** * Use network monitoring tools to ensure Grafana can reach Keep or any alternative endpoint configured for alerts. ## Service Topology Grafana can contribute data to Keep's Service Topology map when the provider is configured with a topology datasource UID. Keep queries Grafana service graph metrics from that datasource and uses the `client` and `server` labels to build services and dependencies.
The Topology Map is generated from traces collected by Tempo and exposed through a Prometheus-compatible datasource. To get the Datasource UID, go to: 1. Connections > Data Sources. 2. Click the Prometheus instance that is scraping data from Tempo. The URL is in the format `https://host/connections/datasources/edit/ ## Webhook Integration Modifications The webhook integration adds Keep as a contact point in the Grafana instance. This integration can be located under the "Contact Points" section. Keep also gains access to the following scopes: * `alert.provisioning:read` * `alert.provisioning:write` # Grafana Incident Provider Source: https://docs.keephq.dev/providers/documentation/grafana_incident-provider Grafana Incident Provider alows you to query all incidents from Grafana Incident. ## Authentication This provider requires authentication. * **host\_url**: Grafana Host URL (required: True, sensitive: False) * **service\_account\_token**: Service Account Token (required: True, sensitive: True) 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: * **authenticated**: User is Authenticated ## In workflows This provider can be used in workflows. As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query grafana_incident provider: grafana_incident config: "{{ provider.my_provider_name }}" with: operationType: {value} updateType: {value} ``` Check the following workflow examples: * [create-new-incident-grafana-incident.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/create-new-incident-grafana-incident.yaml) * [update-incident-grafana-incident.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/update-incident-grafana-incident.yaml) ## Getting started 1. In your Grafana Cloud stack, click Alerts & IRM in the left-side menu. 2. Click the Incident tile to enable the app for your Grafana Cloud instance. 3. Once Grafana Incident is enabled it is accessible to users in your organization. ## Connecting with the Provider 1. After enabling the Grafana Incident app, navigate Adminstration > Users and access > Service Accounts. 2. Create a new service account by clicking the Add Service Account button. 3. Give the service account a name and assign role as Viewer. 4. Click on Add service account token and click on Generate token. 5. Copy the generated token. 6. This will be used as the `service_account_token` parameter in the provider configuration. ## Creating and updating Grafana Incidents Grafana Incident provider supports creating and updating incidents in Grafana. * `operationType` - The operation type can be `create` or `update`. * `updateType` - The update type is used to update the various fields of the incident. ### Create Incident * `operationType` - `create` * `title` (str) - The title of the incident. * `severity` (str) - The severity of the incident. * `labels` (list) - The labels of the incident. * `roomPrefix` (str) - The room prefix of the incident. * `isDrill` (bool) - The drill status of the incident. * `status` (str) - The status of the incident. * `attachCaption` (str) - The attachment caption of the incident. * `attachURL` (str) - The attachment URL of the incident. ### Update Incident * `operationType` - `update` * `updateType` - The updatable fields are `removeLabel`, `unassignLabel`, `unassignLabelByUUID`, `unassignRole`, `updateIncidentEventTime`, `updateIncidentIsDrill`, `updateIncidentSeverity`, `updateIncidentStatus`, `updateIncidentTitle`. #### Remove Label * `incident_id` (str) - The incident ID. * `label` (str) - The label to remove. #### Unassign Label * `incident_id` (str) - The incident ID. * `label` (str) - The label to unassign. * `key` (str) - The key of the label to unassign. #### Unassign Label By UUID * `incident_id` (str) - The incident ID. * `key_uuid` (str) - The key UUID of the label to unassign. * `value_uuid` (str) - The value UUID of the label to unassign. #### Unassign Role * `incident_id` (str) - The incident ID. * `role` (str) - The role to unassign. * `user_id` (str) - The user ID to unassign. #### Update Incident Event Time * `incident_id` (str) - The incident ID. * `event_time` (str) - The event time to update. * `event_name` (str) - The event name to update. #### Update Incident Is Drill * `incident_id` (str) - The incident ID. * `isDrill` (bool) - The drill status to update. #### Update Incident Severity * `incident_id` (str) - The incident ID. * `severity` (str) - The severity to update. #### Update Incident Status * `incident_id` (str) - The incident ID. * `status` (str) - The status to update. #### Update Incident Title * `incident_id` (str) - The incident ID. * `title` (str) - The title to update. ## Usefull Links * [Grafana Incident](https://grafana.com/docs/grafana-cloud/alerting-and-irm/incident/) # Grafana Loki Source: https://docs.keephq.dev/providers/documentation/grafana_loki-provider Grafana Loki provider allows you to query logs from Grafana Loki. ## Overview Grafana Loki is a log aggregation system designed to store and query logs from all your applications and infrastructure. The easiest way to get started is with Grafana Cloud, our fully composable observability stack. ## Authentication This provider requires authentication. * **host\_url**: Grafana Loki Host URL (required: True, sensitive: False) * **verify**: Enable SSL verification (required: False, sensitive: False) * **authentication\_type**: Authentication Type (required: True, sensitive: False) * **username**: HTTP basic authentication - Username (required: False, sensitive: False) * **password**: HTTP basic authentication - Password (required: False, sensitive: True) * **x\_scope\_orgid**: X-Scope-OrgID Header Authentication (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: * **authenticated**: Instance is valid and user is authenticated ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query grafana_loki provider: grafana_loki config: "{{ provider.my_provider_name }}" with: query: {value} limit: {value} time: {value} direction: {value} start: {value} end: {value} since: {value} step: {value} interval: {value} queryType: {value} ``` Check the following workflow example: * [query\_grafana\_loki.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/query_grafana_loki.yaml) ## Connecting with the Grafana Loki provider 1. Obtain the required authentication parameters. 2. Add Grafana Loki provider to your keep account and configure with the above authentication parameters. ## Querying Grafana Loki The Grafana Loki provider allows you to query logs from Grafana Loki through the `query` and `query_range` types. The following are the parameters available for querying: 1. `query` type: * `query`: The [LogQL](https://grafana.com/docs/loki/latest/query/) query to perform. Requests that do not use valid LogQL syntax will return errors. * `limit`: The max number of entries to return. It defaults to `100`. Only applies to query types which produce a stream (log lines) response. * `time`: The evaluation time for the query as a nanosecond Unix epoch or another [supported format](https://grafana.com/docs/loki/latest/reference/loki-http-api/#timestamps). Defaults to now. * `direction`: Determines the sort order of logs. Supported values are `forward` or `backward`. Defaults to `backward`. 2. `query_range` type: * `query`: The [LogQL](https://grafana.com/docs/loki/latest/query/) query to perform. * `limit`: The max number of entries to return. It defaults to `100`. Only applies to query types which produce a stream (log lines) response. * `start`: The start time for the query as a nanosecond Unix epoch or another [supported format](https://grafana.com/docs/loki/latest/reference/loki-http-api/#timestamps). Defaults to one hour ago. Loki returns results with timestamp greater or equal to this value. * `end`: The end time for the query as a nanosecond Unix epoch or another [supported format](https://grafana.com/docs/loki/latest/reference/loki-http-api/#timestamps). Defaults to now. Loki returns results with timestamp lower than this value. * `since`: A `duration` used to calculate `start` relative to `end`. If `end` is in the future, `start` is calculated as this duration before now. Any value specified for `start` supersedes this parameter. * `step`: Query resolution step width in `duration` format or float number of seconds. `duration` refers to Prometheus duration strings of the form `[0-9]+[smhdwy]`. For example, 5m refers to a duration of 5 minutes. Defaults to a dynamic value based on `start` and `end`. Only applies to query types which produce a matrix response. * `interval`: Only return entries at (or greater than) the specified interval, can be a `duration` format or float number of seconds. Only applies to queries which produce a stream response. Not to be confused with step, see the explanation under [Step versus interval](https://grafana.com/docs/loki/latest/reference/loki-http-api/#step-versus-interval). * `direction`: Determines the sort order of logs. Supported values are `forward` or `backward`. Defaults to `backward`. ## Useful Links * [Grafana Loki](https://grafana.com/oss/loki/) * [Grafana Loki Authentication](https://grafana.com/docs/loki/latest/operations/authentication/) # Grafana OnCall Provider Source: https://docs.keephq.dev/providers/documentation/grafana_oncall-provider Grafana Oncall Provider is a class that allows to ingest data to the Grafana OnCall. ## Authentication This provider requires authentication. * **token**: Token (required: True, sensitive: False) * **host**: Grafana OnCall Host (required: True, sensitive: False) ## In workflows This provider can be used in workflows. As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query grafana_oncall provider: grafana_oncall config: "{{ provider.my_provider_name }}" with: title: {value} alert_uid: {value} message: {value} image_url: {value} state: {value} link_to_upstream_details: {value} ``` If you need workflow examples with this provider, please raise a [GitHub issue](https://github.com/keephq/keep/issues). ## Connecting with the Provider To connect to Grafana OnCall, you need to create an API Token: 1. Log in to your Grafana account. 2. Go To "Alerts & IRM" -> OnCall. 3. Go to the **Settings** page. 4. Click the **Create** button and provide a name for your token. 5. Copy the token value and keep it secure. 6. Add the token value to the `authentication` section in the Grafana Oncall Provider configuration. ## Notes * This provider allows you to interact with Grafana OnCall to create alerts. * Keep will create "Webhook" type integration called "Keep Integration" inside Grafana OnCall. Payload example: ```json theme={null} { "alert_uid": "08d6891a-835c-e661-39fa-96b6a9e26552", "title": "The whole system is down", "image_url": "https://upload.wikimedia.org/wikipedia/commons/e/ee/Grumpy_Cat_by_Gage_Skidmore.jpg", "state": "alerting", "link_to_upstream_details": "https://en.wikipedia.org/wiki/Downtime", "message": "Smth happened. Oh no!" } ``` ## Useful Links * [Grafana OnCall Inbound Webhook Integration](https://grafana.com/docs/oncall/latest/configure/integrations/references/webhook/) # Graylog Provider Source: https://docs.keephq.dev/providers/documentation/graylog-provider The Graylog provider enables webhook installations for receiving alerts in Keep ## Overview The **Graylog Provider** facilitates receiving alerts from Graylog by setting up Webhook connections. It allows seamless integration with Graylog to receive notifications about events and alerts through Keep. ## Authentication This provider requires authentication. * **graylog\_user\_name**: Username (required: True, sensitive: False) * **graylog\_access\_token**: Graylog Access Token (required: True, sensitive: True) * **deployment\_url**: Deployment Url (required: True, sensitive: False) * **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: * **authenticated**: Mandatory for all operations, ensures the user is authenticated. (mandatory) * **authorized**: Mandatory for querying incidents and managing resources, ensures the user has `Admin` privileges. (mandatory) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query graylog provider: graylog config: "{{ provider.my_provider_name }}" with: events_search_parameters: {value} ``` If you need workflow examples with this provider, please raise a [GitHub issue](https://github.com/keephq/keep/issues). ## Provider Methods The provider exposes the following [Provider Methods](/providers/provider-methods#via-ai-assistant). They are available in the [AI Assistant](/overview/ai-incident-assistant). * **search** Search using elastic query language in Graylog (action, scopes: authorized) * `query`: The query string to search for. * `query_type`: The type of query to use. Default is "elastic". * `timerange_seconds`: The time range in seconds. Default is 300 seconds. * `timerange_type`: The type of time range. Default is "relative". * `page`: Page number, starting from 0. * `per_page`: Number of results per page. ## Connecting via Webhook (omnidirectional) This provider supports webhooks. To send alerts from Graylog to Keep, Use the following webhook url to configure Graylog send alerts to Keep: 1. In Graylog, from the Topbar, go to `Alerts` > `Notifications`. 2. Click "Create Notification". 3. In the New Notification form, configure: **Note**: For Graylog v4.x please set the **URL** to `KEEP_BACKEND_URL/alerts/event/graylog?api_key={api_key}`. * **Display Name**: keep-graylog-webhook-integration * **Title**: keep-graylog-webhook-integration * **Notification Type**: Custom HTTP Notification * **URL**: KEEP\_BACKEND\_URL/alerts/event/graylog # Whitelist this URL * **Headers**: X-API-KEY: 4. Erase the Body Template. 5. Click on "Create Notification". 6. Go the the `Event Definitions` tab, and select the Event Definition that will trigger the alert you want to send to Keep and click on More > Edit. 7. Go to "Notifications" tab. 8. Click on "Add Notification" and select the "keep-graylog-webhook-integration" that you created in step 3. 9. Click on "Add Notification". 10. Click `Next` > `Update` event definition ## Connecting with the Provider 1. Obtain the **username** and **access token** from your Graylog instance by following [Graylog's API Access Documentation](https://go2docs.graylog.org/current/setting_up_graylog/rest_api_access_tokens.htm?tocpath=Set%20up%20Graylog%7CGet%20Started%20with%20Graylog%7CREST%C2%A0API%7C_____3#CreateanAccessToken). 2. Set the **deployment URL** to your Graylog instance's base URL (e.g., `http://127.0.0.1:9000`). 3. Ensure the user has the **Admin** role in Graylog. ## Features The **Graylog Provider** supports the following key features: * **Webhook Setup**: Configures webhooks to send alerts to Keep. * **Alerts Retrieval**: Fetches and formats alerts from Graylog based on specified search parameters (only a maximum of 10000 most recent alerts)`. 3. Copy that DATASOURCE\_UID and use it while installing the provider. Ensure that the product of `page` and `per_page` does not exceed 10,000. The notification URL for Graylog v4.x has the api\_key as a query param, this is the default behaviour. ## Useful Links * [Graylog API Documentation](https://go2docs.graylog.org/current/what_is_graylog/what_is_graylog.htm?tocpath=What%20Is%20Graylog%253F%7C_____0) * [Graylog Access Token](https://go2docs.graylog.org/current/setting_up_graylog/rest_api_access_tokens.htm?tocpath=Set%20up%20Graylog%7CGet%20Started%20with%20Graylog%7CREST%C2%A0API%7C_____3#CreateanAccessToken) * [Quick Setup for Graylog & Integration with Keep](https://github.com/keephq/keep/keep/providers/graylog_provider/README.md) # Grok Provider Source: https://docs.keephq.dev/providers/documentation/grok-provider The Grok Provider allows for integrating X.AI's Grok language models into Keep. ## Authentication This provider requires authentication. * **api\_key**: X.AI Grok API Key (required: True, sensitive: True) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query grok provider: grok config: "{{ provider.my_provider_name }}" with: prompt: {value} model: {value} max_tokens: {value} structured_output_format: {value} ``` If you need workflow examples with this provider, please raise a [GitHub issue](https://github.com/keephq/keep/issues). ## Connecting with the Provider To connect to Grok, you'll need to obtain an API Key: 1. Subscribe to Grok on X.AI platform. 2. Navigate to the API section in your X.AI account settings. 3. Generate a new API key for Keep. Use the generated API key in the `authentication` section of your Grok Provider configuration. # HTTP Provider Source: https://docs.keephq.dev/providers/documentation/http-provider HTTP Provider is a provider used to query/notify using HTTP requests ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query http provider: http config: "{{ provider.my_provider_name }}" with: url: {value} method: {value} headers: {value} body: {value} params: {value} proxies: {value} fail_on_error: {value} verify: {value} ``` As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query http provider: http config: "{{ provider.my_provider_name }}" with: url: {value} method: {value} headers: {value} body: {value} params: {value} proxies: {value} verify: {value} ``` Check the following workflow examples: * [create-new-incident-grafana-incident.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/create-new-incident-grafana-incident.yaml) * [db\_disk\_space\_monitor.yml](https://github.com/keephq/keep/blob/main/examples/workflows/db_disk_space_monitor.yml) * [http\_enrich.yml](https://github.com/keephq/keep/blob/main/examples/workflows/http_enrich.yml) * [ifelse.yml](https://github.com/keephq/keep/blob/main/examples/workflows/ifelse.yml) * [incident-enrich.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/incident-enrich.yaml) * [pagerduty.yml](https://github.com/keephq/keep/blob/main/examples/workflows/pagerduty.yml) * [permissions\_example.yml](https://github.com/keephq/keep/blob/main/examples/workflows/permissions_example.yml) * [send-message-telegram-with-htmlmd.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/send-message-telegram-with-htmlmd.yaml) * [simple\_http\_request\_ntfy.yml](https://github.com/keephq/keep/blob/main/examples/workflows/simple_http_request_ntfy.yml) * [slack-workflow-trigger.yml](https://github.com/keephq/keep/blob/main/examples/workflows/slack-workflow-trigger.yml) * [telegram\_basic.yml](https://github.com/keephq/keep/blob/main/examples/workflows/telegram_basic.yml) * [update-incident-grafana-incident.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/update-incident-grafana-incident.yaml) * [update\_workflows\_from\_http.yml](https://github.com/keephq/keep/blob/main/examples/workflows/update_workflows_from_http.yml) * [webhook\_example\_foreach.yml](https://github.com/keephq/keep/blob/main/examples/workflows/webhook_example_foreach.yml) * [zoom\_chat\_example.yml](https://github.com/keephq/keep/blob/main/examples/workflows/zoom_chat_example.yml) ## Connecting with the Provider To connect to the provider, you can instantiate an instance of the `HttpProvider` class, providing a `provider_id` and a `ProviderConfig` object. Then you can call the `query` method to query the HTTP endpoint. ## Notes The code logs some debug information about the requests being sent, including the request headers, body, and query parameters. This information should not contain sensitive information, but it's important to make sure of that before using this provider in production. ## Useful Links * [requests library documentation](https://docs.python-requests.org/en/latest/) # Icinga2 Provider Source: https://docs.keephq.dev/providers/documentation/icinga2-provider Icinga2 Provider Allows Reception of Push Alerts from Icinga2 to Keep. ## Authentication This provider requires authentication. * **host\_url**: Icinga2 Host URL (required: True, sensitive: False) * **api\_user**: Icinga2 API User (required: True, sensitive: False) * **api\_password**: Icinga2 API Password (required: True, sensitive: True) 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: * **read\_alerts**: Read alerts from Icinga2 ## In workflows This provider can't be used as a "step" or "action" in workflows. If you want to use it, please let us know by creating an issue in the [GitHub repository](https://github.com/keephq/keep/issues).# Icinga2 Provider The Icinga2 provider allows you to receive alerts from Icinga2 monitoring system within Keep. Icinga2 provider supports 2 methods for recieving alerts; Webhooks & API Polling. The recommended and primary method for receiving alerts is via Webhooks. ## Setup ### Prerequisites 1. Access to an Icinga2 instance 2. API user with relevant permissions 3. Keep instance with webhook capability ### Configuration The provider requires the following configuration: ```yaml theme={null} authentication: host_url: "https://icinga2.example.com" # Your Icinga2 instance URL api_user: "your-api-user" # Icinga2 API username api_password: "your-api-password" # Icinga2 API password ``` ### Webhook Configuration To configure Icinga2 to send alerts to Keep via webhooks: 1. Navigate to your Icinga2 configuration directory 2. Create or edit the `eventcommands.conf` file 3. Add the following event command configuration: ```plaintext theme={null} object EventCommand "keep-notification" { command = [ "curl" ] arguments = { "-X" = "POST" "-H" = "Content-Type: application/json" "-H" = "X-API-KEY: ${keep_api_key}" "--data" = "{ \"host\": { \"name\": \"$host.name$\", \"display_name\": \"$host.display_name$\", \"check_command\": \"$host.check_command$\", \"acknowledgement\": \"$host.acknowledgement$\", \"downtime_depth\": \"$host.downtime_depth$\", \"flapping\": \"$host.flapping$\" }, \"service\": { \"name\": \"$service.name$\", \"display_name\": \"$service.display_name$\", \"check_command\": \"$service.check_command$\", \"acknowledgement\": \"$service.acknowledgement$\", \"downtime_depth\": \"$service.downtime_depth$\", \"flapping\": \"$service.flapping$\" }, \"check_result\": { \"exit_status\": \"$service.state$\", \"state\": \"$service.state_text$\", \"output\": \"$service.output$\", \"execution_start\": \"$service.last_check$\", \"execution_end\": \"$service.last_check$\", \"state_type\": \"$service.state_type$\", \"attempt\": \"$service.check_attempt$\", \"execution_time\": \"$service.execution_time$\", \"latency\": \"$service.latency$\" } }" "${keep_webhook_url}" = { required = true } } } ``` 4. Define variables in your Icinga2 Configuration: * `keep_api_key`: Your Keep API key with webhook role * `keep_webhook_url`: Your Keep Webhook URL 5. Create a notification rule that uses this event command 6. Restart Icinga2 to apply changes ### State Mapping By Default, Icinga2 states are automatically mapped to Keep alert severities & statuses as follows: #### Status Mapping | Icinga2 State | Keep Status | | :------------ | :---------- | | OK | RESOLVED | | WARNING | FIRING | | CRITICAL | FIRING | | UNKNOWN | FIRING | | UP | RESOLVED | | DOWN | FIRING | #### Severity Mapping | Icinga2 State | Keep Severity | | :------------ | :------------ | | OK | INFO | | WARNING | WARNING | | CRITICAL | CRITICAL | | UNKNOWN | INFO | | UP | INFO | | DOWN | CRITICAL | # ilert Provider Source: https://docs.keephq.dev/providers/documentation/ilert-provider The ilert provider facilitates interaction with ilertâs API, allowing for the management of incidents. This includes the ability to create, update, and resolve alerts, as well as send custom event notifications. This provider integrates Keep's system with ilert's AI-first platform for operations teams seeking seamless integration of alerting, on-call management, AI SRE and status pages for faster incident response. ## Overview The ilert provider facilitates interaction with ilertâs API, allowing for the management of incidents and events. This includes the ability to create, update, and resolve incidents, as well as send custom event notifications. This provider integrates Keep's system with ilert's robust alerting and incident management platform. ## Authentication This provider requires authentication. * **ilert\_token**: ILert API token (required: True, sensitive: True) * **ilert\_host**: ILert API host (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: * **read\_permission**: Read permission (mandatory) * **write\_permission**: Write permission ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query ilert provider: ilert config: "{{ provider.my_provider_name }}" with: incident_id: {value} ``` As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query ilert provider: ilert config: "{{ provider.my_provider_name }}" with: _type: {value} # Type of notification ('incident' or 'event') - determines which endpoint is used summary: {value} # A brief summary of the incident (required for new incidents) status: {value} # Current status of the incident (INVESTIGATING, RESOLVED, MONITORING, IDENTIFIED) message: {value} # Detailed message describing the incident (default: empty string) affectedServices: {value} # JSON string of affected services and their statuses (default: "[]") id: {value} # ID of incident to update (use "0" to create a new incident) event_type: {value} # Type of event to post (ALERT, ACCEPT, RESOLVE) details: {value} # Detailed information about the event alert_key: {value} # Unique key for event deduplication priority: {value} # Priority level of the event (HIGH, LOW) images: {value} # List of image URLs to include with the event links: {value} # List of related links to include with the event custom_details: {value} # Custom key-value pairs for additional context ``` Check the following workflow example: * [ilert-incident-upon-alert.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/ilert-incident-upon-alert.yaml) ## Connecting with the Provider To integrate Keep with ilert, follow these steps: 1. Log in to your ilert account. 2. Navigate to "Alert Sources" under your account settings. 3. Create a new alert source specifically for Keep. 4. Note the `ALERT-SOURCE-API-KEY` provided for this alert source. The endpoint to make requests for Keep integration will be: ([https://api.ilert.com/api/v1/events/keep/\{ALERT-SOURCE-API-KEY}](https://api.ilert.com/api/v1/events/keep/\{ALERT-SOURCE-API-KEY})) ## Useful Links * [ilert API Documentation](https://api.ilert.com/api-docs/?utm_campaign=Keep\&utm_source=integration\&utm_medium=organic) * [ilert Alerting](https://www.ilert.com/product/reliable-actionable-alerting?utm_campaign=Keep\&utm_source=integration\&utm_medium=organic) # Incident.io Provider Source: https://docs.keephq.dev/providers/documentation/incidentio-provider The Incident.io provider enables the querying of incidents on Incident.io, leveraging incident management capabilities for effective response. ## Overview The Incident.io provider facilitates interaction with Incident.io's API, allowing for the management of incidents. This includes the ability to query specific incidents, retrieve all incidents, and manage incident details. This provider integrates Keep's system with Incident.io's robust incident management platform. ## Authentication This provider requires authentication. * **incidentIoApiKey**: IncidentIO's API\_KEY (required: True, sensitive: True) 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: * **authenticated**: User is Authenticated (mandatory) * **read\_access**: User has read access (mandatory) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query incidentio provider: incidentio config: "{{ provider.my_provider_name }}" with: incident_id: {value} ``` If you need workflow examples with this provider, please raise a [GitHub issue](https://github.com/keephq/keep/issues). ## Connecting with the Provider ### API Key To use the Incident.io API: 1. Log in to your Incident.io account. 2. Navigate to the "API Keys" section under your account settings. 3. Generate a new API key or use an existing one. 4. Ensure it has `read` permissions enabled for reading and managing incidents. ### Incident Endpoint The Incident.io incident endpoint allows querying and managing incidents. Operations include retrieving specific incident details or fetching a list of all incidents. This is crucial for monitoring and responding to incidents efficiently. For more details, refer to the [Incident.io API Documentation](https://api-docs.incident.io/). ## Useful Links * [Incident.io API Documentation](https://api-docs.incident.io/) * [Incident.io Incidents](https://api-docs.incident.io/tag/Incidents-V2) * [Incident.io Api\_Keys and Permissions](https://help.incident.io/en/articles/6149651-our-api) # Incident Manager Provider Source: https://docs.keephq.dev/providers/documentation/incidentmanager-provider The Incident Manager Provider allows you to push incidents from AWS IncidentManager to Keep. ## Authentication This provider requires authentication. * **region**: AWS region (required: True, sensitive: False) * **response\_plan\_arn**: AWS Response Plan's arn (required: True, sensitive: False) * **sns\_topic\_arn**: AWS SNS Topic arn you want to be used/using in response plan (required: True, sensitive: False) * **access\_key**: AWS access key (Leave empty if using IAM role at EC2) (required: False, sensitive: True) * **access\_key\_secret**: AWS access key secret (Leave empty if using IAM role at EC2) (required: False, sensitive: True) 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: * **ssm-incidents:ListIncidentRecords**: Required to retrieve incidents. (mandatory) ([Documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ssm-incidents.html)) * **ssm-incidents:GetResponsePlan**: Required to get response plan and register keep as webhook ([Documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ssm-incidents.html)) * **ssm-incidents:UpdateResponsePlan**: Required to update response plan and register keep as webhook ([Documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ssm-incidents.html)) * **iam:SimulatePrincipalPolicy**: Allow Keep to test the scopes of the current user/role without modifying any resource. ([Documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ssm-incidents.html)) * **sns:ListSubscriptionsByTopic**: Required to list all subscriptions of a topic, so Keep will be able to add itself as a subscription. ([Documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ssm-incidents.html)) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query incidentmanager provider: incidentmanager config: "{{ provider.my_provider_name }}" ``` If you need workflow examples with this provider, please raise a [GitHub issue](https://github.com/keephq/keep/issues). ## Status Map The Incident Manager Provider maps the following statuses: * "OPEN" to AlertStatus.FIRING * "RESOLVED" to AlertStatus.RESOLVED ## Severities Map The Incident Manager Provider maps the following severities: * 1 to AlertSeverity.CRITICAL * 2 to AlertSeverity.HIGH * 3 to AlertSeverity.LOW * 4 to AlertSeverity.WARNING * 5 to AlertSeverity.INFO ## Notes 1. Incident Manager only throws notification when there is chatChannel attached to response plan. Make sure to add chatChannel to response plan before adding webhook # Jira On-Prem Provider Source: https://docs.keephq.dev/providers/documentation/jira-on-prem-provider Jira On-Prem Provider is a provider used to query data and creating issues in Jira This is on-prem Jira provider documentation, for regular please check [Jira Provider](./jira-provider.md). ## Authentication This provider requires authentication. * **host**: Jira Host (required: True, sensitive: False) * **personal\_access\_token**: Jira PAT (required: True, sensitive: True) * **ticket\_creation\_url**: URL for creating new tickets (required: False, sensitive: False) * **verify**: Verify the Jira server's TLS certificate (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: * **BROWSE\_PROJECTS**: Browse Jira Projects (mandatory) * **CREATE\_ISSUES**: Create Jira Issues (mandatory) * **CLOSE\_ISSUES**: Close Jira Issues * **EDIT\_ISSUES**: Edit Jira Issues * **DELETE\_ISSUES**: Delete Jira Issues * **MODIFY\_REPORTER**: Modify Jira Issue Reporter ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query jiraonprem provider: jiraonprem config: "{{ provider.my_provider_name }}" with: ticket_id: {value} # The ticket id. board_id: {value} # The board id. ``` As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query jiraonprem provider: jiraonprem config: "{{ provider.my_provider_name }}" with: summary: {value} description: {value} issue_type: {value} project_key: {value} board_name: {value} issue_id: {value} labels: {value} components: {value} custom_fields: {value} priority: {value} ``` Check the following workflow example: * [jira\_on\_prem.yml](https://github.com/keephq/keep/blob/main/examples/workflows/jira_on_prem.yml) # Jira Cloud Provider Source: https://docs.keephq.dev/providers/documentation/jira-provider Jira Cloud provider is a provider used to query data and creating issues in Jira ## Authentication This provider requires authentication. * **email**: Atlassian Jira Email (required: True, sensitive: False) * **api\_token**: Atlassian Jira API Token (required: True, sensitive: True) * **host**: Atlassian Jira Host (required: True, sensitive: False) * **ticket\_creation\_url**: URL for creating new tickets (optional, will use default if not provided) (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: * **BROWSE\_PROJECTS**: Browse Jira Projects (mandatory) * **CREATE\_ISSUES**: Create Jira Issues (mandatory) * **CLOSE\_ISSUES**: Close Jira Issues * **EDIT\_ISSUES**: Edit Jira Issues * **DELETE\_ISSUES**: Delete Jira Issues * **MODIFY\_REPORTER**: Modify Jira Issue Reporter * **TRANSITION\_ISSUES**: Transition Jira Issues ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query jira provider: jira config: "{{ provider.my_provider_name }}" with: ticket_id: {value} # The ticket id of the issue, optional. board_id: {value} # The board id of the issue. ``` As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query jira provider: jira config: "{{ provider.my_provider_name }}" with: summary: {value} # The summary of the issue. description: {value} # The description of the issue. issue_type: {value} # The type of the issue. project_key: {value} # The project key of the issue. board_name: {value} # The board name of the issue. issue_id: {value} # The issue id of the issue. labels: {value} # The labels of the issue. components: {value} # The components of the issue. custom_fields: {value} # The custom fields of the issue. transition_to: {value} # Optional transition name (e.g., "Done", "Resolved") to apply after update/create. ``` Check the following workflow examples: * [create\_jira\_ticket\_upon\_alerts.yml](https://github.com/keephq/keep/blob/main/examples/workflows/create_jira_ticket_upon_alerts.yml) * [incident-enrich.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/incident-enrich.yaml) * [jira-create-ticket-on-alert.yml](https://github.com/keephq/keep/blob/main/examples/workflows/jira-create-ticket-on-alert.yml) * [jira-transition-on-resolved.yml](https://github.com/keephq/keep/blob/main/examples/workflows/jira-transition-on-resolved.yml) * [jira\_on\_prem.yml](https://github.com/keephq/keep/blob/main/examples/workflows/jira_on_prem.yml) * [test\_jira\_create\_with\_custom\_fields.yml](https://github.com/keephq/keep/blob/main/examples/workflows/test_jira_create_with_custom_fields.yml) * [test\_jira\_custom\_fields\_fix.yml](https://github.com/keephq/keep/blob/main/examples/workflows/test_jira_custom_fields_fix.yml) * [update\_jira\_ticket.yml](https://github.com/keephq/keep/blob/main/examples/workflows/update_jira_ticket.yml) ## Connecting with the Provider 1. Go to [https://id.atlassian.com/manage-profile/security/api-tokens](https://id.atlassian.com/manage-profile/security/api-tokens) to Create API token and generated token should be passed to jira authentication. 2. Get `host` and `board_id` from your respective board from its URL. 3. Get `project_key` from your project > settings > details. 4. `email` would be same as of your account email. ## Auto-Transition Workflows The Jira provider supports automatically transitioning tickets when alerts change status. This is useful for keeping your Jira board synchronized with alert states - for example, automatically closing tickets when alerts are resolved. ### Prerequisites 1. Configure a Jira Cloud provider in Keep 2. Ensure your Jira user has the `TRANSITION_ISSUES` permission 3. Know your Jira board name and desired transition status names ### Workflow 1: Create Jira Ticket on Alert This workflow creates a Jira ticket when an alert fires, but only if no ticket has been created yet. ```yaml theme={null} workflow: id: jira-create-ticket-on-alert name: Create Jira Ticket on Alert description: Create Jira ticket when alert fires disabled: false triggers: - type: alert cel: status == "firing" actions: - name: jira-action if: "not '{{ alert.ticket_id }}'" provider: type: jira config: "{{ providers.JiraCloud }}" with: board_name: YOUR_BOARD_NAME # Change this to your board name issue_type: Task # Or Bug, Story, etc. summary: "{{ alert.name }} - {{ alert.description }}" description: | "This ticket was created automatically by Keep. Alert Details: {code:json} {{ alert }} {code}" enrich_alert: - key: ticket_type value: jira - key: ticket_id value: results.issue.key - key: ticket_url value: results.ticket_url ``` **Key Points:** * `if: "not '{{ alert.ticket_id }}'"` - Only creates a ticket if one doesn't exist yet * `enrich_alert` - Stores the ticket ID, type, and URL in the alert for later use * The ticket is created in the default status (usually "To Do" or "Open") ### Workflow 2: Transition Ticket to Done on Alert Resolved This workflow updates the existing Jira ticket and transitions it to "Done" when the alert is resolved. ```yaml theme={null} workflow: id: jira-transition-on-resolved name: Transition Jira Ticket to Done description: Close Jira ticket when alert is resolved disabled: false triggers: - type: alert cel: status == "resolved" actions: - name: jira-action provider: type: jira config: "{{ providers.JiraCloud }}" with: issue_id: "{{ alert.ticket_id }}" summary: "{{ alert.name }} - {{ alert.description }} (resolved)" description: | "Alert has been resolved automatically by Keep. Resolved at: {{ alert.lastReceived }} Original Alert Details: {code:json} {{ alert }} {code}" transition_to: Done # Change to your workflow's status name ``` **Key Points:** * Uses `issue_id: "{{ alert.ticket_id }}"` from the enriched alert data * `transition_to: Done` - Transitions the ticket to the specified status * No `if` condition needed - if the alert has no `ticket_id`, the action will simply fail gracefully ### Available Transition Names Common Jira transition names (varies by workflow): * `Done` * `Resolved` * `Closed` * `In Progress` * `To Do` * `Canceled` **How to find your transition names:** 1. Go to your Jira project settings 2. Navigate to Workflows 3. Check the available statuses in your workflow 4. Use the exact status name in the `transition_to` parameter (case-insensitive) ### Error Handling If you specify an invalid transition name, the Jira provider will return a helpful error message listing all available transitions for that ticket: ``` Transition 'Invalid' not found. Available transitions: To Do, In Progress, Done, Closed ``` ### Example: Three-State Workflow You can also create intermediate transitions: ```yaml theme={null} # Workflow 3: Move to In Progress when acknowledged workflow: id: jira-transition-in-progress name: Transition to In Progress description: Move ticket to In Progress when alert is acknowledged disabled: false triggers: - type: alert cel: status == "acknowledged" actions: - name: jira-action provider: type: jira config: "{{ providers.JiraCloud }}" with: issue_id: "{{ alert.ticket_id }}" summary: "{{ alert.name }} - In Progress" description: "Alert acknowledged and being worked on." transition_to: In Progress ``` ### Testing 1. **Create an alert** that triggers the first workflow * Verify a Jira ticket is created * Check that the alert has `ticket_id`, `ticket_type`, and `ticket_url` fields 2. **Resolve the alert** to trigger the second workflow * Verify the existing ticket is updated (no new ticket created) * Check that the ticket status changed to "Done" 3. **Check the logs** in Keep UI for any errors or debugging info ### Troubleshooting #### Issue: Workflow creates a new ticket instead of updating **Cause:** The `issue_id` parameter is missing or the alert doesn't have a `ticket_id`. **Solution:** Ensure the first workflow enriches the alert with `ticket_id` and the second workflow uses it via `issue_id: "{{ alert.ticket_id }}"`. #### Issue: Transition fails with "Transition 'X' not found" **Cause:** The transition name doesn't match your Jira workflow. **Solution:** Check the error message for available transitions and update the `transition_to` parameter accordingly. #### Issue: Permission denied when transitioning **Cause:** Your Jira user doesn't have the `TRANSITION_ISSUES` permission. **Solution:** Grant the necessary permissions in Jira project settings. ### Advanced Features #### Configuration Variables You can use Keep's configuration variables to make the workflows more flexible: ```yaml theme={null} consts: JIRA_BOARD: "ALERTS" JIRA_DONE_STATUS: "Done" JIRA_ISSUE_TYPE: "Task" # Then use in workflows: board_name: "{{ consts.JIRA_BOARD }}" transition_to: "{{ consts.JIRA_DONE_STATUS }}" issue_type: "{{ consts.JIRA_ISSUE_TYPE }}" ``` #### Custom Fields You can also set custom fields when creating or updating tickets: ```yaml theme={null} with: issue_id: "{{ alert.ticket_id }}" summary: "Alert resolved" custom_fields: customfield_10001: "High" customfield_10002: "Production" transition_to: Done ``` #### Labels and Components ```yaml theme={null} with: board_name: YOUR_BOARD_NAME summary: "{{ alert.name }}" description: "{{ alert.description }}" labels: - alert - automated - critical components: - Monitoring - Infrastructure ``` ## Notes ## Useful Links * [https://id.atlassian.com/manage-profile/security/api-tokens](https://id.atlassian.com/manage-profile/security/api-tokens) * [https://developer.atlassian.com/cloud/jira/software/rest/api-group-board/#api-rest-agile-1-0-board-boardid-issue-get](https://developer.atlassian.com/cloud/jira/software/rest/api-group-board/#api-rest-agile-1-0-board-boardid-issue-get) * [https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-post](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-post) * [https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-issueidorkey-transitions-get](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-issueidorkey-transitions-get) (Transitions API) # Kafka Source: https://docs.keephq.dev/providers/documentation/kafka-provider Kafka provider allows integration with Apache Kafka for producing and consuming messages. ## Authentication This provider requires authentication. * **host**: Kafka host (required: True, sensitive: False) * **topic**: The topic to subscribe to (required: True, sensitive: False) * **username**: Username (required: False, sensitive: True) * **password**: Password (required: False, sensitive: True) 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: * **topic\_read**: The kafka user that have permissions to read the topic. (mandatory) ## In workflows This provider can't be used as a "step" or "action" in workflows. If you want to use it, please let us know by creating an issue in the [GitHub repository](https://github.com/keephq/keep/issues). ## Connecting with the Provider 1. Set up a Kafka broker (or use an existing one) and make sure it is accessible. 2. Get the broker URL (e.g., `localhost:9092` or a remote Kafka service URL). 3. (Optional) If using secure communication, provide the security protocol, SASL mechanism, username, and password. 4. Configure the provider with these parameters. ## Usefull Links -[Kafka Clients Documentation](https://kafka.apache.org/documentation/) # Keep Source: https://docs.keephq.dev/providers/documentation/keep-provider Keep provider allows you to query and manage alerts in Keep. ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query keep provider: keep config: "{{ provider.my_provider_name }}" with: filters: {value} # filters to query Keep (only for version 1) version: {value} # version of Keep API distinct: {value} # if True, return only distinct alerts time_delta: {value} # time delta in days to query Keep timerange: {value} # timerange dict to calculate time delta filter: {value} # filter to query Keep (only for version 2) limit: {value} # limit number of results (only for version 2) ``` As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query keep provider: keep config: "{{ provider.my_provider_name }}" with: delete_all_other_workflows: {value} # if True, delete all other workflows workflow_full_sync: {value} # if True, sync all workflows workflow_to_update_yaml: {value} # workflow yaml to update alert: {value} # alert data to create fingerprint_fields: {value} # fields to use for alert fingerprinting override_source_with: {value} # override alert source read_only: {value} # if True, don't modify existing alerts fingerprint: {value} # alert fingerprint if: {value} # condition to evaluate for alert creation for: {value} # duration for state alerts ``` Check the following workflow examples: * [create\_alert\_from\_vm\_metric.yml](https://github.com/keephq/keep/blob/main/examples/workflows/create_alert_from_vm_metric.yml) * [create\_alert\_in\_keep.yml](https://github.com/keephq/keep/blob/main/examples/workflows/create_alert_in_keep.yml) * [create\_alerts\_from\_elastic.yml](https://github.com/keephq/keep/blob/main/examples/workflows/create_alerts_from_elastic.yml) * [create\_alerts\_from\_mysql.yml](https://github.com/keephq/keep/blob/main/examples/workflows/create_alerts_from_mysql.yml) * [create\_multi\_alert\_from\_vm\_metric.yml](https://github.com/keephq/keep/blob/main/examples/workflows/create_multi_alert_from_vm_metric.yml) * [fluxcd\_example.yml](https://github.com/keephq/keep/blob/main/examples/workflows/fluxcd_example.yml) * [resolve\_old\_alerts.yml](https://github.com/keephq/keep/blob/main/examples/workflows/resolve_old_alerts.yml) * [retrieve\_cloudwatch\_logs.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/retrieve_cloudwatch_logs.yaml) * [update\_service\_now\_tickets\_status.yml](https://github.com/keephq/keep/blob/main/examples/workflows/update_service_now_tickets_status.yml) * [update\_workflows\_from\_http.yml](https://github.com/keephq/keep/blob/main/examples/workflows/update_workflows_from_http.yml) * [update\_workflows\_from\_s3.yml](https://github.com/keephq/keep/blob/main/examples/workflows/update_workflows_from_s3.yml) * [webhook\_example\_foreach.yml](https://github.com/keephq/keep/blob/main/examples/workflows/webhook_example_foreach.yml) ## Authentication Parameters To use the Keep provider, you must authenticate with an API token associated with your Keep account. This token can be generated from your Keep dashboard. ## Connecting with the Provider 1. Log in to your Keep account. 2. Navigate to the API section of your account dashboard and generate an API token. 3. Use this token to authenticate when querying alerts via the Keep provider. # Kibana Source: https://docs.keephq.dev/providers/documentation/kibana-provider Kibana provider allows you get alerts from Kibana Alerting via webhooks.Please note that when installing Kibana with Webhook auto instrumentation, Keep installs itself as a Connector, adds itself as an Action to all available Kibana Alert Rules (For each alert, On status changes, when: Alert/No Data/Recovered) and to all available Kibana Watcher rules as a Webhook action. For more information, feel free to reach out on our Slack Community. ## Authentication This provider requires authentication. * **api\_key**: Kibana API Key (required: True, sensitive: True) * **kibana\_host**: Kibana Host (required: True, sensitive: False) * **kibana\_port**: Kibana Port (defaults to 9243) (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: * **rulesSettings:read**: Read alerts (mandatory) * **rulesSettings:write**: Modify alerts (mandatory) * **actions:read**: Read connectors (mandatory) * **actions:write**: Write connectors (mandatory) ## In workflows This provider can't be used as a "step" or "action" in workflows. If you want to use it, please let us know by creating an issue in the [GitHub repository](https://github.com/keephq/keep/issues). ## Connecting with the Provider ### Kibana Host Simply copy the hostname from the URL bar in your browser:### API Key To obtain a Kibana API key, follow these steps: 1. Log in to your Kibana account. 2. Click Stack Management 3. Click on Security 4. Click on API Keys
1. Click on the top right `Create API key` button 2. Give the API key and indicative name (e.g. keep-api-key) 3. Make sure the `Restrict Permissions` toggle is not toggeled 4. On the bottom right corner, click on `Create API key`
6. Copy the newly created encoded API key and you're set!
## Fingerprinting Fingerprints in Kibana are simply the alert instance ID. ## Useful Links * [Kibana Alerting](https://www.elastic.co/guide/en/kibana/current/alerting-getting-started.html) * [Kibana Connectors](https://www.elastic.co/guide/en/kibana/current/action-types.html) # Kubernetes Source: https://docs.keephq.dev/providers/documentation/kubernetes-provider Kubernetes provider to perform rollout restart or list pods action. ## Authentication This provider requires authentication. * **api\_server**: The kubernetes api server url (required: False, sensitive: False) * **token**: Bearer token to access kubernetes (leave empty for in-cluster auth) (required: False, sensitive: True) * **insecure**: Skip TLS verification (required: False, sensitive: False) * **use\_in\_cluster\_config**: Use in-cluster configuration (ServiceAccount) (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: * **connect\_to\_kubernetes**: Check if the provided token can connect to the kubernetes server (mandatory) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query kubernetes provider: kubernetes config: "{{ provider.my_provider_name }}" with: command_type: {value} # The type of query to perform. Supported queries are: - get_logs: Get logs from a pod - get_deployment_logs: Get logs from all pods in a deployment - get_events: Get events for a namespace or pod - get_nodes: List nodes - get_pods: List pods - get_node_pressure: Get node pressure conditions - get_pvc: List persistent volume claims - get_deployments: List deployments - get_statefulsets: List statefulsets - get_daemonsets: List daemonsets - get_services: List services - get_namespaces: List namespaces - get_ingresses: List ingresses for a namespace or all namespaces - get_jobs: List jobs # Additional arguments for the query. ``` As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query kubernetes provider: kubernetes config: "{{ provider.my_provider_name }}" with: action: {value} # The action to perform. Supported actions are: - rollout_restart: Restart a deployment/statefulset/daemonset - restart_pod: Restart a specific pod - cordon_node: Mark node as unschedulable - uncordon_node: Mark node as schedulable - drain_node: Safely evict pods from node - scale_deployment: Scale deployment up/down - scale_statefulset: Scale statefulset up/down - exec_pod_command: Execute command in pod # Additional arguments for the action. ``` Check the following workflow example: * [gke.yml](https://github.com/keephq/keep/blob/main/examples/workflows/gke.yml) ## Connecting with the Provider To connect to Kubernetes, follow below steps: 1. Create a service account on Kubernetes. 2. Create role/clusterrole and bind to service account using rolebinding/clusterrolebinding. 3. Get the token of service account. ## Notes * This provider allows you to interact with Kubernetes to perform rollout restart or pods listing actions. ## Useful Links * [Access Kubernetes Cluster](https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/) # LibreNMS Source: https://docs.keephq.dev/providers/documentation/libre_nms-provider LibreNMS allows you to receive alerts from LibreNMS using API endpoints as well as webhooks ## Authentication This provider requires authentication. * **host\_url**: LibreNMS Host URL (required: True, sensitive: False) * **api\_key**: LibreNMS API Key (required: True, sensitive: True) 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: * **read\_alerts**: Read alerts from LibreNMS ## In workflows This provider can't be used as a "step" or "action" in workflows. If you want to use it, please let us know by creating an issue in the [GitHub repository](https://github.com/keephq/keep/issues). ## Connecting LibreNMS to Keep 1. Open LibreNMS dashboard and click on settings in the top right corner.
2. Click on `Create API access token` to generate a new API key.
3. Give a description to the API key and click on `Create API Token`.
## Webhooks Integration 1. Open LibreNMS dashboard and open `Alerts` tab in the navigation bar and click on `Alert Transports`.
2. Click on `Create add transport` and select `Transport type` as `API`. Select the `API Method` as `POST`. 3. Fill the `API URL` with [https://api.keephq.dev/alerts/event/libre\_nms](https://api.keephq.dev/alerts/event/libre_nms).
4. Copy the below JSON and paste it in `body` field. ```json theme={null} { "title": "{{ $title }}", "hostname": "{{ $hostname }}", "device_id": "{{ $device_id }}", "sysDescr": "{{ $sysDescr }}", "sysName": "{{ $sysName }}", "sysContact": "{{ $sysContact }}", "os": "{{ $os }}", "type": "{{ $type }}", "ip": "{{ $ip }}", "display": "{{ $display }}", "version": "{{ $version }}", "hardware": "{{ $hardware }}", "features": "{{ $features }}", "serial": "{{ $serial }}", "status": "{{ $status }}", "status_reason": "{{ $status_reason }}", "location": "{{ $location }}", "description": "{{ $description }}", "notes": "{{ $notes }}", "uptime": "{{ $uptime }}", "uptime_short": "{{ $uptime_short }}", "uptime_long": "{{ $uptime_long }}", "elapsed": "{{ $elapsed }}", "alerted": "{{ $alerted }}", "alert_id": "{{ $alert_id }}", "alert_notes": "{{ $alert_notes }}", "proc": "{{ $proc }}", "rule_id": "{{ $rule_id }}", "id": "{{ $id }}", "faults": "{{ $faults }}", "uid": "{{ $uid }}", "severity": "{{ $severity }}", "rule": "{{ $rule }}", "name": "{{ $name }}", "string": "{{ $string }}", "timestamp": "{{ $timestamp }}", "contacts": "{{ $contacts }}", "state": "{{ $state }}", "msg": "{{ $msg }}", "builder": "{{ $builder }}" } ``` 5. Follow the below steps to create a new API key in Keep. 6. Go to Keep dashboard and click on the profile icon in the botton left corner and click `Settings`.
7. Select `Users and Access` tab and then select `API Keys` tab and create a new API key.
8. Give name and select the role as `webhook` and click on `Create API Key`.
9. Copy the API key.
10. Add a new header with key as `X-API-KEY` and create a new API key in Keep and paste it as the value and save the webhook.
11. Save the webhook. 12. You can add devices from the Devices tab in the LibreNMS dashboard and select the alert transport that you have created.
13. Now, you will receive the alerts in Keep. ## Useful Links * [LibreNMS](https://www.librenms.org/) # Linear Provider Source: https://docs.keephq.dev/providers/documentation/linear_provider Linear Provider is a provider for fetching data and creating issues in Linear app. ## Authentication This provider requires authentication. * **api\_token**: Linear API Token (required: True, sensitive: True) * **ticket\_creation\_url**: URL for creating new tickets (required: False, sensitive: False) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query linear provider: linear config: "{{ provider.my_provider_name }}" with: team_name: {value} ``` As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query linear provider: linear config: "{{ provider.my_provider_name }}" with: team_name: {value} project_name: {value} title: {value} description: {value} priority: {value} ``` If you need workflow examples with this provider, please raise a [GitHub issue](https://github.com/keephq/keep/issues). ## How to set up The Linear Provider uses `api_token` for request authorization. You need to provider the following: * **api\_token** (requires): The personal api key for your linear app. * How to obtain: 1. Visit the Linear app or website. 2. Log in to your Linear account. 3. Navigate to your account settings -. 4. Navigate to the API page. 5. Under Personal API keys section generate the key. 6. Copy the generated API token. ## Notes * This provider allows you to query projects for the given Linear team. * This provider allows you to notify (create issue) inside Linear app for given project and team. ## Useful Links * [Linear](https://linear.app) * [Linear Docs](https://developers.linear.app/docs/graphql/working-with-the-graphql-api) # LinearB Source: https://docs.keephq.dev/providers/documentation/linearb-provider The LinearB provider enables integration with LinearB's API to manage and notify incidents directly through webhooks.
The LinearB provider facilitates the automatic creation, update, and deletion of incidents in LinearB through its public API. It supports dynamic incident management based on operational events, allowing teams to synchronize their development metrics and alerts with LinearB's project management capabilities. For any support or questions, join our community on Slack or GitHub. ## Authentication This provider requires authentication. * **api\_token**: LinearB API Token (required: True, sensitive: True) 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: * **any**: A way to validate the provider (mandatory) ## In workflows This provider can be used in workflows. As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query linearb provider: linearb config: "{{ provider.my_provider_name }}" with: incident_id: {value} http_url: {value} title: {value} teams: {value} repository_urls: {value} services: {value} started_at: {value} ended_at: {value} git_ref: {value} should_delete: {value} issued_at: {value} ``` If you need workflow examples with this provider, please raise a [GitHub issue](https://github.com/keephq/keep/issues). ## Connecting with the Provider ### Obtaining an API Token To use the LinearB provider, you must obtain an API token from LinearB: 1. Sign in to your LinearB account. 2. Navigate to the API settings section. 3. Generate a new API token with the appropriate permissions. 4. Securely store the API token as it is needed to configure the LinearB provider in Keep. ### Useful Links * [LinearB API Reference](https://docs.linearb.io/api-overview/) # LiteLLM Provider Source: https://docs.keephq.dev/providers/documentation/litellm-provider The LiteLLM Provider enables integration with LiteLLM proxy into Keep. ## Authentication This provider requires authentication. * **api\_url**: LiteLLM API endpoint URL (required: True, sensitive: False) * **api\_key**: Optional API key if your LiteLLM deployment requires authentication (required: False, sensitive: True) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query litellm provider: litellm config: "{{ provider.my_provider_name }}" with: prompt: {value} temperature: {value} model: {value} max_tokens: {value} structured_output_format: {value} ``` Check the following workflow example: * [enrich\_using\_structured\_output\_from\_openai.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/enrich_using_structured_output_from_openai.yaml) # Llama.cpp Provider Source: https://docs.keephq.dev/providers/documentation/llamacpp-provider The Llama.cpp Provider allows for integrating locally running Llama.cpp models into Keep.The Llama.cpp Provider supports querying local Llama.cpp models for prompt-based interactions. Make sure you have Llama.cpp server running locally with your desired model. ### **Cloud Limitation** This provider is disabled for cloud environments and can only be used in local or self-hosted environments. ## Authentication This provider requires authentication. * **host**: Llama.cpp Server Host URL (required: True, sensitive: False) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query llamacpp provider: llamacpp config: "{{ provider.my_provider_name }}" with: prompt: {value} max_tokens: {value} ``` If you need workflow examples with this provider, please raise a [GitHub issue](https://github.com/keephq/keep/issues). ## Connecting with the Provider To use the Llama.cpp Provider: 1. Install Llama.cpp on your system 2. Download or convert your model to GGUF format 3. Start the Llama.cpp server with HTTP interface: ```bash theme={null} ./server --model /path/to/your/model.gguf --host 0.0.0.0 --port 8080 ``` 4. Configure the host URL and model path in your Keep configuration ## Prerequisites * Llama.cpp must be installed and compiled with server support * A GGUF format model file must be available on your system * The Llama.cpp server must be running and accessible * The server must have sufficient resources to load and run your model ## Model Compatibility The provider works with any GGUF format model compatible with Llama.cpp, including: * LLaMA and LLaMA-2 models * Mistral models * OpenLLaMA models * Vicuna models * And other compatible model architectures Make sure your model is in GGUF format before using it with the provider. # Mailgun Provider Source: https://docs.keephq.dev/providers/documentation/mailgun-provider Mailgun Provider allows sending alerts to Keep via email.Mailgun currently supports receiving alerts via email. We will add querying and notifying soon. ## Authentication This provider requires authentication. * **email**: Email address to send alerts to (required: False, sensitive: False) * **sender**: Sender email address to validate (required: False, sensitive: False) * **email\_domain**: Custom email domain for receiving alerts (required: False, sensitive: False) * **extraction**: Extraction Rules (required: False, sensitive: False) ## In workflows This provider can't be used as a "step" or "action" in workflows. If you want to use it, please let us know by creating an issue in the [GitHub repository](https://github.com/keephq/keep/issues). ## Connecting with the Provider To connect to Mailgun, you do not need to perform any actions on the Mailgun side. We use our own Mailgun account and handle everything for you. ## Post Installation Validation You can check that the Mailgun Provider works by sending a test email to the configured email address. 1. Send a test email to the email address provided in the `authentication` section. 2. Check Keep's platform to see if the alert is received.## Default Alert Values When no extraction rules are set, the default values for every alert are as follows: * **name**: The subject of the email. * **source**: The sender of the email. * **message**: The stripped text content of the email. * **timestamp**: The timestamp of the email, converted to ISO format. * **severity**: "info" * **status**: "firing" ## How Extraction Works Extraction rules allow you to extract specific information from the email content using regular expressions. This can be useful for parsing and structuring the alert data.
### Example Extraction Rule An extraction rule is defined as a dictionary with the following keys: * **key**: The key in the email event to apply the extraction rule to. * **value**: The regular expression to use for extraction. #### Example Extract the severity from the subject of the email. ``` Key: subject Value: (?P
\w+): ``` # Mattermost Provider Source: https://docs.keephq.dev/providers/documentation/mattermost-provider Mattermost provider is used to send messages to Mattermost. ## Authentication This provider requires authentication. * **webhook\_url**: Mattermost Webhook Url (required: True, sensitive: True) ## In workflows This provider can be used in workflows. As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query mattermost provider: mattermost config: "{{ provider.my_provider_name }}" with: message: {value} # The content of the message. attachments: {value} # The attachments of the message. channel: {value} # The channel to send the message ``` If you need workflow examples with this provider, please raise a [GitHub issue](https://github.com/keephq/keep/issues). ## Connecting with the Provider 1. **Obtain a Mattermost Webhook URL:** * Go to the Mattermost Incoming Webhook API documentation: [Mattermost Incoming Webhooks](https://docs.mattermost.com/developer/webhooks-incoming.html). * Follow the instructions to create a new incoming webhook. * Copy the generated webhook URL, which should be passed as the `webhook_url` for authentication. ## Useful Links * [Mattermost Incoming Webhooks](https://developers.mattermost.com/integrate/webhooks/incoming/) # Mock Source: https://docs.keephq.dev/providers/documentation/mock-provider Template Provider is a template for newly added provider's documentation ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query mock provider: mock config: "{{ provider.my_provider_name }}" with: # Just will return all parameters passed to it. ``` As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query mock provider: mock config: "{{ provider.my_provider_name }}" with: # Just will return all parameters passed to it. ``` Check the following workflow examples: * [autosupress.yml](https://github.com/keephq/keep/blob/main/examples/workflows/autosupress.yml) * [businesshours.yml](https://github.com/keephq/keep/blob/main/examples/workflows/businesshours.yml) * [datadog-log-monitor.yml](https://github.com/keephq/keep/blob/main/examples/workflows/datadog-log-monitor.yml) * [db\_disk\_space\_monitor.yml](https://github.com/keephq/keep/blob/main/examples/workflows/db_disk_space_monitor.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) * [ilert-incident-upon-alert.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/ilert-incident-upon-alert.yaml) * [resolve\_old\_alerts.yml](https://github.com/keephq/keep/blob/main/examples/workflows/resolve_old_alerts.yml) # Monday Source: https://docs.keephq.dev/providers/documentation/monday-provider Monday Provider allows you to add new pulses to your boards ## Overview Monday Provider enables seamless integration with Monday.com, a work operating system that powers teams to run projects and workflows with confidence. With Monday Provider, you can add new pulses to your boards. ## Authentication This provider requires authentication. * **api\_token**: Personal API Token (required: False, sensitive: True) * **access\_token**: For access token installation flow, use Keep UI (required: False, sensitive: True) * **scopes**: Scopes from OAuth logic, comma separated (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: * **create\_pulse**: Create a new pulse ## In workflows This provider can be used in workflows. As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query monday provider: monday config: "{{ provider.my_provider_name }}" with: board_id: {value} group_id: {value} item_name: {value} column_values: {value} ``` Check the following workflow example: * [monday\_create\_pulse.yml](https://github.com/keephq/keep/blob/main/examples/workflows/monday_create_pulse.yml) #### Admin tab If you are an admin user on your monday.com account, follow these steps to access your API token: 1. Log into your monday.com account. 2. Click on your avatar/profile picture in the top right corner. 3. Select Administration > Connections > API. 4. Copy your personal token. Please note that you can always regenerate a new token, but doing so will cause any previous tokens to expire. #### Developer tab If you are a member user or an admin on your monday.com account, follow these steps to access your API token: 1. Log into your monday.com account. 2. Click on your profile picture in the top right corner. 3. Select Developers. This will open the Developer Center in another tab. 4. Click My Access Tokens > Show. 5. Copy your personal token. Please note that you can always regenerate a new token, but doing so will cause any previous tokens to expire. ## Connecting Monday to Keep 1. Obtain the API Token from Monday. 2. Add Monday as a provider in Keep. 3. Give the provider a name and paste the API Token in the `Personal API Token` field and click `Connect`. ## How to use? 1. In order to add a new pulse to your board, you need the following information: * Board ID: The ID of the board where you want to add the pulse. * Group ID: The ID of the group where you want to add the pulse. * Item Name: The name of the pulse you want to add. * Column Values: The values of the columns you want to set for the pulse. 2. Open the board where you want to add the pulse in the monday.com app. 3. Hover over the board name in the side panel and click on the three dots that appear and click on ID to copy the board ID. 4. Hover over the group name in the board and click on the three dots that appear and click on Group ID to copy the group ID. 5. Item Name is the name of the pulse you want to add. 6. Column ID and Column Value are the values of the columns you want to set for the pulse. Hover over the column name in the board and click on the three dots that appear and click on Column ID to copy the column ID. The column value is the value you want to set for the column. ## Useful Links * [Monday.com](https://monday.com/) * [Example workflow for Monday Provider](https://github.com/keephq/keep/blob/main/examples/workflows/monday_create_pulse.yml) # MongoDB Source: https://docs.keephq.dev/providers/documentation/mongodb-provider MongoDB Provider is a provider used to query MongoDB databases ## Authentication This provider requires authentication. * **host**: Mongo host\_uri (required: True, sensitive: False) * **username**: MongoDB username (required: False, sensitive: False) * **password**: MongoDB password (required: False, sensitive: True) * **database**: MongoDB database name (required: False, sensitive: False) * **auth\_source**: Mongo authSource database name (required: False, sensitive: False) * **additional\_options**: Mongo kwargs, these will be passed to MongoClient (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: * **connect\_to\_server**: The user can connect to the server (mandatory) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query mongodb provider: mongodb config: "{{ provider.my_provider_name }}" with: query: {value} as_dict: {value} single_row: {value} ``` Check the following workflow example: * [query\_mongodb.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/query_mongodb.yaml) ## Connecting with the Provider In order to connect to the MongoDB database, you can use either a connection URI or individual parameters. Here's how you can provide authentication information: 1. If using a connection URI, provide the `host` parameter with the MongoDB connection string. 2. If using individual parameters, provide the following: * `username`: MongoDB username. * `password`: MongoDB password. * `host`: MongoDB hostname. * `database`: MongoDB database name. * `authSource`: MongoDB database name. ## Notes * Ensure that the provided user has the necessary privileges to execute queries on the specified MongoDB database. ## Useful Links * [MongoDB Documentation](https://docs.mongodb.com/) # MySQL Source: https://docs.keephq.dev/providers/documentation/mysql-provider MySQL Provider is a provider used to query MySQL databases ## Authentication This provider requires authentication. * **username**: MySQL username (required: True, sensitive: False) * **password**: MySQL password (required: True, sensitive: True) * **host**: MySQL hostname (required: True, sensitive: False) * **database**: MySQL database name (required: False, sensitive: False) * **port**: MySQL port (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: * **connect\_to\_server**: The user can connect to the server (mandatory) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query mysql provider: mysql config: "{{ provider.my_provider_name }}" with: query: {value} # Query to execute as_dict: {value} # If True, returns the results as a list of dictionaries single_row: {value} # If True, returns only the first row of the results # Arguments will me passed to the query.format(**kwargs) ``` As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query mysql provider: mysql config: "{{ provider.my_provider_name }}" with: query: {value} # Query to execute as_dict: {value} # If True, returns the results as a list of dictionaries single_row: {value} # If True, returns only the first row of the results # Arguments will me passed to the query.format(**kwargs) ``` Check the following workflow examples: * [blogpost.yml](https://github.com/keephq/keep/blob/main/examples/workflows/blogpost.yml) * [conditionally\_run\_if\_ai\_says\_so.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/conditionally_run_if_ai_says_so.yaml) * [create\_alerts\_from\_mysql.yml](https://github.com/keephq/keep/blob/main/examples/workflows/create_alerts_from_mysql.yml) * [raw\_sql\_query\_datetime.yml](https://github.com/keephq/keep/blob/main/examples/workflows/raw_sql_query_datetime.yml) * [simple\_http\_request\_ntfy.yml](https://github.com/keephq/keep/blob/main/examples/workflows/simple_http_request_ntfy.yml) * [slack-message-reaction.yml](https://github.com/keephq/keep/blob/main/examples/workflows/slack-message-reaction.yml) ## Connecting with the Provider In order to connect to the MySQL database, you will need to create a new user with the required permissions. Here's how you can do this: 1. Connect to the MySQL server as a user with sufficient privileges to create a new user. 2. Run the following command to create a new user: `CREATE USER ' '@' ' IDENTIFIED BY ' '`; 3. Grant the necessary permissions to the new user by running the following command: `GRANT ALL PRIVILEGES ON .* TO ' '@' '`; ## Notes ## Useful Links * [MySQL Documentation](https://dev.mysql.com/doc/refman/8.0/en/) # NetBox Source: https://docs.keephq.dev/providers/documentation/netbox-provider NetBox provider allows you to get events from NetBox through webhook. ## Overview NetBox is the leading solution for modeling and documenting modern networks. By combining the traditional disciplines of IP address management (IPAM) and datacenter infrastructure management (DCIM) with powerful APIs and extensions, NetBox provides the ideal "source of truth" to power network automation. Read on to discover why thousands of organizations worldwide put NetBox at the heart of their infrastructure. ## Connecting NetBox to Keep To connect NetBox to Keep, you need to create a webhook in NetBox. 1. Go to NetBox dashboard, click on `Webhooks` under `Operations` section in the sidebar. 2. Add a new webhook by clicking on `Add` button.
3. Enter [https://api.keephq.dev/alerts/event/netbox](https://api.keephq.dev/alerts/event/netbox) as the URL and select the request method as `POST`. 4. Follow the below steps to create a new API key in Keep. 5. Go to Keep dashboard and click on the profile icon in the botton left corner and click `Settings`.
6. Select `Users and Access` tab and then select `API Keys` tab and create a new API key.
7. Give name and select the role as `webhook` and click on `Create API Key`.
8. In the `Additional headers` field enter `X-API-KEY` as the key and the API key generated in step 7 as the value. It should look like below. Refer the screenshot from step 3. ``` X-API-KEY: your-api-key ``` 9. Disable the `SSL verification` (Optional) or enable it based on your requirement.
10. Click on `Save` to save the webhook. 11. Go to `Event Rules` under `Operations` section in the sidebar and click on `Add` button to create a new event rule.
12. Fill the required fields based on your requirement. Select the `Object types` and `Event types` for which you want to receive the events.
13. In the `Action type` select `Webhook` and select the webhook created in step 3 and click on `Save`.
Now, you have successfully connected NetBox to Keep. You will start receiving the events in Keep based on the event rules you have created. ## Useful Links * [NetBox](https://netboxlabs.com/) ## In workflows This provider can't be used as a "step" or "action" in workflows. If you want to use it, please let us know by creating an issue in the [GitHub repository](https://github.com/keephq/keep/issues). # Netdata Source: https://docs.keephq.dev/providers/documentation/netdata-provider Netdata provider allows you to get alerts from Netdata via webhooks. ## Overview The Netdata Provider enables seamless integration between Keep and Netdata, allowing alerts from Netdata to be directly sent to Keep through webhook configurations. This integration ensures that critical alerts are efficiently managed and responded to within Keep's platform. ## In workflows This provider can't be used as a "step" or "action" in workflows. If you want to use it, please let us know by creating an issue in the [GitHub repository](https://github.com/keephq/keep/issues). ## Connecting via Webhook (omnidirectional) This provider supports webhooks. To send alerts from Netdata to Keep, Use the following webhook url to configure Netdata send alerts to Keep: 1. In Netdata, go to Space settings. 2. Go to "Alerts & Notifications". 3. Click on "Add configuration". 4. Add "Webhook" as the notification method. 5. Add a name to the configuration. 6. Select Room(s) to apply the configuration. 7. Select Notification(s) to apply the configuration. 8. In the "Webhook URL" field, add KEEP\_BACKEND\_URL/alerts/event/netdata. 9. Add a request header with the key "x-api-key" and the value as . 10. Leave the Authentication as "No Authentication". 11. Add the "Challenge secret" as "keep-netdata-webhook-integration". 12. Save the configuration. ## Useful Links * [Netdata](https://www.netdata.cloud/) ## Note * Currently, Netdata don't support webhook in on-premises installations. # New Relic Source: https://docs.keephq.dev/providers/documentation/new-relic-provider New Relic Provider enables querying AI alerts and registering webhooks. ## Authentication This provider requires authentication. * **api\_key**: New Relic User key. To receive webhooks, use `User key` of an admin account (required: True, sensitive: True) * **account\_id**: New Relic account ID (required: True, sensitive: False) * **new\_relic\_api\_url**: New Relic API URL (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: * **ai.issues:read**: Required to read issues and related information (mandatory) ([Documentation](https://docs.newrelic.com/docs/accounts/accounts-billing/new-relic-one-user-management/user-management-concepts/)) * **ai.destinations:read**: Required to read whether keep webhooks are registered ([Documentation](https://docs.newrelic.com/docs/accounts/accounts-billing/new-relic-one-user-management/user-management-concepts/)) * **ai.destinations:write**: Required to register keep webhooks ([Documentation](https://docs.newrelic.com/docs/accounts/accounts-billing/new-relic-one-user-management/user-management-concepts/)) * **ai.channels:read**: Required to know informations about notification channels. ([Documentation](https://docs.newrelic.com/docs/accounts/accounts-billing/new-relic-one-user-management/user-management-concepts/)) * **ai.channels:write**: Required to create notification channel ([Documentation](https://docs.newrelic.com/docs/accounts/accounts-billing/new-relic-one-user-management/user-management-concepts/)) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query newrelic provider: newrelic config: "{{ provider.my_provider_name }}" with: nrql: {value} query: {value} # query to execute ``` Check the following workflow example: * [complex-conditions-cel.yml](https://github.com/keephq/keep/blob/main/examples/workflows/complex-conditions-cel.yml) ## Connecting with the Provider 1. Go to [https://one.newrelic.com/admin-portal/api-keys/home](https://one.newrelic.com/admin-portal/api-keys/home) to create User Key. 2. Get `api_key` and `account_id` from the key created. 3. Based on region get `api_url` from here [https://docs.newrelic.com/docs/apis/rest-api-v2/get-started/introduction-new-relic-rest-api-v2](https://docs.newrelic.com/docs/apis/rest-api-v2/get-started/introduction-new-relic-rest-api-v2) . ## Webhook Integration Modifications The webhook integration adds Keep as a destination within the "Alerts and AI" API within New Relic. This grants Keep access to the following scopes within New Relic: * `ai.destinations:read` * `ai.destinations:write` * `ai.channels:read` * `ai.channels:write` ## Useful Links * [https://docs.newrelic.com/docs/apis/rest-api-v2/get-started/introduction-new-relic-rest-api-v2](https://docs.newrelic.com/docs/apis/rest-api-v2/get-started/introduction-new-relic-rest-api-v2) # Ntfy.sh Source: https://docs.keephq.dev/providers/documentation/ntfy-provider Ntfy.sh allows you to send notifications to your devices ## Authentication This provider requires authentication. * **access\_token**: Ntfy Access Token (required: False, sensitive: True) * **host**: Ntfy Host URL (For self-hosted Ntfy only) (required: False, sensitive: False) * **username**: Ntfy Username (For self-hosted Ntfy only) (required: False, sensitive: False) * **password**: Ntfy Password (For self-hosted Ntfy only) (required: False, sensitive: True) 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: * **send\_alert**: (mandatory) ## In workflows This provider can be used in workflows. As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query ntfy provider: ntfy config: "{{ provider.my_provider_name }}" with: message: {value} topic: {value} ``` Check the following workflow examples: * [ntfy\_basic.yml](https://github.com/keephq/keep/blob/main/examples/workflows/ntfy_basic.yml) * [query\_clickhouse.yml](https://github.com/keephq/keep/blob/main/examples/workflows/query_clickhouse.yml) * [query\_victoriametrics.yml](https://github.com/keephq/keep/blob/main/examples/workflows/query_victoriametrics.yml) * [simple\_http\_request\_ntfy.yml](https://github.com/keephq/keep/blob/main/examples/workflows/simple_http_request_ntfy.yml) ## Connecting with the Provider Obtain Ntfy Access Token (For Ntfy.sh only) 1. Create an account on [Ntfy.sh](https://ntfy.sh/). 2. After logging in, go to the [Access token](https://ntfy.sh/account) page. 3. Click on the `CREATE ACCESS TOKEN`. Give it a label and select token expiration time and click on the `CREATE TOKEN` button. 4. Copy the generated token. This will be used as the `Ntfy Access Token` in the provider settings. Self-Hosted Ntfy 1. To self-host Ntfy, you can follow the instructions [here](https://docs.ntfy.sh/install/). 2. For self-hosted Ntfy, you will need to provide the `Ntfy Host URL`, `Ntfy Username`, and `Ntfy Password` in the provider settings instead of the `Ntfy Access Token`. 3. Create a new user for the self-hosted Ntfy instance and use the generated username and password in the provider settings. Subscribing to a Topic (For Ntfy.sh and self-hosted Ntfy) 1. Login to your Ntfy.sh account. 2. Click on `Subscribe to a topic` button and generate name for the topic and subscribe to it. 3. Copy the generated topic name. This will be used as the `Ntfy Subcription Topic` in the provider settings. 4. Reserve the topic and confiure access (Requires ntfy Pro) ## Usefull Links * [Ntfy.sh](https://ntfy.sh/) * [To self-host Ntfy](https://docs.ntfy.sh/install/) # Ollama Provider Source: https://docs.keephq.dev/providers/documentation/ollama-provider The Ollama Provider allows for integrating locally running Ollama language models into Keep.
The Ollama Provider supports querying local Ollama models for prompt-based interactions. Make sure you have Ollama installed and running locally with your desired models. ### **Cloud Limitation** This provider is disabled for cloud environments and can only be used in local or self-hosted environments. ## Authentication This provider requires authentication. * **host**: Ollama API Host URL (required: True, sensitive: False) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query ollama provider: ollama config: "{{ provider.my_provider_name }}" with: prompt: {value} model: {value} max_tokens: {value} structured_output_format: {value} ``` If you need workflow examples with this provider, please raise a [GitHub issue](https://github.com/keephq/keep/issues). ## Connecting with the Provider To use the Ollama Provider: 1. Install Ollama on your system from [Ollama's website](https://ollama.ai). 2. Start the Ollama service. 3. Pull your desired model(s) using `ollama pull model-name`. 4. Configure the host URL in your Keep configuration. ## Prerequisites * Ollama must be installed and running on your system. * The desired models must be pulled and available in your Ollama installation. * The Ollama API must be accessible from the host where Keep is running. # OpenAI Provider Source: https://docs.keephq.dev/providers/documentation/openai-provider The OpenAI Provider allows for integrating OpenAI's language models into Keep.The OpenAI Provider supports querying GPT language models for prompt-based interactions. ## Authentication This provider requires authentication. * **api\_key**: OpenAI Platform API Key (required: True, sensitive: True) * **organization\_id**: OpenAI Platform Organization ID (required: False, sensitive: False) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query openai provider: openai config: "{{ provider.my_provider_name }}" with: prompt: {value} model: {value} max_tokens: {value} structured_output_format: {value} ``` Check the following workflow examples: * [conditionally\_run\_if\_ai\_says\_so.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/conditionally_run_if_ai_says_so.yaml) * [enrich\_using\_structured\_output\_from\_openai.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/enrich_using_structured_output_from_openai.yaml) * [gcp\_logging\_open\_ai.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/gcp_logging_open_ai.yaml) * [send\_slack\_message\_on\_failure.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/send_slack_message_on_failure.yaml) * [update-incident-grafana-incident.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/update-incident-grafana-incident.yaml) ## Connecting with the Provider To connect to OpenAI, you'll need to obtain an API Key and (optionally) an Organization ID: 1. Log in to your OpenAI account at [OpenAI Platform](https://platform.openai.com). 2. Go to the **API Keys** section. 3. Click on **Create new secret key** to generate a key for Keep. 4. (Optional) Retrieve your **Organization ID** under **Organization settings** if youâre part of multiple organizations. Use the generated API key in the `authentication` section of your OpenAI Provider configuration. # OpenObserve Source: https://docs.keephq.dev/providers/documentation/openobserve-provider OpenObserve provider allows you to get OpenObserve `alerts/actions` via webhook installation ## Authentication This provider requires authentication. * **openObserveUsername**: OpenObserve Username (required: True, sensitive: False) * **openObservePassword**: Password (required: True, sensitive: True) * **openObserveHost**: OpenObserve host url (required: True, sensitive: False) * **openObservePort**: OpenObserve Port (required: True, sensitive: False) * **organisationID**: OpenObserve organisationID (required: True, 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: * **authenticated**: User is Authorized (mandatory) ## In workflows This provider can't be used as a "step" or "action" in workflows. If you want to use it, please let us know by creating an issue in the [GitHub repository](https://github.com/keephq/keep/issues). ## Connecting with the Provider Obtain OpenObserve Username and Password: 1. To see how to install and set Credentials: [here](https://openobserve.ai/docs/quickstart/#self-hosted-installation) 2. Get the Organisation ID of the OpenObserve instance in which you wish to install the webhook. ## Webhook Integration Modifications The webhook integration adds Keep as an alert monitor within the OpenObserve instance. It can be found under the "Alerts & Respond" section. The integration automatically gains access to the following scopes within OpenObserve: * `authenticated` ## Useful Links * [OpenObserve Alert Templates](https://openobserve.ai/docs/user-guide/alerts/templates) * [OpenObserve API Spec](https://openobserve.ai/docs/api_specs/#?route=overview) * [OpenObserve Destinations](https://openobserve.ai/docs/user-guide/alerts/destinations/) * [OpenObserve Installation and Credentials](https://openobserve.ai/docs/quickstart/#self-hosted-installation) # OpenSearch Serverless Source: https://docs.keephq.dev/providers/documentation/opensearchserverless-provider OpenSearch Serverless provider enables seamless integration with AWS OpenSearch Serverless for document-level querying, alerting, and writing, directly into Keep. ## Overview The OpenSearch Provider offers native integration with **Amazon OpenSearch Serverless**, allowing Keep users to query, monitor, and write documents in real-time. This supports observability and event-driven alerting for operational and security use cases. ### Key Features: * **Read & Write Support**: Enables both querying and writing documents to OpenSearch Serverless collections. * **AWS IAM Authentication**: Authenticates using AWS IAM credentials (access key/secret or instance role). ## Connecting with the Provider To connect OpenSearch with Keep, youâll need: * An AWS account with permissions for OpenSearch Serverless (AOSS). * A configured collection and index in AOSS. * AWS IAM credentials (permanent or temporary). ## Required AWS IAM Permissions (Scopes) To function properly, the OpenSearch provider requires the following IAM scopes: ### Mandatory Scopes * **`iam:SimulatePrincipalPolicy`** * **Description**: Required to check if the IAM identity has access to AOSS API. * **Alias**: Needed to test the access for next 3 scopes. * **Mandatory**: Yes * **`aoss:APIAccessAll`** * **Description**: Required to make API calls to OpenSearch Serverless. * **Alias**: Access to make API calls to serverless * **Mandatory**: Yes * **`aoss:ListAccessPolicies`** * **Description**: Needed to list all Data Access Policies. * **Alias**: Policy List access * **Mandatory**: Yes * **`aoss:GetAccessPolicy`** * **Description**: Required to inspect each policy for read/write scope. * **Alias**: Policy read access * **Mandatory**: Yes * **`aoss:CreateIndex`** * **Description**: Required to create an index. * **Documentation**: [AOSS API Docs](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-genref.html#serverless-operations) * **Alias**: Create Index * **Mandatory**: Yes * **`aoss:ReadDocument`** * **Description**: Required to read documents from an OpenSearch collection. * **Documentation**: [AOSS API Docs](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-genref.html#serverless-operations) * **Alias**: Read Documents * **Mandatory**: Yes * **`aoss:WriteDocument`** * **Description**: Required to index or update documents in an OpenSearch collection. * **Documentation**: [AOSS API Docs](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-genref.html#serverless-operations) * **Alias**: Write Documents * **Mandatory**: Yes`iam:SimulatePrincipalPolicy`, `aoss:APIAccessAll`, `aoss:ListAccessPolicies`, `aoss:GetAccessPolicy`, needs to be added from your IAM console to the IAM identity used by Keep. The other two policies are data access policies which needs to be added from aws serverless dashboard. Go through the readme to get step by step setup: [README](https://github.com/keep/keep/providers/opensearchserverless_provider\README.md) ## Authentication Configuration To authenticate with OpenSearch Serverless, provide the following: * **AWS Access Key** (Mandatory): Your AWS access key. * **AWS Access Key Secret** (Mandatory): Your AWS access key secret. * **Region** (Mandatory): The AWS region hosting your OpenSearch collection. * **Domain Endpoint** (Mandatory): The full domain URL of your AOSS collection endpoint. ## Setting Up the Integration ### Steps: 1. **Assign IAM Permissions**: Grant your IAM user/role `aoss:CreateIndex`, `aoss:ReadDocument` and `aoss:WriteDocument` on the target collection. 2. **Configure Keep Provider**: Provide access key, secret, region, and collection endpoint in the Keep platform. ## Querying OpenSearch Keep supports standard OpenSearch queries using the `_search` endpoint: * **index**: The name of the OpenSearch index to query. * **query**: A valid OpenSearch query DSL object. ### Example ```json theme={null} { "query": { "match_all": {} }, "size": 1 } ``` ## Writing to OpenSearch You can use the `_notify` functionality to push documents into OpenSearch collections. * **index**: The index name where the document should be written. * **document**: A Python dictionary representing the document body. * **id**: ID for the document ## Useful Links * [AWS OpenSearch Serverless Documentation](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless.html) * [AOSS Data Access Control](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-data-access.html) * [README](https://github.com/keep/keep/providers/opensearchserverless_provider\README.md) # Openshift Source: https://docs.keephq.dev/providers/documentation/openshift-provider Openshift provider to perform rollout restart action on specific resources. ## Authentication This provider requires authentication. * **api\_server**: The openshift api server url (required: True, sensitive: False) * **token**: The openshift token (required: True, sensitive: True) * **insecure**: Skip TLS verification (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: * **connect\_to\_openshift**: Check if the provided token can connect to the openshift server (mandatory) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query openshift provider: openshift config: "{{ provider.my_provider_name }}" with: command_type: {value} # The type of query to perform. Supported queries are: - get_logs: Get logs from a pod - get_events: Get events for a namespace or pod - get_pods: List pods in a namespace or across all namespaces - get_node_pressure: Get node pressure conditions - get_pvc: List persistent volume claims - get_routes: List OpenShift routes - get_deploymentconfigs: List OpenShift deployment configs - get_projects: List OpenShift projects # Additional arguments for the query. ``` As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query openshift provider: openshift config: "{{ provider.my_provider_name }}" with: action: {value} # The action to perform. Supported actions are: - rollout_restart: Restart a deployment, statefulset, or daemonset - restart_pod: Restart a pod by deleting it - scale_deployment: Scale a deployment to specified replicas - scale_deploymentconfig: Scale a deployment config to specified replicas # Additional arguments for the action. ``` Check the following workflow examples: * [openshift\_basic.yml](https://github.com/keephq/keep/blob/main/examples/workflows/openshift_basic.yml) * [openshift\_monitoring\_and\_remediation.yml](https://github.com/keephq/keep/blob/main/examples/workflows/openshift_monitoring_and_remediation.yml) * [openshift\_pod\_restart.yml](https://github.com/keephq/keep/blob/main/examples/workflows/openshift_pod_restart.yml) ## Connecting with the Provider To connect to Openshift, follow below steps: 1. Log in to your Openshift cluster and create a new service account with required roles. 2. Get the token of the service account. 3. Use the token to authenticate with Openshift. ## Notes * This provider allows you to interact with Openshift to perform rollout restart actions. # Opsgenie Provider Source: https://docs.keephq.dev/providers/documentation/opsgenie-provider OpsGenie Provider is a provider that allows to create alerts in OpsGenie. ## Authentication This provider requires authentication. * **api\_key**: OpsGenie api key (required: True, sensitive: True) * **integration\_name**: OpsGenie integration name (required: True, 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: * **opsgenie:create**: Create OpsGenie alerts (mandatory) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query opsgenie provider: opsgenie config: "{{ provider.my_provider_name }}" with: query_type: {value} query: {value} ``` As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query opsgenie provider: opsgenie config: "{{ provider.my_provider_name }}" with: user: {value} # Display name of the request owner note: {value} # Additional note that will be added while creating the alert source: {value} # Source field of the alert. Default value is IP address of the incoming request message: {value} # Message of the alert alias: {value} # Client-defined identifier of the alert, that is also the key element of alert deduplication description: {value} # Description field of the alert that is generally used to provide a detailed information responders: {value} # Responders that the alert will be routed to send notifications visible_to: {value} # Teams and users that the alert will become visible to without sending any notification actions: {value} # Custom actions that will be available for the alert tags: {value} # Tags of the alert details: {value} # Map of key-value pairs to use as custom properties of the alert entity: {value} # Entity field of the alert that is generally used to specify which domain alert is related to priority: {value} # Priority level of the alert type: {value} # Type of the request, e.g. create_alert, close_alert # Additional arguments ``` Check the following workflow examples: * [failed-to-login-workflow.yml](https://github.com/keephq/keep/blob/main/examples/workflows/failed-to-login-workflow.yml) * [opsgenie-close-alert.yml](https://github.com/keephq/keep/blob/main/examples/workflows/opsgenie-close-alert.yml) * [opsgenie-create-alert-cel.yml](https://github.com/keephq/keep/blob/main/examples/workflows/opsgenie-create-alert-cel.yml) * [opsgenie-create-alert.yml](https://github.com/keephq/keep/blob/main/examples/workflows/opsgenie-create-alert.yml) * [opsgenie\_open\_alerts.yml](https://github.com/keephq/keep/blob/main/examples/workflows/opsgenie_open_alerts.yml) ## Provider Methods The provider exposes the following [Provider Methods](/providers/provider-methods#via-ai-assistant). They are available in the [AI Assistant](/overview/ai-incident-assistant). * **close\_alert** Close an alert (action, scopes: opsgenie:create) * **comment\_alert** Comment an alert (action, scopes: opsgenie:create) ## Connecting with the Provider To use the Opsgenie Provider, you'll need to provide the API Key and Integration Name from API Integration. You can create an API integration under Settings -> Integrations -> Add integration and search for API Integration. Select API and provide a name for the integration and click on continue. You can create an integration key under Settings -> Integrations -> Add integrationIf you are in the free tier, the integration key can be created under Teams -> Your team -> Integrations -> Add Integration (API) Visit the [Opsgenie API Integration](https://app.opsgenie.com/settings/integrations/create/api) for creating an API integration quickly.![]()
![]()
![]()
Visit the [Opsgenie API Integration](https://support.atlassian.com/opsgenie/docs/create-a-default-api-integration/) documentation for latest information. ## Useful Links * How to create Opsgenie API Integration - [https://support.atlassian.com/opsgenie/docs/create-a-default-api-integration/](https://support.atlassian.com/opsgenie/docs/create-a-default-api-integration/) # PagerDuty Provider Source: https://docs.keephq.dev/providers/documentation/pagerduty-provider PagerDuty Provider allows integration with PagerDuty to create, manage, and synchronize incidents and alerts within Keep. ## Description The PagerDuty Provider enables integration with PagerDuty to create, manage, and synchronize incidents and alerts within Keep. It supports both direct API key authentication and OAuth2, allowing greater flexibility for secure integration. ## Authentication This provider requires authentication. * **routing\_key**: Routing Key (an integration or ruleset key) (required: False, sensitive: False) * **api\_key**: Api Key (a user or team API key) (required: False, sensitive: True) * **oauth\_data**: For oauth flow (required: False, sensitive: True) * **service\_id**: Service Id (if provided, keep will only operate on this service) (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: * **incidents\_read**: Read incidents data. (mandatory) * **incidents\_write**: Write incidents. * **webhook\_subscriptions\_read**: Read webhook data. * **webhook\_subscriptions\_write**: Write webhooks. ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query pagerduty provider: pagerduty config: "{{ provider.my_provider_name }}" with: incident_id: {value} incident_key: {value} ``` As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query pagerduty provider: pagerduty config: "{{ provider.my_provider_name }}" with: title: {value} # Title of the alert or incident dedup: {value} # String used to deduplicate alerts for events API, max 255 chars service_id: {value} # ID of the service for incidents routing_key: {value} # API routing_key (optional), if not specified, fallbacks to the one provided in provider requester: {value} # Email of the user requesting the incident creation incident_id: {value} # Key to identify the incident. UUID generated if not provided event_type: {value} # Event type for events API (trigger/acknowledge/resolve) severity: {value} # Severity for events API (critical/error/warning/info) source: {value} # Source field for events API priority: {value} # Priority reference ID for incidents status: {value} # Status for incident updates (resolved/acknowledged) resolution: {value} # Resolution note for resolved incidents client: {value} # Name of the monitoring client triggering this event (Events API v2 only) client_url: {value} # URL of the monitoring client triggering this event (Events API v2 only) body: {value} # Body of the incident as per https://developer.pagerduty.com/api-reference/a7d81b0e9200f-create-an-incident#request-body kwargs: {value} # Additional event/incident fields ``` Check the following workflow examples: * [ifelse.yml](https://github.com/keephq/keep/blob/main/examples/workflows/ifelse.yml) * [pagerduty.yml](https://github.com/keephq/keep/blob/main/examples/workflows/pagerduty.yml) ## Topology This provider pulls [topology](/overview/servicetopology) to Keep. It could be used in [correlations](/overview/correlation-topology) and [mapping](/overview/enrichment/mapping#mapping-with-topology-data), and as a context for [alerts](/alerts/sidebar#7-alert-topology-view) and [incidents](/overview#17-incident-topology). ## Connecting with the Provider To connect Keep to PagerDuty: * **Routing Key**: Use for event posting via the PagerDuty Events API. In the PagerDuty UI, this is displayed as the integration key. * **API Key**: Use for incident creation and management through the PagerDuty Incidents API. * **Service Id** (Optional): If provided, keep operates within the service's scope. * **OAuth2**: Token management handled automatically by Keep.
![]()
You can find your routing key in the PagerDuty (integration key in PagerDuty UI) web app under **Services** > **Service Directory** > **Your service** > **Integrations** > **Expand Events API**, and select the integration you want to use. You can find your API key in the PagerDuty web app under **Configuration** > **API Access**. The routing\_key is used to post events to PagerDuty using the events API. The api\_key is used to create incidents using the incidents API. ### Enabling OAuth in the open-source version If you would like to use OAuth in the open-source, where you self-host Keep, you can do so by following these step: 1. Create a PagerDuty account 2. In the account page, go to **Integrations** > **App Registration**3. Click on **New App** blue button on the top right 4. Fill in the required fields 5. Select "OAuth 2.0" in the Functionality section and click **Next** 6. In the Redirect URL, you need to add Keep's PagerDuty OAuth2 redirect URL, which is based on your deployments URL. For example, if Keep is deployed at [http://localhost:3000](http://localhost:3000), the redirect URL is [http://localhost:3000/providers/oauth2/pagerduty](http://localhost:3000/providers/oauth2/pagerduty)
7. In the Authorization section, select **Scoped OAuth** and select the following scopes: * Abilities: Read Access * Incidents: Read/Write Access * Services: Read/Write Access * Webhook Subscriptions: Read/Write Access 8. Click on **Register App** blue button on the bottom right 9. Copy the **Client ID** and **Client Secret** from the OAuth 2.0 Client Information modal and set the `PAGERDUTY_CLIENT_ID` and `PAGERDUTY_CLIENT_SECRET` environment variables in your Keep backend deployment.
## PagerDuty Webhook Integration By default, when Keep installs itself as a webhook integration, it subscribes to all incident events ("Account Scope").
If you wish to limit Keep to some specific services, you can do so by selecting the **Service** scope and selecting the services you want to subscribe to.
Find this page under **Integrations** > **Generic Webhooks (v3)** ## Notes The provider uses either the events API or the incidents API to create an alert or an incident. The choice of API to use is determined by the presence of either a routing\_key or an api\_key. An expired trial while using the free version of PagerDuty may result in the "pagerduty scopes are invalid" error at Keep. ## Webhook Integration Modifications The webhook integration adds Keep as a destination within the "Integrations" API within PagerDuty. This grants Keep access to the following scopes within PagerDuty: * `webhook_subscriptions_read` * `webhook_subscriptions_write` ## Useful Links * PagerDuty Events API documentation: [https://v2.developer.pagerduty.com/docs/send-an-event-events-api-v2](https://v2.developer.pagerduty.com/docs/send-an-event-events-api-v2) * PagerDuty Incidents API documentation: [https://v2.developer.pagerduty.com/docs/create-an-incident-incidents-api-v2](https://v2.developer.pagerduty.com/docs/create-an-incident-incidents-api-v2) # Pagertree Provider Source: https://docs.keephq.dev/providers/documentation/pagertree-provider The Pagertree Provider facilitates interactions with the Pagertree API, allowing the retrieval and management of alerts. ## Authentication This provider requires authentication. * **api\_token**: Your pagertree APIToken (required: True, sensitive: True) 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: * **authenticated**: The user can connect to the server and is authenticated using their API\_Key (mandatory) ## In workflows This provider can be used in workflows. As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query pagertree provider: pagertree config: "{{ provider.my_provider_name }}" with: title: {value} # Title of the alert. urgency: {value} # low|medium|high|critical incident: {value} # True if the alert is an incident severities: {value} # SEV-1|SEV-2|SEV-3|SEV-4|SEV-5|SEV_UNKNOWN incident_message: {value} # Message to be displayed in the incident description: {value} # UTF-8 string of custom message for alert. Shown in incident description status: {value} # alert status to send destination_team_ids: {value} # destination team_ids to send alert to destination_router_ids: {value} # destination router_ids to send alert to destination_account_user_ids: {value} # destination account_users_ids to send alert to # Additional parameters to be passed ``` If you need workflow examples with this provider, please raise a [GitHub issue](https://github.com/keephq/keep/issues). ## Connecting with the Provider * To interact with the Pagertree API, you need to provide an api\_token. * You can view and manage your API keys on your [User Settings](https://app.pagertree.com/user/settings) page. ## Notes *This provider uses the Pagertree API to send alerts or mark them as incidents based on the parameters provided. Depending on whether an incident is flagged as true, it either calls `__send_alert` or `__send_incident` method.* ## Useful Links * Pagertree API documentation: [Pagertree API](https://pagertree.com/docs) * Pagertree Authentication: [Authentication](https://pagertree.com/docs/api/authentication) * Pagertree Alerts: [Alerts & Incident](https://pagertree.com/docs/api/alerts) # Parseable Source: https://docs.keephq.dev/providers/documentation/parseable-provider Parseable provider allows integration with Parseable, a tool for collecting and querying logs. ## Authentication This provider requires authentication. * **parseable\_server**: Parseable Frontend URL (required: True, sensitive: False) * **username**: Parseable username (required: True, sensitive: False) * **password**: Parseable password (required: True, sensitive: True) ## In workflows This provider can't be used as a "step" or "action" in workflows. If you want to use it, please let us know by creating an issue in the [GitHub repository](https://github.com/keephq/keep/issues). ## Connecting via Webhook (omnidirectional) This is an example of how to configure an alert to be sent to Keep using Parseable's webhook feature. Post this to https\://YOUR\_PARSEABLE\_SERVER/api/v1/logstream/YOUR\_STREAM\_NAME/alert ``` {{ "version": "v1", "alerts": [ {{ "name": "Alert: Server side error", "message": "server reporting status as 500", "rule": {{ "type": "column", "config": {{ "column": "status", "operator": "=", "value": 500, "repeats": 2 }} }}, "targets": [ {{ "type": "webhook", "endpoint": "KEEP_BACKEND_URL/alerts/event/parseable", "skip_tls_check": true, "repeat": {{ "interval": "10s", "times": 5 }}, "headers": {{"X-API-KEY": "{api_key}"}} }} ] }} ] }} ``` ## Connecting with the Provider 1. Obtain an API key from your Parseable instance. 2. Configure your provider using the `api_key` and `parseable_url`. ## Usefull Links -[Parseable API Documentation](https://www.parseable.com/docs/api) # Pingdom Source: https://docs.keephq.dev/providers/documentation/pingdom-provider Pingdom provider allows you to pull alerts from Pingdom or install Keep as webhook. ## Authentication This provider requires authentication. * **api\_key**: Pingdom API Key (required: True, sensitive: True) 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: * **read**: Read alerts from Pingdom. (mandatory) ## In workflows This provider can't be used as a "step" or "action" in workflows. If you want to use it, please let us know by creating an issue in the [GitHub repository](https://github.com/keephq/keep/issues). ## Connecting via Webhook (omnidirectional) Install Keep as Pingdom webhook 1. Go to Settings > Integrations. 2. Click Add Integration. 3. Enter: Type = Webhook Name = Keep URL = Your Keep Backend URL 4. Click Save Integration. ## Connecting with the Provider ### API Key To obtain the Pingdom API key, follow these steps: 1. Log in to your Pingdom account. 2. Navigate to the "Settings" section. 3. Click on the "Pingdom API" tab. 4. Generate a new API Key. ## Fingerprinting Fingerprints in Pingdom are calculated based on the `check_id` incoming/pulled event. ## Notes *No information yet, feel free to contribute it using the "Edit this page" link at the bottom of the page* ## Useful Links * [Pingdom Webhook Documentation](https://www.pingdom.com/resources/webhooks) * [Pingdom Actions API](https://docs.pingdom.com/api/#tag/Actions) # Microsoft Planner Provider Source: https://docs.keephq.dev/providers/documentation/planner-provider Microsoft Planner Provider to create task in planner. ## Authentication This provider requires authentication. * **tenant\_id**: Planner Tenant ID (required: True, sensitive: True) * **client\_id**: Planner Client ID (required: True, sensitive: True) * **client\_secret**: Planner Client Secret (required: True, sensitive: True) ## In workflows This provider can be used in workflows. As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query planner provider: planner config: "{{ provider.my_provider_name }}" with: plan_id: {value} title: {value} bucket_id: {value} ``` Check the following workflow example: * [planner\_basic.yml](https://github.com/keephq/keep/blob/main/examples/workflows/planner_basic.yml) ## Connecting with the Provider To connect to Microsoft Planner, follow below steps: 1. Log in to your [Azure](https://azure.microsoft.com/) account. 2. Register an application [here](https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/CreateApplicationBlade/isMSAApp~/false). 3. After successfully registering the application, go to the **API permissions** page and add the below permissions: * `Tasks.Read.All` * `Tasks.ReadWrite.All` 4. Go to **Overview** page and note the `Application (client) ID` and `Directory (tenant) ID`. 5. Go to **Certificates & secrets** page, create a new client secret and note the client secret value. 6. Add the client id, client secret and tenant id to the `authentication` section in the Microsoft Planner Provider configuration. ## Notes * This provider allows you to interact with Microsoft Planner Provider to create tasks. ## Useful Links * [Microsoft Planner Provider Documentation](https://learn.microsoft.com/en-us/graph/api/planner-post-tasks?view=graph-rest-1.0\&tabs=http) * [Create an Azure Active Directory app](https://learn.microsoft.com/en-us/graph/toolkit/get-started/add-aad-app-registration) # PostgreSQL Source: https://docs.keephq.dev/providers/documentation/postgresql-provider PostgreSQL Provider is a provider used to query POSTGRES databases ## Authentication This provider requires authentication. * **username**: Postgres username (required: True, sensitive: False) * **password**: Postgres password (required: True, sensitive: True) * **host**: Postgres hostname (required: True, sensitive: False) * **database**: Postgres database name (required: False, sensitive: False) * **port**: Postgres port (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: * **connect\_to\_server**: The user can connect to the server (mandatory) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query postgres provider: postgres config: "{{ provider.my_provider_name }}" with: query: {value} ``` As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query postgres provider: postgres config: "{{ provider.my_provider_name }}" with: query: {value} ``` Check the following workflow example: * [disk\_grown\_defects\_rule.yml](https://github.com/keephq/keep/blob/main/examples/workflows/disk_grown_defects_rule.yml) ## Provider Methods The provider exposes the following [Provider Methods](/providers/provider-methods#via-ai-assistant). They are available in the [AI Assistant](/overview/ai-incident-assistant). * **execute\_query** Query the Postgres database (view, scopes: no additional scopes) ## Connecting with the Provider In order to connect to the Postgres database, you will need to create a new user with the required permissions. Here's how you can do this: 1. Connect to the Postgresql server as a user with sufficient privileges to create a new user. 2. Run the following command to create a new user: `CREATE USER '
' WITH ENCRYPTED PASSWORD ' '`; 3. Run the following command to create a database: `CREATE DATABASE ' ';`; 4. Grant the necessary permissions to the new user by running the following command: `GRANT ALL PRIVILEGES ON .* TO ' '`; ## Notes ## Useful Links * [Postgresql Documentation](https://www.postgresql.org/docs/) * [Creating user,database and adding access on psql](https://medium.com/coding-blocks/creating-user-database-and-adding-access-on-postgresql-8bfcd2f4a91e) # PostHog Source: https://docs.keephq.dev/providers/documentation/posthog-provider PostHog provider allows you to query session recordings and analytics data from PostHog. ## Authentication This provider requires authentication. * **api\_key**: PostHog API key (required: True, sensitive: True) * **project\_id**: PostHog project ID (required: True, 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: * **session\_recording:read**: Read PostHog session recordings (mandatory) * **session\_recording\_playlist:read**: Read PostHog session recording playlists * **project:read**: Read PostHog project data (mandatory) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query posthog provider: posthog config: "{{ provider.my_provider_name }}" with: query_type: {value} # Type of query (e.g., "session_recording_domains", "session_recordings") hours: {value} # Number of hours to look back limit: {value} # Maximum number of items to fetch # Additional arguments ``` Check the following workflow example: * [posthog\_example.yml](https://github.com/keephq/keep/blob/main/examples/workflows/posthog_example.yml) ## Provider Methods The provider exposes the following [Provider Methods](/providers/provider-methods#via-ai-assistant). They are available in the [AI Assistant](/overview/ai-incident-assistant). * **get\_session\_recording\_domains** Get a list of domains from session recordings within a time period (action, scopes: session\_recording:read, project:read) * `hours`: Number of hours to look back (default: 24) * `limit`: Maximum number of recordings to fetch (default: 100) * **get\_session\_recordings** Get session recordings within a time period (action, scopes: session\_recording:read, project:read) * `hours`: Number of hours to look back (default: 24) * `limit`: Maximum number of recordings to fetch (default: 100) ## Connecting with the Provider ### API Key To obtain the PostHog API key, follow these steps: 1. Log in to your PostHog account. 2. Navigate to "Project Settings" > "API Keys". 3. Create a new API key or use an existing one. 4. Copy the API key value. ### Project ID To find your PostHog project ID: 1. Log in to your PostHog account. 2. The project ID is visible in your project settings or in the URL when you're viewing your project. ## Available Methods The PostHog provider offers the following methods: ### Get Session Recording Domains Retrieve a list of domains from session recordings within a specified time period. ```yaml theme={null} - name: get-posthog-domains provider: config: "{{ providers.posthog }}" type: posthog with: query_type: session_recording_domains hours: 24 # Number of hours to look back limit: 500 # Maximum number of recordings to fetch ``` ### Get Session Recordings Retrieve session recordings data within a specified time period. ```yaml theme={null} - name: get-posthog-recordings provider: config: "{{ providers.posthog }}" type: posthog with: query_type: session_recordings hours: 24 # Number of hours to look back limit: 100 # Maximum number of recordings to fetch ``` ## Example Workflow Here's an example workflow that tracks domains from PostHog session recordings over the last 24 hours and sends a summary to Slack: ```yaml theme={null} workflow: id: posthog-domain-tracker name: PostHog Domain Tracker description: Tracks domains from PostHog session recordings over the last 24 hours and sends a summary to Slack. triggers: - type: manual - type: interval value: 86400 # Run daily (in seconds) steps: - name: get-posthog-domains provider: config: "{{ providers.posthog }}" type: posthog with: query_type: session_recording_domains hours: 24 limit: 500 actions: - name: send-to-slack provider: config: "{{ providers.slack }}" type: slack with: blocks: - type: header text: type: plain_text text: "PostHog Session Recording Domains (Last 24 Hours)" emoji: true - type: section text: type: mrkdwn text: "Found *{{ steps.get-posthog-domains.results.unique_domains_count }}* unique domains across *{{ steps.get-posthog-domains.results.total_domains_found }}* occurrences" - type: divider - type: section text: type: mrkdwn text: "Domains:*" - type: section text: type: mrkdwn text: "{{#steps.get-posthog-domains.results.unique_domains}} ⢠*{{ . }}* {{/steps.get-posthog-domains.results.unique_domains}}" - type: divider ``` ## Notes The PostHog provider requires the following scopes: * `session_recording:read` - Allows reading session recordings data * `project:read` - Allows reading project data * `session_recording_playlist:read` - Optional access to recording playlists ## Useful Links * [PostHog API Documentation](https://posthog.com/docs/api/overview) * [PostHog Session Recordings API](https://posthog.com/docs/api/session-recordings) * [PostHog Projects API](https://posthog.com/docs/api/projects) # Prometheus Source: https://docs.keephq.dev/providers/documentation/prometheus-provider 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/) # Pushover Source: https://docs.keephq.dev/providers/documentation/pushover-provider Pushover docs ## Authentication This provider requires authentication. * **token**: Pushover app token (required: True, sensitive: True) * **user\_key**: Pushover user key (required: True, sensitive: False) ## In workflows This provider can be used in workflows. As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query pushover provider: pushover config: "{{ provider.my_provider_name }}" with: message: {value} # The content of the message. title: {value} # Optional notification title. priority: {value} # Message priority (-2 to 2, where 2 is emergency). sound: {value} # Pushover sound name. retry: {value} # Retry interval in seconds for emergency priority. expire: {value} # Expiry in seconds for emergency priority. ``` If you need workflow examples with this provider, please raise a [GitHub issue](https://github.com/keephq/keep/issues). Token: User key:
## Useful Links * [https://support.pushover.net/i44-example-code-and-pushover-libraries#python](https://support.pushover.net/i44-example-code-and-pushover-libraries#python) # Python Source: https://docs.keephq.dev/providers/documentation/python-provider Python provider allows executing Python code snippets. ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query python provider: python config: "{{ provider.my_provider_name }}" with: code: {value} imports: {value} ``` Check the following workflow examples: * [bash\_example.yml](https://github.com/keephq/keep/blob/main/examples/workflows/bash_example.yml) * [mustache-paths-example.yml](https://github.com/keephq/keep/blob/main/examples/workflows/mustache-paths-example.yml) ## Limitations * The Python provider is currently disabled for cloud execution. This means that Python scripts cannot be executed in a cloud environment. * Users must ensure that the scripts are compatible with the local execution environment. ## Usefull Links -[Python Documentation](https://docs.python.org/3/) # QuickChart Provider Source: https://docs.keephq.dev/providers/documentation/quickchart-provider The QuickChart provider enables the generation of chart images through a simple and open API, allowing visualization of alert trends and counts. It supports both anonymous usage and authenticated access with an API key for enhanced functionality. # QuickChart Provider ## Overview The QuickChart provider allows for the generation of two types of charts based on alert data within Keep's platform: 1. A line chart that shows the trend of a specific fingerprint alert over time. 2. A radial gauge chart displaying the total number of alerts Keep received for this fingerprint. These charts can be used in various reports, dashboards, or alert summaries to provide visual insights into alert activity and trends.
![]()
## Authentication This provider requires authentication. * **api\_key**: Quickchart API Key (required: False, sensitive: True) ## In workflows This provider can be used in workflows. As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query quickchart provider: quickchart config: "{{ provider.my_provider_name }}" with: fingerprint: {value} status: {value} chartConfig: {value} ``` If you need workflow examples with this provider, please raise a [GitHub issue](https://github.com/keephq/keep/issues). ## Connecting with the Provider ### Using QuickChart without an API Key The QuickChart provider can generate charts without the need for an API key. However, this usage is limited to basic functionality and lower request limits. ### Using QuickChart with an API Key To unlock more advanced features and higher usage limits, you can use a QuickChart API key. Here's how to obtain one: 1. Visit [QuickChart](https://quickchart.io/). 2. Sign up for a free account to get started. 3. Navigate to your account settings to find your API key. Once you have your API key, add it to the provider configuration in Keep. ## Notes This provider is designed to offer flexible chart generation capabilities within Keep, enhancing how you visualize alert data and trends. It is ideal for users who want to quickly integrate visual representations of alert activity into their workflows. ## Useful Links * [QuickChart API Documentation](https://quickchart.io/documentation/) * [QuickChart Website](https://quickchart.io/) # Redmine Source: https://docs.keephq.dev/providers/documentation/redmine-provider # Redmine Provider `RedmineProvider` is a class that integrates with Redmine to manage issue tracking through Keep. ## Authentication This provider requires authentication. * **host**: Redmine Host (required: True, sensitive: False) * **api\_access\_key**: Redmine API Access key (required: True, sensitive: True) * **ticket\_creation\_url**: URL for creating new tickets (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: * **authenticated**: Authenticated with Redmine API (mandatory) ## In workflows This provider can be used in workflows. As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query redmine provider: redmine config: "{{ provider.my_provider_name }}" with: project_id: {value} subject: {value} priority_id: {value} description: {value} ``` If you need workflow examples with this provider, please raise a [GitHub issue](https://github.com/keephq/keep/issues). ## Connecting with the Provider To connect with the Redmine provider and manage issues through Keep, follow these steps: 1. Obtain a Redmine Personal Access Token: Visit the [Redmine API documentation](https://www.redmine.org/projects/redmine/wiki/rest_api#Authentication) to see the steps to get an API key. 2. Use the following YAML example to create an issue using the Redmine provider, all these are [valid arguments](https://www.redmine.org/projects/redmine/wiki/Rest_Issues#Creating-an-issue): ```yaml title=examples/issue_creation_example.yml theme={null} # Create an issue using the Redmine provider. task: id: create-redmine-issue description: Create an issue in Redmine actions: - name: create-issue provider: type: redmine config: "{{ providers.redmine-provider }}" with: project_id: "example_project" subject: "Issue Subject" priority_id: "2" description: "This is the issue description." ``` ## Useful Links * [Redmine REST API](https://www.redmine.org/projects/redmine/wiki/rest_api) * [Authentication Guide](https://www.redmine.org/projects/redmine/wiki/rest_api#Authentication) * [Valid arguments while creating issue](https://www.redmine.org/projects/redmine/wiki/Rest_Issues#Creating-an-issue) # Resend Source: https://docs.keephq.dev/providers/documentation/resend-provider # Resend Provider ResendProvider is a class that implements the Resend API and allows email sending through Keep. ## Authentication This provider requires authentication. * **api\_key**: Resend API key (required: True, sensitive: True) ## In workflows This provider can be used in workflows. As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query resend provider: resend config: "{{ provider.my_provider_name }}" with: _from: {value} # From email address to: {value} # To email address subject: {value} # Email subject html: {value} # Email body ``` Check the following workflow example: * [bash\_example.yml](https://github.com/keephq/keep/blob/main/examples/workflows/bash_example.yml) ## Connecting with the Provider To connect with the Resend provider and send emails through Keep, follow these steps: 1. Obtain a Resend API key: Visit [Resend API Keys](https://resend.com/api-keys) to obtain an API key if you don't have one already. 2. Configure the Resend provider in your system with the obtained API key. 3. Use the following YAML example to send an email notification using the Resend provider: ```yaml title=examples/alert_example.yml theme={null} # Send an email notification using the Resend provider. alert: id: email-notification description: Send an email notification using Resend actions: - name: send-email provider: type: resend config: "{{ providers.resend-provider }}" with: _from: "sender@example.com" to: "recipient@example.com" subject: "Hello from Resend Provider" html: "
This is the email body.
" ``` ## Useful Links * [Resend API Keys](https://resend.com/api-keys) # Rollbar Source: https://docs.keephq.dev/providers/documentation/rollbar-provider Rollbar provides real-time error tracking and debugging tools for developers. ## Authentication This provider requires authentication. * **rollbarAccessToken**: Project Access Token (required: True, sensitive: True) 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: * **authenticated**: User is Authenticated ## In workflows This provider can't be used as a "step" or "action" in workflows. If you want to use it, please let us know by creating an issue in the [GitHub repository](https://github.com/keephq/keep/issues). ## Connecting with the Provider 1. Create an account on [Rollbar](https://rollbar.com/). 2. After logging in, navigate to the project you want to connect with and go to the project settings. 3. Under Setup, go to Project Access Tokens and create new token with read and write scopes. 4. Copy the generated token. 5. This will be used as the `rollbarAccessToken` parameter in the provider configuration. ## Webhook Integration Modifications You can manage the permissions granted by the webhook integration by navigating to **Settings > Notifications > Webhook** within the Rollbar project. ## Usefull Links * [Rollbar](https://rollbar.com/) # AWS S3 Source: https://docs.keephq.dev/providers/documentation/s3-provider AWS S3 provider to query S3 buckets ## Authentication This provider requires authentication. * **access\_key**: S3 Access Token (Leave empty if using IAM role at EC2) (required: False, sensitive: True) * **secret\_access\_key**: S3 Secret Access Token (Leave empty if using IAM role at EC2) (required: False, sensitive: True) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query s3 provider: s3 config: "{{ provider.my_provider_name }}" with: bucket: {value} ``` Check the following workflow examples: * [consts\_and\_dict.yml](https://github.com/keephq/keep/blob/main/examples/workflows/consts_and_dict.yml) * [update\_workflows\_from\_s3.yml](https://github.com/keephq/keep/blob/main/examples/workflows/update_workflows_from_s3.yml) ## Limitations Querying only yaml, yml, json, xml and csv files. ## Scopes Please note that during the installation, the provider is performing `list_buckets` to validate the config. Here is an example IAM policy: ``` { "Version": "2025-01-15", "Statement": [ { "Sid": "VisualEditor0", "Effect": "Allow", "Action": [ "s3:ListBucket", "s3:GetObject", "s3:GetBucketLocation", "s3:ListAllMyBuckets" ], "Resource": "*" } ] } ``` # SendGrid Source: https://docs.keephq.dev/providers/documentation/sendgrid-provider # SendGrid Provider SendGridProvider is a class that implements the SendGrid API and allows email sending through Keep. ## Authentication This provider requires authentication. * **api\_key**: SendGrid API key (required: True, sensitive: True) * **from\_email**: From email address (required: True, 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: * **email.send**: Send emails using SendGrid (mandatory) ([Documentation](https://sendgrid.com/docs/API_Reference/api_v3.html)) ## In workflows This provider can be used in workflows. As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query sendgrid provider: sendgrid config: "{{ provider.my_provider_name }}" with: to: {value} # To email address or list of email addresses subject: {value} # Email subject html: {value} # Email body ``` Check the following workflow examples: * [consts\_and\_vars.yml](https://github.com/keephq/keep/blob/main/examples/workflows/consts_and_vars.yml) * [sendgrid\_basic.yml](https://github.com/keephq/keep/blob/main/examples/workflows/sendgrid_basic.yml) ## Connecting with the Provider To connect with the SendGrid provider and send emails through Keep, follow these steps: 1. Obtain a SendGrid API key: Visit [SendGrid API Keys](https://www.twilio.com/docs/sendgrid/api-reference/api-keys/) to obtain an API key if you don't have one already. 2. Configure the SendGrid provider in your system with the obtained API key and the `from_email` address. 3. Use the following YAML example to send an email notification using the SendGrid provider: ## Useful Links * [SendGrid API Keys](https://sendgrid.com/docs/ui/account-and-settings/api-keys/) * [SendGrid API Reference](https://www.twilio.com/docs/sendgrid/api-reference) # Sentry Source: https://docs.keephq.dev/providers/documentation/sentry-provider Sentry provider allows you to query Sentry events and to pull/push alerts from Sentry ## Authentication This provider requires authentication. * **api\_key**: Sentry Api Key (required: True, sensitive: True) * **organization\_slug**: Sentry organization slug (required: True, sensitive: False) * **api\_url**: Sentry API URL (required: False, sensitive: False) * **project\_slug**: Sentry project slug within the organization (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: * \*\*\*\*: Write permission for projects in organization ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query sentry provider: sentry config: "{{ provider.my_provider_name }}" with: project: {value} # project name time: {value} # time range, for example: 14d ``` Check the following workflow example: * [create\_jira\_ticket\_upon\_alerts.yml](https://github.com/keephq/keep/blob/main/examples/workflows/create_jira_ticket_upon_alerts.yml) ## Connecting with the ProviderTo connect self hosted Sentry, you need to set the `api_url` parameter. Default value is `https://sentry.io/api/0/`. ### API Key To obtain the Sentry API key, follow these steps ([Docs](https://docs.sentry.io/product/integrations/integration-platform/?original_referrer=https%3A%2F%2Fwww.google.com%2F#internal-integrations)): 1. Log in to your Sentry account. 2. Navigate `Settings` -> `Developer Settings` section. 3. Click on `Custom integrations`. 4. Click on `Create New Integration` on the top right side of the screen.5. Select `Internal Integration` and click `Next`
6. Give the integration an indicative name, e.g. `Keep Integration` 7. From the permission section, select the required scopes: Project: Read & Write Issue & Event: Read Organization: Read Alerts: Read & Write (Not Mandatory)
8. Click `Save Changes`
9. Scroll down to the bottom of the screen to the `TOKENS` section and copy the generated token -- This is the API key you will be using in Keep.
### Organization Slug You can find the Organization Slug in your Sentry URL. For example, this is our playground account: `https://keep-dr.sentry.io/` - The organization slug is `keep-dr`. To obtain the Organization Slug from the settings page: 1. Log in to your Sentry account. 2. Navigate `Settings` -> `General Settings`. 3. Copy the Organization Slug from the Organization Slug input. ## Notes
When installing Sentry webhook integration, Keep enables built-in Webhook integration to all accessible projects and adds a new Alert that has an `Action` to send a notification via Webhooks to all accessible projects. You can achieve alerts pushing from Sentry to Keep using an `Internal Integration` which is not automated via the platform. [Contact us](mailto:founder@keephq.dev) to set it up. ## Useful Links * [Sentry Integration Platform](https://docs.sentry.io/product/integrations/integration-platform/) * [Sentry API Reference](https://docs.sentry.io/api/) # Service Now Source: https://docs.keephq.dev/providers/documentation/service-now-provider Service Now provider allows sending notifications, updates, and retrieving topology information from the ServiceNow CMDB. ## Authentication This provider requires authentication. * **service\_now\_base\_url**: The base URL of the ServiceNow instance (required: True, sensitive: False) * **username**: The username of the ServiceNow user (required: True, sensitive: False) * **password**: The password of the ServiceNow user (required: True, sensitive: True) * **client\_id**: The client ID to use OAuth 2.0 based authentication (required: False, sensitive: False) * **client\_secret**: The client secret to use OAuth 2.0 based authentication (required: False, sensitive: True) * **ticket\_creation\_url**: URL for creating new tickets (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: * **itil**: The user can read/write tickets from the table (mandatory) ([Documentation](https://docs.servicenow.com/bundle/sandiego-platform-administration/page/administer/roles/reference/r_BaseSystemRoles.html)) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query servicenow provider: servicenow config: "{{ provider.my_provider_name }}" with: table_name: {value} # The name of the table to query. incident_id: {value} # The incident ID to query. sysparm_limit: {value} # The maximum number of records to return. sysparm_offset: {value} # The offset to start from. ``` As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query servicenow provider: servicenow config: "{{ provider.my_provider_name }}" with: table_name: {value} # The name of the table to create the ticket in. payload: {value} # The ticket payload. ticket_id: {value} # The ticket ID (optional to update a ticket). fingerprint: {value} # The fingerprint of the ticket (optional to update a ticket). ``` Check the following workflow examples: * [blogpost.yml](https://github.com/keephq/keep/blob/main/examples/workflows/blogpost.yml) * [clickhouse\_multiquery.yml](https://github.com/keephq/keep/blob/main/examples/workflows/clickhouse_multiquery.yml) * [create\_service\_now\_ticket\_upon\_alerts.yml](https://github.com/keephq/keep/blob/main/examples/workflows/create_service_now_ticket_upon_alerts.yml) * [update\_service\_now\_tickets\_status.yml](https://github.com/keephq/keep/blob/main/examples/workflows/update_service_now_tickets_status.yml) ## Topology This provider pulls [topology](/overview/servicetopology) to Keep. It could be used in [correlations](/overview/correlation-topology) and [mapping](/overview/enrichment/mapping#mapping-with-topology-data), and as a context for [alerts](/alerts/sidebar#7-alert-topology-view) and [incidents](/overview#17-incident-topology). ## Provider Methods The provider exposes the following [Provider Methods](/providers/provider-methods#via-ai-assistant). They are available in the [AI Assistant](/overview/ai-incident-assistant). * **get\_incidents** Fetch all incidents from ServiceNow (view, scopes: itil) * **get\_incident\_activities** Get work notes and comments from a ServiceNow incident (view, scopes: itil) * `incident_id`: The incident number (e.g. INC0010001) or sys\_id. * `limit`: Maximum number of activity records to return. * **add\_incident\_activity** Add a work note or comment to a ServiceNow incident (action, scopes: itil) * `incident_id`: The incident number (e.g. INC0010001) or sys\_id. * `content`: The text content to add. * `activity_type`: Either 'work\_notes' or 'comments'. Defaults to 'work\_notes'. ## Connecting with the Provider 1. Ensure that the ServiceNow instance is accessible via API. 2. Provide the necessary API credentials (`instance_url` and `api_token`) in the provider configuration. ## Additional * `KEEP_SERVICENOW_PROVIDER_SKIP_SCOPE_VALIDATION` envirnomental variable in the backend allows to bypass scope validation. ## Useful Links * [Service Now API documentation](https://docs.servicenow.com/bundle/xanadu-api-reference/page/build/applications/concept/api-rest.html) # SignalFX Source: https://docs.keephq.dev/providers/documentation/signalfx-provider SignalFX provider allows you get alerts from SignalFX Alerting via webhooks. ## Overview SignalFX Provider enriches your monitoring and alerting capabilities by seamlessly integrating with SignalFX Alerting via webhooks. This integration allows you to receive alerts directly from SignalFX, ensuring you're promptly informed about significant events and metrics within your infrastructure. Key Features: * Webhook Auto-Instrumentation: Automatically configures Keep as a Webhook Integration within SignalFX, subscribing to all available SignalFX Detectors and Rules for comprehensive monitoring. * Manual and Automated Subscription Management: Provides flexibility in adding Keep as a subscriber to new Detectors either manually or by re-running the "setup webhook" feature from the UI for effortless maintenance.For further information or assistance, feel free to reach out on our Slack Community. ## Connecting with the Provider There are three approaches to connect with SignalFX: * Push (Manually) - Install Keep as a Webhook Integration. * Push (Auto Instrumentation) - Let Keep instrument itself as a webhook integration and subscribe to your SignalFx detectors. * Pull - Keep will pull alerts from SignalFx.The recommended way to install SignalFx is through Push (Auto Instrumentation). With this approach, you benefit from the advantages of the Push approach, which include more context (since SignalFx sends more context on Webhooks) and more real-time alerts, combined with the convenience of Pull integration (just supply credentials, and Keep will do the rest). In the following sections, we will elaborate on each approach. ### Push (Manually)For more information about how SignalFx integrates with Webhooks, you can read [https://docs.splunk.com/observability/en/admin/notif-services/webhook.html#webhook2](https://docs.splunk.com/observability/en/admin/notif-services/webhook.html#webhook2) 1. From your SignalFx console, click on "Data Management":2. Click on "+ Add Integration"
3. Change the "By Use Case" select to "All" and filter "webhook":
4. Click on the Webhook tile and fill the following details:
5. Now, go to Detectors & SLOs page:
6. For every Detector and Rule, add Keep as Alert recipient:
### Push (Auto Instrumentation) With this approach: 1. Keep installs itself as Webhook Integration. 2. Keep iterates all Detectors and Rules, and will add itself as a subscriber
The downside of this approach is that you'll need email/password of a user with admin role. This is due to SignalFx limitation on installing integrations: You can read more here - [https://dev.splunk.com/observability/reference/api/integrations/latest#endpoint-create-integration](https://dev.splunk.com/observability/reference/api/integrations/latest#endpoint-create-integration) To install Keep with Push (auto instrumentation): 1. SF token with read permissions - go to Settings -> Access Tokens -> New Token
2. email/password for a user with admin role - this will be used only for creating the Webhook Integration 3. orgid - this will be used only for creating the Webhook Integration
After we have all what we need, go to Keep and install the SignalFx provider:
### Pull With this approach, Keep will pull alerts from SignalFx every time you refresh the console page. 1. SF token with read permissions - go to Settings -> Access Tokens -> New Token
2. In Keep's UI, install SignalFx Provider:
## Fingerprinting Fingerprints in SignalFx calculated based on (incidentId, detectorId). ## Webhook Integration Modifications The automatic webhook integration gains access to the `API` authScope, which gives Keep the ability to read and write to the SignalFx API. ## Authentication This provider requires authentication. * **sf\_token**: SignalFX token (required: True, sensitive: True) * **realm**: SignalFX Realm (required: False, sensitive: False) * **email**: SignalFX email. Required for setup webhook. (required: False, sensitive: True) * **password**: SignalFX password. Required for setup webhook. (required: False, sensitive: True) * **org\_id**: SignalFX organization ID. Required for setup webhook. (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: * **API**: API authScope - read permission for SignalFx API (mandatory) ([Documentation](https://dev.splunk.com/observability/reference/api/org_tokens/latest#endpoint-create-single-token)) ## In workflows This provider can't be used as a "step" or "action" in workflows. If you want to use it, please let us know by creating an issue in the [GitHub repository](https://github.com/keephq/keep/issues). ## Useful Links * [SignalFx Webhook](https://docs.splunk.com/observability/en/admin/notif-services/webhook.html#webhook2) # SIGNL4 Provider Source: https://docs.keephq.dev/providers/documentation/signl4-provider SIGNL4 offers critical alerting, incident response and service dispatching for operating critical infrastructure. It alerts you persistently via app push, SMS text and voice calls including tracking, escalation, collaboration and duty planning. Find out more at [signl4.com](https://www.signl4.com/) ## Authentication This provider requires authentication. * **signl4\_integration\_secret**: SIGNL4 integration or team secret (required: True, sensitive: True) 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: * **signl4:create**: Create SIGNL4 alerts (mandatory) ## In workflows This provider can be used in workflows. As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query signl4 provider: signl4 config: "{{ provider.my_provider_name }}" with: title: {value} # Alert title. message: {value} # Alert message. user: {value} # User name. s4_external_id: {value} # External ID. s4_status: {value} # Alert status. s4_service: {value} # Service name. s4_location: {value} # Location. s4_alerting_scenario: {value} # Alerting scenario. s4_filtering: {value} # Filtering. # Additional alert data. ``` Check the following workflow example: * [signl4-alerting-workflow.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/signl4-alerting-workflow.yaml) ## Connecting with the Provider To use the Signl4Provider, you'll need to provide your signl4\_integration\_secret. You can find your integration or team secret in the SIGNL4 web portal under **Teams** or **Integrations** -> **Distribution Rules**. The signl4\_integration\_secret is used to post events to SIGNL4 using the webhook API. ## Notes The provider uses either the events API or the incidents API to create an alert or an incident. The choice of API to use is determined by the presence of either a routing\_key or an api\_key. ## Useful Links * SIGNL4: [https://signl4.com/](https://signl4.com/) * SIGNL4 knowledge base: [https://support.signl4.com/](https://support.signl4.com/) * SIGNL4 getting-started videos: [https://www.youtube.com/watch?v=bwYSYOjMJZ8\&list=PL9FRxukdQyk9QRZPOEH3jhRX9WQCovCc6](https://www.youtube.com/watch?v=bwYSYOjMJZ8\&list=PL9FRxukdQyk9QRZPOEH3jhRX9WQCovCc6) * SIGNL4 videos: [https://vimeo.com/showcase/signl4](https://vimeo.com/showcase/signl4) # Site24x7 Provider Source: https://docs.keephq.dev/providers/documentation/site24x7-provider The Site24x7 Provider allows you to install webhooks and receive alerts in Site24x7. It manages authentication, setup of webhooks, and retrieval of alert logs from Site24x7. ## Authentication This provider requires authentication. * **zohoRefreshToken**: Zoho Refresh Token (required: True, sensitive: True) * **zohoClientId**: Zoho Client Id (required: True, sensitive: True) * **zohoClientSecret**: Zoho Client Secret (required: True, sensitive: True) * **zohoAccountTLD**: Zoho Account's TLD (.com | .eu | .com.cn | .in | .au | .jp) (required: True, 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: * **authenticated**: User is Authenticated (mandatory) * **valid\_tld**: TLD is amongst the list \[.com | .eu | .com.cn | .in | .com.au | .jp] (mandatory) ## In workflows This provider can't be used as a "step" or "action" in workflows. If you want to use it, please let us know by creating an issue in the [GitHub repository](https://github.com/keephq/keep/issues). ### Main Class Methods * **`setup_webhook(tenant_id, keep_api_url, api_key, setup_alerts)`** * `tenant_id (str)`: Tenant identifier. * `keep_api_url (str)`: URL to send alert data. * `api_key (str)`: API key for authentication. * `setup_alerts (bool)`: Whether to setup alerting capabilities (default is True). * **`_get_alerts()`** * Returns a list of `AlertDto` objects representing the alerts. ## Connecting with the Provider To use the Site24x7 Provider, initialize it with the necessary authentication credentials and provider configuration. Ensure that your Zoho account credentials (Client ID, Client Secret, and Refresh Token) are correctly set up in the `Site24x7ProviderAuthConfig`. ## Steps to Obtain a Refresh Token 1. **Registration and Client Credentials:** * Navigate to [Zoho API Console](https://api-console.zoho.com/). * Sign in or sign up using the email associated with your Site24x7 account. * Register your application using the "Self Client" option to get your Client ID and Client Secret. 2. **Generating Grant Token:** * Go to the Zoho Developer Console and access your registered Self Client. * In the "Generate Code" tab, input the required scopes (`Site24x7.Admin.Read, Site24x7.Admin.Create, Site24x7.Operations.Read`), description, and time duration. * Click "Generate" and copy the provided code. 3. **Generating Access and Refresh Tokens:** * Use the grant token to make a POST request to `https://accounts.zoho.com/oauth/v2/token` to obtain the access and refresh tokens. ```bash theme={null} curl -X POST 'https://accounts.zoho.com/oauth/v2/token' \ -d 'client_id=your_client_id' \ -d 'client_secret=your_client_secret' \ -d 'code=your_grant_token' \ -d 'grant_type=authorization_code' ``` OR ```python theme={null} import requests response = requests.post( 'https://accounts.zoho.com/oauth/v2/token', data={ 'client_id': 'your_client_id', 'client_secret': 'your_client_secret', 'code': 'your_grant_token', 'grant_type': 'authorization_code' } ) refresh_token = response.json().get('refresh_token') ``` *** ## Notes * You must use your domain-specific Zoho Accounts URL to generate refresh tokens, otherwise you will receive an `invalid_client` error. See [Data center for Zoho Account](https://help.zoho.com/portal/en/kb/accounts/manage-your-zoho-account/articles/data-center-for-zoho-account). * Ensure that the necessary scopes **Site24x7.Admin.Read, Site24x7.Admin.Create, Site24x7.Operations.Read** are included when generating the grant token, as they dictate the API functionalities accessible via the provider. * Zoho API Console [Link](https://api-console.zoho.com) ## Webhook Integration Modifications The webhook integration grants Keep access to the following scopes within Site24x7: * `authenticated` * `valid_tld` The webhook can be accessed via the "Alarms" section in the Site24x7 console. *** ## Useful Links * [Site24x7 API Documentation](https://www.site24x7.com/help/api/) * [Zoho OAuth Documentation](https://www.zoho.com/accounts/protocol/oauth/web-apps.html) * [Site 24x7 Authentication Guide](https://www.site24x7.com/help/api/#authentication) * [Third Party and Webhook Integrations](https://www.site24x7.com/help/api/#third-party-integrations) * [List of Zoho Account datacenters](https://help.zoho.com/portal/en/kb/accounts/manage-your-zoho-account/articles/data-center-for-zoho-account) # Keep's integration for Slack Source: https://docs.keephq.dev/providers/documentation/slack-provider Enhance your Keep workflows with direct Slack notifications. Simplify communication with timely updates and alerts directly within Slack. ## Overview Keep's integration for Slack enables seamless communication by allowing you to send notifications to Slack. This integration is designed to streamline your processes, ensuring your team remains informed with real-time updates. ### Key Features * **Direct Notifications**: Utilize Keep to send messages directly to your Slack channels. * **Flexible Configuration**: Easily configure alerts based on specific triggers within your Keep workflows. * **Interactive Messages**: Enhance your Slack messages with interactive components like buttons and inputs. * **Editable Messages**: Update existing Slack messages dynamically based on changes in alert status or other workflow outcomes, ensuring that your notifications reflect the most current information. ## Authentication This provider requires authentication. * **webhook\_url**: Slack Webhook Url (required: True, sensitive: True) * **access\_token**: For access token installation flow, use Keep UI (required: False, sensitive: True) ## In workflows This provider can be used in workflows. As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query slack provider: slack config: "{{ provider.my_provider_name }}" with: message: {value} # The content of the message. blocks: {value} # The blocks of the message. channel: {value} # The channel to send the message slack_timestamp: {value} # The timestamp of the message to update thread_timestamp: {value} # The timestamp of the thread to send the message attachments: {value} # The attachments of the message. username: {value} # The username of the message. notification_type: {value} # The type of notification. ``` Check the following workflow examples: * [consts\_and\_vars.yml](https://github.com/keephq/keep/blob/main/examples/workflows/consts_and_vars.yml) * [create\_jira\_ticket\_upon\_alerts.yml](https://github.com/keephq/keep/blob/main/examples/workflows/create_jira_ticket_upon_alerts.yml) * [datadog-log-monitor.yml](https://github.com/keephq/keep/blob/main/examples/workflows/datadog-log-monitor.yml) * [db\_disk\_space\_monitor.yml](https://github.com/keephq/keep/blob/main/examples/workflows/db_disk_space_monitor.yml) * [elastic\_enrich\_example.yml](https://github.com/keephq/keep/blob/main/examples/workflows/elastic_enrich_example.yml) * [failed-to-login-workflow.yml](https://github.com/keephq/keep/blob/main/examples/workflows/failed-to-login-workflow.yml) * [gcp\_logging\_open\_ai.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/gcp_logging_open_ai.yaml) * [ifelse.yml](https://github.com/keephq/keep/blob/main/examples/workflows/ifelse.yml) * [incident-tier-escalation.yml](https://github.com/keephq/keep/blob/main/examples/workflows/incident-tier-escalation.yml) * [new-auth0-users-monitor.yml](https://github.com/keephq/keep/blob/main/examples/workflows/new-auth0-users-monitor.yml) * [new\_github\_stars.yml](https://github.com/keephq/keep/blob/main/examples/workflows/new_github_stars.yml) * [notify-new-trello-card.yml](https://github.com/keephq/keep/blob/main/examples/workflows/notify-new-trello-card.yml) * [openshift\_monitoring\_and\_remediation.yml](https://github.com/keephq/keep/blob/main/examples/workflows/openshift_monitoring_and_remediation.yml) * [opsgenie\_open\_alerts.yml](https://github.com/keephq/keep/blob/main/examples/workflows/opsgenie_open_alerts.yml) * [permissions\_example.yml](https://github.com/keephq/keep/blob/main/examples/workflows/permissions_example.yml) * [posthog\_example.yml](https://github.com/keephq/keep/blob/main/examples/workflows/posthog_example.yml) * [query\_clickhouse.yml](https://github.com/keephq/keep/blob/main/examples/workflows/query_clickhouse.yml) * [query\_victoriametrics.yml](https://github.com/keephq/keep/blob/main/examples/workflows/query_victoriametrics.yml) * [raw\_sql\_query\_datetime.yml](https://github.com/keephq/keep/blob/main/examples/workflows/raw_sql_query_datetime.yml) * [send\_slack\_message\_on\_failure.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/send_slack_message_on_failure.yaml) * [service-error-rate-monitor-datadog.yml](https://github.com/keephq/keep/blob/main/examples/workflows/service-error-rate-monitor-datadog.yml) * [slack-message-reaction.yml](https://github.com/keephq/keep/blob/main/examples/workflows/slack-message-reaction.yml) * [slack-workflow-trigger.yml](https://github.com/keephq/keep/blob/main/examples/workflows/slack-workflow-trigger.yml) * [slack\_basic.yml](https://github.com/keephq/keep/blob/main/examples/workflows/slack_basic.yml) * [slack\_basic\_cel.yml](https://github.com/keephq/keep/blob/main/examples/workflows/slack_basic_cel.yml) * [slack\_basic\_interval.yml](https://github.com/keephq/keep/blob/main/examples/workflows/slack_basic_interval.yml) * [slack\_message\_update.yml](https://github.com/keephq/keep/blob/main/examples/workflows/slack_message_update.yml) * [workflow\_only\_first\_time\_example.yml](https://github.com/keephq/keep/blob/main/examples/workflows/workflow_only_first_time_example.yml) * [workflow\_start\_example.yml](https://github.com/keephq/keep/blob/main/examples/workflows/workflow_start_example.yml) * [zoom\_example.yml](https://github.com/keephq/keep/blob/main/examples/workflows/zoom_example.yml) ## Getting Started ## Authentication Methods Keep's integration for Slack supports two primary authentication methods: * **Webhook URL**: For simple notifications, use the webhook URL associated with your Slack channel. * **OAuth 2.0**: For a more integrated experience, authorize Keep using Slack's OAuth 2.0 flow. This method is particularly useful for applications requiring access to more Slack features. ### Installation 1. **Add to Slack**: Begin by clicking the "Add to Slack" button on this page. You'll be guided through the OAuth authorization process to connect Keep with your Slack workspace.
2. **Installation Confirmation**: After adding Keep to Slack, you'll be redirected to a confirmation page. This page will confirm the successful installation and provide the next steps to fully leverage Slack notifications within your Keep workflows. ### OAuth Flow The OAuth flow simplifies the connection between Keep and Slack, providing a secure method to authenticate and authorize. 1. **Initiate OAuth**: Click the "Slack" Provider in the [Platform](https://platform.keephq.dev).
2. **Authorize Keep**: Follow the prompts to authorize Keep to access your Slack workspace. ### Setup 1. **Create a Slack App**: If you haven't already, create a Slack app in the [Slack API Dashboard](https://api.slack.com/apps). 2. **Enable Incoming Webhooks**: In your Slack app settings, enable Incoming Webhooks and create a webhook for the channel you wish to post messages to. 3. **Use Your Webhook URL**: Within Keep, use the webhook URL to send notifications to your chosen Slack channel. ## Using Keep's integration for Slack With Keep's integration for Slack installed, you're ready to enhance your workflows with Slack notifications. Here's how to get started: 1. **Workflow Integration**: In Keep, select the workflow you wish to add Slack notifications to. Add a Slack notification block and configure it with your message or alert criteria.
2. **Send a Test Notification**: Ensure your setup is correct by sending a test notification through your configured workflow, use the "Run Manually" link for that.. ## Useful Links * [Slack API Documentation](https://api.slack.com/messaging/webhooks) * [Keep Privacy Policy](https://www.keephq.dev/privacy-policy) * [Keep Pricing Information](https://www.keephq.dev/pricing)
For support and further assistance, shoot us a message over [Slack](https://slack.keephq.dev) (pun intended ;)) # SMTP Source: https://docs.keephq.dev/providers/documentation/smtp-provider SMTP Provider allows you to send emails. ## Overview SMTP Provider allows you to send emails from Keep. Most of the email services like Gmail, Yahoo, Mailgun, etc. provide SMTP servers to send emails. You can use these SMTP servers to send emails from Keep. The SMTP provider supports both plain text and HTML-formatted emails, allowing you to create rich, styled email notifications. ## Authentication This provider requires authentication. * **smtp\_server**: SMTP Server Address (required: True, sensitive: False) * **smtp\_port**: SMTP port (required: True, sensitive: False) * **encryption**: SMTP encryption (required: True, sensitive: False) * **smtp\_username**: SMTP username (required: False, sensitive: False) * **smtp\_password**: SMTP password (required: False, sensitive: True) 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: * **send\_email**: Send email using SMTP protocol (mandatory) ## In workflows This provider can be used in workflows. As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query smtp provider: smtp config: "{{ provider.my_provider_name }}" with: from_email: {value} from_name: {value} to_email: {value} subject: {value} body: {value} html: {value} ``` Check the following workflow examples: * [send\_smtp\_email.yml](https://github.com/keephq/keep/blob/main/examples/workflows/send_smtp_email.yml) * [send\_smtp\_html\_email.yml](https://github.com/keephq/keep/blob/main/examples/workflows/send_smtp_html_email.yml) ## Connecting with SMTP Provider 1. Obtain the SMTP credentials from your email service provider. Example: Gmail, Yahoo, Mailgun, etc. 2. Add SMTP Provider in Keep with the obtained credentials. 3. Connect the SMTP Provider with Keep. ## Email Format Support The SMTP provider supports two email formats: ### Plain Text Emails Use the `body` parameter to send plain text emails: ```yaml theme={null} with: from_email: "sender@example.com" from_name: "Keep Alerts" to_email: "recipient@example.com" subject: "Alert Notification" body: "This is a plain text email notification." ``` ### HTML Emails Use the `html` parameter to send HTML-formatted emails: ```yaml theme={null} with: from_email: "sender@example.com" from_name: "Keep Alerts" to_email: "recipient@example.com" subject: "Alert Notification" html: "Alert
This is an HTML email notification.
" ``` When both `body` and `html` are provided, the HTML content takes precedence. ## Multiple Recipients You can send emails to multiple recipients by providing a list of email addresses: ```yaml theme={null} with: to_email: - "recipient1@example.com" - "recipient2@example.com" - "recipient3@example.com" ``` # Snowflake Source: https://docs.keephq.dev/providers/documentation/snowflake-provider Template Provider is a template for newly added provider's documentation ## Authentication This provider requires authentication. * **user**: Snowflake user (required: True, sensitive: False) * **account**: Snowflake account (required: True, sensitive: False) * **pkey**: Snowflake private key (required: True, sensitive: True) * **pkey\_passphrase**: Snowflake password (required: False, sensitive: True) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query snowflake provider: snowflake config: "{{ provider.my_provider_name }}" with: query: {value} # query to execute ``` If you need workflow examples with this provider, please raise a [GitHub issue](https://github.com/keephq/keep/issues). # Splunk Source: https://docs.keephq.dev/providers/documentation/splunk-provider Splunk provider allows you to get Splunk `saved searches` via webhook installation ## Authentication This provider requires authentication. * **api\_key**: Splunk API Key (required: True, sensitive: True) * **host**: Splunk Host (default is localhost) (required: False, sensitive: False) * **port**: Splunk Port (default is 8089) (required: False, sensitive: False) * **verify**: Enable SSL verification (required: False, sensitive: False) * **username**: The username connected with the API key/token provided. (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: * **list\_all\_objects**: The user can get all the alerts (mandatory) * **edit\_own\_objects**: The user can edit and add webhook to saved\_searches (mandatory) ## In workflows This provider can't be used as a "step" or "action" in workflows. If you want to use it, please let us know by creating an issue in the [GitHub repository](https://github.com/keephq/keep/issues). ## Connecting with the Provider Obtain Splunk API Token: 1. Ensure you have a Splunk account with the necessary [permissions](https://docs.splunk.com/Documentation/Splunk/9.2.0/Security/Rolesandcapabilities). The basic permissions required are `list_all_objects` & `edit_own_objects`. 2. Get an API token for authenticating API requests. [Read More](https://docs.splunk.com/Documentation/Splunk/9.2.0/Security/Setupauthenticationwithtokens) on how to set up and get API Keys. Identify Your Splunk Instance Details: 1. Determine the Host (IP address or hostname) and Port (default is 8089 for Splunk's management API) of the Splunk instance you wish to connect to. *** **NOTE** Make sure to follow this [Guide](https://docs.splunk.com/Documentation/Splunk/9.2.0/Alert/ConfigureWebhookAllowList) to configure your webhook allow list to allow your `keep` deployment. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ## Useful Links * [Splunk Python SDK](https://dev.splunk.com/view/python-sdk/SP-CAAAEBB) * [Splunk Webhook](https://docs.splunk.com/Documentation/Splunk/9.2.0/Alert/Webhooks) * [Splunk Webhook Allow List](https://docs.splunk.com/Documentation/Splunk/9.2.0/Alert/ConfigureWebhookAllowList) * [Splunk Permissions and Roles](https://docs.splunk.com/Documentation/Splunk/9.2.0/Security/Rolesandcapabilities) * [Splunk API tokens](https://docs.splunk.com/Documentation/Splunk/9.2.0/Security/Setupauthenticationwithtokens) # Squadcast Provider Source: https://docs.keephq.dev/providers/documentation/squadcast-provider Squadcast provider is a provider used for creating issues in Squadcast ## Authentication This provider requires authentication. * **service\_region**: Service region: EU/US (required: True, sensitive: False) * **refresh\_token**: Squadcast Refresh Token (required: False, sensitive: True) * **webhook\_url**: Incident webhook url (required: False, sensitive: True) 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: * **authenticated**: The user can connect to the client ## In workflows This provider can be used in workflows. As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query squadcast provider: squadcast config: "{{ provider.my_provider_name }}" with: notify_type: {value} message: {value} description: {value} incident_id: {value} priority: {value} tags: {value} status: {value} event_id: {value} attachments: {value} additional_json: {value} ``` Check the following workflow example: * [squadcast\_example.yml](https://github.com/keephq/keep/blob/main/examples/workflows/squadcast_example.yml) ## Inputs The `notify` function take following parameters as inputs: * `notify_type` (required): Takes either of `incident` or `notes` depending on weather you want to create an incident or a note. 1. ##### parameters for `incident` * `message` (required): This will be the incident message. * `description` (required): This will be the incident description. * `tags` (optional): Tags for the incident. It should be a dict format. * `priority` (optional): Priority of the incident. * `status` (optional): Status of the event. * `event_id` (optional): event\_id is used to resolve an incident * `additional_json` (optional): Additional JSON data to be sent with the incident. 2. ##### parameters for `notes` * `message` (required): The message of the note. * `incident_id` (required): Id of the incident where the Note has to be created. * `attachments` (optional): List of attachments for the notes. See [documentation](https://support.squadcast.com/integrations/incident-webhook-incident-webhook-api) for more ## Connecting with the Provider 1. Go to [Refresh Tokens](https://support.squadcast.com/terraform-and-api-documentation/public-api-refresh-token#from-your-profile-page) to see how to create a `refresh_token`. 2. Visit [Documentations](https://support.squadcast.com/integrations/incident-webhook-incident-webhook-api) to learn how to setup `incident_webhooks` & get the `webhook_url` ## Useful Links * [Squadcast Incident API](https://support.squadcast.com/integrations/incident-webhook-incident-webhook-api) * [Squadcast Refresh Tokens](https://support.squadcast.com/terraform-and-api-documentation/public-api-refresh-token#from-your-profile-page) * [Incident Notes](https://support.squadcast.com/incidents-page/incident-notes) # SSH Source: https://docs.keephq.dev/providers/documentation/ssh-provider The `SSH Provider` is a provider that provides a way to execute SSH commands and get their output. ## Authentication This provider requires authentication. * **host**: SSH hostname (required: True, sensitive: False) * **user**: SSH user (required: True, sensitive: False) * **port**: SSH port (required: False, sensitive: False) * **pkey**: SSH private key (required: False, sensitive: True) * **password**: SSH password (required: False, sensitive: True) 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: * **ssh\_access**: The provided credentials grant access to the SSH server ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query ssh provider: ssh config: "{{ provider.my_provider_name }}" with: command: {value} query: {value} # command to execute ``` Check the following workflow example: * [businesshours.yml](https://github.com/keephq/keep/blob/main/examples/workflows/businesshours.yml) ## Connecting with the Provider The `SshProvider` class provides a way to execute SSH commands and get their output. The class uses the `paramiko` library to establish an SSH connection to a server and execute commands. ## Notes *No information yet, feel free to contribute it using the "Edit this page" link the buttom of the page* ## Useful Links * [https://www.ssh.com/academy/ssh/keygen](https://www.ssh.com/academy/ssh/keygen) # StatusCake Source: https://docs.keephq.dev/providers/documentation/statuscake-provider StatusCake allows you to monitor your website and APIs. Keep allows to read alerts and install webhook in StatusCake ## Authentication This provider requires authentication. * **api\_key**: Statuscake API Key (required: True, sensitive: True) 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: * **alerts**: Read alerts from Statuscake ## In workflows This provider can't be used as a "step" or "action" in workflows. If you want to use it, please let us know by creating an issue in the [GitHub repository](https://github.com/keephq/keep/issues). ## Connecting with the Provider Obtain StatusCake API Key 1. Create an account on [StatusCake](https://www.statuscake.com/). 2. After logging in, go to the My Account under [Account Settings](https://app.statuscake.com/User.php) 3. Under Manage API Keys, generate a new API key or use the default key. 4. Copy the API Key. This will be used as the `Statuscake API Key` in the provider settings. ## Usefull Links * [StatusCake](https://www.statuscake.com/) # SumoLogic Provider Source: https://docs.keephq.dev/providers/documentation/sumologic-provider The SumoLogic provider enables webhook installations for receiving alerts in keep ## Overview The SumoLogic provider facilitates receiving alerts from Monitors in SumoLogic using a Webhook Connection. ## Authentication This provider requires authentication. * **sumoAccessId**: SumoLogic Access ID (required: True, sensitive: False) * **sumoAccessKey**: SumoLogic Access Key (required: True, sensitive: True) * **deployment**: Deployment Region (required: True, 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: * **authenticated**: User is Authorized (mandatory) * **authorized**: Required privileges (mandatory) ## In workflows This provider can't be used as a "step" or "action" in workflows. If you want to use it, please let us know by creating an issue in the [GitHub repository](https://github.com/keephq/keep/issues). ## Connecting with the Provider 1. Follow the instructions [here](https://help.sumologic.com/docs/manage/security/access-keys/) to get your Access Key & Access ID 2. Make sure the user has roles with the following capabilities: * `manageScheduledViews` * `manageConnections` * `manageUsersAndRoles` 3. Find your `deployment` from [here](https://api.sumologic.com/docs/#section/Getting-Started/API-Endpoints), keep will automatically figure out your endpoint. ## Useful Links * [SumoLogic API Documentation](https://api.sumologic.com/docs/#section/Getting-Started) * [SumoLogic Access\_Keys](https://help.sumologic.com/docs/manage/security/access-keys/) * [SumoLogic Roles Management](https://help.sumologic.com/docs/manage/users-roles/roles/create-manage-roles/) * [SumoLogic Deployments](https://api.sumologic.com/docs/#section/Getting-Started/API-Endpoints) # Microsoft Teams Provider Source: https://docs.keephq.dev/providers/documentation/teams-provider Microsoft Teams Provider is a provider that allows to notify alerts to Microsoft Teams chats. ## Authentication This provider requires authentication. * **webhook\_url**: Teams Webhook Url (required: True, sensitive: True) ## In workflows This provider can be used in workflows. As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query teams provider: teams config: "{{ provider.my_provider_name }}" with: message: {value} # The message to send typeCard: {value} # The card type. Can be "MessageCard" (legacy) or "message" (for Adaptive Cards). Default is "message" themeColor: {value} # Hexadecimal color (only used with MessageCard type) sections: {value} # For MessageCard: Array of custom information sections. For Adaptive Cards: Array of card elements following the Adaptive Card schema. Can be provided as a JSON string or array. schema: {value} # Schema URL for Adaptive Cards. Default is "http://adaptivecards.io/schemas/adaptive-card.json" attachments: {value} # Custom attachments array for Adaptive Cards (overrides default attachment structure). Can be provided as a JSON string or array. mentions: {value} # List of user mentions to include in the Adaptive Card. Each mention should be a dict with 'id' (user ID, Microsoft Entra Object ID, or UPN) and 'name' (display name) keys. Example: [{"id": "user-id-123", "name": "John Doe"}, {"id": "john.doe@example.com", "name": "John Doe"}] ``` Check the following workflow examples: * [create\_jira\_ticket\_upon\_alerts.yml](https://github.com/keephq/keep/blob/main/examples/workflows/create_jira_ticket_upon_alerts.yml) * [teams-adaptive-card-notifier.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/teams-adaptive-card-notifier.yaml) * [teams-adaptive-cards-with-mentions.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/teams-adaptive-cards-with-mentions.yaml) ## Connecting with the Provider## Notes When using Adaptive Cards (`typeCard="message"`): * The `sections` parameter should follow the [Adaptive Cards schema](https://adaptivecards.io/explorer/) * `themeColor` is ignored for Adaptive Cards * If no sections are provided, the message will be displayed as a simple text block * Both `sections` and `attachments` can be provided as JSON strings or arrays * You can mention users in your Adaptive Cards using the `mentions` parameter ### Workflow Example You can also find this example in our [examples](https://github.com/keephq/keep/tree/main/examples/workflows/keep-teams-adaptive-cards.yaml) folder in the Keep GitHub repository. ```yaml theme={null} id: 6bc7c72e-ab3d-4913-84dd-08b9323195ae description: Teams Adaptive Cards Example disabled: false triggers: - type: manual - filters: - key: source value: r".*" type: alert consts: {} name: Keep Teams Adaptive Cards owners: [] services: [] steps: [] actions: - name: teams-action provider: config: "{{ providers.teams }}" type: teams with: message: "" sections: '[{"type": "TextBlock", "text": "{{alert.name}}"}, {"type": "TextBlock", "text": "Tal from Keep"}]' typeCard: message # Optional: Add mentions to notify specific users # mentions: '[{"id": "user@example.com", "name": "User Name"}]' ``` You can also find an example with user mentions in our [examples](https://github.com/keephq/keep/tree/main/examples/workflows/keep-teams-adaptive-cards-with-mentions.yaml) folder. 1. In the New Teams client, select Teams and navigate to the channel where you want to add an Incoming Webhook. 2. Select More options â˘â˘â˘ on the right side of the channel name. 3. Select Manage Channel ![]()
For members who aren't admins of the channel, the Manage channel option is available under the Open channel details option in the upper-right corner of a channel. 4. Select Edit5. Search for Incoming Webhook and select Add.
6. Select Add
7. Provide a name for the webhook and upload an image if necessary. 8. Select Create.
9. Copy and save the unique webhook URL present in the dialog. The URL maps to the channel and you can use it to send information to Teams. 10. Select Done. The webhook is now available in the Teams channel.
![]()
1. In the Classic Teams client, select Teams and navigate to the channel where you want to add an Incoming Webhook. 2. Select More options â˘â˘â˘ from the upper-right corner. 3. Select Connectors from the dropdown menu. 4. Search for Incoming Webhook and select Add.
5. Select Add.
6. Provide a name for the webhook and upload an image if necessary. 7. Select Create.
8. Copy and save the unique webhook URL present in the dialog. The URL maps to the channel and you can use it to send information to Teams. 9. Select Done.
![]()
The sections parameter is a JSON string that follows the Adaptive Cards schema, but can also be an object. If it's a string, it will be parsed as a JSON string. ### Using Sections ```python theme={null} provider.notify( message="Fallback text", typeCard="message", sections=[ { "type": "TextBlock", "text": "Hello from Adaptive Card!" }, { "type": "Image", "url": "https://example.com/image.jpg" } ] ) ``` ### Using Custom Attachments ```python theme={null} provider.notify( typeCard="message", attachments=[{ "contentType": "application/vnd.microsoft.card.adaptive", "content": { "type": "AdaptiveCard", "version": "1.2", "body": [ { "type": "TextBlock", "text": "Custom Attachment Example" } ] } }] ) ``` ### Using User Mentions in Adaptive Cards You can mention users in your Adaptive Cards using the `mentions` parameter. The text in your card should include the mention in the format `User Name `, and you need to provide the user's ID and name in the `mentions` parameter. Teams supports three types of user IDs for mentions: * Teams User ID (format: `29:1234...`) * Microsoft Entra Object ID (format: `49c4641c-ab91-4248-aebb-6a7de286397b`) * User Principal Name (UPN) (format: `user@example.com`) ```python theme={null} provider.notify( typeCard="message", sections=[ { "type": "TextBlock", "text": "HelloJohn Doe , please review this alert!" } ], mentions=[ { "id": "john.doe@example.com", # Can be UPN, Microsoft Entra Object ID, or Teams User ID "name": "John Doe" } ] ) ``` You can also mention multiple users in a single card: ```python theme={null} provider.notify( typeCard="message", sections=[ { "type": "TextBlock", "text": "HelloJohn Doe andJane Smith , please review this alert!" } ], mentions=[ { "id": "john.doe@example.com", "name": "John Doe" }, { "id": "49c4641c-ab91-4248-aebb-6a7de286397b", # Microsoft Entra Object ID "name": "Jane Smith" } ] ) ``` In YAML workflows, you can provide the mentions as a JSON string: ```yaml theme={null} actions: - name: teams-action provider: config: "{{ providers.teams }}" type: teams with: typeCard: message sections: '[{"type": "TextBlock", "text": "HelloJohn Doe , please review this alert!"}]' mentions: '[{"id": "john.doe@example.com", "name": "John Doe"}]' ``` ## Useful Links * [https://learn.microsoft.com/pt-br/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook](https://learn.microsoft.com/pt-br/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook) * [https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/connectors-using](https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/connectors-using) * [https://adaptivecards.io/explorer/](https://adaptivecards.io/explorer/) * [https://adaptivecards.io/schemas/adaptive-card.json](https://adaptivecards.io/schemas/adaptive-card.json) # Telegram Provider Source: https://docs.keephq.dev/providers/documentation/telegram-provider Telegram Provider is a provider that allows to notify alerts to telegram chats. ## Authentication This provider requires authentication. * **bot\_token**: Telegram Bot Token (required: True, sensitive: True) ## In workflows This provider can be used in workflows. As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query telegram provider: telegram config: "{{ provider.my_provider_name }}" with: chat_id: {value} # Unique identifier for the target chat or username of the target channel topic_id: {value} # Unique identifier for the target message thread (topic) message: {value} # Message to be sent reply_markup: {value} # Inline keyboard markup to be attached to the message reply_markup_layout: {value} # Direction of the reply markup, could be "horizontal" or "vertical" parse_mode: {value} # Mode for parsing entities in the message text, could be "markdown" or "html" image_url: {value} # URL of the image to be attached to the message caption_on_image: {value} # Whether to use the message as a caption for the image ``` Check the following workflow examples: * [send-message-telegram-with-htmlmd.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/send-message-telegram-with-htmlmd.yaml) * [telegram\_advanced.yml](https://github.com/keephq/keep/blob/main/examples/workflows/telegram_advanced.yml) * [telegram\_basic.yml](https://github.com/keephq/keep/blob/main/examples/workflows/telegram_basic.yml) Telegram only supports limited formatting options. Refer to the [Telegram Bot API documentation](https://core.telegram.org/bots/api#formatting-options) for more information. ## Authentication Parameters The TelegramProviderAuthConfig class takes the following parameters: * bot\_token (str): The bot of the token. \*Required\*\* ## Connecting with the Provider To use the Telegram Provider you'll need a bot token. How to create telegram bot - [https://core.telegram.org/bots#how-do-i-create-a-bot](https://core.telegram.org/bots#how-do-i-create-a-bot) ## Useful Links * Telegram Bot docs - [https://core.telegram.org/bots](https://core.telegram.org/bots) * Telegram how to get chat id - [https://stackoverflow.com/questions/32423837/telegram-bot-how-to-get-a-group-chat-id](https://stackoverflow.com/questions/32423837/telegram-bot-how-to-get-a-group-chat-id) ## Example See `examples/alerts/db_disk_space_telegram.yml` for a full working example. # Template Source: https://docs.keephq.dev/providers/documentation/template Template Provider is a template for newly added provider's documentation ## Inputs *No information yet, feel free to contribute it using the "Edit this page" link the buttom of the page* ## Outputs *No information yet, feel free to contribute it using the "Edit this page" link the buttom of the page* ## Authentication Parameters *No information yet, feel free to contribute it using the "Edit this page" link the buttom of the page* ## Connecting with the Provider *No information yet, feel free to contribute it using the "Edit this page" link the buttom of the page* ## Notes *No information yet, feel free to contribute it using the "Edit this page" link the buttom of the page* ## Useful Links *No information yet, feel free to contribute it using the "Edit this page" link the buttom of the page* # ThousandEyes Source: https://docs.keephq.dev/providers/documentation/thousandeyes-provider ThousandEyes allows you to receive alerts from ThousandEyes using API endpoints as well as webhooks ## Authentication This provider requires authentication. * **oauth2\_token**: OAuth2 Bearer Token (required: True, sensitive: True) 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: * **authenticated**: User is Authenticated ## In workflows This provider can't be used as a "step" or "action" in workflows. If you want to use it, please let us know by creating an issue in the [GitHub repository](https://github.com/keephq/keep/issues). ## Connecting ThousandEyes to Keep 1. Go to [ThousandEyes Dashboard](https://app.thousandeyes.com/dashboard) 2. Click on `Manage` in the left sidebar and select `Account Settings`.3. Select `Users and Roles` in the Account Settings
4. Under `User API Tokens`, you can create OAuth Bearer Token
5. Copy the generated token. This will be used as the `OAuth2 Bearer Token` in the provider settings. ## Webhooks Integration 1. Open [ThousandEyes Dashboard](https://app.thousandeyes.com/dashboard) and click on `Network & App Synthetics` in the left sidebar and select `Agent Settings`.
2. Go to `Notifications` under `Enterprise Agents` and click on `Notifications`.
3. Go to `Notifications` and create new webhook notification.
4. Give it a name and set the url as [https://api.keephq.dev/alerts/event/thousandeyes?api\_key=your-api-key](https://api.keephq.dev/alerts/event/thousandeyes?api_key=your-api-key) 5. Select `Auth Type` as None and `Add New Webhook`.
6. Go to Keep dashboard and click on the profile icon in the botton left corner and click `Settings`.
7. Select `Users and Access` tab and then select `API Keys` tab and create a new API key.
8. Give name and select the role as `webhook` and click on `Create API Key`.
9. Copy the API key and paste it in the webhook URL.
## Useful Links * [ThousandEyes](https://www.thousandeyes.com/) # Trello Source: https://docs.keephq.dev/providers/documentation/trello-provider Trello provider is a provider used to query data from Trello ## Authentication This provider requires authentication. * **api\_key**: Trello API Key (required: True, sensitive: True) * **api\_token**: Trello API Token (required: True, sensitive: True) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query trello provider: trello config: "{{ provider.my_provider_name }}" with: board_id: {value} # Trello board ID filter: {value} # Trello action filter ``` Check the following workflow example: * [notify-new-trello-card.yml](https://github.com/keephq/keep/blob/main/examples/workflows/notify-new-trello-card.yml) ## Connecting with the Provider 1. Go to [https://trello.com/power-ups/admin](https://trello.com/power-ups/admin) to create custom power-up. 2. Create new power-up and add basic details like name, email address, etc. 3. Once it is created, navigate inside power-up and go to API Key section. 4. There click on `Generate a new API key` and it will generate API Key, that will be used as `api_key`. 5. For generating `api_token`, there is option to generate Token manually, click on that and authorize the application. ## Notes ## Useful Links * [https://developer.atlassian.com/cloud/trello/guides/power-ups/your-first-power-up/](https://developer.atlassian.com/cloud/trello/guides/power-ups/your-first-power-up/) * [https://trello.com/power-ups/admin](https://trello.com/power-ups/admin) # Twilio Provider Source: https://docs.keephq.dev/providers/documentation/twilio-provider Twilio Provider is a provider that allows to notify alerts via SMS using Twilio. ## Authentication This provider requires authentication. * **account\_sid**: Twilio Account SID (required: True, sensitive: False) * **api\_token**: Twilio API Token (required: True, sensitive: True) * **from\_phone\_number**: Twilio Phone Number (required: True, 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: * **send\_sms**: The API token has permission to send the SMS (mandatory) ## In workflows This provider can be used in workflows. As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query twilio provider: twilio config: "{{ provider.my_provider_name }}" with: message_body: {value} # The content of the SMS message to be sent. Defaults to "". to_phone_number: {value} # The recipient's phone number. Defaults to "". ``` If you need workflow examples with this provider, please raise a [GitHub issue](https://github.com/keephq/keep/issues). ## Connecting with the Provider To use the Twilio Provider you'll need API token. How to create Twilio API token - [https://support.twilio.com/hc/en-us/articles/223136027-Auth-Tokens-and-How-to-Change-Them](https://support.twilio.com/hc/en-us/articles/223136027-Auth-Tokens-and-How-to-Change-Them) ## Useful Links * Twilio API token - [https://support.twilio.com/hc/en-us/articles/223136027-Auth-Tokens-and-How-to-Change-Them](https://support.twilio.com/hc/en-us/articles/223136027-Auth-Tokens-and-How-to-Change-Them) * Twilio phone number - [https://www.twilio.com/en-us/guidelines/regulatory](https://www.twilio.com/en-us/guidelines/regulatory) # UptimeKuma Source: https://docs.keephq.dev/providers/documentation/uptimekuma-provider UptimeKuma allows you to monitor your website and APIs and send alert to keep ## Authentication This provider requires authentication. * **host\_url**: UptimeKuma Host URL (required: True, sensitive: False) * **username**: UptimeKuma Username (required: True, sensitive: False) * **password**: UptimeKuma Password (required: True, sensitive: True) 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: * **alerts**: Read alerts from UptimeKuma ## In workflows This provider can't be used as a "step" or "action" in workflows. If you want to use it, please let us know by creating an issue in the [GitHub repository](https://github.com/keephq/keep/issues). ## Connecting with the Provider Obtain UptimeKuma Host URL, Username and Password 1. UptimeKuma can only be self-hosted. You need to have an instance of UptimeKuma running. 2. After setting up UptimeKuma, you can obtain the Host URL, Username and Password. 3. Use the obtained Host URL, Username and Password in the provider settings. ## Webhooks Integration 1. Connect to UptimeKuma provider with the required parameters. 2. Use the Keep Backend API URL as the Host URL in UptimeKuma. [https://api.keephq.dev](https://api.keephq.dev) (Default) 3. Navigate to Account Settings in Keep, proceed to API Keys, and generate a API Key for Webhook. ## Usefull Links * [UptimeKuma](https://uptime.kuma.pet/) # VictoriaLogs Source: https://docs.keephq.dev/providers/documentation/victorialogs-provider VictoriaLogs provider allows you to query logs from VictoriaLogs. ## Overview VictoriaLogs is open source user-friendly database for logs from VictoriaMetrics. It is optimized for high performance and low memory usage. It can handle high cardinality and high volume of logs. Note: To add authentication VMAuth should be configured. For more information, refer to the [VMauth documentation](https://docs.victoriametrics.com/vmauth/). ## Authentication This provider requires authentication. * **host\_url**: VictoriaLogs Host URL (required: True, sensitive: False) * **authentication\_type**: Authentication Type (required: True, sensitive: False) * **username**: HTTP basic authentication - Username (required: False, sensitive: False) * **password**: HTTP basic authentication - Password (required: False, sensitive: True) * **bearer\_token**: Bearer Token (required: False, sensitive: True) * **x\_scope\_orgid**: X-Scope-OrgID Header (required: False, sensitive: False) * **insecure**: Skip TLS verification (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: * **authenticated**: The instance is valid and the user is authenticated ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query victorialogs provider: victorialogs config: "{{ provider.my_provider_name }}" with: queryType: {value} query: {value} time: {value} start: {value} end: {value} step: {value} account_id: {value} project_id: {value} limit: {value} timeout: {value} ``` Check the following workflow example: * [query\_victorialogs.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/query_victorialogs.yaml) ### NoAuth * No additional parameters are required, only the `Grafana Loki Host URL` is required. ### HTTP basic authentication * `HTTP basic authentication - Username`: The username to use for HTTP basic authentication. * `HTTP basic authentication - Password`: The password to use for HTTP basic authentication. ### Bearer * `Bearer Token` : The bearer token to use for authentication. * `X-Scope-OrgID Header`: The organization ID to use for VictoriaLogs Multi-tenancy support. (Optional) ## Querying VictoriaLogs The VictoriaLogs provider allows you to query logs from VictoriaLogs through the `query`, `hits`, `stats_query` and `stats_query_range` types. The following are the parameters available for querying: 1. `query` type: * `query`: This is the query to perform. * `limit`: The max number of matching entries to return. * `timeout`: The query timeout in seconds. * `AccountID`: The account ID to use for VictoriaLogs. * `ProjectID`: The project ID to use for VictoriaLogs. 2. `hits` type: * `query`: This is the query to perform. * `start`: The start time for the query. * `end`: The end time for the query. * `step`: The step for the query. * `AccountID`: The account ID to use for VictoriaLogs. * `ProjectID`: The project ID to use for VictoriaLogs. 3. `stats_query` type: * `query`: This is the query to perform. * `time`: The evaluation time for the query. 4. `stats_query_range` type: * `query`: This is the query to perform. * `start`: The start time for the query. * `end`: The end time for the query. * `step`: The step for the query. ## Useful Links * [VictoriaLogs](https://docs.victoriametrics.com/victorialogs/) * [VMauth documentation](https://docs.victoriametrics.com/vmauth/) # Victoriametrics Provider Source: https://docs.keephq.dev/providers/documentation/victoriametrics-provider The VictoriametricsProvider allows you to fetch alerts in Victoriametrics. ## Authentication This provider requires authentication. * **VMAlertHost**: The hostname or IP address where VMAlert is running (required: False, sensitive: False) * **VMAlertPort**: The port number on which VMAlert is listening (required: False, sensitive: False) * **VMAlertURL**: The full URL to the VMAlert instance. Alternative to Host/Port (required: False, sensitive: False) * **VMBackendHost**: The hostname or IP address where VictoriaMetrics backend is running (required: False, sensitive: False) * **VMBackendPort**: The port number on which VictoriaMetrics backend is listening (required: False, sensitive: False) * **VMBackendURL**: The full URL to the VictoriaMetrics backend. Alternative to Host/Port (required: False, sensitive: False) * **BasicAuthUsername**: Username for basic authentication (required: False, sensitive: False) * **BasicAuthPassword**: Password for basic authentication (required: False, sensitive: True) * **SkipValidation**: Enter 'true' to skip validation of authentication (required: False, sensitive: False) * **insecure**: Skip TLS verification (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: * **connected**: The user can connect to the client (mandatory) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query victoriametrics provider: victoriametrics config: "{{ provider.my_provider_name }}" with: query: {value} start: {value} end: {value} step: {value} queryType: {value} ``` Check the following workflow examples: * [create\_alert\_from\_vm\_metric.yml](https://github.com/keephq/keep/blob/main/examples/workflows/create_alert_from_vm_metric.yml) * [create\_multi\_alert\_from\_vm\_metric.yml](https://github.com/keephq/keep/blob/main/examples/workflows/create_multi_alert_from_vm_metric.yml) * [query\_victoriametrics.yml](https://github.com/keephq/keep/blob/main/examples/workflows/query_victoriametrics.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/victoriametrics' send_resolved: true http_config: basic_auth: username: api_key password: {api_key} ``` ## Connecting with the Provider 1. Ensure you have a running instance of VMAlert accessible by the host and port specified. 2. Include the host and port information in your Victoriametrics provider configuration when initializing the provider. ## Querying Victoriametrics The Victoriametrics provider allows you to query from Victoriametrics through `query` and `query_range` types. The following are the parameters available for querying: 1. `query` type: * `query`: The query to execute on Victoriametrics. Example: `sum(rate(http_requests_total{job="api-server"}[5m]))`. * `start`: The time to query the data for. Example: `2024-01-01T00:00:00Z` 2. `query_range` type: * `query`: The query to execute on Victoriametrics. Example: `sum(rate(http_requests_total{job="api-server"}[5m]))`. * `start`: The start time to query the data for. Example: `2024-01-01T00:00:00Z` * `end`: The end time to query the data for. Example: `2024-01-01T00:00:00Z` * `step`: The step size to use for the query. Example: `15s` ## Useful Links * [Victoriametrics](https://victoriametrics.com/docs/) * [VMAlert](https://victoriametrics.github.io/vmalert.html) # vLLM Provider Source: https://docs.keephq.dev/providers/documentation/vllm-provider The vLLM Provider enables integration with vLLM-deployed language models into Keep.
The vLLM Provider supports querying language models deployed with vLLM for prompt-based interactions. ## Authentication This provider requires authentication. * **api\_url**: vLLM API endpoint URL (required: True, sensitive: False) * **api\_key**: Optional API key if your vLLM deployment requires authentication (required: False, sensitive: True) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query vllm provider: vllm config: "{{ provider.my_provider_name }}" with: prompt: {value} temperature: {value} model: {value} max_tokens: {value} structured_output_format: {value} ``` Check the following workflow example: * [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) ## Connecting with the Provider To connect to a vLLM deployment: 1. Deploy your vLLM instance or obtain the API endpoint of an existing deployment 2. Configure the API URL in your provider configuration 3. If your deployment requires authentication, configure the API key # Wazuh Source: https://docs.keephq.dev/providers/documentation/wazuh-provider Wazuh provider allows you to get alerts from Wazuh via custom integration. ## Overview The Wazuh provider enables seamless integration between Keep and Wazuh. It allows you to get alerts from Wazuh to Keep via custom integration making it easier to track security-related activities in one place. Please refer to the [Wazuh Docs](https://documentation.wazuh.com/current/user-manual/manager/integration-with-external-apis.html#custom-integration) if you want to learn more about Wazuh Custom Integrations. ## In workflows This provider can't be used as a "step" or "action" in workflows. If you want to use it, please let us know by creating an issue in the [GitHub repository](https://github.com/keephq/keep/issues). ## Connecting Wazuh to Keep To connect Wazuh to Keep, you need to configure it as a custom integration in Wazuh. Follow the steps below to set up the integration: 1. Keep webhook scripts need to installed on the Wazuh server. 2. You can download the Keep webhook scripts using the following command: ```bash theme={null} wget -O custom-keep.py https://github.com/keephq/keep/blob/main/keep/providers/wazuh_provider/custom-keep.py?raw=true wget -O custom-keep https://github.com/keephq/keep/blob/main/keep/providers/wazuh_provider/custom-keep?raw=true ``` 3. Copy the downloaded script to the following path on the Wazuh server: `/var/ossec/integrations/` and set correct permissions ```bash theme={null} cp custom-keep.py /var/ossec/integrations/custom-keep.py cp custom-keep /var/ossec/integrations/custom-keep chown root:wazuh custom-keep* chmod 750 /var/ossec/integrations/custom-keep* ``` 4. Get the Webhook URL of Keep which is `https://api.keephq.dev/alerts/event/wazuh`. 5. Get the API Key of Keep which you can generate in the [Keep settings](https://platform.keephq.dev/settings?selectedTab=users\&userSubTab=api-keys). 6. In the config `/var/ossec/etc/ossec.conf` set new integration block ```xml theme={null}``` Please refer to the [Wazuh Documentation](https://documentation.wazuh.com/current/user-manual/manager/integration-with-external-apis.html#custom-integration) for more information and set the `level` you are interested in. 7\. Restart the `wazuh-manager` ```bash theme={null} $ systemctl restart wazuh-manager ``` ## Useful Links * [Wazuh](https://documentation.wazuh.com/) # Webhook Source: https://docs.keephq.dev/providers/documentation/webhook-provider A webhook is a method used to send real-time data from one application to another whenever a specific event occurs ## Authentication This provider requires authentication. * **url**: Webhook URL (required: True, sensitive: False) * **verify**: Enable SSL verification (required: False, sensitive: False) * **method**: HTTP method (required: True, sensitive: False) * **http\_basic\_authentication\_username**: HTTP basic authentication - Username (required: False, sensitive: False) * **http\_basic\_authentication\_password**: HTTP basic authentication - Password (required: False, sensitive: True) * **api\_key**: API key (required: False, sensitive: True) * **headers**: Headers (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: * **send\_webhook**: (mandatory) ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query webhook provider: webhook config: "{{ provider.my_provider_name }}" with: url: {value} method: {value} http_basic_authentication_username: {value} http_basic_authentication_password: {value} api_key: {value} headers: {value} body: {value} params: {value} fail_on_error: {value} ``` As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query webhook provider: webhook config: "{{ provider.my_provider_name }}" with: body: {value} params: {value} ``` Check the following workflow examples: * [webhook\_example.yml](https://github.com/keephq/keep/blob/main/examples/workflows/webhook_example.yml) * [webhook\_example\_foreach.yml](https://github.com/keephq/keep/blob/main/examples/workflows/webhook_example_foreach.yml) * [zoom\_chat\_example.yml](https://github.com/keephq/keep/blob/main/examples/workflows/zoom_chat_example.yml) # Websocket Source: https://docs.keephq.dev/providers/documentation/websocket-provider ## In workflows This provider can be used in workflows. As "step" to query data, example: ```yaml theme={null} steps: - name: Query websocket provider: websocket config: "{{ provider.my_provider_name }}" with: socket_url: {value} # The websocket URL to query. timeout: {value} # Connection Timeout. Defaults to None. data: {value} # Data to send through the websocket. Defaults to None. ``` If you need workflow examples with this provider, please raise a [GitHub issue](https://github.com/keephq/keep/issues). ## Outputs The `query` function of `WebsocketProvider` outputs the following format: ```json theme={null} { "connection": true, "data": "Received data from the websocket" } ``` The `connection` field indicates whether the websocket connection was successful (`true`) or not (`false`). The `data` field contains the received data from the websocket. If the `connection` field indicates unsuccessful connection (`false`) then the object will also include an `error` field with details about the failed connection. ## Authentication Parameters The Websocket provider does not require any specific authentication parameters. ## Connecting with the Provider To connect with the Websocket provider and perform queries, follow these steps: Initialize the provider and provider configuration in your system. Use the query function of the WebsocketProvider to interact with the websocket. See [documentation](https://websocket-client.readthedocs.io/en/latest/api.html#websocket.WebSocket.send) for more information. # YouTrack Source: https://docs.keephq.dev/providers/documentation/youtrack-provider YouTrack provider allows you to create new issues in YouTrack. ## Overview YouTrack is a project management tool packed with features that streamline your work and increase productivity on any team project. From software development and DevOps to HR and marketing, all kinds of teams can use YouTrack's functionality to easily track and collaborate on projects of any size. ## Authentication This provider requires authentication. * **host\_url**: YouTrack Host URL (required: True, sensitive: False) * **project\_id**: YouTrack Project ID (required: True, sensitive: False) * **permanent\_token**: YouTrack Permanent Token (required: True, sensitive: True) * **ticket\_creation\_url**: URL for creating new tickets (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: * **create\_issue**: (mandatory) ## In workflows This provider can be used in workflows. As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query youtrack provider: youtrack config: "{{ provider.my_provider_name }}" with: summary: {value} description: {value} ``` Check the following workflow example: * [create-issue-youtrack.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/create-issue-youtrack.yaml) ### How to get Project ID and Permanent Token? 1. **Project ID**: The project ID can be found in the URL of the project. For example, in the URL `https:// custom-keep 10 PLACE_YOUR_KEEP_WEBHOOK_URL_HERE PLACE_HERE_YOUR_API_KEY json /projects/ `, the project ID is ` `. 2. **Permanent Token**: Checkout the [YouTrack - Generate Permanent Token](https://www.jetbrains.com/help/youtrack/server/manage-permanent-token.html) documentation to generate a permanent token. ## Useful Links * [YouTrack](https://www.jetbrains.com/youtrack/) * [YouTrack - Generate Permanent Token](https://www.jetbrains.com/help/youtrack/server/manage-permanent-token.html) # Zabbix Source: https://docs.keephq.dev/providers/documentation/zabbix-provider Zabbix provider allows you to pull/push alerts from Zabbix Please note that we currently only support Zabbix of version 6 and above (6.0^) ## Authentication This provider requires authentication. * **zabbix\_frontend\_url**: Zabbix Frontend URL (required: True, sensitive: False) * **auth\_token**: Zabbix Auth Token (required: True, 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: * **action.create**: This method allows to create new actions. (mandatory) ([Documentation](https://www.zabbix.com/documentation/current/en/manual/api/reference/action/create)) * **action.get**: This method allows to retrieve actions. (mandatory) ([Documentation](https://www.zabbix.com/documentation/current/en/manual/api/reference/action/get)) * **event.acknowledge**: This method allows to update events. (mandatory) ([Documentation](https://www.zabbix.com/documentation/current/en/manual/api/reference/event/acknowledge)) * **mediatype.create**: This method allows to create new media types. (mandatory) ([Documentation](https://www.zabbix.com/documentation/current/en/manual/api/reference/mediatype/create)) * **mediatype.get**: This method allows to retrieve media types. (mandatory) ([Documentation](https://www.zabbix.com/documentation/current/en/manual/api/reference/mediatype/get)) * **mediatype.update**: This method allows to update media types. (mandatory) ([Documentation](https://www.zabbix.com/documentation/current/en/manual/api/reference/mediatype/update)) * **problem.get**: The method allows to retrieve problems. (mandatory) ([Documentation](https://www.zabbix.com/documentation/current/en/manual/api/reference/problem/get)) * **script.create**: This method allows to create new scripts. (mandatory) ([Documentation](https://www.zabbix.com/documentation/current/en/manual/api/reference/script/create)) * **script.get**: The method allows to retrieve scripts. (mandatory) ([Documentation](https://www.zabbix.com/documentation/current/en/manual/api/reference/script/get)) * **script.update**: This method allows to update scripts. (mandatory) ([Documentation](https://www.zabbix.com/documentation/current/en/manual/api/reference/script/update)) * **user.get**: This method allows to retrieve users. (mandatory) ([Documentation](https://www.zabbix.com/documentation/current/en/manual/api/reference/user/get)) * **user.update**: This method allows to update users. (mandatory) ([Documentation](https://www.zabbix.com/documentation/current/en/manual/api/reference/user/update)) ## In workflows This provider can't be used as a "step" or "action" in workflows. If you want to use it, please let us know by creating an issue in the [GitHub repository](https://github.com/keephq/keep/issues). ## Provider Methods The provider exposes the following [Provider Methods](/providers/provider-methods#via-ai-assistant). They are available in the [AI Assistant](/overview/ai-incident-assistant). * **close\_problem** No description. (action, scopes: event.acknowledge) * `id`: The problem id. * **change\_severity** No description. (action, scopes: event.acknowledge) * `id`: The problem id. * `new_severity`: The new severity. Can be an integer string (0-5) or severity name: * "0" or "Not classified" * "1" or "Information" * "2" or "Warning" * "3" or "Average" * "4" or "High" * "5" or "Disaster" * **surrpress\_problem** No description. (action, scopes: event.acknowledge) * `id`: The problem id. * `suppress_until`: The datetime to suppress the problem until. * **unsurrpress\_problem** No description. (action, scopes: event.acknowledge) * `id`: The problem id. * **acknowledge\_problem** No description. (action, scopes: event.acknowledge) * `id`: The problem id. * **unacknowledge\_problem** No description. (action, scopes: event.acknowledge) * `id`: The problem id. * **add\_message\_to\_problem** No description. (action, scopes: event.acknowledge) * `id`: The problem id. * `message_text`: The message text. * **get\_problem\_messages** No description. (view, scopes: problem.get) * `id`: The problem id. ## Connecting with the Provider ### API Key To obtain Zabbix authentication token, follow the following steps, divided in to 3 categories ([Docs](https://www.zabbix.com/documentation/current/en/manual/web_interface/frontend_sections/users/api_tokens)): First, login in to your Zabbix account (the provided `zabbix_frontend_url`) with a privileged user. #### Create a User Role 1. Navigate to `Users` -> `User Roles` section. 2. In the top right corner of the screen, click `Create user role` 3. Give the role an indicative name (e.g. Keep Role) 4. In the `User type` selectbox, select `Super Admin` * This is because some of the scopes we need are available to `Super Admin` user type only. [See here](https://www.zabbix.com/documentation/current/en/manual/api/reference/mediatype/create) 5. Remove all the checkboxes from everything, except 1 random `Access to UI elements` which is required for any role. 6. In the `API methods` section, select `Allow list` and fill with these scopes: * `action.create` * `action.get` * `event.acknowledge` * `mediatype.create` * `mediatype.get` * `mediatype.update` * `problem.get` * `script.create` * `script.get` * `script.update` * `user.get` * `user.update`#### Create a user 1. Navigate to `Users` -> `Users` section. 2. Follow the instructions to add a new user. Give it an indicative username (e.g. KeepUser) 3. In the `Permissions` tab, select the Role you have just created. 4. Click `Add` #### Create API token 1. Navigate to `Users` -> `API tokens` section. 2. In the top right corner of the screen, click `Create API token` 3. Give the API token an indicative name (e.g. Keep Token) 4. Select the user you have just created 5. Unselect the `Set expiration date and time` checkbox and click `Add` 6. Copy the generated API token and keep it for further use in Keep. ## Notes
When installing Zabbix webhook, Keep automatically adds a new media type of type Keep to your media types. After the new media type is added, Keep automatically adds this mediatype as a media to all existing users, in order to get all alerts incoming from Zabbix. ## Webhook Integration Modifications The automatic webhook integration grants Keep access to the following scopes within the Zabbix instance: * `mediatype.get` * `mediatype.update` * `mediatype.create` * `user.get` * `user.update` You can view the webhook settings under **Alerts > Media Types** ## Useful Links * [Zabbix API](https://www.zabbix.com/documentation/current/en/manual/api) # Zenduty Source: https://docs.keephq.dev/providers/documentation/zenduty-provider Zenduty docs## Authentication This provider requires authentication. * **api\_key**: Zenduty api key (required: True, sensitive: True) ## In workflows This provider can be used in workflows. As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query zenduty provider: zenduty config: "{{ provider.my_provider_name }}" with: title: {value} # Title of the incident summary: {value} # Summary of the incident service: {value} # Service ID in Zenduty user: {value} # User ID in Zenduty policy: {value} # Policy ID in Zenduty ``` If you need workflow examples with this provider, please raise a [GitHub issue](https://github.com/keephq/keep/issues). ## Authentication configuration example: ``` zenduty: authentication: api_key: XXXXXXXXXXXXXXXX ``` ## Useful Links * [https://docs.zenduty.com/docs/api](https://docs.zenduty.com/docs/api) # Zoom Source: https://docs.keephq.dev/providers/documentation/zoom-provider Zoom provider allows you to create meetings with Zoom.
For this integration, you'll need to create a Zoom Application - for more details read [https://developers.zoom.us/docs/internal-apps](https://developers.zoom.us/docs/internal-apps) The `record_meeting` parameter won't work with Zoom's basic plan. With basic plan, you'll be able to connect to the meeting and enable the "recording" manually. ## Authentication This provider requires authentication. * **account\_id**: Zoom Account ID (required: True, sensitive: True) * **client\_id**: Zoom Client ID (required: True, sensitive: True) * **client\_secret**: Zoom Client Secret (required: True, sensitive: True) 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: * **create\_meeting**: Create a new Zoom meeting (mandatory) ## In workflows This provider can be used in workflows. As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query zoom provider: zoom config: "{{ provider.my_provider_name }}" with: topic: {value} start_time: {value} duration: {value} timezone: {value} record_meeting: {value} host_email: {value} ``` Check the following workflow examples: * [zoom\_chat\_example.yml](https://github.com/keephq/keep/blob/main/examples/workflows/zoom_chat_example.yml) * [zoom\_example.yml](https://github.com/keephq/keep/blob/main/examples/workflows/zoom_example.yml) ## Connecting with the Provider ### Create an ApplicationKeep the credentials:
### Grant Scopes
### Activate the app
### (Optional) Make sure cloud recording is set on your account
![]()
# Zoom Chat Source: https://docs.keephq.dev/providers/documentation/zoom_chat-provider Zoom Chat provider allows you to send Zoom Chats using the Incoming Webhook Zoom application.
For this integration, you will need to add and configure the Incoming Webhook application from the Zoom App Marketplace: [https://marketplace.zoom.us/apps/eH\_dLuquRd-VYcOsNGy-hQ](https://marketplace.zoom.us/apps/eH_dLuquRd-VYcOsNGy-hQ) ## Authentication This provider requires authentication. * **webhook\_url**: Zoom Incoming Webhook Full Format Url (required: True, sensitive: True) * **authorization\_token**: Incoming Webhook Authorization Token (required: True, sensitive: True) * **account\_id**: Zoom Account ID (required: False, sensitive: True) * **client\_id**: Zoom Client ID (required: False, sensitive: True) * **client\_secret**: Zoom Client Secret (required: False, sensitive: True) 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: * **user:read:user:admin**: View a Zoom user's details * **user:read:list\_users:admin**: List Zoom users ## In workflows This provider can be used in workflows. As "action" to make changes or update data, example: ```yaml theme={null} actions: - name: Query zoom_chat provider: zoom_chat config: "{{ provider.my_provider_name }}" with: severity: {value} # The severity of the alert. title: {value} # The title to use for the message. (optional) message: {value} # The text message to send. Supports Markdown formatting. tagged_users: {value} # A list of Zoom user email addresses to tag. (optional) details_url: {value} # A URL linking to more information. (optional) ``` Check the following workflow example: * [zoom\_chat\_example.yml](https://github.com/keephq/keep/blob/main/examples/workflows/zoom_chat_example.yml) ## Connecting with the Provider ### Enable the Incoming Webhook Application The Incoming Webhook application is available in the Zoom App Marketplace.![]()
### Create Team Chat Channel: This channel will be the recipient of the Keep notifications.
![]()
### Enable the Incoming Webhook Application Send `/inc connect
` to the channel to enable a webhook with authorization code. The app will respond with the webhook url and authorization code. You should use the "Full Format" Incoming Webhook Url, which ends in `?format=full`. ![]()
## (Optional) Enabling User JID Lookup Messages can optionally include Zoom user JIDs, which are used to tag a particular Zoom user in a message. This is useful, for example, if a team subscribes to a chat channel but members only wish to be notified when they are explicitly tagged. ### Create a Zoom Application User lookup requires authorization. Create an internal only, Zoom Server to Server OAuth application.
![]()
### Assign Required Scopes
![]()
# Linked providers Source: https://docs.keephq.dev/providers/linked-providers Understanding linked vs connected providers in Keep # Linked providers In Keep, providers can be either "connected" or "linked." Understanding the difference is important for proper alert routing and management.
## Connected vs linked providers * **Connected Providers**: These are providers that have been explicitly configured in Keep through the UI or API. They have full provider configuration and authentication details. * **Linked Providers**: These are providers that send alerts to Keep without being explicitly connected. They appear automatically when Keep receives alerts from them through webhooks or push mechanisms. ## How linking works When Keep receives alerts from an unconnected provider (like Prometheus pushing alerts), it automatically creates a "linked" provider entry. This allows you to: * Track which systems are sending alerts * See when Keep last received an alert * Apply deduplication rules specific to that provider ## Attaching alerts to connected providers If you have a connected provider and want to associate incoming alerts with it instead of creating a linked provider, add the `provider_id` query parameter to the webhook URL. For example, with Prometheus AlertManager: ```yaml theme={null} alertmanager: config: receivers: - name: "keep" webhook_configs: - url: "https://api.keephq.dev/alerts/event/prometheus?provider_id=your_provider_id" ``` Or with other webhook-based integrations: ```bash theme={null} # Grafana webhook https://api.keephq.dev/alerts/event/grafana?provider_id=grafana-prod # Datadog webhook https://api.keephq.dev/alerts/event/datadog?provider_id=datadog-main # Generic webhook https://api.keephq.dev/alerts/event/webhook?provider_id=custom-webhook ``` ## Best practices 1. **For Production Systems**: It's recommended to use connected providers when possible, as they provide: * Better authentication and security * Access to provider-specific features * Clearer audit trail 2. **For Testing/Development**: Linked providers can be useful for: * Quick prototyping * Testing alert flows * Temporary integrations 3. **Converting Linked to Connected**: If you regularly receive alerts from a linked provider, consider: * Setting up a proper provider connection * Using the `provider_id` parameter to attach alerts to the connected provider ## Limitations Linked providers: * Can't be used to pull alerts or data * Don't have authentication details * Can't be used for provider-specific actions * May have limited deduplication capabilities For full capabilities, consider converting linked providers to connected providers when they become part of your permanent alerting infrastructure. # Overview Source: https://docs.keephq.dev/providers/overview A Provider is a component of Keep that enables it to interact with third-party products. It is implemented as extensible Python code, making it easy to enhance and customize. Providers are core components of Keep that allows Keep to either query data, send notifications, get alerts from or manage third-party tools. These third-party tools include, among others, Datadog, Cloudwatch, and Sentry for data querying and/or alert management, and Slack, Resend, Twilio, and PagerDuty for notifications/incidents. By leveraging Keep Providers, users are able to deeply integrate Keep with the tools they use and trust, providing them with a flexible and powerful way to manage these tools with ease and from a single pane.
# Provider methods Source: https://docs.keephq.dev/providers/provider-methods Provider methods are additional capabilities that providers expose beyond the basic `query` and `notify` capabilities ([read more here](/providers/adding-a-new-provider#basics)). These methods allow you to interact with the provider's API in more specific ways, enabling richer integrations and automation capabilities. ## What are provider methods? Developers define provider methods using the `PROVIDER_METHODS` list in each provider class. They represent specific actions or queries that you can perform through the provider's API. These methods extend the basic capabilities of providers beyond simple notifications and queries. } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> For example, a monitoring service provider might expose methods to: * Mute/unmute alerts * Get detailed traces * Search for specific metrics * Modify monitoring configurations ## Using provider methods You can access provider methods through: * Keep's platform interface via the alert action menu * Keep's smart AI assistant (for example, "get traces for this alert") * Keep's API * Keep's workflows ### Via UI Methods appear in the alert action menu when available for the alert's source provider:
![]()
The form is automatically populated with the parameters required by the method, if they're available in the alert. ### Via AI assistant Keep's AI assistant can automatically discover and invoke provider methods based on natural language requests by understanding multiple contexts:1. **Alert Context**: The AI understands: * The alert's source provider * Alert metadata and attributes * Related services and applications * Current alert status and severity 2. **Provider Context**: The AI knows: * Which providers you have connected to your account * Available methods for each provider * Required parameters and their types * Method descriptions and capabilities 3. **Historical Context**: The AI learns from: * Similar past incidents * Previously successful method invocations * Common patterns in alert resolution For example: ```text theme={null} User: Can you get the traces for this alert? Assistant: I see this alert came from Datadog. I'll use the Datadog provider's get_traces method to fetch the traces. I'll use the trace_id from the alert's metadata: abc-123... User: This alert seems related to high latency. Can you help investigate? Assistant: I'll help investigate the latency issue. Since this is a Datadog alert, I can: 1. Get recent traces using search_traces() to look for slow requests 2. Fetch metrics using get_metrics() to check system performance 3. Look for related logs using search_logs() Would you like me to start with any of these? ``` The AI assistant automatically: 1. Identifies relevant provider methods 2. Extracts required parameters from context 3. Suggests appropriate actions based on the alert type 4. Chains multiple methods for comprehensive investigation ### Via API ```python theme={null} # Example using a Datadog provider method to mute a monitor response = await api.post( f"/providers/{provider_id}/invoke/mute_monitor", {"monitor_id": "abc123", "duration": 3600} ) ``` ## Adding new provider methods To add a new method to your provider: 1. Define the method in your provider class (must be an instance method): ```python theme={null} def get_traces(self, trace_id: str) -> dict: """Get trace details from the provider. Args: trace_id (str): The ID of the trace to retrieve Returns: dict: The trace details """ # Implementation pass ``` 2. Add method metadata to `PROVIDER_METHODS`: ```python theme={null} from keep.providers.models.provider_method import ProviderMethod PROVIDER_METHODS = [ ProviderMethod( name="Get Traces", description="Retrieve trace details", func_name="get_traces", type="view", # 'view' or 'action' scopes=["traces:read"], # Required provider scopes category="Observability", # Optional category for grouping methods ) ] ``` Note: The `func_params` field is automatically populated by Keep through reflection of the method signature, so you don't need to define it manually.
Provider methods must be instance methods (not static or class methods) of the provider class. The method signature is automatically inspected to generate UI forms and parameter validation. ### Complete example Here's a complete example of a provider with custom methods: ```python theme={null} class MonitoringProvider(BaseProvider): PROVIDER_DISPLAY_NAME = "Monitoring Service" PROVIDER_METHODS = [ ProviderMethod( name="Mute Alert", description="Mute an alert for a specified duration", func_name="mute_alert", type="action", scopes=["alerts:write"], category="Alert Management", ), ProviderMethod( name="Get Metrics", description="Retrieve metrics for a service", func_name="get_metrics", type="view", scopes=["metrics:read"], category="Observability", ), ] def mute_alert(self, alert_id: str, duration_minutes: int = 60) -> dict: """ Mute an alert for the specified duration. Args: alert_id: The ID of the alert to mute duration_minutes: Duration to mute in minutes (default: 60) Returns: dict: Confirmation of the mute action """ # Implementation here response = self._api_call(f"/alerts/{alert_id}/mute", {"duration": duration_minutes}) return {"success": True, "muted_until": response["muted_until"]} def get_metrics(self, service_name: str, metric_type: str, time_range: str = "1h") -> list: """ Get metrics for a specific service. Args: service_name: Name of the service metric_type: Type of metric (cpu, memory, latency, etc.) time_range: Time range for metrics (default: "1h") Returns: list: List of metric data points """ # Implementation here return self._query(f"metrics.{metric_type}", service=service_name, range=time_range) ``` ### Method types * **view**: Returns data for display (for example, getting traces, metrics) * **action**: Performs an action (for example, muting an alert, creating a ticket) ### Parameter types Supported parameter types for provider methods: * `str`: String input field * `int`: Numeric input field * `float`: Decimal number input field * `bool`: Boolean checkbox * `datetime`: Date/time picker * `dict`: JSON object input * `list`: Array/list input * `Literal`: Dropdown with predefined values * `Optional[type]`: Optional parameter of the specified type Example with different parameter types: ```python theme={null} from typing import Optional, Literal from datetime import datetime def advanced_query( self, metric_name: str, # Required string time_range: Literal["1h", "6h", "24h", "7d"] = "1h", # Dropdown with options include_metadata: bool = False, # Boolean checkbox limit: Optional[int] = None, # Optional integer start_time: Optional[datetime] = None, # Optional datetime picker ) -> dict: """Query metrics with advanced filtering options.""" # Implementation pass ``` ### Auto-discovery Keep automatically inspects provider classes to: 1. Discover available methods 2. Extract parameter information 3. Generate UI components 4. Enable AI understanding of method capabilities ## Best practices 1. **Clear Documentation**: Provide detailed docstrings for methods 2. **Type Hints**: Use Python type hints for parameters 3. **Error Handling**: Return clear error messages 4. **Scopes**: Define minimum required scopes 5. **Validation**: Validate parameters before execution ## Limitations * Currently supports only synchronous methods * The supported parameter types are limited to basic types * Methods must be instance methods of the provider class * Methods are automatically discovered through reflection * Keep validates parameter types based on type hints # Suppressing Alerts Automatically Source: https://docs.keephq.dev/workflows/examples/autosupressLink to the [workflow](https://github.com/keephq/keep/blob/main/examples/workflows/autosupress.yml). This workflow demonstrates how to suppress alerts by marking them as dismissed. Explanation: * Trigger: Activated by any alert. * Action: Enrich the alert by adding a `dismissed` field with the value `true`. ```yaml theme={null} workflow: id: autosupress description: demonstrates how to automatically suppress alerts triggers: - type: alert actions: - name: dismiss-alert provider: type: mock with: enrich_alert: - key: dismissed value: "true" ``` # Executing Actions During Business Hours Source: https://docs.keephq.dev/workflows/examples/buisnesshoursLink to the [workflow](https://github.com/keephq/keep/blob/main/examples/workflows/businesshours.yml). This workflow demonstrates how to take actions only during specified business hours. Explanation: * Trigger: Activated by an alert or manually. * Action: Check if the current time falls within business hours in the `America/New_York` timezone. If yes, enrich the alert with a `businesshours` field set to `true`. ```yaml theme={null} workflow: id: businesshours description: demonstrate how to do smth only when it's business hours triggers: - type: alert - type: manual actions: - name: dismiss-alert if: "keep.is_business_hours(timezone='America/New_York')" provider: type: mock with: enrich_alert: - key: businesshours value: "true" ``` # Continue on Error Source: https://docs.keephq.dev/workflows/examples/continue-on-error This workflow demonstrates `continue_on_error`, which lets a step or action fail without stopping the rest of the workflow â similar to `continue-on-error` in GitHub Actions. **Use case:** enrich an alert with optional data from an external API, then always send a Slack notification regardless of whether the enrichment succeeded. ```yaml theme={null} workflow: id: continue-on-error-example description: "Fetch optional enrichment data and always notify via Slack" triggers: - type: alert cel: source.contains("grafana") steps: - name: fetch-optional-enrichment continue_on_error: true provider: type: http config: "{{ providers.internal-api }}" with: url: "https://api.example.com/enrich/{{ alert.fingerprint }}" method: GET actions: - name: notify-slack provider: type: slack config: "{{ providers.slack-demo }}" with: message: > Alert: {{ alert.name }} Enrichment: {{ steps.fetch-optional-enrichment.results | default('unavailable') }} ``` **How it works:** 1. The `fetch-optional-enrichment` step calls an external API. If the API is down or returns an error, the failure is logged as a warning and execution continues. 2. The `notify-slack` action always runs, using the enrichment results if available or falling back gracefully if not. The same flag works on actions. In the example below, a best-effort ticket is created in ServiceNow and a Slack message is sent regardless of whether the ticket creation succeeded: ```yaml theme={null} workflow: id: best-effort-ticket description: "Create a ServiceNow ticket (best-effort) and always notify Slack" triggers: - type: alert cel: severity == "critical" actions: - name: create-ticket continue_on_error: true provider: type: servicenow config: "{{ providers.servicenow }}" with: table_name: INCIDENT payload: short_description: "{{ alert.name }}" description: "{{ alert.description }}" - name: notify-slack provider: type: slack config: "{{ providers.slack-demo }}" with: message: "Critical alert: {{ alert.name }}. A ServiceNow ticket was attempted." ```When `continue_on_error: true` is set, the step or action failure is logged as a warning but does **not** mark the overall workflow execution as failed. # Creating ServiceNow Tickets for Alerts Source: https://docs.keephq.dev/workflows/examples/create-servicenow-ticketsLink to the [workflow](https://github.com/keephq/keep/blob/main/examples/workflows/create_service_now_ticket_upon_alerts.yml). This workflow creates a ServiceNow ticket whenever an alert from Grafana or Prometheus is triggered. Explanation: * Trigger: Activated by alerts from Grafana or Prometheus. * Action: If the alert does not already have a ticket ID, create a ServiceNow ticket and enrich the alert with details like ticket ID, URL, and status. ```yaml theme={null} workflow: id: servicenow description: create a ticket in servicenow when an alert is triggered triggers: - type: alert cel: source.contains("grafana") || source.contains("prometheus") actions: - name: create-service-now-ticket if: "not '{{ alert.ticket_id }}' and {{ alert.annotations.ticket_type }}" provider: type: servicenow config: "{{ providers.servicenow }}" with: table_name: "{{ alert.annotations.ticket_type }}" payload: short_description: "{{ alert.name }} - {{ alert.description }} [created by Keep][fingerprint: {{alert.fingerprint}}]" description: "{{ alert.description }}" enrich_alert: - key: ticket_type value: servicenow - key: ticket_id value: results.sys_id - key: ticket_url value: results.link - key: ticket_status value: results.stage ``` # Handling High-Severity Sentry Alerts Source: https://docs.keephq.dev/workflows/examples/highsevLink to the [workflow](https://github.com/keephq/keep/blob/main/examples/workflows/create_jira_ticket_upon_alerts.yml). This workflow handles critical alerts from Sentry based on the service they are associated with. Explanation: * Trigger: Activated by critical alerts from Sentry. * Actions: * * Send a Slack message to the payments team for alerts related to the `payments` service. * * Create a Jira ticket for alerts related to the `ftp` service if a ticket ID is not already present. ```yaml theme={null} workflow: id: sentry-alerts description: handle alerts triggers: - type: alert cel: source.contains("sentry") && severity == "critical" && (service == "payments" || service == "ftp") actions: - name: send-slack-message-team-payments if: "'{{ alert.service }}' == 'payments'" provider: type: slack config: "{{ providers.team-payments-slack }}" with: message: | "A new alert from Sentry: Alert: {{ alert.name }} - {{ alert.description }} {{ alert }}" - name: create-jira-ticket-oncall-board if: "'{{ alert.service }}' == 'ftp' and not '{{ alert.ticket_id }}'" provider: type: jira config: "{{ providers.jira }}" with: board_name: "Oncall Board" custom_fields: customfield_10201: "Critical" issuetype: "Task" summary: "{{ alert.name }} - {{ alert.description }} (created by Keep)" description: | "This ticket was created by Keep. Please check the alert details below: {code:json} {{ alert }} {code}" enrich_alert: - key: ticket_type value: jira - key: ticket_id value: results.issue.key - key: ticket_url value: results.ticket_url ``` # Update ServiceNow Tickets Source: https://docs.keephq.dev/workflows/examples/update-servicenow-ticketsLink to the [workflow](https://github.com/keephq/keep/blob/main/examples/workflows/update_service_now_tickets_status.yml). This example demonstrates how to periodically update the status of ServiceNow tickets associated with alerts. Explanation: * Trigger: The workflow can be triggered manually, simulating the scheduled execution. * Step 1: Fetch all alerts with a `ticket_type` of `servicenow` using the Keep provider. * Action: Iterate over the fetched alerts and update their associated ServiceNow tickets with the latest status. ```yaml theme={null} workflow: id: servicenow description: update the ticket status every minute triggers: - type: manual steps: - name: get-alerts provider: type: keep with: cel: ticket_type == "servicenow" actions: - name: update-ticket foreach: "{{ steps.get-alerts.results }}" provider: type: servicenow config: "{{ providers.servicenow }}" with: ticket_id: "{{ foreach.value.alert_enrichment.enrichments.ticket_id }}" table_name: "{{ foreach.value.alert_enrichment.enrichments.table_name }}" fingerprint: "{{ foreach.value.alert_fingerprint }}" enrich_alert: - key: ticket_status value: results.state ``` # Overview Source: https://docs.keephq.dev/workflows/overviewYou can see plenty of fully working examples at our [GitHub repo](https://github.com/keephq/keep/blob/main/examples/workflows/). Keep Workflow Engine designed to streamline and automate operational tasks by integrating triggers, steps, actions, and conditions. This documentation provides an overview of the core concepts used to define and execute workflows effectively. ### General Structure Each workflow compose of: 1. **metadata** - id, description 2. **triggers** - when this workflow runs? 3. **steps/actions** - what this workflow should do? The general structure of a workflow is: ```yaml theme={null} workflow: id: aks-example description: aks-example triggers: # list of triggers - type: manual steps: # list of steps - name: some-step provider: type: some-provider-type config: "{{ providers.provider_id }}" with: # provider configuration - ... actions: - name: some-action provider: type: some-provider-type with: # provider configuration - ... ``` Let's dive into building workflows: * [Triggers](#triggers) * [Steps And Actions](#steps-and-actions) * [Conditions](#conditions) * [Functions](#functions) * [Context](#context) * [Providers](#providers) * [Variables](#variables) * [Foreach Loops](#foreach-loops) * [Alert Enrichment](#alert-enrichment) ### Triggers Define how a workflow starts, such as manually, on a schedule, or in response to alerts with optional filters for specific conditions. [See syntax](/workflows/syntax/triggers) ### Steps And Actions Represent sequential operations, like querying data or running scripts, using configurable providers. [See syntax](/workflows/syntax/steps-and-actions) ### Conditions Allow decision-making in actions based on thresholds, assertions, or previous step results. [See syntax](/workflows/syntax/conditions) ### Functions Built-in helpers like datetime\_compare or is\_business\_hours simplify complex operations. [See syntax](/workflows/syntax/functions) ### Context Enables access to and reuse of outputs from earlier steps within actions or conditions. [See syntax](/workflows/syntax/context) ### Providers External systems or services (e.g., Slack, Datadog, ServiceNow) integrated into workflows through a standard configuration interface. [See syntax](/workflows/syntax/providers) ### Foreach Loops Iterate over a list of results from a step to perform repeated actions for each item. [See syntax](/workflows/syntax/foreach) ### Alert Enrichment Add context to alerts, like customer details or ticket metadata, using enrichment mechanisms in steps or actions. [See syntax](/workflows/syntax/enrichment) # Conditions Source: https://docs.keephq.dev/workflows/syntax/conditions # Conditions Attach a condition to any step or action to decide at runtime whether it should run. A condition is a mustache expression that can reference outputs from earlier steps, workflow variables, or any other data in the execution context. Using conditions, you can introduce decision-making into workflows by asserting values, thresholds, or specific states. ### Simple `if` condition ```yaml theme={null} actions: - name: notify-slack if: "{{ alert.cpu_load }} == '70'" provider: type: slack config: "{{ providers.slack }}" with: message: "The CPU load exceeded the threshold!" ```**Values of variables will be quoted when evaluated**. For example, if `alert.cpu_load` is `70`, it will resolve to `'70'` (number quoted with single quotes). ### Using results of other steps in condition ```yaml theme={null} workflow: id: query-and-alert description: "Query a database and notify only if a threshold is met" steps: - name: get-disk-usage provider: type: mysql config: "{{ providers.mysql-prod }}" with: query: "SELECT disk_usage FROM metrics WHERE server = 'db1'" single_row: true actions: - name: notify-slack if: "{{ steps.get-disk-usage.results.disk_usage }} > 90" provider: type: slack config: "{{ providers.slack }}" with: message: "Disk usage is critical: {{ steps.get-disk-usage.results.disk_usage }}%" ``` ### Complex logic ```yaml theme={null} actions: - name: create-incident if: "{{ steps.get-alert.results.severity }} == 'critical' and {{ steps.get-alert.results.source }} == 'datadog'" provider: type: servicenow config: "{{ providers.servicenow }}" with: table_name: INCIDENT payload: short_description: "Critical Datadog alert received" ``` ### Condition with foreach ```yaml theme={null} actions: - name: process-pods foreach: "{{ steps.get-pods.results }}" if: "{{ foreach.value.status.phase }} == 'Failed'" provider: type: slack with: message: "Pod {{ foreach.value.metadata.name }} has failed!" ``` ## Condition with constants ```yaml theme={null} consts: max_load: 70 actions: - name: process-pods if: "{{ alert.cpu_load }} > {{ consts.max_load }}" provider: type: slack with: message: "Pod {{ foreach.value.metadata.name }} has failed!" ``` *** ## Explicit condition blocks (deprecated)Explicit condition blocks are deprecated and will be discontinued. Use the `if` syntax instead. ### assert (deprecated) Checks whether a specific assertion is true. ```yaml theme={null} condition: - name: assert-condition type: assert assert: "{{ steps.get-data.results.value }} == 'expected'" ``` ### threshold (deprecated) Compares a value to a threshold using operators like `>` (gt) and `<` (lt), defaults to `>` (gt). ```yaml theme={null} condition: - name: threshold-condition type: threshold value: "{{ steps.get-data.results.value }}" compare_to: 100 compare_type: gt ``` # Context Source: https://docs.keephq.dev/workflows/syntax/context The **Context** in Keep workflows allows you to reference and utilize data dynamically across different parts of your workflow. Context variables give you access to runtime data such as alert details, results from previous steps or actions, and constants defined in your workflow. This capability makes workflows flexible, reusable, and able to handle complex scenarios dynamically. *** ## Accessing Context Context variables can be accessed using curly braces (`{{ }}`). You can use these variables directly in triggers, steps, and actions. The context includes: 1. **Alert Data**: Access data from the alert triggering the workflow. 2. **Incident Data**: If the workflow is incident-based, you can access the incident's attributes. 3. **Steps and Actions Results**: Retrieve data produced by previous steps or actions using their unique IDs. ### Alert Data You can access attributes of the alert anywhere in the workflow: ```yaml theme={null} message: "Alert triggered: {{ alert.name }} - Severity: {{ alert.severity }}" ``` ### Incident Data For incident workflows, access incident-related context: ```yaml theme={null} if: "{{ incident.current_tier == 1 }}" ``` ### Steps Results Access results from previous steps: ```yaml theme={null} message: "Query results: {{ steps.get-max-datetime.results }}" ``` ### Action Results Retrieve data from completed actions: ```yaml theme={null} if: "{{ actions.trigger-email.results.success }}" ``` ### Constants Define reusable values in the workflow and access them: ```yaml theme={null} consts: alert_message: "Critical system alert!" escalation_policy: "tier-1" slack_channels: sre_team: CH00001 payments_team: CH00002 actions: - name: notify-slack if: "{{alert.source}} == 'datadog'" provider: type: slack config: "{{ providers.slack }}" with: channel: "{{ consts.slack_channels.sre_team }}" message: "{{ consts.alert_message }}" ``` ## Using Context in Loops When iterating over data in a `foreach` loop, the context provides `foreach.value` for the current iteration. For example: ```yaml theme={null} steps: - name: get-alerts provider: type: keep with: query: "status == 'firing'" actions: - name: notify-on-alerts foreach: "{{ steps.get-alerts.results }}" provider: type: slack with: message: "Alert: {{ foreach.value.name }} is firing!" ``` *** ## Examples of Context Usage ### Dynamic Action Execution Using context to trigger actions conditionally: ```yaml theme={null} actions: - name: escalate-alert if: "{{ alert.severity == 'critical' }}" provider: type: slack with: message: "Critical alert: {{ alert.name }}" ``` ### Enriching Alerts You can use results from a step to enrich an alert ```yaml theme={null} steps: - name: fetch-customer-details provider: type: mysql with: query: "SELECT * FROM customers WHERE id = '{{ alert.customer_id }}'" single_row: true actions: - name: enrich-alert provider: type: mock with: enrich_alert: - key: customer_name value: "{{ steps.fetch-customer-details.results.name }}" ``` ### Conditional Logic Based on Step Results ```yaml theme={null} actions: - name: trigger-slack if: "{{ steps.get-pods.results.0.status.phase == 'Running' }}" provider: type: slack with: message: "Pod is running: {{ steps.get-pods.results.0.metadata.name }}" ``` # Enrichment Source: https://docs.keephq.dev/workflows/syntax/enrichment Keep workflows support **enrichment**, a powerful feature that allows you to enhance alerts with additional data, making them more actionable and meaningful. Enrichments add custom fields or modify existing ones in an alert directly from your workflow. *** ## Why Enrich Alerts? * **Provide Context:** Add critical information, such as related customer data or ticket IDs. * **Enable Automation:** Use enriched fields in subsequent actions for dynamic processing. * **Improve Visibility:** Surface essential metadata for better decision-making. *** ## How to Enrich Alerts ### Using the `enrich_alert` Directive The `enrich_alert` directive is used in actions to add or update fields in the alert. You specify a list of key-value pairs where: * `key` is the field name to add or update. * `value` is the data to assign to the field. It can be a static value or dynamically derived from steps or other parts of the workflow. * `disposable` is an optional attribute that determines whether the enrichment is temporary and should be discarded when a new alert is received. If disposable is set to True, the enrichment is added to disposable\_enrichments and marked with dispose\_on\_new\_alert=True. ### Example Workflow with Enrichment ```yaml theme={null} workflow: id: enrich-alert-example description: Demonstrates enriching alerts triggers: - type: alert steps: - name: get-customer-details provider: type: mysql config: "{{ providers.mysql-prod }}" with: query: "SELECT * FROM customers WHERE customer_id = '{{ alert.customer_id }}'" single_row: true actions: - name: enrich-alert-with-customer-data provider: type: mock with: enrich_alert: - key: customer_name value: "{{ steps.get-customer-details.results.name }}" - key: customer_tier value: "{{ steps.get-customer-details.results.tier }}" ``` In this example: * The `get-customer-details` step fetches customer data based on the alert. * The `enrich_alert` directive adds `customer_name` and `customer_tier` to the alert. *** ## Enrichment Syntax ### Key-Value Pairs Each enrichment is defined as a key-value pair: ```yaml theme={null} enrich_alert: - key: field_name value: field_value disposable: true ``` * **Static Values:** Use static strings or numbers for straightforward enrichments: ```yaml theme={null} - key: alert_source value: "Monitoring System" ``` \-- **Dynamic Values:** Use values derived from steps, actions, or the alert itself: ```yaml theme={null} - key: severity_level value: "{{ alert.severity }}" ``` ### Conditional Enrichment You can combine enrichment with conditions to enrich alerts dynamically: ```yaml theme={null} actions: - name: enrich-critical-alert if: "{{ alert.severity == 'critical' }}" provider: type: mock with: enrich_alert: - key: priority value: high ``` ## Advanced Use Cases ### Enrich Alerts with Results from Actions Enrichments can use results from actions, allowing dynamic updates based on previous steps: ```yaml theme={null} enrich_alert: - key: ticket_id value: "{{ actions.create-ticket.results.ticket_id }}" - key: ticket_url value: "{{ actions.create-ticket.results.ticket_url }}" ``` ## Enrichment Workflow Example This example demonstrates how to enrich an alert with ticket details from ServiceNow: ```yaml theme={null} workflow: id: servicenow-ticket-enrichment triggers: - type: alert steps: - name: fetch-alert-details provider: type: keep with: filter: "alert_id == '{{ alert.id }}'" actions: - name: create-servicenow-ticket provider: type: servicenow config: "{{ providers.servicenow }}" with: table_name: INCIDENT payload: short_description: "Alert: {{ alert.name }}" description: "{{ alert.description }}" enrich_alert: - key: ticket_id value: "{{ results.sys_id }}" - key: ticket_url value: "{{ results.link }}" ``` ## Troubleshooting Enrichment ### Enrichment without an Alert/Incident If there is no alert/incident present in the trigger (for example interval trigger or manual call in workflow page), the enrichment rule would not have an alert/incident to apply to. The enrichment process typically requires an alert/incident to be present to apply the specified enrichments. Without an alert/incident, the enrichment rule would not execute as intended. A workaround is to use a foreach directive and pass it an object containing the "fingerprint" variable. # Foreach Source: https://docs.keephq.dev/workflows/syntax/foreach The `foreach` directive in Keep workflows allows you to iterate over a list of items and perform actions for each item. This is particularly useful for processing multiple results returned by a step or performing actions on a collection of entities. ## Key Features * **Dynamic Iteration:** Iterate over any list or array returned by a step or defined in the workflow. * **Scoped Variables:** Each iteration exposes the current item under the `foreach` variable, allowing you to access its properties directly. * **Action Chaining:** Multiple actions can use `foreach` to work sequentially on the same list of items. *** ## Defining a `foreach` To use `foreach`, include it as part of an action. The value of `foreach` should be a reference to the list you want to iterate over. ### Example Workflow with `foreach` ```yaml theme={null} workflow: id: foreach-example description: Demonstrates the use of foreach triggers: - type: manual steps: - name: get-pods provider: type: gke config: "{{ providers.gke }}" with: command_type: get_pods actions: - name: echo-pod-status foreach: "{{ steps.get-pods.results }}" provider: type: console with: message: "Pod name: {{ foreach.value.metadata.name }} || Namespace: {{ foreach.value.metadata.namespace }} || Status: {{ foreach.value.status.phase }}" ``` In this example: * The `get-pods` step retrieves a list of Kubernetes pods. * The `foreach` iterates over the `results` returned by the `get-pods` step. * For each pod, it prints its `name`, `namespace`, and `status.` *** ## Using `foreach` Variables The `foreach` variable provides scoped access to the current item in the iteration. ### Example of Scoped Variables ```yaml theme={null} actions: - name: notify-pod-status foreach: "{{ steps.get-pods.results }}" provider: type: slack with: message: | Pod Name: {{ foreach.value.metadata.name }} Namespace: {{ foreach.value.metadata.namespace }} Status: {{ foreach.value.status.phase }} ``` In this case: * `{{ foreach.value }}` refers to the current item in the list. * Access properties like `metadata.name`, `metadata.namespace`, and `s`tatus.phase\` dynamically. ### Using Conditions with `foreach` You can combine `foreach` with `if` conditions to filter or act selectively. ```yaml theme={null} actions: - name: alert-critical-pods foreach: "{{ steps.get-pods.results }}" if: "{{ foreach.value.status.phase == 'Failed' }}" provider: type: slack with: message: "Critical pod failure detected: {{ foreach.value.metadata.name }}" ``` # Functions Source: https://docs.keephq.dev/workflows/syntax/functions The **Functions** in Keep Workflow Engine are utilities that can be used to manipulate data, check conditions, or perform transformations within workflows. This document provides a brief overview and usage examples for each available function. *** ## Mathematical Functions ### `add` **Description:** Adds all provided numbers together. All arguments are converted to integers. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.add(1, 2, 3) # Output: 6 message2: keep.add(10, 20, 30) # Output: 60 ``` *** ### `sub` **Description:** Subtracts all subsequent numbers from the first number. All arguments are converted to integers. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.sub(10, 2, 3) # Output: 5 message2: keep.sub(100, 20, 30) # Output: 50 ``` *** ### `mul` **Description:** Multiplies all provided numbers together. All arguments are converted to integers. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.mul(2, 3, 4) # Output: 24 message2: keep.mul(5, 6, 7) # Output: 210 ``` *** ### `div` **Description:** Divides the first number by all subsequent numbers. All arguments are converted to integers. Returns an integer if the division result is whole, otherwise returns a floating-point number. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.div(10, 2) # Output: 5 message2: keep.div(10, 3) # Output: 3.3333333333333335 message3: keep.div(100, 2, 5) # Output: 10 ``` *** ### `mod` **Description:** Calculates the remainder of dividing the first number by all subsequent numbers sequentially. All arguments are converted to integers. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.mod(10, 3) # Output: 1 message2: keep.mod(100, 30, 7) # Output: 2 ``` *** ### `exp` **Description:** Raises the first number to the power equal to the product of all subsequent numbers. All arguments are converted to integers. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.exp(2, 3) # Output: 8 message2: keep.exp(2, 3, 2) # Output: 64 ``` *** ### `fdiv` **Description:** Performs integer division of the first number by all subsequent numbers sequentially. All arguments are converted to integers. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.fdiv(10, 3) # Output: 3 message2: keep.fdiv(100, 3, 2) # Output: 16 ``` *** ### `eq` **Description:** Checks if two values are equal. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.eq(5, 5) # Output: true message2: keep.eq("hello", "world") # Output: false message3: keep.eq([1, 2, 3], [1, 2, 3]) # Output: true ``` *** ## String Functions ### `uppercase` **Description:** Converts a string to uppercase. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: "keep.uppercase('hello world')" # Output: "HELLO WORLD" ``` *** ### `lowercase` **Description:** Converts a string to lowercase. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: "keep.lowercase('HELLO WORLD')" # Output: "hello world" ``` *** ### `capitalize` **Description:** Capitalizes the first character of a string. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.capitalize("hello world") # Output: "Hello world" ``` *** ### `title` **Description:** Converts a string to title case (capitalizes each word). **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.title("hello world") # Output: "Hello World" ``` *** ### `split` **Description:** Splits a string into a list using a delimiter. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: "keep.split('a,b,c', ',')" # Output: ["a", "b", "c"] ``` *** ### `strip` **Description:** Removes leading and trailing whitespace from a string. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.strip(" hello world ") # Output: "hello world" ``` *** ### `replace` **Description:** Replaces occurrences of a substring with another string. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.replace("hello world", "world", "Keep") # Output: "hello Keep" ``` *** ### `remove_newlines` **Description:** Removes all newline and tab characters from a string. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.remove_newlines("hello\nworld\t!") # Output: "helloworld!" ``` *** ### `encode` **Description:** URL-encodes a string. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.encode("hello world") # Output: "hello%20world" ``` *** ### `slice` **Description:** Extracts a portion of a string based on start and end indices. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.slice("hello world", 0, 5) # Output: "hello" ``` *** ## List and Dictionary Functions ### `first` **Description:** Retrieves the first element from a list. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.first([1, 2, 3]) # Output: 1 ``` *** ### `last` **Description:** Retrieves the last element from a list. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.last([1, 2, 3]) # Output: 3 ``` *** ### `index` **Description:** Retrieves an element at a specific index from a list. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.index(["a", "b", "c"], 1) # Output: "b" ``` *** ### `join` **Description:** Joins a list of elements into a string using a delimiter. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.join(["a", "b", "c"], ",") # Output: "a,b,c" ``` *** ### `len` **Description:** Returns the length of a list. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.len([1, 2, 3]) # Output: 3 ``` *** ### `dict_to_key_value_list` **Description:** Converts a dictionary into a list of key-value pairs. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.dict_to_key_value_list({"a": 1, "b": 2}) # Output: ["a:1", "b:2"] ``` *** ### `dict_pop` **Description:** Removes specified keys from a dictionary. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.dict_pop({"a": 1, "b": 2, "c": 3}, "a", "b") # Output: {"c": 3} ``` *** ### `dict_pop_prefix` **Description:** Removes all keys that start with a specified prefix from a dictionary. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.dict_pop_prefix({"a_1": 1, "a_2": 2, "b_1": 3}, "a_") # Output: {"b_1": 3} ``` *** ### `dict_filter_by_prefix` **Description:** Returns only the dictionary entries whose keys start with a specified prefix. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.dict_filter_by_prefix({"a_1": 1, "a_2": 2, "b_1": 3}, "a_") # Output: {"a_1": 1, "a_2": 2} ``` *** ### `dictget` **Description:** Gets a value from a dictionary with a default fallback. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.dictget({"a": 1, "b": 2}, "c", "default") # Output: "default" ``` *** ## Date and Time Functions ### `from_timestamp` **Description:** Converts unix timestamp int, float or string to datetime object, with optional timezone option. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: console with: message: keep.from_timestamp(1717244449.0) # will print "2024-06-01 12:20:49+00:00" # or with timezone # message: keep.from_timestamp(1717244449.0, "Europe/Berlin") # will print "2024-06-01 14:20:49+02:00" ``` ### `utcnow` **Description:** Returns the current UTC datetime. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.utcnow() ``` *** ### `utcnowtimestamp` **Description:** Returns the current UTC datetime as a Unix timestamp (seconds since epoch). **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.utcnowtimestamp() # Output: 1704067200 ``` *** ### `utcnowiso` **Description:** Returns the current UTC datetime in ISO format. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.utcnowiso() ``` *** ### `to_utc` **Description:** Converts a datetime string or object to UTC. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.to_utc("2024-01-01T00:00:00") ``` *** ### `to_timestamp` **Description:** Converts a datetime object or string into a Unix timestamp. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.to_timestamp("2024-01-01T00:00:00") ``` *** ### `datetime_compare` **Description:** Compares two datetime objects and returns the difference in hours. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.datetime_compare("2024-01-01T10:00:00", "2024-01-01T00:00:00") # Output: 10.0 ``` *** ### `is_business_hours` **Description:** Checks whether a given time falls within business hours. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.is_business_hours( time_to_check="2024-01-01T14:00:00Z", start_hour=8, end_hour=20, business_days=[0,1,2,3,4], timezone="America/New_York" ) ``` *** ## JSON Functions ### `json_dumps` **Description:** Converts a dictionary or string into a formatted JSON string. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.json_dumps({"key": "value"}) ``` *** ### `json_loads` **Description:** Parses a JSON string into a dictionary. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.json_loads('{"key": "value"}') ``` *** ## Utility Functions ### `get_firing_time` **Description:** Calculates the firing duration of an alert in specified time units. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.get_firing_time(alert, "m", tenant_id="tenant-id") # Output: "15.0" ``` *** ### `add_time_to_date` **Description:** Adds time to a date string based on specified time units. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.add_time_to_date("2024-01-01", "%Y-%m-%d", "1w 2d") # Output: "2024-01-10" ``` *** ### `timestamp_delta` **Description:** Adds or subtracts a time delta to/from a datetime. Use negative values to subtract time. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: # Add 2 hours to the current time add_hours: keep.timestamp_delta(keep.utcnow(), 2, "hours") # Subtract 30 minutes from a specific datetime subtract_minutes: keep.timestamp_delta("2024-01-01T12:00:00Z", -30, "minutes") # Output: 2024-01-01T11:30:00Z # Add 1 week to a datetime add_week: keep.timestamp_delta("2024-01-01T00:00:00Z", 1, "weeks") # Output: 2024-01-08T00:00:00Z ``` *** ### `is_first_time` **Description:** Checks if an alert with a given fingerprint is firing for the first time or first time within a specified period. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: # Check if this is the first time the alert is firing first_time: keep.is_first_time(alert.fingerprint, tenant_id="tenant-id") # Check if this is the first time the alert is firing in the last 24 hours first_time_24h: keep.is_first_time(alert.fingerprint, "24h", tenant_id="tenant-id") ``` *** ### `all` **Description:** Checks if all elements in an iterable are identical. **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.all([1, 1, 1]) # Output: true ``` *** ### `diff` **Description:** Checks if any elements in an iterable are different (opposite of `all`). **Example:** ```yaml theme={null} steps: - name: example-step provider: type: mock with: message: keep.diff([1, 2, 1]) # Output: true ``` *** # Permissions Source: https://docs.keephq.dev/workflows/syntax/permissions # Permissions Permissions in Keep Workflow Engine define **who can execute a workflow manually**. They allow you to restrict access to workflows based on user roles or specific email addresses, ensuring that only authorized users can trigger sensitive workflows.Currently, permissions can only be edited directly in the workflow YAML file. The workflow builder UI does not support editing permissions at this time. *** ## General Structure Permissions are defined at the top level of a workflow YAML file using the `permissions` field, which accepts a list of roles and/or email addresses. ```yaml theme={null} workflow: id: sensitive-workflow name: Sensitive Workflow description: "A workflow with restricted access" permissions: - admin - john.doe@example.com steps: # workflow steps ``` ## How Permissions Work When a workflow has permissions defined: 1. **Admin users** can always run the workflow regardless of the permissions list 2. **Non-admin users** can only run the workflow if: * Their role is explicitly listed in the permissions * OR their email address is explicitly listed in the permissions 3. If the `permissions` field is empty or not defined, any user with the `write:workflows` permission can run the workflow ## Supported Role Types Keep supports the following role types that can be used in the permissions list: * `admin`: Administrator users with full system access * `noc`: Network Operations Center users with read-only access * `webhook`: API access for webhook integrations * `workflowrunner`: Special role for running workflows via API ## Examples ### Restricting to Admin Users Only ```yaml theme={null} workflow: id: critical-infrastructure-workflow name: Critical Infrastructure Workflow permissions: - admin steps: # workflow steps ``` ### Allowing Specific Users ```yaml theme={null} workflow: id: department-specific-workflow name: Department Specific Workflow permissions: - sarah.smith@example.com - team.lead@example.com steps: # workflow steps ``` ### Combining Roles and Individual Users ```yaml theme={null} workflow: id: mixed-permissions-workflow name: Mixed Permissions Workflow permissions: - admin - noc - devops.specialist@example.com steps: # workflow steps ``` ## Best Practices * Use permissions for workflows that have significant impact on systems or trigger sensitive operations * Consider using role-based permissions (like `admin` or `noc`) for groups of users with similar responsibilities * List individual email addresses only for exceptions or when very specific access control is needed * Review workflow permissions regularly as part of security audits * Document which workflows have restricted permissions in your internal documentation # Providers Source: https://docs.keephq.dev/workflows/syntax/providers Providers are a fundamental part of workflows in Keep. They enable workflows to interact with external systems, fetch data, and perform actions. Each provider is designed to handle specific integrations such as Datadog, Slack, ServiceNow, or custom-built APIs. ## Key Features of Providers * **Extensibility:** Providers can be easily extended to support new systems or custom use cases.You can explore and contribute to the existing providers or create your own in the [Keep Providers Code Directory on GitHub](https://github.com/keephq/keep/providers). * **Parameterization:** Parameters under the `with` section are passed directly to the provider. This allows you to configure provider-specific settings for each step or action. * **Provisioning:** Providers can be provisioned via CI/CD pipelines or through the Keep UI, providing flexibility for both automated and manual setups. *** ## Defining a Provider To define a provider, include its configuration under the `providers` section of your workflow file. Here's an example: ```yaml theme={null} providers: slack: description: "Slack provider for sending messages" authentication: webhook_url: "{{ env.SLACK_WEBHOOK_URL }}" ``` ## Using a Provider in a Workflow Once a provider is defined, it can be used in workflow steps or actions by specifying its type and configuration. For example: ```yaml theme={null} actions: - name: trigger-slack provider: type: slack config: "{{ providers.slack }}" with: channel: "#alerts" message: "Alert triggered: {{ alert.name }}" ``` * The `config` field links the action to the provider. * The `with` section includes parameters that are passed to the provider. ## Examples ### Fetching Data with a Provider ```yaml theme={null} steps: - name: get-alerts provider: type: datadog config: "{{ providers.datadog }}" with: query: "avg:cpu.usage{*}" timeframe: "1h" ``` ### Sending Notifications with a Provider ```yaml theme={null} actions: - name: notify-slack provider: type: slack config: "{{ providers.slack }}" with: channel: "#alerts" message: "Critical alert: {{ alert.name }}" ``` # Steps and Actions Source: https://docs.keephq.dev/workflows/syntax/steps-and-actions Steps and actions are the building blocks of workflows in Keep Workflow Engine. While they share a similar structure and syntax, the **difference between steps and actions is mostly semantic**: * **Steps**: Focused on querying data or triggering fetch-like operations from providers (e.g., querying databases, fetching logs, or retrieving information). * **Actions**: Geared toward notifying or triggering outcomes, such as sending notifications, updating tickets, or invoking external services. Together, steps and actions allow workflows to both gather the necessary data and act upon it. *** ## General Structure Both steps and actions are defined using a similar schema: ### Steps Used for querying or fetching data. Step uses the `_query` method of each provider. ```yaml theme={null} steps: - name:provider: type: config: with: ``` ### Actions Used for notifications or triggering effects. Action uses the `_notify` method of each provider. ```yaml theme={null} actions: - name: provider: type: config: with: ``` ## Examples ### Fetch data from a MySQL database ```yaml theme={null} steps: - name: get-user-data provider: type: mysql config: "{{ providers.mysql-prod }}" with: query: "SELECT * FROM users WHERE id = 1" single_row: true ``` ### Retrieve logs from Datadog ```yaml theme={null} steps: - name: get-service-logs provider: type: datadog config: "{{ providers.datadog }}" with: query: "service:keep and @error" timeframe: "1h" ``` ### Query Kubernetes for running pods ```yaml theme={null} steps: - name: get-pods provider: type: k8s config: "{{ providers.k8s-cluster }}" with: command_type: get_pods ``` ### Send an email ```yaml theme={null} actions: - name: send-email provider: type: email config: "{{ providers.email }}" with: to: "user@example.com" subject: "Account Updated" body: "Your account details have been updated." ``` ### Send a Slack Message ```yaml theme={null} actions: - name: notify-slack provider: type: slack config: "{{ providers.slack-demo }}" with: message: "Critical alert received!" ``` ### Create a ticket in ServiceNow ```yaml theme={null} actions: - name: create-servicenow-ticket provider: type: servicenow config: "{{ providers.servicenow }}" with: table_name: INCIDENT payload: short_description: "New incident created by Keep" description: "Please investigate the issue." ``` ## Combining Steps and Actions A workflow typically combines steps (for querying data) with actions (for notifications or outcomes). Here's few examples: ### Query and Notify ```yaml theme={null} workflow: id: query-and-notify description: "Query a database and notify via Slack" steps: - name: get-user-data provider: type: mysql config: "{{ providers.mysql-prod }}" with: query: "SELECT email FROM users WHERE id = 1" single_row: true actions: - name: send-notification provider: type: slack config: "{{ providers.slack-demo }}" with: message: "User email: {{ steps.get-user-data.results.email }}" ``` ### Alert and Incident Management ```yaml theme={null} workflow: id: alert-management description: "Handle alerts and create incidents" steps: - name: get-alert-details provider: type: datadog config: "{{ providers.datadog }}" with: query: "service:keep and @alert" timeframe: "1h" actions: - name: create-incident provider: type: servicenow config: "{{ providers.servicenow }}" with: table_name: INCIDENT payload: short_description: "Alert from Datadog: {{ steps.get-alert-details.results.alert_name }}" description: "Details: {{ steps.get-alert-details.results.alert_description }}" ``` ## Error Handling and Retries Both steps and actions support error handling to ensure workflows can recover from failures. ```yaml theme={null} steps: - name: fetch-data provider: type: http with: url: "https://api.example.com/data" on-failure: retry: count: 3 # Retry every 5 seconds interval: 5 ``` ### Continue on error By default, if a step or action fails the workflow stops immediately and reports a failure. Set `continue_on_error: true` on any step or action to swallow its failure and continue executing the remaining steps/actions â similar to `continue-on-error` in GitHub Actions. ```yaml theme={null} steps: - name: optional-enrichment continue_on_error: true provider: type: http config: "{{ providers.some-api }}" with: url: "https://api.example.com/optional-data" - name: always-runs provider: type: slack config: "{{ providers.slack-demo }}" with: message: "Runs even if optional-enrichment failed" ``` The same attribute works on actions: ```yaml theme={null} actions: - name: best-effort-ticket continue_on_error: true provider: type: servicenow config: "{{ providers.servicenow }}" with: table_name: INCIDENT payload: short_description: "Automated incident" - name: fallback-slack provider: type: slack config: "{{ providers.slack-demo }}" with: message: "Ticket creation may have failed, check ServiceNow" ``` When `continue_on_error: true` is set, the step/action failure is logged as a warning but does **not** mark the overall workflow execution as failed. # Triggers Source: https://docs.keephq.dev/workflows/syntax/triggers ## Overview Triggers in Keep Workflow Engine define **when a workflow is executed**. Triggers are the starting point for workflows and can be configured to respond to a variety of events, conditions, or schedules. A workflow can have one or multiple triggers, and these triggers determine the specific circumstances under which the workflow is initiated. Examples include manual invocation, time-based schedules, or event-driven actions like alerts or incident updates. Triggers are defined under the `triggers` section of a workflow YAML file. Each trigger has a `type` and optional additional configurations or filters. ## Supported Trigger Types ### Manual Trigger Used to execute workflows on demand. ```yaml theme={null} triggers: - type: manual ``` ### Interval Trigger Runs workflows at a regular time. ```yaml theme={null} triggers: - type: interval # Run every 5 seconds value: 5 ``` ### Alert Trigger Executes a workflow when an alert is received. ```yaml theme={null} triggers: - type: alert ```If no filters or CEL expressions are specified, the workflow will be executed for every alert that comes in. ### Filtering Alerts There are two ways to filter alerts in Keep: #### 1. CEL-based Filtering (Recommended) Keep uses [Common Expression Language (CEL)](https://github.com/google/cel-spec/blob/master/doc/langdef.md) for filtering alerts. CEL provides a powerful and flexible way to express conditions using a simple expression language. ```yaml theme={null} triggers: - type: alert cel: source.contains("datadog") && severity == "critical" ``` Common CEL patterns: * String matching: `source.contains("prometheus")` * Exact matching: `severity == "critical"` * Multiple conditions: `source.contains("datadog") && severity == "critical"` * Pattern matching: `name.contains("error") || name.contains("failure")` * Complex conditions: `(source.contains("datadog") && severity == "critical") || (source.contains("newrelic") && severity == "error")` You can test and experiment with CEL expressions using the [CEL Playground](https://playcel.undistro.io/). #### 2. Legacy Filtering (Deprecated) The old filtering mechanism is deprecated but still supported for backward compatibility. It uses a list of key-value pairs with optional regex patterns. ```yaml theme={null} triggers: - type: alert filters: - key: severity value: critical - key: source value: datadog - key: service value: r"(payments|ftp)" ``` ### Incident Trigger Runs workflows when an incident is created, updated, or resolved. ```yaml theme={null} triggers: - type: incident on: - create - update ``` ### Field Change Trigger Executes a workflow when specific fields in an alert change, such as status or severity. ```yaml theme={null} triggers: - type: alert only_on_change: - status ``` ## Summary Triggers are a powerful way to control the execution of workflows, ensuring that they respond appropriately to manual actions, schedules, or events. By leveraging CEL expressions or filters, workflows can be fine-tuned to execute only under specific conditions. For more information about CEL expressions, refer to the [CEL Language Definition](https://github.com/google/cel-spec/blob/master/doc/langdef.md) and experiment with expressions in the [CEL Playground](https://playcel.undistro.io/).