OpenTelemetry support for Google Cloud Trace
Quick start
Cargo.toml:
[]
= "0.3"
Compatibility matrix
| opentelemetry-gcloud-trace version | opentelemetry version | tracing-opentelemetry |
|---|---|---|
| 0.3 | 0.18 | 0.18 |
| 0.2 | 0.17 | 0.17 |
Example code:
use KeyValue;
use *;
use *;
let google_project_id = config_env_var?;
let tracer: Tracer =
new
.install_simple // use install_batch for production/performance reasons
.await?;
tracer.in_span;
All examples available at examples directory.
To run example use with environment variables:
# PROJECT_ID=<your-google-project-id> cargo run --example enable-exporter

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.
[]
= { = "*", = ["rt-tokio"] }
= "*"
let google_project_id = config_env_var?;
let tracer: Tracer = new
.install_batch
.await?;
Configuration
You can specify trace configuration using with_trace_config:
new.with_trace_config
Limitations
- This exporter doesn't support any other runtimes except Tokio.
Licence
Apache Software License (ASL)
Author
Abdulla Abdurakhmanov