Obtain an API token
Before sending events from GitHub, contact Chronosphere Support to obtain an API token for use with authenticating your third-party app with Observability Platform.This API token differs from an API token that’s generated when creating
a service account.
Create a GitHub webhook
To send GitHub events to Observability Platform:- In GitHub, open the repository you want to configure a webhook for.
- Click Settings.
- Under Code and automation, click Webhooks.
-
In the Add webhook window, in the Payload URL field, enter:
Replace
TENANTwith your organization name from your Observability Platform tenant. - Select application/json as the Content type.
- In the Secret field, enter the API token you obtained from Chronosphere Support.
- Choose Let me select individual events, and then select Deployment and Deployment Status as the events to trigger the webhook.
- Save your webhook.
Map GitHub events to Observability Platform events
After creating a GitHub webhook to send events to Observability Platform, you can use Observability Platform or the CreateEvent API to create change events. Observability Platform automatically maps the GitHub payload to change events in Observability Platform. You can’t customize how the payload maps to change events. If you want to modify how the GitHub payload gets mapped, contact Chronosphere Support. The following table indicates the fields and values required to create a GitHub event in Observability Platform:| Field | Value |
|---|---|
category | deploys |
type | deploy_ACTION |
source | github |
happened_at | TIMESTAMP |
title | TITLE |
ACTION: The type ofdeployevent to create, such asdeploy_start,deploy_in_progress, ordeploy_end.TIMESTAMP: The time event occurred, which must be between 24 hours in the past or 24 hours in the future. Defaults tonowif not specified.TITLE: A short description of the event that occurred, such as a commit message of a code deploy.
deploy event from GitHub with a type of
deploy_start. Observability Platform maps the environment, deploy.sha, and
deploy.log_url labels by default.
Replace the following:
TENANT: Your organization name from your Observability Platform tenant.CHRONOSPHERE_API_TOKEN: The API token for authenticating with Observability Platform.