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 
38 
44 
51 
58 
65 
78 
89 
97 
108 
121 
122 #endif // PROM_H
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
const char * prom_collector_registry_bridge(prom_collector_registry_t *self)
Returns a string in the default metric exposition format.
int prom_collector_registry_destroy(prom_collector_registry_t *self)
Destroy a collector registry.
struct prom_metric prom_metric_t
A prometheus metric.
Definition: prom_metric.h:34
int prom_collector_registry_default_init(void)
Initializes the default collector registry and enables metric collection on the executing process...
A Prometheus collector returns a collection of metrics.
prom_collector_registry_t * prom_collector_registry_new(const char *name)
Constructs a prom_collector_registry_t*.
int prom_collector_registry_enable_process_metrics(prom_collector_registry_t *self)
Enable process metrics on the given collector registry.
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_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_t * PROM_COLLECTOR_REGISTRY_DEFAULT
Initialize the default registry by calling prom_collector_registry_init within your program...
Functions for retrieving metric samples from metrics given an ordered set of labels.
int prom_collector_registry_register_metric(prom_metric_t *metric)
Registers a metric with the default collector on PROM_DEFAULT_COLLECTOR_REGISTRY. ...
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:
int prom_collector_registry_register_collector(prom_collector_registry_t *self, prom_collector_t *collector)
Register a collector with the given registry.