mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 01:27:31 +08:00
feat(traces): add support for aws xray (#1194)
This commit is contained in:
@ -99,6 +99,8 @@ pub struct LogTelemetry {
|
||||
pub otel_exporter_otlp_endpoint: Option<String>,
|
||||
/// Timeout (in milliseconds) for sending metrics and traces.
|
||||
pub otel_exporter_otlp_timeout: Option<u64>,
|
||||
/// Whether to use xray ID generator, (enable this if you plan to use AWS-XRAY)
|
||||
pub use_xray_generator: bool,
|
||||
}
|
||||
|
||||
/// Telemetry / tracing.
|
||||
|
||||
@ -134,7 +134,7 @@ fn setup_tracing_pipeline(
|
||||
{
|
||||
global::set_text_map_propagator(TraceContextPropagator::new());
|
||||
|
||||
let trace_config = trace::config()
|
||||
let mut trace_config = trace::config()
|
||||
.with_sampler(trace::Sampler::TraceIdRatioBased(
|
||||
config.sampling_rate.unwrap_or(1.0),
|
||||
))
|
||||
@ -142,6 +142,9 @@ fn setup_tracing_pipeline(
|
||||
"service.name",
|
||||
service_name,
|
||||
)]));
|
||||
if config.use_xray_generator {
|
||||
trace_config = trace_config.with_id_generator(trace::XrayIdGenerator::default());
|
||||
}
|
||||
let traces_layer_result = opentelemetry_otlp::new_pipeline()
|
||||
.tracing()
|
||||
.with_exporter(get_opentelemetry_exporter(config))
|
||||
|
||||
Reference in New Issue
Block a user