n8n
Version:
n8n Workflow Automation Tool
52 lines (51 loc) • 2.21 kB
TypeScript
import { GlobalConfig } from '@n8n/config';
import { LicenseMetricsRepository, WorkflowRepository } from '@n8n/db';
import type express from 'express';
import { InstanceSettings } from 'n8n-core';
import { MessageEventBus } from '../eventbus/message-event-bus/message-event-bus';
import { EventService } from '../events/event.service';
import { CacheService } from '../services/cache/cache.service';
import type { MetricCategory, MetricLabel } from './types';
export declare class PrometheusMetricsService {
private readonly cacheService;
private readonly eventBus;
private readonly globalConfig;
private readonly eventService;
private readonly instanceSettings;
private readonly workflowRepository;
private readonly licenseMetricsRepository;
constructor(cacheService: CacheService, eventBus: MessageEventBus, globalConfig: GlobalConfig, eventService: EventService, instanceSettings: InstanceSettings, workflowRepository: WorkflowRepository, licenseMetricsRepository: LicenseMetricsRepository);
private readonly counters;
private tokenExchangeListenersRegistered;
private readonly gauges;
private readonly histograms;
private readonly prefix;
private readonly includes;
init(app: express.Application): Promise<void>;
enableMetric(metric: MetricCategory): void;
disableMetric(metric: MetricCategory): void;
disableAllMetrics(): void;
enableLabels(labels: MetricLabel[]): void;
disableAllLabels(): void;
private initN8nVersionMetric;
private initInstanceRoleMetric;
updateOnLeaderTakeover(): void;
updateOnLeaderStepdown(): void;
private initDefaultMetrics;
private initPssMetric;
private initRouteMetrics;
private mountMetricsEndpoint;
private initCacheMetrics;
private toCounter;
private initEventBusMetrics;
private initQueueMetrics;
private initWorkflowExecutionDurationMetric;
private initActiveWorkflowCountMetric;
private toLabels;
private buildWorkflowLabels;
private workflowStatisticsCache;
private getWorkflowStatistics;
private createWorkflowStatisticsGauge;
private initWorkflowStatisticsMetrics;
private initTokenExchangeMetrics;
}