2021-08-12 15:04:37 +02:00
import {
2021-05-03 22:08:14 +02:00
FEATURE_CREATED ,
FEATURE_UPDATED ,
FEATURE_ARCHIVED ,
FEATURE_REVIVED ,
FEATURE_STALE_ON ,
FEATURE_STALE_OFF ,
2021-10-07 10:22:20 +02:00
FEATURE_ENVIRONMENT_ENABLED ,
FEATURE_ENVIRONMENT_DISABLED ,
FEATURE_STRATEGY_REMOVE ,
FEATURE_STRATEGY_UPDATE ,
FEATURE_STRATEGY_ADD ,
FEATURE_METADATA_UPDATED ,
FEATURE_PROJECT_CHANGE ,
2023-07-19 15:52:19 +02:00
FEATURE_POTENTIALLY_STALE_ON ,
2023-09-26 12:15:22 +02:00
FEATURE_ENVIRONMENT_VARIANTS_UPDATED ,
2021-08-12 15:04:37 +02:00
} from '../types/events' ;
import { IAddonDefinition } from '../types/model' ;
2021-05-03 22:08:14 +02:00
2021-08-12 15:04:37 +02:00
const dataDogDefinition : IAddonDefinition = {
2021-05-03 22:08:14 +02:00
name : 'datadog' ,
displayName : 'Datadog' ,
description : 'Allows Unleash to post updates to Datadog.' ,
documentationUrl : 'https://docs.getunleash.io/docs/addons/datadog' ,
2023-09-12 14:25:38 +02:00
howTo : 'The Datadog integration allows Unleash to post Updates to Datadog when a feature toggle is updated.' ,
2021-05-03 22:08:14 +02:00
parameters : [
{
name : 'url' ,
displayName : 'Datadog Events URL' ,
description :
2023-09-14 14:01:29 +02:00
"Default URL: https://api.datadoghq.com/api/v1/events. Needs to be changed if your're not using the US1 site." ,
2021-05-03 22:08:14 +02:00
type : 'url' ,
required : false ,
2021-08-12 15:04:37 +02:00
sensitive : false ,
2021-05-03 22:08:14 +02:00
} ,
{
name : 'apiKey' ,
2022-09-05 11:00:59 +02:00
displayName : 'Datadog API key' ,
2021-05-03 22:08:14 +02:00
placeholder : 'j96c23b0f12a6b3434a8d710110bd862' ,
2023-09-14 14:01:29 +02:00
description : '(Required) API key to connect to Datadog' ,
2021-05-03 22:08:14 +02:00
type : 'text' ,
required : true ,
sensitive : true ,
} ,
2023-07-10 15:38:53 +02:00
{
name : 'sourceTypeName' ,
displayName : 'Datadog Source Type Name' ,
description :
'(Optional) source_type_name parameter to be included in Datadog events.' ,
type : 'text' ,
required : false ,
sensitive : false ,
} ,
2023-07-05 09:42:17 +02:00
{
name : 'customHeaders' ,
displayName : 'Extra HTTP Headers' ,
2023-09-20 10:21:30 +02:00
placeholder : ` {
2023-09-26 12:15:22 +02:00
"SOME_CUSTOM_HTTP_HEADER" : "SOME_VALUE" ,
"SOME_OTHER_CUSTOM_HTTP_HEADER" : "SOME_OTHER_VALUE"
2023-09-20 10:21:30 +02:00
} ` ,
2023-09-07 12:27:46 +02:00
description :
2023-09-14 14:01:29 +02:00
'(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' ,
2023-07-05 09:42:17 +02:00
required : false ,
sensitive : true ,
type : 'textfield' ,
} ,
2023-09-19 13:08:10 +02:00
{
name : 'bodyTemplate' ,
displayName : 'Body template' ,
placeholder : ` {
"event" : "{{event.type}}" ,
"createdBy" : "{{event.createdBy}}" ,
"featureToggle" : "{{event.data.name}}" ,
"timestamp" : "{{event.data.createdAt}}"
} ` ,
description :
'(Optional) The default format is a markdown string formatted by Unleash. You may override the format of the body using a mustache template.' ,
required : false ,
sensitive : false ,
type : 'textfield' ,
} ,
2021-05-03 22:08:14 +02:00
] ,
events : [
FEATURE_CREATED ,
FEATURE_UPDATED ,
FEATURE_ARCHIVED ,
FEATURE_REVIVED ,
FEATURE_STALE_ON ,
FEATURE_STALE_OFF ,
2021-10-07 10:22:20 +02:00
FEATURE_ENVIRONMENT_ENABLED ,
FEATURE_ENVIRONMENT_DISABLED ,
FEATURE_STRATEGY_REMOVE ,
FEATURE_STRATEGY_UPDATE ,
FEATURE_STRATEGY_ADD ,
FEATURE_METADATA_UPDATED ,
FEATURE_PROJECT_CHANGE ,
2023-09-26 12:15:22 +02:00
FEATURE_ENVIRONMENT_VARIANTS_UPDATED ,
2023-07-19 15:52:19 +02:00
FEATURE_POTENTIALLY_STALE_ON ,
2021-05-03 22:08:14 +02:00
] ,
tagTypes : [
{
name : 'datadog' ,
description :
'All Datadog tags added to a specific feature are sent to datadog event stream.' ,
icon : 'D' ,
} ,
] ,
} ;
2021-08-12 15:04:37 +02:00
export default dataDogDefinition ;