libprom  @VERSION@
C based libraries to expose metrics in Promtheus exposition format
prom_metric.h
Go to the documentation of this file.
1 /*
2 Copyright 2019-2020 DigitalOcean Inc.
3 Copyright 2021 Jens Elkner <jel+libprom@cs.uni-magdeburg.de>
4 
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
8 
9  http://www.apache.org/licenses/LICENSE-2.0
10 
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16 */
17 
24 #ifndef PROM_METRIC_H
25 #define PROM_METRIC_H
26 
27 #include <math.h>
28 
29 #ifdef NAN
30 #define NaN NAN
31 #else
32 #define NaN (0.0f / 0.0f)
33 #endif
34 
35 #include "prom_metric_sample.h"
37 
38 struct prom_metric;
43 typedef struct prom_metric prom_metric_t;
44 
62 pms_t *pms_from_labels(prom_metric_t *self, const char **label_values);
63 
81 pms_histogram_t *pms_histogram_from_labels(prom_metric_t *self, const char **label_values);
82 
83 #endif // PROM_METRIC_H
pms_from_labels
pms_t * pms_from_labels(prom_metric_t *self, const char **label_values)
Get a prom metric sample by label values.
prom_metric_sample.h
Functions for interfacting with metric samples directly.
prom_metric_t
struct prom_metric prom_metric_t
A prometheus metric.
Definition: prom_metric.h:43
prom_metric_sample_histogram.h
Functions for interacting with histogram metric samples directly.
pms_t
struct pms pms_t
Contains the specific metric and value given the name and label set.
Definition: prom_metric_sample.h:33
pms_histogram_from_labels
pms_histogram_t * pms_histogram_from_labels(prom_metric_t *self, const char **label_values)
Get a prom histogram metric sample by label values.
pms_histogram_t
struct pms_histogram pms_histogram_t
A histogram metric sample.
Definition: prom_metric_sample_histogram.h:30