prometheus-client-c: promhttp/include/promhttp.h File Reference

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

Functions
promhttp.h File Reference

Provides a HTTP endpoint for metric exposition References: 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 (prom_collector_registry_t *active_registry)
| Sets the active registry for metric scraping. More...
struct MHD_Daemon * | promhttp_start_daemon (unsigned int flags, unsigned short port, MHD_AcceptPolicyCallback apc, void *apc_cls)
| Starts a daemon in the background and returns a pointer to an HMD_Daemon. More...

## 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-_002aMHD_005fAcceptPolicyCallback

## Function Documentation

## ◆ promhttp_set_active_collector_registry()

void promhttp_set_active_collector_registry | ( | prom_collector_registry_t * | active_registry | ) |

Sets the active registry for metric scraping.

Parameters

  active_registery | The target prom_collector_registry_t*. If null is passed, the default registry is used. The registry MUST be initialized.

## ◆ promhttp_start_daemon()

struct MHD_Daemon* promhttp_start_daemon | ( | unsigned int | flags,
|  | unsigned short | port,
|  | MHD_AcceptPolicyCallback | apc,
|  | void * | apc_cls
| ) |  |

Starts a daemon in the background and returns a pointer to an HMD_Daemon.

References:

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

Returns
  struct MHD_Daemon*