UNPKG

@backstage/plugin-catalog-backend

Version:

The Backstage backend plugin that provides the Backstage catalog

34 lines (30 loc) 954 B
'use strict'; var promClient = require('prom-client'); function createCounterMetric(config) { let metric = promClient.register.getSingleMetric(config.name); if (!metric) { metric = new promClient.Counter(config); promClient.register.registerMetric(metric); } return metric; } function createGaugeMetric(config) { let metric = promClient.register.getSingleMetric(config.name); if (!metric) { metric = new promClient.Gauge(config); promClient.register.registerMetric(metric); } return metric; } function createSummaryMetric(config) { let metric = promClient.register.getSingleMetric(config.name); if (!metric) { metric = new promClient.Summary(config); promClient.register.registerMetric(metric); } return metric; } exports.createCounterMetric = createCounterMetric; exports.createGaugeMetric = createGaugeMetric; exports.createSummaryMetric = createSummaryMetric; //# sourceMappingURL=metrics.cjs.js.map