diff --git a/contrib/prometheus-exporter/service-prometheus.c b/contrib/prometheus-exporter/service-prometheus.c index bad4be8ea..2dcbb9d7e 100644 --- a/contrib/prometheus-exporter/service-prometheus.c +++ b/contrib/prometheus-exporter/service-prometheus.c @@ -74,6 +74,12 @@ enum { #define PROMEX_FL_SCOPE_ALL (PROMEX_FL_SCOPE_GLOBAL|PROMEX_FL_SCOPE_FRONT|PROMEX_FL_SCOPE_BACK|PROMEX_FL_SCOPE_SERVER) +/* Promtheus metric type (gauge or counter) */ +enum promex_mt_type { + PROMEX_MT_GAUGE = 1, + PROMEX_MT_COUNTER = 2, +}; + /* The max length for metrics name. It is a hard limit but it should be * enough. */ @@ -89,6 +95,13 @@ enum { #define PROMEX_VERSION_LABEL "version=\"" HAPROXY_VERSION "\"" #define PROMEX_BUILDINFO_LABEL PROMEX_VERSION_LABEL +/* Describe a prometheus metric */ +struct promex_metric { + const struct ist n; /* The metric name */ + enum promex_mt_type type; /* The metric type (gauge or counter) */ + unsigned int flags; /* PROMEX_FL_* flags */ +}; + /* Matrix used to dump global metrics. Each metric points to the next one to be * processed or 0 to stop the dump. */ const int promex_global_metrics[INF_TOTAL_FIELDS] = {