-
Notifications
You must be signed in to change notification settings - Fork 817
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
243 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
--- | ||
title: 'Dash0' | ||
sidebarTitle: 'Dash0 Provider' | ||
description: '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. | ||
|
||
<Frame width="100" height="200"> | ||
<img height="10" src="/images/dash0-provider_1.png" /> | ||
</Frame> | ||
|
||
2. Click on `Notification Channels` and create a New notification channel of type `Webhook`. | ||
|
||
<Frame width="100" height="200"> | ||
<img height="10" src="/images/dash0-provider_2.png" /> | ||
</Frame> | ||
|
||
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`. | ||
|
||
<Frame width="100" height="200"> | ||
<img height="10" src="/images/keep-apikey-1.png" /> | ||
</Frame> | ||
|
||
6. Select `Users and Access` tab and then select `API Keys` tab and create a new API key. | ||
|
||
<Frame width="100" height="200"> | ||
<img height="10" src="/images/keep-apikey-2.png" /> | ||
</Frame> | ||
|
||
7. Give name and select the role as `webhook` and click on `Create API Key`. | ||
|
||
<Frame width="100" height="200"> | ||
<img height="10" src="/images/keep-apikey-3.png" /> | ||
</Frame> | ||
|
||
8. Copy the API key. | ||
|
||
<Frame width="100" height="200"> | ||
<img height="10" src="/images/keep-apikey-4.png" /> | ||
</Frame> | ||
|
||
9. Add a new request header with key `X-API-KEY` and value as the API key copied from Keep and save the webhook. | ||
|
||
<Frame width="100" height="200"> | ||
<img height="10" src="/images/dash0-provider_3.png" /> | ||
</Frame> | ||
|
||
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. | ||
|
||
<Frame width="100" height="200"> | ||
<img height="10" src="/images/dash0-provider_4.png" /> | ||
</Frame> | ||
|
||
11. Go to `Checks` under `Alerting` and create a new check or edit an existing check to use the notification rule created. | ||
|
||
<Frame width="100" height="200"> | ||
<img height="10" src="/images/dash0-provider_5.png" /> | ||
</Frame> | ||
|
||
<Frame width="100" height="200"> | ||
<img height="10" src="/images/dash0-provider_6.png" /> | ||
</Frame> | ||
|
||
12. Now you will start receiving events in Keep from Dash0. | ||
|
||
## Useful Links | ||
|
||
- [Dash0](https://dash0.com/) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
ALERTS = { | ||
"type": "alert.resolved", | ||
"data": { | ||
"issue": { | ||
"id": "b9a9da0b-7a79-4a1d-abf3-5cd07649e80a", | ||
"issueIdentifier": "6820705469291328438", | ||
"dataset": "default", | ||
"start": "2025-02-03T07:17:17.474101621Z", | ||
"end": "2025-02-03T07:24:17.474101621Z", | ||
"status": "resolved", | ||
"summary": "This is a summay", | ||
"description": "This is a description", | ||
"labels": [ | ||
{ | ||
"key": "service.name", | ||
"value": { | ||
"stringValue": "my-first-observable-service" | ||
} | ||
}, | ||
{ | ||
"key": "dash0.resource.name", | ||
"value": { | ||
"stringValue": "my-first-observable-service" | ||
} | ||
} | ||
], | ||
"annotations": [], | ||
"checkrules": [ | ||
{ | ||
"id": "97daff98-e694-421d-abda-d53b23ccfd41", | ||
"version": 1, | ||
"name": "New Check Rule", | ||
"expression": "increase({otel_metric_name = \"dash0.logs\"}[5m]) >= $__threshold", | ||
"thresholds": { | ||
"degraded": 1, | ||
"failed": 5 | ||
}, | ||
"interval": "1m0s", | ||
"for": "0s", | ||
"keepFiringFor": "0s", | ||
"summary": "This is a summay", | ||
"description": "This is a description", | ||
"labels": {}, | ||
"annotations": {}, | ||
"url": "https://app.dash0.com/alerting/check-rules?org=477cb1f5-90ca-404e-8533-7a1907b58669&s=eJxljU0OwiAUhO_y1sW-0tYKB_AA6sodhYcSsU34WTXcXerKxOXMN19mgxbkBjasb5DAkY8MOcP-hpPsuEQ8IOIdGkjrH-fihxuVVKRUR4asyj5BaaBVnkJyy6PVT9IvFrKnuP9946WmK3nSya3L3jpTdTEZZa04MTqKgQ28M0zNRjEz9jPvtbZm6Oqfi-fsfdSBqLopZCqlfADAkT0J" | ||
} | ||
], | ||
"url": "https://app.dash0.com/alerting/failed-checks?org=477cb1f5-90ca-404e-8533-7a1907b58669&s=eJxlT71uwyAQfhfmEJ8xNoY36NIuVYduhzlaFMdUgNMh8rsXqg6Vst3p-7-zjpk78ylemWECxMhBcBheQZleGIAzALyzEyvxARf6H-6wYKZSSY487mthx4l1uFIqYfvoPIaVHF8-abnklpiDI4upnSHnnZ5clVqN2iFYrlBpLrF3HK0f-Lg4UJPUNAPWrD8BbSX4QNWDTbMABaOctND9IGY5zK1zuNKLf46NtmAJcXvcIE2vzlLJ341oKyHeKN0CfbcBjkotnt_aW5vGL6oWJe10HMcPHhhbwg%3D%3D" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
""" | ||
Dash0 Provider allows to receive alerts from Dash0 using Webhook. | ||
""" | ||
|
||
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 | ||
|
||
class Dash0Provider(BaseProvider): | ||
""" | ||
Get alerts from Dash0 into Keep. | ||
""" | ||
|
||
webhook_description = "" | ||
webhook_template = "" | ||
webhook_markdown = """ | ||
💡 For more details on how to configure Dash0 to send alerts to Keep, see the [Keep documentation](https://docs.keephq.dev/providers/documentation/dash0-provider). | ||
To send alerts from Dash0 to Keep, Use the following webhook url to configure Dash0 send alerts to Keep: | ||
1. In Dash0, go to Organization settings. | ||
2. Go to Notification Channels and create a New notification channel with type Webhook. | ||
3. Give a name to the notification channel and use {keep_webhook_api_url} as the URL. | ||
4. Add a request header with the key "x-api-key" and the value as {api_key}. | ||
5. Save the configuration. | ||
6. Go to Notifications under Alerting in the left sidebar and create a New notification rule if required or change the Notification channel to webhook created in step 3 for an existing Notification Rule. | ||
7. Go to Checks under Alerting in the left sidebar and create a New Check Rule according to your requirements and assign the Notification Rule. | ||
""" | ||
|
||
STATUS_MAP = { | ||
"critical": AlertStatus.FIRING, | ||
"degraded": AlertStatus.FIRING, | ||
"resolved": AlertStatus.RESOLVED, | ||
} | ||
|
||
# Dash0 doesn't have severity levels, so we map status to severity levels manually. | ||
SEVERITIES_MAP = { | ||
"critical": AlertSeverity.CRITICAL, | ||
"degraded": AlertSeverity.WARNING, | ||
"resolved": AlertSeverity.INFO, | ||
} | ||
|
||
PROVIDER_DISPLAY_NAME = "Dash0" | ||
PROVIDER_TAGS = ["alert"] | ||
PROVIDER_CATEGORY = ["Monitoring"] | ||
|
||
def __init__( | ||
self, context_manager: ContextManager, provider_id: str, config: ProviderConfig | ||
): | ||
super().__init__(context_manager, provider_id, config) | ||
|
||
def validate_config(self): | ||
""" | ||
Validates required configuration for Dash0's provider. | ||
""" | ||
pass | ||
|
||
@staticmethod | ||
def _format_alert( | ||
event: dict, provider_instance: "BaseProvider" = None | ||
) -> AlertDto: | ||
alert = AlertDto( | ||
id=event["data"]["issue"]["id"], | ||
name=event["type"], | ||
description=event["data"]["issue"]["description"], | ||
summary=event["data"]["issue"]["summary"], | ||
url=event["data"]["issue"]["url"], | ||
status=Dash0Provider.STATUS_MAP[event["data"]["issue"]["status"]], | ||
severity=Dash0Provider.SEVERITIES_MAP[event["data"]["issue"]["status"]], | ||
lastReceived=event["data"]["issue"].get("end", event["data"]["issue"]["start"]), | ||
startedAt=event["data"]["issue"]["start"], | ||
labels=event["data"]["issue"]["labels"], | ||
checkrules=event["data"]["issue"]["checkrules"], | ||
source=["dash0"], | ||
) | ||
|
||
return alert | ||
|
||
if __name__ == "__main__": | ||
pass |