pub fn new_with_telemetry(callback: ThreadsafeFunction<String>, endpoint: Option<String>) -> Self {
        let javascript_cb = EventChannel::new(callback, EnvFilter::new("trace"), true);

        global::set_text_map_propagator(TraceContextPropagator::new());

        // A special parameter for Jaeger to set the service name in spans.
        let resource = Resource::new(vec![KeyValue::new("service.name", "query-engine-napi")]);
        let config = Config::default().with_resource(resource);

        let mut builder = opentelemetry_otlp::new_pipeline().with_trace_config(config);

        if let Some(endpoint) = endpoint {
            builder = builder.with_endpoint(endpoint);
        }

        let (tracer, guard) = builder.install().unwrap();

        let telemetry_layer = tracing_opentelemetry::layer().with_tracer(tracer);
        let registry = EventRegistry::new().with(telemetry_layer).with(javascript_cb);
        let with_telemetry = WithTelemetry::new(registry);

        let subscriber = Subscriber::WithTelemetry(with_telemetry);

        Self {
            subscriber,
            guard: Some(Arc::new(guard)),
        }
    }
/// Creates a new instance of a logger with the `trace` minimum level.
/// Enables tracing events to OTLP endpoint.
Creates a new instance of a logger with the `trace` minimum level.
Enables tracing events to OTLP endpoint.
Creates a new instance of a logger with the ` trace ` minimum level . Enables tracing events to OTLP endpoint .
pub fn new_with_telemetry(callback: ThreadsafeFunction<String>, endpoint: Option<String>) -> Self {
        let javascript_cb = EventChannel::new(callback, EnvFilter::new("trace"), true);
        global::set_text_map_propagator(TraceContextPropagator::new());
        // A special parameter for Jaeger to set the service name in spans.
        let resource = Resource::new(vec![KeyValue::new("service.name", "query-engine-napi")]);
        let config = Config::default().with_resource(resource);
        let mut builder = opentelemetry_otlp::new_pipeline().with_trace_config(config);
        if let Some(endpoint) = endpoint {
            builder = builder.with_endpoint(endpoint);
        }
        let (tracer, guard) = builder.install().unwrap();
        let telemetry_layer = tracing_opentelemetry::layer().with_tracer(tracer);
        let registry = EventRegistry::new().with(telemetry_layer).with(javascript_cb);
        let with_telemetry = WithTelemetry::new(registry);
        let subscriber = Subscriber::WithTelemetry(with_telemetry);
        Self {
            subscriber,
            guard: Some(Arc::new(guard)),
        }
    }
pub fn new_with_telemetry ( callback : ThreadsafeFunction < String > , endpoint : Option < String > ) -> Self { let javascript_cb = EventChannel :: new ( callback , EnvFilter :: new ( " " ) , true ) ; global :: set_text_map_propagator ( TraceContextPropagator :: new ( ) ) ; // A special parameter for Jaeger to set the service name in spans. let resource = Resource :: new ( vec ! [ KeyValue new ( " " " " ) ] ) ; let config = Config :: default ( ) . with_resource ( resource ) ; let mut builder = opentelemetry_otlp :: new_pipeline ( ) . with_trace_config ( config ) ; if let Some ( endpoint ) = endpoint { builder = builder . with_endpoint ( endpoint ) ; } let ( tracer , guard ) = builder . install ( ) . unwrap ( ) ; let telemetry_layer = tracing_opentelemetry :: layer ( ) . with_tracer ( tracer ) ; let registry = EventRegistry :: new ( ) . with ( telemetry_layer ) . with ( javascript_cb ) ; let with_telemetry = WithTelemetry :: new ( registry ) ; let subscriber = Subscriber :: WithTelemetry ( with_telemetry ) ; Self { subscriber , guard : Some ( Arc :: new ( guard ) ) , } }
Creates a new instance of a logger with the `trace` minimum level.
Creates a new instance of a logger with the ` trace ` minimum level .
callback
ThreadsafeFunction<String>
endpoint
Option<String>