libprom  1.2.0
C based libraries to expose metrics in Promtheus exposition format
prom_histogram.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 
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9 
10  http://www.apache.org/licenses/LICENSE-2.0
11 
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17 */
18 
24 #ifndef PROM_HISTOGRAM_INCLUDED
25 #define PROM_HISTOGRAM_INCLUDED
26 
27 #include <stdlib.h>
28 
29 #include "prom_histogram_buckets.h"
30 #include "prom_metric.h"
31 
39 
62 prom_histogram_t *prom_histogram_new(const char *name, const char *help, phb_t *buckets, size_t label_key_count, const char **label_keys);
63 
71 
83 int prom_histogram_observe(prom_histogram_t *self, double value, const char **label_values);
84 
85 #endif // PROM_HISTOGRAM_INCLUDED
prom_metric.h
Functions for retrieving metric samples from metrics given an ordered set of labels.
prom_metric_t
struct prom_metric prom_metric_t
A prometheus metric.
Definition: prom_metric.h:43
prom_histogram_new
prom_histogram_t * prom_histogram_new(const char *name, const char *help, phb_t *buckets, size_t label_key_count, const char **label_keys)
Construct a new metric of type histogram (or short: histogram)
prom_histogram_destroy
int prom_histogram_destroy(prom_histogram_t *self)
Destroy the given histogram.
prom_histogram_buckets.h
https://prometheus.io/docs/concepts/metric_types/#histogram
phb
Definition: prom_histogram_buckets.h:30
prom_histogram_observe
int prom_histogram_observe(prom_histogram_t *self, double value, const char **label_values)
Observe the given value of the given histogram with the given labels.
prom_histogram_t
prom_metric_t prom_histogram_t
Prometheus metric: histogram.
Definition: prom_histogram.h:38