C++ Actor Framework 1.0.0
|
Manages a collection of metric families. More...
#include <metric_registry.hpp>
Classes | |
struct | span_type |
Forces the compiler to use the type span<const T> instead of trying to match parameters to a span . More... | |
Public Types | |
template<class T > | |
using | span_t = typename span_type<T>::type |
Convenience alias to safe some typing. | |
Public Member Functions | |
metric_registry (const actor_system_config &cfg) | |
template<class ValueType = int64_t> | |
metric_family_impl< gauge< ValueType > > * | gauge_family (std::string_view prefix, std::string_view name, span_t< std::string_view > labels, std::string_view helptext, std::string_view unit="1", bool is_sum=false) |
Returns a gauge metric family. | |
template<class ValueType = int64_t> | |
metric_family_impl< gauge< ValueType > > * | gauge_family (std::string_view prefix, std::string_view name, std::initializer_list< std::string_view > labels, std::string_view helptext, std::string_view unit="1", bool is_sum=false) |
Returns a gauge metric family. | |
template<class ValueType = int64_t> | |
metric_family_impl< gauge< ValueType > > * | gauge_family (std::string_view prefix, std::string_view name, span_t< label_view > labels, std::string_view helptext, std::string_view unit="1", bool is_sum=false) |
Returns a gauge metric family. | |
template<class ValueType = int64_t> | |
gauge< ValueType > * | gauge_instance (std::string_view prefix, std::string_view name, span_t< label_view > labels, std::string_view helptext, std::string_view unit="1", bool is_sum=false) |
Returns a gauge. | |
template<class ValueType = int64_t> | |
gauge< ValueType > * | gauge_instance (std::string_view prefix, std::string_view name, std::initializer_list< label_view > labels, std::string_view helptext, std::string_view unit="1", bool is_sum=false) |
Returns a gauge. | |
template<class ValueType = int64_t> | |
gauge< ValueType > * | gauge_singleton (std::string_view prefix, std::string_view name, std::string_view helptext, std::string_view unit="1", bool is_sum=false) |
Returns a gauge metric singleton, i.e., the single instance of a family without label dimensions. | |
template<class ValueType = int64_t> | |
metric_family_impl< counter< ValueType > > * | counter_family (std::string_view prefix, std::string_view name, span_t< std::string_view > labels, std::string_view helptext, std::string_view unit="1", bool is_sum=false) |
Returns a counter metric family. | |
template<class ValueType = int64_t> | |
metric_family_impl< counter< ValueType > > * | counter_family (std::string_view prefix, std::string_view name, std::initializer_list< std::string_view > labels, std::string_view helptext, std::string_view unit="1", bool is_sum=false) |
Returns a counter metric family. | |
template<class ValueType = int64_t> | |
counter< ValueType > * | counter_instance (std::string_view prefix, std::string_view name, span_t< label_view > labels, std::string_view helptext, std::string_view unit="1", bool is_sum=false) |
Returns a counter. | |
template<class ValueType = int64_t> | |
counter< ValueType > * | counter_instance (std::string_view prefix, std::string_view name, std::initializer_list< label_view > labels, std::string_view helptext, std::string_view unit="1", bool is_sum=false) |
Returns a counter. | |
template<class ValueType = int64_t> | |
counter< ValueType > * | counter_singleton (std::string_view prefix, std::string_view name, std::string_view helptext, std::string_view unit="1", bool is_sum=false) |
Returns a counter metric singleton, i.e., the single instance of a family without label dimensions. | |
template<class ValueType = int64_t> | |
metric_family_impl< histogram< ValueType > > * | histogram_family (std::string_view prefix, std::string_view name, span_t< std::string_view > label_names, span_t< ValueType > default_upper_bounds, std::string_view helptext, std::string_view unit="1", bool is_sum=false) |
Returns a histogram metric family. | |
template<class ValueType = int64_t> | |
metric_family_impl< histogram< ValueType > > * | histogram_family (std::string_view prefix, std::string_view name, std::initializer_list< std::string_view > label_names, span_t< ValueType > upper_bounds, std::string_view helptext, std::string_view unit="1", bool is_sum=false) |
Returns a gauge metric family. | |
template<class ValueType = int64_t> | |
histogram< ValueType > * | histogram_instance (std::string_view prefix, std::string_view name, span_t< label_view > labels, span_t< ValueType > upper_bounds, std::string_view helptext, std::string_view unit="1", bool is_sum=false) |
Returns a histogram. | |
template<class ValueType = int64_t> | |
histogram< ValueType > * | histogram_instance (std::string_view prefix, std::string_view name, std::initializer_list< label_view > labels, span_t< ValueType > upper_bounds, std::string_view helptext, std::string_view unit="1", bool is_sum=false) |
@copdoc histogram_instance | |
template<class ValueType = int64_t> | |
histogram< ValueType > * | histogram_singleton (std::string_view prefix, std::string_view name, span_t< ValueType > upper_bounds, std::string_view helptext, std::string_view unit="1", bool is_sum=false) |
Returns a histogram metric singleton, i.e., the single instance of a family without label dimensions. | |
void | config (const settings *ptr) |
template<class Collector > | |
void | collect (Collector &collector) const |
void | merge (metric_registry &other) |
Takes ownership of all metric families in other . | |
Static Public Member Functions | |
static metric_registry * | from (actor_system &sys) |
Returns a pointer to the metric registry from the actor system. | |
Manages a collection of metric families.
metric_family_impl< counter< ValueType > > * caf::telemetry::metric_registry::counter_family | ( | std::string_view | prefix, |
std::string_view | name, | ||
span_t< std::string_view > | labels, | ||
std::string_view | helptext, | ||
std::string_view | unit = "1", | ||
bool | is_sum = false ) |
Returns a counter metric family.
Creates the family lazily if necessary, but fails if the full name already belongs to a different family.
prefix | The prefix (namespace) this family belongs to. Usually the application or protocol name, e.g., http . The prefix caf as well as prefixes starting with an underscore are reserved. |
name | The human-readable name of the metric, e.g., requests . |
labels | Names for all label dimensions of the metric. |
helptext | Short explanation of the metric. |
unit | Unit of measurement. Please use base units such as bytes or seconds (prefer lowercase). The pseudo-unit 1 identifies dimensionless counts. |
is_sum | Setting this to true indicates that this metric adds something up to a total, where only the total value is of interest. For example, the total number of HTTP requests. |
metric_family_impl< counter< ValueType > > * caf::telemetry::metric_registry::counter_family | ( | std::string_view | prefix, |
std::string_view | name, | ||
std::initializer_list< std::string_view > | labels, | ||
std::string_view | helptext, | ||
std::string_view | unit = "1", | ||
bool | is_sum = false ) |
Returns a counter metric family.
Creates the family lazily if necessary, but fails if the full name already belongs to a different family.
prefix | The prefix (namespace) this family belongs to. Usually the application or protocol name, e.g., http . The prefix caf as well as prefixes starting with an underscore are reserved. |
name | The human-readable name of the metric, e.g., requests . |
labels | Names for all label dimensions of the metric. |
helptext | Short explanation of the metric. |
unit | Unit of measurement. Please use base units such as bytes or seconds (prefer lowercase). The pseudo-unit 1 identifies dimensionless counts. |
is_sum | Setting this to true indicates that this metric adds something up to a total, where only the total value is of interest. For example, the total number of HTTP requests. |
counter< ValueType > * caf::telemetry::metric_registry::counter_instance | ( | std::string_view | prefix, |
std::string_view | name, | ||
span_t< label_view > | labels, | ||
std::string_view | helptext, | ||
std::string_view | unit = "1", | ||
bool | is_sum = false ) |
Returns a counter.
Creates all objects lazily if necessary, but fails if the full name already belongs to a different family.
prefix | The prefix (namespace) this family belongs to. Usually the application or protocol name, e.g., http . The prefix caf as well as prefixes starting with an underscore are reserved. |
name | The human-readable name of the metric, e.g., requests . |
labels | Values for all label dimensions of the metric. |
helptext | Short explanation of the metric. |
unit | Unit of measurement. Please use base units such as bytes or seconds (prefer lowercase). The pseudo-unit 1 identifies dimensionless counts. |
is_sum | Setting this to true indicates that this metric adds something up to a total, where only the total value is of interest. For example, the total number of HTTP requests. |
counter< ValueType > * caf::telemetry::metric_registry::counter_instance | ( | std::string_view | prefix, |
std::string_view | name, | ||
std::initializer_list< label_view > | labels, | ||
std::string_view | helptext, | ||
std::string_view | unit = "1", | ||
bool | is_sum = false ) |
Returns a counter.
Creates all objects lazily if necessary, but fails if the full name already belongs to a different family.
prefix | The prefix (namespace) this family belongs to. Usually the application or protocol name, e.g., http . The prefix caf as well as prefixes starting with an underscore are reserved. |
name | The human-readable name of the metric, e.g., requests . |
labels | Values for all label dimensions of the metric. |
helptext | Short explanation of the metric. |
unit | Unit of measurement. Please use base units such as bytes or seconds (prefer lowercase). The pseudo-unit 1 identifies dimensionless counts. |
is_sum | Setting this to true indicates that this metric adds something up to a total, where only the total value is of interest. For example, the total number of HTTP requests. |
counter< ValueType > * caf::telemetry::metric_registry::counter_singleton | ( | std::string_view | prefix, |
std::string_view | name, | ||
std::string_view | helptext, | ||
std::string_view | unit = "1", | ||
bool | is_sum = false ) |
Returns a counter metric singleton, i.e., the single instance of a family without label dimensions.
Creates all objects lazily if necessary, but fails if the full name already belongs to a different family.
prefix | The prefix (namespace) this family belongs to. Usually the application or protocol name, e.g., http . The prefix caf as well as prefixes starting with an underscore are reserved. |
name | The human-readable name of the metric, e.g., requests . |
helptext | Short explanation of the metric. |
unit | Unit of measurement. Please use base units such as bytes or seconds (prefer lowercase). The pseudo-unit 1 identifies dimensionless counts. |
is_sum | Setting this to true indicates that this metric adds something up to a total, where only the total value is of interest. For example, the total number of HTTP requests. |
metric_family_impl< gauge< ValueType > > * caf::telemetry::metric_registry::gauge_family | ( | std::string_view | prefix, |
std::string_view | name, | ||
span_t< label_view > | labels, | ||
std::string_view | helptext, | ||
std::string_view | unit = "1", | ||
bool | is_sum = false ) |
Returns a gauge metric family.
Creates the family lazily if necessary, but fails if the full name already belongs to a different family.
prefix | The prefix (namespace) this family belongs to. Usually the application or protocol name, e.g., http . The prefix caf as well as prefixes starting with an underscore are reserved. |
name | The human-readable name of the metric, e.g., requests . |
labels | Names for all label dimensions of the metric. |
helptext | Short explanation of the metric. |
unit | Unit of measurement. Please use base units such as bytes or seconds (prefer lowercase). The pseudo-unit 1 identifies dimensionless counts. |
is_sum | Setting this to true indicates that this metric adds something up to a total, where only the total value is of interest. For example, the total number of HTTP requests. |
metric_family_impl< gauge< ValueType > > * caf::telemetry::metric_registry::gauge_family | ( | std::string_view | prefix, |
std::string_view | name, | ||
span_t< std::string_view > | labels, | ||
std::string_view | helptext, | ||
std::string_view | unit = "1", | ||
bool | is_sum = false ) |
Returns a gauge metric family.
Creates the family lazily if necessary, but fails if the full name already belongs to a different family.
prefix | The prefix (namespace) this family belongs to. Usually the application or protocol name, e.g., http . The prefix caf as well as prefixes starting with an underscore are reserved. |
name | The human-readable name of the metric, e.g., requests . |
labels | Names for all label dimensions of the metric. |
helptext | Short explanation of the metric. |
unit | Unit of measurement. Please use base units such as bytes or seconds (prefer lowercase). The pseudo-unit 1 identifies dimensionless counts. |
is_sum | Setting this to true indicates that this metric adds something up to a total, where only the total value is of interest. For example, the total number of HTTP requests. |
metric_family_impl< gauge< ValueType > > * caf::telemetry::metric_registry::gauge_family | ( | std::string_view | prefix, |
std::string_view | name, | ||
std::initializer_list< std::string_view > | labels, | ||
std::string_view | helptext, | ||
std::string_view | unit = "1", | ||
bool | is_sum = false ) |
Returns a gauge metric family.
Creates the family lazily if necessary, but fails if the full name already belongs to a different family.
prefix | The prefix (namespace) this family belongs to. Usually the application or protocol name, e.g., http . The prefix caf as well as prefixes starting with an underscore are reserved. |
name | The human-readable name of the metric, e.g., requests . |
labels | Names for all label dimensions of the metric. |
helptext | Short explanation of the metric. |
unit | Unit of measurement. Please use base units such as bytes or seconds (prefer lowercase). The pseudo-unit 1 identifies dimensionless counts. |
is_sum | Setting this to true indicates that this metric adds something up to a total, where only the total value is of interest. For example, the total number of HTTP requests. |
gauge< ValueType > * caf::telemetry::metric_registry::gauge_instance | ( | std::string_view | prefix, |
std::string_view | name, | ||
span_t< label_view > | labels, | ||
std::string_view | helptext, | ||
std::string_view | unit = "1", | ||
bool | is_sum = false ) |
Returns a gauge.
Creates all objects lazily if necessary, but fails if the full name already belongs to a different family.
prefix | The prefix (namespace) this family belongs to. Usually the application or protocol name, e.g., http . The prefix caf as well as prefixes starting with an underscore are reserved. |
name | The human-readable name of the metric, e.g., requests . |
labels | Values for all label dimensions of the metric. |
helptext | Short explanation of the metric. |
unit | Unit of measurement. Please use base units such as bytes or seconds (prefer lowercase). The pseudo-unit 1 identifies dimensionless counts. |
is_sum | Setting this to true indicates that this metric adds something up to a total, where only the total value is of interest. For example, the total number of HTTP requests. |
gauge< ValueType > * caf::telemetry::metric_registry::gauge_instance | ( | std::string_view | prefix, |
std::string_view | name, | ||
std::initializer_list< label_view > | labels, | ||
std::string_view | helptext, | ||
std::string_view | unit = "1", | ||
bool | is_sum = false ) |
Returns a gauge.
Creates all objects lazily if necessary, but fails if the full name already belongs to a different family.
prefix | The prefix (namespace) this family belongs to. Usually the application or protocol name, e.g., http . The prefix caf as well as prefixes starting with an underscore are reserved. |
name | The human-readable name of the metric, e.g., requests . |
labels | Values for all label dimensions of the metric. |
helptext | Short explanation of the metric. |
unit | Unit of measurement. Please use base units such as bytes or seconds (prefer lowercase). The pseudo-unit 1 identifies dimensionless counts. |
is_sum | Setting this to true indicates that this metric adds something up to a total, where only the total value is of interest. For example, the total number of HTTP requests. |
gauge< ValueType > * caf::telemetry::metric_registry::gauge_singleton | ( | std::string_view | prefix, |
std::string_view | name, | ||
std::string_view | helptext, | ||
std::string_view | unit = "1", | ||
bool | is_sum = false ) |
Returns a gauge metric singleton, i.e., the single instance of a family without label dimensions.
Creates all objects lazily if necessary, but fails if the full name already belongs to a different family.
prefix | The prefix (namespace) this family belongs to. Usually the application or protocol name, e.g., http . The prefix caf as well as prefixes starting with an underscore are reserved. |
name | The human-readable name of the metric, e.g., requests . |
helptext | Short explanation of the metric. |
unit | Unit of measurement. Please use base units such as bytes or seconds (prefer lowercase). The pseudo-unit 1 identifies dimensionless counts. |
is_sum | Setting this to true indicates that this metric adds something up to a total, where only the total value is of interest. For example, the total number of HTTP requests. |
metric_family_impl< histogram< ValueType > > * caf::telemetry::metric_registry::histogram_family | ( | std::string_view | prefix, |
std::string_view | name, | ||
span_t< std::string_view > | label_names, | ||
span_t< ValueType > | default_upper_bounds, | ||
std::string_view | helptext, | ||
std::string_view | unit = "1", | ||
bool | is_sum = false ) |
Returns a histogram metric family.
Creates the family lazily if necessary, but fails if the full name already belongs to a different family.
prefix | The prefix (namespace) this family belongs to. Usually the application or protocol name, e.g., http . The prefix caf as well as prefixes starting with an underscore are reserved. |
name | The human-readable name of the metric, e.g., requests . |
label_names | Names for all label dimensions of the metric. |
default_upper_bounds | Upper bounds for the metric buckets. |
helptext | Short explanation of the metric. |
unit | Unit of measurement. Please use base units such as bytes or seconds (prefer lowercase). The pseudo-unit 1 identifies dimensionless counts. |
is_sum | Setting this to true indicates that this metric adds something up to a total, where only the total value is of interest. For example, the total number of HTTP requests. |
upper_bounds
. metric_family_impl< histogram< ValueType > > * caf::telemetry::metric_registry::histogram_family | ( | std::string_view | prefix, |
std::string_view | name, | ||
std::initializer_list< std::string_view > | label_names, | ||
span_t< ValueType > | upper_bounds, | ||
std::string_view | helptext, | ||
std::string_view | unit = "1", | ||
bool | is_sum = false ) |
Returns a gauge metric family.
Creates the family lazily if necessary, but fails if the full name already belongs to a different family.
prefix | The prefix (namespace) this family belongs to. Usually the application or protocol name, e.g., http . The prefix caf as well as prefixes starting with an underscore are reserved. |
name | The human-readable name of the metric, e.g., requests . |
labels | Names for all label dimensions of the metric. |
helptext | Short explanation of the metric. |
unit | Unit of measurement. Please use base units such as bytes or seconds (prefer lowercase). The pseudo-unit 1 identifies dimensionless counts. |
is_sum | Setting this to true indicates that this metric adds something up to a total, where only the total value is of interest. For example, the total number of HTTP requests. |
histogram< ValueType > * caf::telemetry::metric_registry::histogram_instance | ( | std::string_view | prefix, |
std::string_view | name, | ||
span_t< label_view > | labels, | ||
span_t< ValueType > | upper_bounds, | ||
std::string_view | helptext, | ||
std::string_view | unit = "1", | ||
bool | is_sum = false ) |
Returns a histogram.
Creates the family lazily if necessary, but fails if the full name already belongs to a different family.
prefix | The prefix (namespace) this family belongs to. Usually the application or protocol name, e.g., http . The prefix caf as well as prefixes starting with an underscore are reserved. |
name | The human-readable name of the metric, e.g., requests . |
labels | Names for all label dimensions of the metric. |
upper_bounds | Upper bounds for the metric buckets. |
helptext | Short explanation of the metric. |
unit | Unit of measurement. Please use base units such asbytes or seconds (prefer lowercase). The pseudo-unit 1 identifies dimensionless counts. |
is_sum | Setting this to true indicates that this metric adds something up to a total, where only the total value is of interest. For example, the total number of HTTP requests. |
upper_bounds
. histogram< ValueType > * caf::telemetry::metric_registry::histogram_singleton | ( | std::string_view | prefix, |
std::string_view | name, | ||
span_t< ValueType > | upper_bounds, | ||
std::string_view | helptext, | ||
std::string_view | unit = "1", | ||
bool | is_sum = false ) |
Returns a histogram metric singleton, i.e., the single instance of a family without label dimensions.
Creates all objects lazily if necessary, but fails if the full name already belongs to a different family.
prefix | The prefix (namespace) this family belongs to. Usually the application or protocol name, e.g., http . The prefix caf as well as prefixes starting with an underscore are reserved. |
name | The human-readable name of the metric, e.g., requests . |
helptext | Short explanation of the metric. |
unit | Unit of measurement. Please use base units such as bytes or seconds (prefer lowercase). The pseudo-unit 1 identifies dimensionless counts. |
is_sum | Setting this to true indicates that this metric adds something up to a total, where only the total value is of interest. For example, the total number of HTTP requests. |
upper_bounds
. void caf::telemetry::metric_registry::merge | ( | metric_registry & | other | ) |
Takes ownership of all metric families in other
.
other
must not contain any duplicated metric family