Skip to content

Commit

Permalink
chore: flag for webhook domain logging (#8413)
Browse files Browse the repository at this point in the history
  • Loading branch information
daveleek authored Oct 10, 2024
1 parent a5cfd2e commit b1cdde0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/lib/addons/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,12 @@ export default class Webhook extends Addon {
});
}

const domain = new URL(url).hostname;
this.logger.info(`Webhook invoked`, {
domain,
});
if (this.flagResolver.isEnabled('webhookDomainLogging')) {
const domain = new URL(url).hostname;
this.logger.info(`Webhook invoked`, {
domain,
});
}

this.registerEvent({
integrationId,
Expand Down
7 changes: 6 additions & 1 deletion src/lib/types/experimental.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ export type IFlagKey =
| 'personalDashboardUI'
| 'trackLifecycleMetrics'
| 'purchaseAdditionalEnvironments'
| 'unleashAI';
| 'unleashAI'
| 'webhookDomainLogging';

export type IFlags = Partial<{ [key in IFlagKey]: boolean | Variant }>;

Expand Down Expand Up @@ -307,6 +308,10 @@ const flags: IFlags = {
process.env.UNLEASH_EXPERIMENTAL_UNLEASH_AI,
false,
),
webhookDomainLogging: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENT_WEBHOOK_DOMAIN_LOGGING,
false,
),
};

export const defaultExperimentalOptions: IExperimentalOptions = {
Expand Down
1 change: 1 addition & 0 deletions src/server-dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ process.nextTick(async () => {
personalDashboardUI: true,
purchaseAdditionalEnvironments: true,
unleashAI: true,
webhookDomainLogging: true,
},
},
authentication: {
Expand Down

0 comments on commit b1cdde0

Please sign in to comment.