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:
parent
967df825cb
commit
b356e23191
@ -101,6 +101,7 @@ exports[`should create default config 1`] = `
|
|||||||
"preHook": undefined,
|
"preHook": undefined,
|
||||||
"preRouterHook": undefined,
|
"preRouterHook": undefined,
|
||||||
"prometheusApi": undefined,
|
"prometheusApi": undefined,
|
||||||
|
"prometheusImpactMetricsApi": undefined,
|
||||||
"publicFolder": undefined,
|
"publicFolder": undefined,
|
||||||
"rateLimiting": {
|
"rateLimiting": {
|
||||||
"callSignalEndpointMaxPerSecond": 1,
|
"callSignalEndpointMaxPerSecond": 1,
|
||||||
|
@ -773,6 +773,10 @@ export function createConfig(options: IUnleashOptions): IUnleashConfig {
|
|||||||
defaultDaysToBeConsideredInactive,
|
defaultDaysToBeConsideredInactive,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const prometheusImpactMetricsApi =
|
||||||
|
options.prometheusImpactMetricsApi ||
|
||||||
|
process.env.PROMETHEUS_IMPACT_METRICS_API;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
db,
|
db,
|
||||||
session,
|
session,
|
||||||
@ -804,6 +808,7 @@ export function createConfig(options: IUnleashOptions): IUnleashConfig {
|
|||||||
clientFeatureCaching,
|
clientFeatureCaching,
|
||||||
accessControlMaxAge,
|
accessControlMaxAge,
|
||||||
prometheusApi,
|
prometheusApi,
|
||||||
|
prometheusImpactMetricsApi,
|
||||||
publicFolder: options.publicFolder,
|
publicFolder: options.publicFolder,
|
||||||
disableScheduler: options.disableScheduler,
|
disableScheduler: options.disableScheduler,
|
||||||
isEnterprise: isEnterprise,
|
isEnterprise: isEnterprise,
|
||||||
|
@ -164,6 +164,7 @@ export interface IUnleashOptions {
|
|||||||
clientFeatureCaching?: Partial<IClientCachingOption>;
|
clientFeatureCaching?: Partial<IClientCachingOption>;
|
||||||
accessControlMaxAge?: number;
|
accessControlMaxAge?: number;
|
||||||
prometheusApi?: string;
|
prometheusApi?: string;
|
||||||
|
prometheusImpactMetricsApi?: string;
|
||||||
publicFolder?: string;
|
publicFolder?: string;
|
||||||
disableScheduler?: boolean;
|
disableScheduler?: boolean;
|
||||||
metricsRateLimiting?: Partial<IMetricsRateLimiting>;
|
metricsRateLimiting?: Partial<IMetricsRateLimiting>;
|
||||||
@ -288,6 +289,7 @@ export interface IUnleashConfig {
|
|||||||
clientFeatureCaching: IClientCachingOption;
|
clientFeatureCaching: IClientCachingOption;
|
||||||
accessControlMaxAge: number;
|
accessControlMaxAge: number;
|
||||||
prometheusApi?: string;
|
prometheusApi?: string;
|
||||||
|
prometheusImpactMetricsApi?: string;
|
||||||
publicFolder?: string;
|
publicFolder?: string;
|
||||||
disableScheduler?: boolean;
|
disableScheduler?: boolean;
|
||||||
isEnterprise: boolean;
|
isEnterprise: boolean;
|
||||||
|
@ -69,6 +69,7 @@ process.nextTick(async () => {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
prometheusImpactMetricsApi: 'http://localhost:9090',
|
||||||
/* can be tweaked to control configuration caching for /api/client/features
|
/* can be tweaked to control configuration caching for /api/client/features
|
||||||
clientFeatureCaching: {
|
clientFeatureCaching: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user