1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

fix: datadog addon needs flagResolver (#4806)

Fixes what this breaks: https://github.com/Unleash/unleash/pull/4765 -
The Datadog integration needs a `flagResolver`.
This commit is contained in:
Nuno Góis 2023-09-21 14:07:24 +01:00 committed by GitHub
parent ea9901c968
commit 7eae1f8382
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -5,6 +5,7 @@ import DatadogAddon from './datadog';
import Addon from './addon';
import { LogProvider } from '../logger';
import SlackAppAddon from './slack-app';
import { IFlagResolver } from '../types';
export interface IAddonProviders {
[key: string]: Addon;
@ -13,7 +14,8 @@ export interface IAddonProviders {
export const getAddons: (args: {
getLogger: LogProvider;
unleashUrl: string;
}) => IAddonProviders = ({ getLogger, unleashUrl }) => {
flagResolver: IFlagResolver;
}) => IAddonProviders = ({ getLogger, unleashUrl, flagResolver }) => {
const addons: Addon[] = [
new Webhook({ getLogger }),
new SlackAddon({ getLogger, unleashUrl }),

View File

@ -49,7 +49,11 @@ export default class AddonService {
IUnleashStores,
'addonStore' | 'eventStore' | 'featureToggleStore'
>,
{ getLogger, server }: Pick<IUnleashConfig, 'getLogger' | 'server'>,
{
getLogger,
server,
flagResolver,
}: Pick<IUnleashConfig, 'getLogger' | 'server' | 'flagResolver'>,
tagTypeService: TagTypeService,
addons?: IAddonProviders,
) {
@ -64,6 +68,7 @@ export default class AddonService {
getAddons({
getLogger,
unleashUrl: server.unleashUrl,
flagResolver,
});
this.sensitiveParams = this.loadSensitiveParams(this.addonProviders);
if (addonStore) {