Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaning up stale flag: addonUsageMetrics and event emitting from addons #8381

Merged
merged 17 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/lib/addons/datadog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,10 @@ export default class DatadogAddon extends Addon {
this.logger.warn(failedMessage);
}

if (this.flagResolver.isEnabled('addonUsageMetrics')) {
this.eventBus.emit(ADDON_EVENTS_HANDLED, {
result: state,
destination: 'datadog',
});
}
this.eventBus.emit(ADDON_EVENTS_HANDLED, {
result: state,
destination: 'datadog',
});

this.registerEvent({
integrationId,
Expand Down
10 changes: 4 additions & 6 deletions src/lib/addons/new-relic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,10 @@ export default class NewRelicAddon extends Addon {
this.logger.warn(failedMessage);
}

if (this.flagResolver.isEnabled('addonUsageMetrics')) {
this.eventBus.emit(ADDON_EVENTS_HANDLED, {
result: state,
destination: 'new-relic',
});
}
this.eventBus.emit(ADDON_EVENTS_HANDLED, {
result: state,
destination: 'new-relic',
});

this.registerEvent({
integrationId,
Expand Down
10 changes: 4 additions & 6 deletions src/lib/addons/slack-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,10 @@ export default class SlackAppAddon extends Addon {
stateDetails.push(errorMessage);
this.logger.warn(errorMessage, error);
} finally {
if (this.flagResolver.isEnabled('addonUsageMetrics')) {
this.eventBus.emit(ADDON_EVENTS_HANDLED, {
result: state,
destination: 'slack-app',
});
}
this.eventBus.emit(ADDON_EVENTS_HANDLED, {
result: state,
destination: 'slack-app',
});

this.registerEvent({
integrationId,
Expand Down
10 changes: 4 additions & 6 deletions src/lib/addons/slack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,10 @@ export default class SlackAddon extends Addon {
this.logger.warn(successWithErrorsMessage);
}

if (this.flagResolver.isEnabled('addonUsageMetrics')) {
this.eventBus.emit(ADDON_EVENTS_HANDLED, {
result: state,
destination: 'slack',
});
}
this.eventBus.emit(ADDON_EVENTS_HANDLED, {
result: state,
destination: 'slack',
});

this.registerEvent({
integrationId,
Expand Down
10 changes: 4 additions & 6 deletions src/lib/addons/teams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,10 @@ export default class TeamsAddon extends Addon {
this.logger.warn(failedMessage);
}

if (this.flagResolver.isEnabled('addonUsageMetrics')) {
this.eventBus.emit(ADDON_EVENTS_HANDLED, {
result: state,
destination: 'teams',
});
}
this.eventBus.emit(ADDON_EVENTS_HANDLED, {
result: state,
destination: 'teams',
});

this.registerEvent({
integrationId,
Expand Down
10 changes: 4 additions & 6 deletions src/lib/addons/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,10 @@ export default class Webhook extends Addon {
this.logger.warn(failedMessage);
}

if (this.flagResolver.isEnabled('addonUsageMetrics')) {
this.eventBus.emit(ADDON_EVENTS_HANDLED, {
result: state,
destination: 'webhook',
});
}
this.eventBus.emit(ADDON_EVENTS_HANDLED, {
result: state,
destination: 'webhook',
});

const domain = new URL(url).hostname;
this.logger.info(`Webhook invoked`, {
Expand Down
5 changes: 0 additions & 5 deletions src/lib/types/experimental.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export type IFlagKey =
| 'extendedMetrics'
| 'removeUnsafeInlineStyleSrc'
| 'originMiddleware'
| 'addonUsageMetrics'
| 'onboardingMetrics'
| 'onboardingUI'
| 'projectRoleAssignment'
Expand Down Expand Up @@ -270,10 +269,6 @@ const flags: IFlags = {
process.env.UNLEASH_EXPERIMENTAL_ORIGIN_MIDDLEWARE,
false,
),
addonUsageMetrics: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_ADDON_USAGE_METRICS,
false,
),
daveleek marked this conversation as resolved.
Show resolved Hide resolved
onboardingMetrics: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_ONBOARDING_METRICS,
false,
Expand Down
1 change: 0 additions & 1 deletion src/server-dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ process.nextTick(async () => {
enableLegacyVariants: false,
extendedMetrics: true,
originMiddleware: true,
addonUsageMetrics: true,
onboardingMetrics: true,
onboardingUI: true,
personalDashboardUI: true,
Expand Down
Loading