Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
Loading...
Searching...
No Matches
metric_exporters.h File Reference

Metric data exporters for various monitoring and observability systems. More...

#include "../core/result_types.h"
#include "../core/error_codes.h"
#include "../interfaces/monitoring_core.h"
#include "../interfaces/monitorable_interface.h"
#include "opentelemetry_adapter.h"
#include "udp_transport.h"
#include "http_transport.h"
#include "grpc_transport.h"
#include <vector>
#include <string>
#include <memory>
#include <chrono>
#include <optional>
#include <functional>
#include <atomic>
#include <algorithm>
#include <unordered_map>
#include <sstream>
#include <regex>
#include <mutex>
#include <cctype>
#include <cstdint>
Include dependency graph for metric_exporters.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  kcenon::monitoring::metric_export_config
 Configuration for metric exporters. More...
 
struct  kcenon::monitoring::prometheus_metric_data
 Prometheus-specific metric representation. More...
 
struct  kcenon::monitoring::statsd_metric_data
 StatsD-specific metric representation. More...
 
class  kcenon::monitoring::metric_exporter_interface
 Abstract interface for metric exporters. More...
 
class  kcenon::monitoring::prometheus_exporter
 Prometheus metric exporter implementation. More...
 
class  kcenon::monitoring::statsd_exporter
 StatsD metric exporter implementation. More...
 
class  kcenon::monitoring::otlp_metrics_exporter
 OpenTelemetry Protocol (OTLP) metrics exporter implementation. More...
 
class  kcenon::monitoring::metric_exporter_factory
 Factory for creating metric exporters. More...
 

Namespaces

namespace  kcenon
 
namespace  kcenon::monitoring
 

Enumerations

enum class  kcenon::monitoring::metric_export_format {
  kcenon::monitoring::prometheus_text , kcenon::monitoring::prometheus_protobuf , kcenon::monitoring::statsd_plain , kcenon::monitoring::statsd_datadog ,
  kcenon::monitoring::otlp_grpc , kcenon::monitoring::otlp_http_json , kcenon::monitoring::otlp_http_protobuf
}
 Supported metric export formats. More...
 
enum class  kcenon::monitoring::metric_type {
  kcenon::monitoring::counter , kcenon::monitoring::gauge , kcenon::monitoring::histogram , kcenon::monitoring::summary ,
  kcenon::monitoring::timer , kcenon::monitoring::counter = 0 , kcenon::monitoring::gauge , kcenon::monitoring::histogram ,
  kcenon::monitoring::summary , kcenon::monitoring::timer , kcenon::monitoring::set
}
 Metric types supported by exporters. More...
 

Functions

std::unique_ptr< prometheus_exporterkcenon::monitoring::create_prometheus_exporter (std::uint16_t port=9090, const std::string &job_name="monitoring_system")
 Helper function to create a Prometheus exporter.
 
std::unique_ptr< statsd_exporterkcenon::monitoring::create_statsd_exporter (const std::string &host="localhost", std::uint16_t port=8125, bool datadog_format=false)
 Helper function to create a StatsD exporter.
 
std::unique_ptr< otlp_metrics_exporterkcenon::monitoring::create_otlp_metrics_exporter (const std::string &endpoint, const otel_resource &resource, metric_export_format format=metric_export_format::otlp_grpc)
 Helper function to create an OTLP metrics exporter.
 

Detailed Description

Metric data exporters for various monitoring and observability systems.

This file provides exporters for popular metric collection systems:

  • Prometheus (Pull-based metrics system with HTTP endpoint)
  • StatsD (Push-based UDP metrics aggregation system)
  • OpenTelemetry Metrics (OTLP metrics protocol)

Each exporter handles format conversion and protocol-specific transmission to the respective metrics backend.

Definition in file metric_exporters.h.