mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
feat: add logging for lifecycle prom metrics (#8341)
This commit is contained in:
parent
c58d4830eb
commit
e512739571
@ -132,8 +132,17 @@ export class FeatureLifecycleService {
|
||||
}
|
||||
|
||||
private recordStagesEntered(newlyEnteredStages: NewStage[]) {
|
||||
if (this.flagResolver.isEnabled('trackLifecycleMetrics')) {
|
||||
this.logger.info(
|
||||
'recordStagesEntered parameter',
|
||||
newlyEnteredStages,
|
||||
);
|
||||
}
|
||||
newlyEnteredStages.forEach(({ stage, feature }) => {
|
||||
this.eventBus.emit(STAGE_ENTERED, { stage, feature });
|
||||
if (this.flagResolver.isEnabled('trackLifecycleMetrics')) {
|
||||
this.logger.info('STAGE_ENTERED emitted', { stage, feature });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -453,6 +453,9 @@ export default class MetricsMonitor {
|
||||
eventBus.on(
|
||||
events.STAGE_ENTERED,
|
||||
(entered: { stage: string; feature: string }) => {
|
||||
if (flagResolver.isEnabled('trackLifecycleMetrics')) {
|
||||
logger.info('STAGE_ENTERED listened', entered);
|
||||
}
|
||||
featureLifecycleStageEnteredCounter.increment({
|
||||
stage: entered.stage,
|
||||
});
|
||||
|
@ -60,7 +60,8 @@ export type IFlagKey =
|
||||
| 'onboardingUI'
|
||||
| 'projectRoleAssignment'
|
||||
| 'eventTimeline'
|
||||
| 'personalDashboardUI';
|
||||
| 'personalDashboardUI'
|
||||
| 'trackLifecycleMetrics';
|
||||
|
||||
export type IFlags = Partial<{ [key in IFlagKey]: boolean | Variant }>;
|
||||
|
||||
@ -297,6 +298,10 @@ const flags: IFlags = {
|
||||
process.env.UNLEASH_EXPERIMENTAL_PERSONAL_DASHBOARD_UI,
|
||||
false,
|
||||
),
|
||||
trackLifecycleMetrics: parseEnvVarBoolean(
|
||||
process.env.UNLEASH_EXPERIMENTAL_TRACK_LIFECYCLE_METRICS,
|
||||
false,
|
||||
),
|
||||
};
|
||||
|
||||
export const defaultExperimentalOptions: IExperimentalOptions = {
|
||||
|
Loading…
Reference in New Issue
Block a user