Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
Loading...
Searching...
No Matches
kcenon::monitoring::metric_exporter_factory Class Reference

Factory for creating metric exporters. More...

#include <metric_exporters.h>

Collaboration diagram for kcenon::monitoring::metric_exporter_factory:
Collaboration graph

Static Public Member Functions

static std::unique_ptr< metric_exporter_interfacecreate_exporter (const metric_export_config &config, const otel_resource &resource=create_service_resource("monitoring_system", "2.0.0"))
 Create a metric exporter based on format.
 
static std::vector< metric_export_formatget_supported_formats (const std::string &backend)
 Get supported formats for a specific backend.
 

Detailed Description

Factory for creating metric exporters.

Definition at line 1100 of file metric_exporters.h.

Member Function Documentation

◆ create_exporter()

static std::unique_ptr< metric_exporter_interface > kcenon::monitoring::metric_exporter_factory::create_exporter ( const metric_export_config & config,
const otel_resource & resource = create_service_resource("monitoring_system", "2.0.0") )
inlinestatic

Create a metric exporter based on format.

Definition at line 1105 of file metric_exporters.h.

1107 {
1108
1109 switch (config.format) {
1112 return std::make_unique<prometheus_exporter>(config);
1113
1116 return std::make_unique<statsd_exporter>(config);
1117
1121 return std::make_unique<otlp_metrics_exporter>(config, resource);
1122
1123 default:
1124 return nullptr;
1125 }
1126 }
@ prometheus_protobuf
Prometheus protocol buffers format.
@ statsd_plain
StatsD plain UDP format.
@ otlp_grpc
OTLP gRPC metrics protocol.
@ statsd_datadog
StatsD DataDog extension format.
@ prometheus_text
Prometheus text exposition format.
@ otlp_http_json
OTLP HTTP JSON metrics protocol.
@ otlp_http_protobuf
OTLP HTTP Protocol Buffers metrics.

References kcenon::monitoring::metric_export_config::format, kcenon::monitoring::otlp_grpc, kcenon::monitoring::otlp_http_json, kcenon::monitoring::otlp_http_protobuf, kcenon::monitoring::prometheus_protobuf, kcenon::monitoring::prometheus_text, kcenon::monitoring::statsd_datadog, and kcenon::monitoring::statsd_plain.

Referenced by TEST_F().

Here is the caller graph for this function:

◆ get_supported_formats()

static std::vector< metric_export_format > kcenon::monitoring::metric_exporter_factory::get_supported_formats ( const std::string & backend)
inlinestatic

Get supported formats for a specific backend.

Definition at line 1131 of file metric_exporters.h.

1131 {
1132 if (backend == "prometheus") {
1134 } else if (backend == "statsd") {
1136 } else if (backend == "otlp") {
1139 }
1140 return {};
1141 }

References kcenon::monitoring::otlp_grpc, kcenon::monitoring::otlp_http_json, kcenon::monitoring::otlp_http_protobuf, kcenon::monitoring::prometheus_protobuf, kcenon::monitoring::prometheus_text, kcenon::monitoring::statsd_datadog, and kcenon::monitoring::statsd_plain.

Referenced by TEST_F().

Here is the caller graph for this function:

The documentation for this class was generated from the following file: