libprom @VERSION@
C based libraries to expose metrics in Promtheus exposition format
Loading...
Searching...
No Matches
prom_counter.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
18#ifndef PROM_COUNTER_H
19#define PROM_COUNTER_H
20
21#include <stdlib.h>
22
23#include "prom_metric.h"
24
37
57prom_counter_t *prom_counter_new(const char *name, const char *help, size_t label_key_count, const char **label_keys);
58
67
86int prom_counter_inc(prom_counter_t *self, const char **label_values);
87
107int prom_counter_add(prom_counter_t *self, double r_value, const char **label_values);
108
120int prom_counter_reset(prom_counter_t *self, double r_value, const char **label_values);
121
122#endif // PROM_COUNTER_H
int prom_counter_inc(prom_counter_t *self, const char **label_values)
Increment the given counter by 1.
prom_metric_t prom_counter_t
Prometheus metric: counter.
Definition prom_counter.h:36
int prom_counter_reset(prom_counter_t *self, double r_value, const char **label_values)
Reset the given counter to the given value.
prom_counter_t * prom_counter_new(const char *name, const char *help, size_t label_key_count, const char **label_keys)
Construct a new metric of type counter (or short: counter).
int prom_counter_destroy(prom_counter_t *self)
Destroys the given counter.
int prom_counter_add(prom_counter_t *self, double r_value, const char **label_values)
Add the value to the give counter.
Functions for retrieving metric samples from metrics given an ordered set of labels.
struct prom_metric prom_metric_t
A prometheus metric.
Definition prom_metric.h:43