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

prom_collector_registry.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
22 #ifndef PROM_REGISTRY_H
23 #define PROM_REGISTRY_H
24
25 #include "prom_collector.h"
26 #include "prom_metric.h"
27
31 typedef struct prom_collector_registry prom_collector_registry_t;
32
37 extern prom_collector_registry_t *PROM_COLLECTOR_REGISTRY_DEFAULT;
38
43 int prom_collector_registry_default_init(void);
44
50 prom_collector_registry_t *prom_collector_registry_new(const char *name);
51
57 int prom_collector_registry_destroy(prom_collector_registry_t *self);
58
64 int prom_collector_registry_enable_process_metrics(prom_collector_registry_t *self);
65
77 prom_metric_t *prom_collector_registry_must_register_metric(prom_metric_t *metric);
78
88 int prom_collector_registry_register_metric(prom_metric_t *metric);
89
96 int prom_collector_registry_register_collector(prom_collector_registry_t *self, prom_collector_t *collector);
97
107 const char *prom_collector_registry_bridge(prom_collector_registry_t *self);
108
120 int prom_collector_registry_validate_metric_name(prom_collector_registry_t *self, const char *metric_name);
121
122 #endif // PROM_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_collector_registry_bridge
const char * prom_collector_registry_bridge(prom_collector_registry_t *self)
Returns a string in the default metric exposition format.
prom_collector_registry_destroy
int prom_collector_registry_destroy(prom_collector_registry_t *self)
Destroy a collector registry.
prom_metric_t
struct prom_metric prom_metric_t
A prometheus metric.
Definition: prom_metric.h:34
prom_collector_registry_default_init
int prom_collector_registry_default_init(void)
Initializes the default collector registry and enables metric collection on the executing process...
prom_collector.h
A Prometheus collector returns a collection of metrics.
prom_collector_registry_new
prom_collector_registry_t * prom_collector_registry_new(const char *name)
Constructs a prom_collector_registry_t*.
prom_collector_registry_enable_process_metrics
int prom_collector_registry_enable_process_metrics(prom_collector_registry_t *self)
Enable process metrics on the given collector registry.
prom_collector_registry_t
struct prom_collector_registry prom_collector_registry_t
A prom_registry_t is responsible for registering metrics and briding them to the string exposition fo...
Definition: prom_collector_registry.h:31
prom_collector_registry_must_register_metric
prom_metric_t * prom_collector_registry_must_register_metric(prom_metric_t *metric)
Registers a metric with the default collector on PROM_DEFAULT_COLLECTOR_REGISTRY. ...
PROM_COLLECTOR_REGISTRY_DEFAULT
prom_collector_registry_t * PROM_COLLECTOR_REGISTRY_DEFAULT
Initialize the default registry by calling prom_collector_registry_init within your program...
prom_metric.h
Functions for retrieving metric samples from metrics given an ordered set of labels.
prom_collector_registry_register_metric
int prom_collector_registry_register_metric(prom_metric_t *metric)
Registers a metric with the default collector on PROM_DEFAULT_COLLECTOR_REGISTRY. ...
prom_collector_registry_validate_metric_name
int prom_collector_registry_validate_metric_name(prom_collector_registry_t *self, const char *metric_name)
Validates that the given metric name complies with the specification:
prom_collector_registry_register_collector
int prom_collector_registry_register_collector(prom_collector_registry_t *self, prom_collector_t *collector)
Register a collector with the given registry.