UNPKG

@reportfy/apm

Version:

Pacote para utilização de apm do reportfy.com.br

35 lines 1.67 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.totalHttpRequestDuration = exports.totalHttpRequestIntegrationDuration = exports.totalHttpRequestIntegrationCount = exports.eventErrorCount = exports.totalHttpRequestCount = exports.metricsReportfy = void 0; var prom_client_1 = require("prom-client"); (0, prom_client_1.collectDefaultMetrics)({}); var metricsReportfy = function () { return prom_client_1.register.metrics(); }; exports.metricsReportfy = metricsReportfy; var httpMetricsLabelNames = ['method', 'path', 'body', 'headers', 'statusCode', 'error']; var errorMetricsLabelNames = ['origin', 'message', 'stack', 'type']; exports.totalHttpRequestCount = new prom_client_1.Counter({ name: 'nodejs_http_total_count_input', help: 'total request number', labelNames: httpMetricsLabelNames }); exports.eventErrorCount = new prom_client_1.Counter({ name: 'nodejs_error_stack_count', help: 'total error number', labelNames: errorMetricsLabelNames }); exports.totalHttpRequestIntegrationCount = new prom_client_1.Counter({ name: 'nodejs_http_total_count_integration', help: 'total request number', labelNames: httpMetricsLabelNames }); exports.totalHttpRequestIntegrationDuration = new prom_client_1.Counter({ name: 'nodejs_http_total_count_integration_duration', help: 'total request number', labelNames: httpMetricsLabelNames }); exports.totalHttpRequestDuration = new prom_client_1.Gauge({ name: 'nodejs_http_total_input_duration', help: 'the last duration or response time of last request', labelNames: httpMetricsLabelNames }); //# sourceMappingURL=prometheus.js.map