Crate opentelemetry_gcloud_trace
source ·Expand description
§OpenTelemetry Google Cloud Trace Exporter
OpenTelemetry exporter implementation for Google Cloud Trace
§Performance
For optimal performance, a batch exporter is recommended as the simple exporter will export
each span synchronously on drop. You can enable the [rt-tokio
], [rt-tokio-current-thread
]
features and specify a runtime on the pipeline to have a batch exporter
configured for you automatically.
[dependencies]
opentelemetry = { version = "*", features = ["rt-tokio"] }
opentelemetry-gcloud-trace = "*"
ⓘ
let google_project_id = config_env_var("PROJECT_ID")?;
let tracer = GcpCloudTraceExporterBuilder::new(google_project_id)
.install()
.await?;
§Configuration
You can specify trace configuration using with_trace_config
:
ⓘ
GcpCloudTraceExporterBuilder::new(google_project_id).with_trace_config(
trace::config()
.with_sampler(Sampler::AlwaysOn)
.with_id_generator(RandomIdGenerator::default())
)