Add (optional) OpenTelemetry + Xray integration (#95) (#96)

This introduces all the necessary code to be able to send traces to
AWS Xray via `tracing-opentelemetry`. It can be optionally enabled
using the `xray` feature defined on this crate.

Also update the README.md with instructions on how to enable and use
this.
This commit is contained in:
Bryan Garza
2022-05-18 09:13:19 -07:00
committed by GitHub
parent 4b4ecf0310
commit 6cd697afe9
4 changed files with 106 additions and 6 deletions

View File

@@ -24,13 +24,25 @@ path = "src/bin/server.rs"
async-stream = "0.3.0"
atoi = "0.3.2"
bytes = "1"
rand = "0.8.5"
structopt = "0.3.14"
tokio = { version = "1", features = ["full"] }
tokio-stream = "0.1"
tracing = "0.1.13"
tracing = "0.1.34"
tracing-futures = { version = "0.2.3" }
tracing-subscriber = "0.2.2"
tracing-subscriber = { version = "0.3.11", features = ["env-filter"] }
# Implements the types defined in the OTel spec
opentelemetry = { version = "0.17.0", optional = true }
# Integration between the tracing crate and the opentelemetry crate
tracing-opentelemetry = { version = "0.17.2", optional = true }
# Provides a "propagator" to pass along an XrayId across services
opentelemetry-aws = { version = "0.5.0", optional = true }
# Allows you to send data to the OTel collector
opentelemetry-otlp = { version = "0.10.0", optional = true }
[dev-dependencies]
# Enable test-utilities in dev mode only. This is mostly for tests.
tokio = { version = "1", features = ["test-util"] }
[features]
otel = ["dep:opentelemetry", "dep:tracing-opentelemetry", "dep:opentelemetry-aws", "dep:opentelemetry-otlp"]