1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-06-27 01:19:00 +02:00

feat: add prometheusImpactMetricsApi option to configuration (#10168)

API url, similar to `config.prometheusApi`, for impact metrics
This commit is contained in:
Tymoteusz Czech 2025-06-18 17:53:08 +02:00 committed by GitHub
parent 967df825cb
commit b356e23191
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 0 deletions

View File

@ -101,6 +101,7 @@ exports[`should create default config 1`] = `
"preHook": undefined,
"preRouterHook": undefined,
"prometheusApi": undefined,
"prometheusImpactMetricsApi": undefined,
"publicFolder": undefined,
"rateLimiting": {
"callSignalEndpointMaxPerSecond": 1,

View File

@ -773,6 +773,10 @@ export function createConfig(options: IUnleashOptions): IUnleashConfig {
defaultDaysToBeConsideredInactive,
);
const prometheusImpactMetricsApi =
options.prometheusImpactMetricsApi ||
process.env.PROMETHEUS_IMPACT_METRICS_API;
return {
db,
session,
@ -804,6 +808,7 @@ export function createConfig(options: IUnleashOptions): IUnleashConfig {
clientFeatureCaching,
accessControlMaxAge,
prometheusApi,
prometheusImpactMetricsApi,
publicFolder: options.publicFolder,
disableScheduler: options.disableScheduler,
isEnterprise: isEnterprise,

View File

@ -164,6 +164,7 @@ export interface IUnleashOptions {
clientFeatureCaching?: Partial<IClientCachingOption>;
accessControlMaxAge?: number;
prometheusApi?: string;
prometheusImpactMetricsApi?: string;
publicFolder?: string;
disableScheduler?: boolean;
metricsRateLimiting?: Partial<IMetricsRateLimiting>;
@ -288,6 +289,7 @@ export interface IUnleashConfig {
clientFeatureCaching: IClientCachingOption;
accessControlMaxAge: number;
prometheusApi?: string;
prometheusImpactMetricsApi?: string;
publicFolder?: string;
disableScheduler?: boolean;
isEnterprise: boolean;

View File

@ -69,6 +69,7 @@ process.nextTick(async () => {
},
],
},
prometheusImpactMetricsApi: 'http://localhost:9090',
/* can be tweaked to control configuration caching for /api/client/features
clientFeatureCaching: {
enabled: true,