prometheus-client-c: prom/include/prom_collector.h Source File

prometheus-client-c 0.1.1 Prometheus client for the C programming language

prom_collector.h
Go to the documentation of this file.
1 /*
2 Copyright 2019-2020 DigitalOcean Inc.
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15 */
16
17 #ifndef PROM_COLLECTOR_H
18 #define PROM_COLLECTOR_H
19
20 #include "prom_map.h"
21 #include "prom_metric.h"
22
32 typedef struct prom_collector prom_collector_t;
33
43 typedef prom_map_t *prom_collect_fn(prom_collector_t *self);
44
50 prom_collector_t *prom_collector_new(const char *name);
51
60 prom_collector_t *prom_collector_process_new(const char *limits_path, const char *stat_path);
61
67 int prom_collector_destroy(prom_collector_t *self);
68
73 void prom_collector_free_generic(void *gen);
74
80 int prom_collector_destroy_generic(void *gen);
81
88 int prom_collector_add_metric(prom_collector_t *self, prom_metric_t *metric);
89
98 int prom_collector_set_collect_fn(prom_collector_t *self, prom_collect_fn *fn);
99
100 #endif // PROM_COLLECTOR_H
prom_collector_t
struct prom_collector prom_collector_t
A prometheus collector calls collect to prepare metrics and return them to the registry to which it i...
Definition: prom_collector.h:32
prom_metric_t
struct prom_metric prom_metric_t
A prometheus metric.
Definition: prom_metric.h:34
prom_collector_add_metric
int prom_collector_add_metric(prom_collector_t *self, prom_metric_t *metric)
Add a metric to a collector.
prom_collector_destroy
int prom_collector_destroy(prom_collector_t *self)
Destroy a collector.
prom_collector_set_collect_fn
int prom_collector_set_collect_fn(prom_collector_t *self, prom_collect_fn *fn)
The collect function is responsible for doing any work involving a set of metrics and then returning ...
prom_collector_new
prom_collector_t * prom_collector_new(const char *name)
Create a collector.
prom_collector_free_generic
void prom_collector_free_generic(void *gen)
Frees a collector passed as a void pointer.
prom_collector_process_new
prom_collector_t * prom_collector_process_new(const char *limits_path, const char *stat_path)
Construct a prom_collector_t* which includes the default process metrics.
prom_metric.h
Functions for retrieving metric samples from metrics given an ordered set of labels.
prom_collector_destroy_generic
int prom_collector_destroy_generic(void *gen)
Destroys a collector passed as a void pointer.
prom_collect_fn
prom_map_t * prom_collect_fn(prom_collector_t *self)
The function responsible for preparing metric data and returning metrics for a given collector...
Definition: prom_collector.h:43