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