Asterisk - The Open Source Telephony Project GIT-master-7e7a603
prometheus_internal.h
Go to the documentation of this file.
1/*
2 * Prometheus Internal API
3 *
4 * Copyright (C) 2019 Sangoma, Inc.
5 *
6 * Matt Jordan <mjordan@digium.com>
7 *
8 * See http://www.asterisk.org for more information about
9 * the Asterisk project. Please do not directly contact
10 * any of the maintainers of this project for assistance;
11 * the project provides a web site, mailing lists and IRC
12 * channels for your use.
13 *
14 * This program is free software, distributed under the terms of
15 * the GNU General Public License Version 2. See the LICENSE file
16 * at the top of the source tree.
17 */
18
19#ifndef PROMETHEUS_INTERNAL_H__
20#define PROMETHEUS_INTERNAL_H__
21
22/*!
23 * \file
24 *
25 * \brief Prometheus Metric Internal API
26 *
27 * This module provides internal APIs for res_prometheus.
28 * It should not be used outsize of that module, and should
29 * typically only provide intialization functions for units that
30 * want to register metrics / handlers with the core API.
31 */
32
33/*!
34 * \brief Retrieve the amount of time it took to perform the last scrape
35 *
36 * \details Time returned is in milliseconds
37 *
38 * \retval The scrape duration, in milliseconds
39 */
41
42/*!
43 * \brief Retrieve the timestamp when the last scrape occurred
44 *
45 * \retval The time when the last scrape occurred
46 */
47struct timeval prometheus_last_scrape_time_get(void);
48
49/*!
50 * \brief Get the raw output of what a scrape would produce
51 *
52 * \details
53 * It can be useful to dump what a scrape will look like.
54 * This function returns the raw string representation
55 * of the metrics.
56 *
57 * \retval NULL on error
58 * \retval Malloc'd ast_str on success
59 */
61
62/*!
63 * \brief Initialize CLI command
64 *
65 * \retval 0 success
66 * \retval -1 error
67 */
68int cli_init(void);
69
70/*!
71 * \brief Initialize channel metrics
72 *
73 * \retval 0 success
74 * \retval -1 error
75 */
76int channel_metrics_init(void);
77
78/*!
79 * \brief Initialize endpoint metrics
80 *
81 * \retval 0 success
82 * \retval -1 error
83 */
84int endpoint_metrics_init(void);
85
86/*!
87 * \brief Initialize bridge metrics
88 *
89 * \retval 0 success
90 * \retval -1 error
91 */
92int bridge_metrics_init(void);
93
94/*!
95 * \brief Initialize PJSIP outbound registration metrics
96 *
97 * \retval 0 success
98 * \retval -1 error
99 */
101
102#endif /* #define PROMETHEUS_INTERNAL_H__ */
int pjsip_outbound_registration_metrics_init(void)
Initialize PJSIP outbound registration metrics.
int channel_metrics_init(void)
Initialize channel metrics.
Definition: channels.c:241
struct ast_str * prometheus_scrape_to_string(void)
Get the raw output of what a scrape would produce.
struct timeval prometheus_last_scrape_time_get(void)
Retrieve the timestamp when the last scrape occurred.
int cli_init(void)
Initialize CLI command.
int64_t prometheus_last_scrape_duration_get(void)
Retrieve the amount of time it took to perform the last scrape.
int bridge_metrics_init(void)
Initialize bridge metrics.
Definition: bridges.c:206
int endpoint_metrics_init(void)
Initialize endpoint metrics.
Support for dynamic strings.
Definition: strings.h:623