Skip to content

Commit

Permalink
docs: improve datadog integration docs (#4802)
Browse files Browse the repository at this point in the history
## About the changes

Improvement to the description of the datadog integration. Adds 2
missing event types, removes an event type that is deprecated and about
to be completely removed, adds missing description of extra json headers
and source type name, and adds description for the new configuration
option for JSON body support

---------

Co-authored-by: Nuno Góis <[email protected]>
Co-authored-by: Thomas Heartman <[email protected]>
  • Loading branch information
3 people authored Sep 26, 2023
1 parent 45aca5b commit 0938b2e
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/lib/addons/datadog-definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import {
FEATURE_STRATEGY_ADD,
FEATURE_METADATA_UPDATED,
FEATURE_PROJECT_CHANGE,
FEATURE_VARIANTS_UPDATED,
FEATURE_POTENTIALLY_STALE_ON,
FEATURE_ENVIRONMENT_VARIANTS_UPDATED,
} from '../types/events';
import { IAddonDefinition } from '../types/model';

Expand Down Expand Up @@ -55,8 +55,8 @@ const dataDogDefinition: IAddonDefinition = {
name: 'customHeaders',
displayName: 'Extra HTTP Headers',
placeholder: `{
"ISTIO_USER_KEY": "hunter2",
"SOME_OTHER_CUSTOM_HTTP_HEADER": "SOMEVALUE"
"SOME_CUSTOM_HTTP_HEADER": "SOME_VALUE",
"SOME_OTHER_CUSTOM_HTTP_HEADER": "SOME_OTHER_VALUE"
}`,
description:
'(Optional) Used to add extra HTTP Headers to the request the plugin fires off. This must be a valid json object of key-value pairs where both the key and the value are strings',
Expand Down Expand Up @@ -94,7 +94,7 @@ const dataDogDefinition: IAddonDefinition = {
FEATURE_STRATEGY_ADD,
FEATURE_METADATA_UPDATED,
FEATURE_PROJECT_CHANGE,
FEATURE_VARIANTS_UPDATED,
FEATURE_ENVIRONMENT_VARIANTS_UPDATED,
FEATURE_POTENTIALLY_STALE_ON,
],
tagTypes: [
Expand Down
48 changes: 46 additions & 2 deletions website/docs/reference/integrations/datadog.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,63 @@ You can choose to trigger updates for the following events:
- feature-stale-off
- feature-environment-enabled
- feature-environment-disabled
- feature-environment-variants-updated
- feature-potentially-stale-on

> *) Deprecated, and will not be used after transition to environments in Unleash v4.3
#### Parameters {#parameters}

Unleash Datadog integration takes the following parameters.

- **Datadog Events URL** - This property is optional. The default url is https://api.datadoghq.com/api/v1/events. Needs to be changed if you are not not on the US1 [Datadog site](https://docs.datadoghq.com/getting_started/site/). Possible alternatives:
- **Datadog Events URL** - This is an optional property. The default URL is https://api.datadoghq.com/api/v1/events. If you are not not using the US1 [Datadog site](https://docs.datadoghq.com/getting_started/site/), you'll need to change this. Some instances and their URLs are:
- EU: https://app.datadoghq.eu/api/v1/events
- US1: https://app.datadoghq.com/api/v1/events
- US3: https://us3.datadoghq.com/api/v1/events
- US1-FED: https://app.ddog-gov.com/api/v1/events
- **DD API KEY** - This is a required property.


- **Datadog API key** - This is a required property. The API key to use to authenticate with Datadog.

- **Datadog Source Type Name** - This is an optional property. Sets `source_type_name` parameter to be included in Datadog events.

- **Extra HTTP Headers** - This is an optional property. Used to set the additional headers when Unleash communicates with Datadog.

Example:

```json
{
"SOME_CUSTOM_HTTP_HEADER": "SOME_VALUE",
"SOME_OTHER_CUSTOM_HTTP_HEADER": "SOME_OTHER_VALUE"
}
```

:::info Body template availability

The body template property will be introduced as a beta feature in Unleash 5.5 and is expected to be made generally available in Unleash 5.6.

:::

- **Body template** - This is an optional property. The template is used to override the body template used by Unleash when performing the HTTP POST. You can format your message using a [Mustache template](https://mustache.github.io). Refer to the [Unleash event types](/reference/event-types) reference to find out which event properties you have access to in the template.

Example:

```mustache
{
"event": "{{event.type}}",
"createdBy": "{{event.createdBy}}",
"featureToggle": "{{event.data.name}}",
"timestamp": "{{event.data.createdAt}}"
}
```

If you don't specify anything Unleash will send a formatted markdown body.

Example:

```markdown
username created feature toggle (featurename)[http://your.url/projects/projectname/features/featurename] in project *projectname*
```

#### Tags {#tags}

Expand Down

0 comments on commit 0938b2e

Please sign in to comment.