mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-06 00:07:44 +01:00
b37851acea
## About the changes Include a new configuration parameter to be able to specify source_type_name. This is an opt-in feature which provides backward compatibility to our existing users. ![image](https://github.com/Unleash/unleash/assets/455064/0e65584f-f601-4f17-b7a5-e73dae55772e) Closes #4109 ## Discussion points Maybe this should be hardcoded to `Unleash` but this gives additional flexibility
92 lines
2.8 KiB
TypeScript
92 lines
2.8 KiB
TypeScript
import {
|
|
FEATURE_CREATED,
|
|
FEATURE_UPDATED,
|
|
FEATURE_ARCHIVED,
|
|
FEATURE_REVIVED,
|
|
FEATURE_STALE_ON,
|
|
FEATURE_STALE_OFF,
|
|
FEATURE_ENVIRONMENT_ENABLED,
|
|
FEATURE_ENVIRONMENT_DISABLED,
|
|
FEATURE_STRATEGY_REMOVE,
|
|
FEATURE_STRATEGY_UPDATE,
|
|
FEATURE_STRATEGY_ADD,
|
|
FEATURE_METADATA_UPDATED,
|
|
FEATURE_PROJECT_CHANGE,
|
|
FEATURE_VARIANTS_UPDATED,
|
|
} from '../types/events';
|
|
import { IAddonDefinition } from '../types/model';
|
|
|
|
const dataDogDefinition: IAddonDefinition = {
|
|
name: 'datadog',
|
|
displayName: 'Datadog',
|
|
description: 'Allows Unleash to post updates to Datadog.',
|
|
documentationUrl: 'https://docs.getunleash.io/docs/addons/datadog',
|
|
parameters: [
|
|
{
|
|
name: 'url',
|
|
displayName: 'Datadog Events URL',
|
|
description:
|
|
'Default url: https://api.datadoghq.com/api/v1/events. Needs to be changed if your not using the US1 site.',
|
|
type: 'url',
|
|
required: false,
|
|
sensitive: false,
|
|
},
|
|
{
|
|
name: 'apiKey',
|
|
displayName: 'Datadog API key',
|
|
placeholder: 'j96c23b0f12a6b3434a8d710110bd862',
|
|
description: '(Required) API key from Datadog',
|
|
type: 'text',
|
|
required: true,
|
|
sensitive: true,
|
|
},
|
|
{
|
|
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,
|
|
},
|
|
{
|
|
name: 'customHeaders',
|
|
displayName: 'Extra HTTP Headers',
|
|
placeholder: `{
|
|
"ISTIO_USER_KEY": "hunter2",
|
|
"SOME_OTHER_CUSTOM_HTTP_HEADER": "SOMEVALUE"
|
|
}`,
|
|
description: `(Optional) Used to add extra HTTP Headers to the request the plugin fires off. Format here needs to be a valid json object of key value pairs where both key and value are strings`,
|
|
required: false,
|
|
sensitive: true,
|
|
type: 'textfield',
|
|
},
|
|
],
|
|
events: [
|
|
FEATURE_CREATED,
|
|
FEATURE_UPDATED,
|
|
FEATURE_ARCHIVED,
|
|
FEATURE_REVIVED,
|
|
FEATURE_STALE_ON,
|
|
FEATURE_STALE_OFF,
|
|
FEATURE_ENVIRONMENT_ENABLED,
|
|
FEATURE_ENVIRONMENT_DISABLED,
|
|
FEATURE_STRATEGY_REMOVE,
|
|
FEATURE_STRATEGY_UPDATE,
|
|
FEATURE_STRATEGY_ADD,
|
|
FEATURE_METADATA_UPDATED,
|
|
FEATURE_PROJECT_CHANGE,
|
|
FEATURE_VARIANTS_UPDATED,
|
|
],
|
|
tagTypes: [
|
|
{
|
|
name: 'datadog',
|
|
description:
|
|
'All Datadog tags added to a specific feature are sent to datadog event stream.',
|
|
icon: 'D',
|
|
},
|
|
],
|
|
};
|
|
|
|
export default dataDogDefinition;
|