Commit c3666eeb authored by Amy Qualls's avatar Amy Qualls

Merge branch 'sarahwaldner-master-patch-12404' into 'master'

Doc updates for HTTP endpoints

See merge request gitlab-org/gitlab!47354
parents 221ba2f3 87ff3ab3
...@@ -9,7 +9,8 @@ info: To determine the technical writer assigned to the Stage/Group associated w ...@@ -9,7 +9,8 @@ info: To determine the technical writer assigned to the Stage/Group associated w
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/13203) in [GitLab Ultimate](https://about.gitlab.com/pricing/) 12.4. > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/13203) in [GitLab Ultimate](https://about.gitlab.com/pricing/) 12.4.
> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/42640) to [GitLab Core](https://about.gitlab.com/pricing/) in 12.8. > - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/42640) to [GitLab Core](https://about.gitlab.com/pricing/) in 12.8.
GitLab can accept alerts from any source via a webhook receiver. This can be configured generically or, in GitLab versions 13.1 and greater, you can configure GitLab can accept alerts from any source via a webhook receiver. This can be configured
generically or, in GitLab versions 13.1 and greater, you can configure
[External Prometheus instances](../metrics/alerts.md#external-prometheus-instances) [External Prometheus instances](../metrics/alerts.md#external-prometheus-instances)
to use this endpoint. to use this endpoint.
...@@ -26,16 +27,14 @@ The list displays the integration name, type, and status (enabled or disabled): ...@@ -26,16 +27,14 @@ The list displays the integration name, type, and status (enabled or disabled):
## Configuration ## Configuration
You can either configure alerts to integrate with an [external Prometheus server](#external-prometheus-integration), GitLab can receive alerts via a [HTTP endpoint](#generic-http-endpoint) that you configure,
or provide a [generic HTTP endpoint](#generic-http-endpoint) to receive alerts or the [Prometheus integration](#external-prometheus-integration).
from other services.
### Generic HTTP Endpoint ### Generic HTTP Endpoint **CORE**
Enabling the Generic HTTP Endpoint creates a unique HTTP endpoint that can receive alert payloads in JSON format. You can always Enabling the Generic HTTP Endpoint activates a unique HTTP endpoint that can
[customize the payload](#customizing-the-payload) to your liking. receive alert payloads in JSON format. You can always
[customize the payload](#customize-the-alert-payload-outside-of-gitlab) to your liking.
You will need to activate the endpoint and obtain credentials to set up this integration:
1. Sign in to GitLab as a user with maintainer [permissions](../../user/permissions.md) 1. Sign in to GitLab as a user with maintainer [permissions](../../user/permissions.md)
for a project. for a project.
...@@ -44,20 +43,49 @@ You will need to activate the endpoint and obtain credentials to set up this int ...@@ -44,20 +43,49 @@ You will need to activate the endpoint and obtain credentials to set up this int
1. Toggle the **Active** alert setting to display the **URL** and **Authorization Key** 1. Toggle the **Active** alert setting to display the **URL** and **Authorization Key**
for the webhook configuration. for the webhook configuration.
### HTTP Endpoints **PREMIUM**
> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/4442) in [GitLab Premium](https://about.gitlab.com/pricing/) 13.6.
In [GitLab Premium](https://about.gitlab.com/pricing/), you can create multiple
unique HTTP endpoints to receive alerts from any external source in JSON format,
and you can [customize the payload](#customize-the-alert-payload-outside-of-gitlab).
1. Sign in to GitLab as a user with maintainer [permissions](../../user/permissions.md)
for a project.
1. Navigate to **Settings > Operations** in your project.
1. Expand the **Alerts** section.
1. For each endpoint you want to create:
1. In the **Integration** dropdown menu, select **HTTP Endpoint**.
1. Name the integration.
1. Toggle the **Active** alert setting to display the **URL** and **Authorization Key**
for the webhook configuration. You will input the URL and Authorization Key
in your external service.
1. _(Optional)_ To generate a test alert to test the new integration, enter a
sample payload, then click **Save and test alert payload**.Valid JSON is required.
1. Click **Save Integration**.
The new HTTP Endpoint displays in the [integrations list](#integrations-list).
You can edit the integration by selecting the **{pencil}** pencil icon on the right
side of the integrations list.
### External Prometheus integration ### External Prometheus integration
For GitLab versions 13.1 and greater, please see [External Prometheus Instances](../metrics/alerts.md#external-prometheus-instances) to configure alerts for this integration. For GitLab versions 13.1 and greater, please read
[External Prometheus Instances](../metrics/alerts.md#external-prometheus-instances)
to configure alerts for this integration.
## Customizing the payload ## Customize the alert payload outside of GitLab
You can customize the payload by sending the following parameters. This applies to all types of integrations. All fields For all integration types, you can customize the payload by sending the following
other than `title` are optional: parameters. All fields other than `title` are optional:
| Property | Type | Description | | Property | Type | Description |
| ------------------------- | --------------- | ----------- | | ------------------------- | --------------- | ----------- |
| `title` | String | The title of the incident. Required. | | `title` | String | The title of the incident. Required. |
| `description` | String | A high-level summary of the problem. | | `description` | String | A high-level summary of the problem. |
| `start_time` | DateTime | The time of the incident. If none is provided, a timestamp of the issue will be used. | | `start_time` | DateTime | The time of the incident. If none is provided, a timestamp of the issue is used. |
| `end_time` | DateTime | For existing alerts only. When provided, the alert is resolved and the associated incident is closed. | | `end_time` | DateTime | For existing alerts only. When provided, the alert is resolved and the associated incident is closed. |
| `service` | String | The affected service. | | `service` | String | The affected service. |
| `monitoring_tool` | String | The name of the associated monitoring tool. | | `monitoring_tool` | String | The name of the associated monitoring tool. |
...@@ -74,8 +102,9 @@ can be a nested JSON object. For example: ...@@ -74,8 +102,9 @@ can be a nested JSON object. For example:
{ "foo": { "bar": { "baz": 42 } } } { "foo": { "bar": { "baz": 42 } } }
``` ```
TIP: **Payload size:** TIP: **Tip:**
Ensure your requests are smaller than the [payload application limits](../../administration/instance_limits.md#generic-alert-json-payloads). Ensure your requests are smaller than the
[payload application limits](../../administration/instance_limits.md#generic-alert-json-payloads).
Example request: Example request:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment