Created
October 6, 2022 08:36
-
-
Save tomerguttman/dd2995dea3f88bb17350c76f0f3de99f to your computer and use it in GitHub Desktop.
Prometheus counters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Prometheus = require('prom-client'); | |
const reportsStartedCounter = Prometheus.register.getSingleMetric(prometheusConfig.METRIC_NAMES.REPORTS_STARTED_FLOW_COUNTER) || | |
new Prometheus.Counter({ | |
name: prometheusConfig.METRIC_NAMES.REPORTS_STARTED_FLOW_COUNTER, | |
labelNames: ['report_type', 'is_scheduled'], | |
help: 'Reports that are actually being generated' | |
}); | |
function incReportsStartedCounter(reportType, isScheduled) { | |
reportsStartedCounter.inc({ report_type: reportType, is_scheduled: isScheduled }); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment