syslog-ng source
stats-prometheus.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2023 László Várady
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17  *
18  * As an additional exemption you are allowed to compile & link against the
19  * OpenSSL libraries as published by the OpenSSL project. See the file
20  * COPYING for details.
21  *
22  */
23 #ifndef STATS_PROMETHEUS_H_INCLUDED
24 #define STATS_PROMETHEUS_H_INCLUDED 1
25 
26 #include "syslog-ng.h"
27 #include "stats-cluster.h"
28 
29 #define PROMETHEUS_METRIC_PREFIX "syslogng_"
30 
31 typedef void (*StatsPrometheusRecordFunc)(const char *record, gpointer user_data);
32 
33 GString *stats_prometheus_format_counter(StatsCluster *sc, gint type, StatsCounterItem *counter);
34 
35 void stats_generate_prometheus(StatsPrometheusRecordFunc process_record, gpointer user_data, gboolean with_legacy,
36  gboolean without_orphaned, gboolean *cancelled);
37 
38 #endif
void(* StatsPrometheusRecordFunc)(const char *record, gpointer user_data)
Definition: stats-prometheus.h:31
void stats_generate_prometheus(StatsPrometheusRecordFunc process_record, gpointer user_data, gboolean with_legacy, gboolean without_orphaned, gboolean *cancelled)
Definition: test-http-scraper-responder-server.c:138
GString * stats_prometheus_format_counter(StatsCluster *sc, gint type, StatsCounterItem *counter)
Definition: stats-prometheus.c:269
Definition: stats-cluster.h:155
Definition: stats-counter.h:67