Send Sentry events to Tinybird¶
Sentry is a platform for monitoring and alerting on errors in your applications. By integrating Sentry with Tinybird, you can analyze your Sentry events in real time and enrich it with other data sources.
Some common use cases for sending Sentry events to Tinybird include:
- Analyze errors from your applications.
- Detect patterns in your error data.
- Build an alert system based on error patterns.
- Build custom analytical dashboards.
Read on to learn how to send logs from Sentry to Tinybird.
Before you start¶
Before you connect Sentry to Tinybird, ensure:
- You have a Sentry account.
- You have a Tinybird Workspace.
Connect Sentry to Tinybird¶
In Sentry, go to Settings > Developer Settings > Custom Integrations.
Select Create New Integration.
In Tinybird, create a Data Source, called
sentry
, with the following schema:
SCHEMA > `action` LowCardinality(String) `json:$.action` DEFAULT 'unknown', `actor` JSON `json:$.actor` DEFAULT '{}', `data` JSON `json:$.data` DEFAULT '{}', `installation` JSON `json:$.installation` DEFAULT '{}' ENGINE "MergeTree" ENGINE_SORTING_KEY "action"
Using the JSON Data Type you can store the semi-structured data you receive from Sentry in a single column. You can later retrieve various events and their metadata as needed in your Pipes.
In Tinybird, copy a token with privileges to append to the Data Source you created. You can use the admin token or create one with the required scope.
Back in Sentry, paste the Events API URL in your Custom Integration. Use the query parameter
name
to match the name of the Data Source you created in Tinybird.
https://api.tinybird.co/v0/events?name=sentry&token=<your user token>
Replace the Tinybird API hostname or region with the API region that matches your Workspace.
Select Alert Rule Action.
In the Permissions box Issue and Event > Read.
Check all webhooks and Save Changes.
If you also want to send alerts to Tinybird, select Alerts from the left menu, click on an alert and select Edit Rule. You can select Send Notifications via your previously created Custom Integration.
You can then select Send Test Notification to check the connection.
You're done. Any of the Sentry events you selected are automatically sent to Tinybird through the Events API.
Check the status of the integration from the Log tab in the Tinybird sentry
Data Source.