LCOV - code coverage report
Current view: top level - source/extensions/tracers/dynamic_ot - config.cc (source / functions) Hit Total Coverage
Test: coverage.dat Lines: 1 10 10.0 %
Date: 2024-01-05 06:35:25 Functions: 1 2 50.0 %

          Line data    Source code
       1             : #include "source/extensions/tracers/dynamic_ot/config.h"
       2             : 
       3             : #include "envoy/config/trace/v3/dynamic_ot.pb.h"
       4             : #include "envoy/config/trace/v3/dynamic_ot.pb.validate.h"
       5             : #include "envoy/registry/registry.h"
       6             : 
       7             : #include "source/common/common/utility.h"
       8             : #include "source/extensions/tracers/dynamic_ot/dynamic_opentracing_driver_impl.h"
       9             : 
      10             : namespace Envoy {
      11             : namespace Extensions {
      12             : namespace Tracers {
      13             : namespace DynamicOt {
      14             : 
      15             : DynamicOpenTracingTracerFactory::DynamicOpenTracingTracerFactory()
      16           2 :     : FactoryBase("envoy.tracers.dynamic_ot") {}
      17             : 
      18             : Tracing::DriverSharedPtr DynamicOpenTracingTracerFactory::createTracerDriverTyped(
      19             :     const envoy::config::trace::v3::DynamicOtConfig& proto_config,
      20           0 :     Server::Configuration::TracerFactoryContext& context) {
      21           0 :   const std::string& library = proto_config.library();
      22           0 :   const ProtobufWkt::Struct& config_struct = proto_config.config();
      23           0 :   absl::StatusOr<std::string> json_or_error = MessageUtil::getJsonStringFromMessage(config_struct);
      24           0 :   ENVOY_BUG(json_or_error.ok(), "Failed to parse json");
      25           0 :   const std::string config = json_or_error.ok() ? json_or_error.value() : "";
      26           0 :   return std::make_shared<DynamicOpenTracingDriver>(context.serverFactoryContext().scope(), library,
      27           0 :                                                     config);
      28           0 : }
      29             : 
      30             : /**
      31             :  * Static registration for the dynamic opentracing tracer. @see RegisterFactory.
      32             :  */
      33             : LEGACY_REGISTER_FACTORY(DynamicOpenTracingTracerFactory, Server::Configuration::TracerFactory,
      34             :                         "envoy.dynamic.ot");
      35             : 
      36             : } // namespace DynamicOt
      37             : } // namespace Tracers
      38             : } // namespace Extensions
      39             : } // namespace Envoy

Generated by: LCOV version 1.15