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,
|
||||
"preRouterHook": undefined,
|
||||
"prometheusApi": undefined,
|
||||
"prometheusImpactMetricsApi": undefined,
|
||||
"publicFolder": undefined,
|
||||
"rateLimiting": {
|
||||
"callSignalEndpointMaxPerSecond": 1,
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user