libprom  @VERSION@
C based libraries to expose metrics in Promtheus exposition format
Functions
promhttp/include/promhttp.h File Reference

Provides a HTTP endpoint for metric exposition References: * MHD_FLAG: https://www.gnu.org/software/libmicrohttpd/manual/libmicrohttpd.html#microhttpd_002dconst * MHD_AcceptPolicyCallback: https://www.gnu.org/software/libmicrohttpd/manual/libmicrohttpd.html#index-MHD_005fResult. More...

#include <string.h>
#include "microhttpd.h"
#include "prom_collector_registry.h"
Include dependency graph for promhttp.h:

Go to the source code of this file.

Functions

void promhttp_set_active_collector_registry (pcr_t *registry)
 Sets the active registry for metric scraping.
struct MHD_Daemon * promhttp_start_daemon (unsigned int flags, unsigned short port, MHD_AcceptPolicyCallback apc, void *apc_cls)
 Start a daemon in the background and return a reference to it.
void promhttp_stop_daemon (struct MHD_Daemon *daemon)
 Shutdown the given HTTP daemon.

Detailed Description

Provides a HTTP endpoint for metric exposition References: * MHD_FLAG: https://www.gnu.org/software/libmicrohttpd/manual/libmicrohttpd.html#microhttpd_002dconst * MHD_AcceptPolicyCallback: https://www.gnu.org/software/libmicrohttpd/manual/libmicrohttpd.html#index-MHD_005fResult.


Function Documentation

Sets the active registry for metric scraping.

Parameters:
registryThe target prom registry to generate the report to send in Prometheus exposition format. If NULL is passed, the default registry will be used.
Note:
The registry MUST be initialized.
struct MHD_Daemon* promhttp_start_daemon ( unsigned int  flags,
unsigned short  port,
MHD_AcceptPolicyCallback  apc,
void *  apc_cls 
) [read]

Start a daemon in the background and return a reference to it.

References: * https://www.gnu.org/software/libmicrohttpd/manual/libmicrohttpd.html#microhttpd_002dinit

Returns:
A reference to the started daemon.
void promhttp_stop_daemon ( struct MHD_Daemon *  daemon)

Shutdown the given HTTP daemon.

This is actually just a 1:1 wrapper around MHD_stop_daemon(daemon). Thus applications using just promhttp_start_daemon() and promhttp_stop_daemon() do not need to be linked against libmicrohttpd (against libpromhttp, only) and thus have only a loose/indirect dependency to libmicrohttpd, what may ease app maintenance.

Parameters:
daemonThe daemon to stop.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines