Tor 0.4.9.0-alpha-dev
Macros | Functions
prometheus.c File Reference

Metrics format driver for Prometheus data model. More...

#include "orconfig.h"
#include "lib/container/smartlist.h"
#include "lib/log/util_bug.h"
#include "lib/malloc/malloc.h"
#include "lib/string/printf.h"
#include "lib/metrics/prometheus.h"
#include <string.h>

Go to the source code of this file.

Functions

static const char * format_labels (smartlist_t *labels)
 
static void format_histogram (const metrics_store_entry_t *entry, buf_t *data)
 
void prometheus_format_store_entry (const metrics_store_entry_t *entry, buf_t *data, bool no_comment)
 

Detailed Description

Metrics format driver for Prometheus data model.

Definition in file prometheus.c.

Macro Definition Documentation

◆ METRICS_STORE_ENTRY_PRIVATE

#define METRICS_STORE_ENTRY_PRIVATE

Definition at line 9 of file prometheus.c.

Function Documentation

◆ format_histogram()

static void format_histogram ( const metrics_store_entry_t *  entry,
buf_t *  data 
)
static

Write the string representation of the histogram entry to the specified buffer.

Note: entry must be a histogram.

Definition at line 51 of file prometheus.c.

◆ format_labels()

static const char * format_labels ( smartlist_t labels)
static

Return a static buffer containing all the labels properly formatted for the output as a string.

Subsequent calls to this invalidates the previous result.

Definition at line 27 of file prometheus.c.

◆ prometheus_format_store_entry()

void prometheus_format_store_entry ( const metrics_store_entry_t *  entry,
buf_t *  data,
bool  no_comment 
)

Format the given entry in to the buffer data.

Definition at line 88 of file prometheus.c.

Referenced by metrics_store_get_output().