MCPcopy Create free account
hub / github.com/cargo-lambda/cargo-lambda / xray_layer

Function xray_layer

crates/cargo-lambda-watch/src/lib.rs:150–167  ·  view source on GitHub ↗
(config: &Watch)

Source from the content-addressed store, hash-verified

148}
149
150pub fn xray_layer<S>(config: &Watch) -> OpenTelemetryLayer<S, Tracer>
151where
152 S: Subscriber + for<'span> LookupSpan<'span>,
153{
154 global::set_text_map_propagator(XrayPropagator::default());
155
156 let builder = stdout::new_pipeline().with_trace_config(
157 trace::config()
158 .with_sampler(trace::Sampler::AlwaysOn)
159 .with_id_generator(trace::XrayIdGenerator::default()),
160 );
161 let tracer = if config.print_traces {
162 builder.install_simple()
163 } else {
164 builder.with_writer(std::io::sink()).install_simple()
165 };
166 tracing_opentelemetry::layer().with_tracer(tracer)
167}
168
169fn build_runtime_state(
170 config: &Watch,

Callers 1

run_subcommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected