Skip to content

Commit

Permalink
feat: feature flags for metrics and service name logging (#7916)
Browse files Browse the repository at this point in the history
  • Loading branch information
daveleek authored Aug 19, 2024
1 parent 2050cb0 commit 205aeb5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/lib/__snapshots__/create-config.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ exports[`should create default config 1`] = `
"feedbackUriPath": undefined,
"flagResolver": FlagResolver {
"experiments": {
"addonUsageMetrics": false,
"adminTokenKillSwitch": false,
"anonymiseEventLog": false,
"anonymizeProjectOwners": false,
Expand Down Expand Up @@ -153,6 +154,7 @@ exports[`should create default config 1`] = `
"useMemoizedActiveTokens": false,
"useProjectReadModel": false,
"userAccessUIEnabled": false,
"webhookServiceNameLogging": false,
},
"externalResolver": {
"getVariant": [Function],
Expand Down
12 changes: 11 additions & 1 deletion src/lib/types/experimental.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ export type IFlagKey =
| 'changeRequestPlayground'
| 'archiveProjects'
| 'projectListImprovements'
| 'useProjectReadModel';
| 'useProjectReadModel'
| 'webhookServiceNameLogging'
| 'addonUsageMetrics';

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

Expand Down Expand Up @@ -323,6 +325,14 @@ const flags: IFlags = {
process.env.UNLEASH_EXPERIMENTAL_USE_PROJECT_READ_MODEL,
false,
),
webhookServiceNameLogging: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_WEBHOOK_SERVICE_NAME_LOGGING,
false,
),
addonUsageMetrics: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_ADDON_USAGE_METRICS,
false,
),
};

export const defaultExperimentalOptions: IExperimentalOptions = {
Expand Down
2 changes: 2 additions & 0 deletions src/server-dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ process.nextTick(async () => {
changeRequestPlayground: true,
projectListImprovements: true,
useProjectReadModel: true,
webhookServiceNameLogging: true,
addonUsageMetrics: true,
},
},
authentication: {
Expand Down

0 comments on commit 205aeb5

Please sign in to comment.