|
Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
|
Zipkin trace exporter implementation. More...
#include <trace_exporters.h>


Public Member Functions | |
| zipkin_exporter (const trace_export_config &config) | |
| zipkin_exporter (const trace_export_config &config, std::unique_ptr< http_transport > transport) | |
| zipkin_span_data | convert_span (const trace_span &span) const |
| Convert internal span to Zipkin format. | |
| common::VoidResult | export_spans (const std::vector< trace_span > &spans) override |
| Export a batch of spans. | |
| common::VoidResult | flush () override |
| Flush any pending spans. | |
| common::VoidResult | shutdown () override |
| Shutdown the exporter. | |
| std::unordered_map< std::string, std::size_t > | get_stats () const override |
| Get exporter statistics. | |
Public Member Functions inherited from kcenon::monitoring::trace_exporter_interface | |
| virtual | ~trace_exporter_interface ()=default |
Private Member Functions | |
| common::VoidResult | send_json_batch (const std::vector< zipkin_span_data > &spans) |
| common::VoidResult | send_protobuf_batch (const std::vector< zipkin_span_data > &spans) |
| common::VoidResult | send_with_retry (const http_request &request) |
Private Attributes | |
| trace_export_config | config_ |
| std::unique_ptr< http_transport > | transport_ |
| std::atomic< std::size_t > | exported_spans_ {0} |
| std::atomic< std::size_t > | failed_exports_ {0} |
| std::atomic< std::size_t > | dropped_spans_ {0} |
| std::size_t | max_retries_ {3} |
| std::chrono::milliseconds | base_retry_delay_ {100} |
Zipkin trace exporter implementation.
Supports JSON v2 and Protocol Buffers formats. Default endpoint: /api/v2/spans
Definition at line 464 of file trace_exporters.h.
|
inlineexplicit |
Definition at line 475 of file trace_exporters.h.
|
inline |
Definition at line 478 of file trace_exporters.h.
|
inline |
Convert internal span to Zipkin format.
Definition at line 484 of file trace_exporters.h.
References config_, kcenon::monitoring::zipkin_span_data::duration, kcenon::monitoring::trace_span::end_time, kcenon::monitoring::zipkin_span_data::kind, kcenon::monitoring::zipkin_span_data::local_endpoint_service_name, kcenon::monitoring::zipkin_span_data::name, kcenon::monitoring::trace_span::operation_name, kcenon::monitoring::zipkin_span_data::parent_id, kcenon::monitoring::trace_span::parent_span_id, kcenon::monitoring::trace_export_config::service_name, kcenon::monitoring::trace_span::service_name, kcenon::monitoring::trace_span::span_id, kcenon::monitoring::zipkin_span_data::span_id, kcenon::monitoring::trace_span::start_time, kcenon::monitoring::trace_span::tags, kcenon::monitoring::zipkin_span_data::tags, kcenon::monitoring::zipkin_span_data::timestamp, kcenon::monitoring::trace_span::trace_id, and kcenon::monitoring::zipkin_span_data::trace_id.
Referenced by export_spans(), and TEST_F().

|
inlineoverridevirtual |
Export a batch of spans.
Implements kcenon::monitoring::trace_exporter_interface.
Definition at line 517 of file trace_exporters.h.
References config_, convert_span(), exported_spans_, failed_exports_, kcenon::monitoring::trace_export_config::format, kcenon::monitoring::invalid_configuration, kcenon::monitoring::operation_failed, send_json_batch(), send_protobuf_batch(), kcenon::monitoring::error_info::to_common_error(), kcenon::monitoring::zipkin_json, and kcenon::monitoring::zipkin_protobuf.
Referenced by TEST_F(), and TEST_F().


|
inlineoverridevirtual |
Flush any pending spans.
Implements kcenon::monitoring::trace_exporter_interface.
Definition at line 553 of file trace_exporters.h.
Referenced by shutdown(), and TEST_F().

|
inlineoverridevirtual |
Get exporter statistics.
Implements kcenon::monitoring::trace_exporter_interface.
Definition at line 562 of file trace_exporters.h.
References dropped_spans_, exported_spans_, and failed_exports_.
Referenced by TEST_F().

|
inlineprivate |
Definition at line 571 of file trace_exporters.h.
References kcenon::monitoring::http_request::body, config_, kcenon::monitoring::trace_export_config::endpoint, kcenon::monitoring::http_request::headers, kcenon::monitoring::trace_export_config::headers, kcenon::monitoring::http_request::method, send_with_retry(), kcenon::monitoring::http_request::timeout, kcenon::monitoring::trace_export_config::timeout, and kcenon::monitoring::http_request::url.
Referenced by export_spans().


|
inlineprivate |
Definition at line 600 of file trace_exporters.h.
References kcenon::monitoring::http_request::body, config_, kcenon::monitoring::trace_export_config::endpoint, kcenon::monitoring::http_request::headers, kcenon::monitoring::trace_export_config::headers, kcenon::monitoring::http_request::method, send_with_retry(), kcenon::monitoring::http_request::timeout, kcenon::monitoring::trace_export_config::timeout, and kcenon::monitoring::http_request::url.
Referenced by export_spans().


|
inlineprivate |
Definition at line 621 of file trace_exporters.h.
References base_retry_delay_, kcenon::monitoring::delay, max_retries_, kcenon::monitoring::operation_failed, kcenon::monitoring::error_info::to_common_error(), and transport_.
Referenced by send_json_batch(), and send_protobuf_batch().


|
inlineoverridevirtual |
Shutdown the exporter.
Implements kcenon::monitoring::trace_exporter_interface.
Definition at line 558 of file trace_exporters.h.
References flush().
Referenced by TEST_F().


|
private |
|
private |
Definition at line 466 of file trace_exporters.h.
Referenced by convert_span(), export_spans(), send_json_batch(), and send_protobuf_batch().
|
private |
|
private |
Definition at line 468 of file trace_exporters.h.
Referenced by export_spans(), and get_stats().
|
private |
Definition at line 469 of file trace_exporters.h.
Referenced by export_spans(), and get_stats().
|
private |
|
private |
Definition at line 467 of file trace_exporters.h.
Referenced by send_with_retry().