Comments (7)
Could be nice to see a before / after here to evaluate ergonomics and conversion (e.g. uuid)
Looks like currently to/from would be something like:
let trace_id: u128 = 0x4bf9_2f35_77b3_4da6_a3ce_929d_0e0e_4736;
// From str
assert_eq!(u128::from_str_radix("4bf92f3577b34da6a3ce929d0e0e4736", 16), Ok(trace_id));
// To str
assert_eq!(format!("{:032x}", trace_id).as_str(), "4bf92f3577b34da6a3ce929d0e0e4736");
// From / to uuid
assert_eq!(uuid::Uuid::from_u128(trace_id).as_u128(), trace_id);
from opentelemetry-rust.
It's worth mentioning that B3 headers support 128 bit trace IDs where most other propagators are limited to 64 bits. The full trace ID needs to be preserved if received and then propagated via B3 headers but can be truncated to 64 bits (lower significant bits) for other propagators.
Some implementations use a byte array (like Go) to manage a single 64 or 128 bit id, others maintain the original trace ID as a string and a uint64 for the truncated 64 bit part (eg .NET).
from opentelemetry-rust.
@MikeGoldsmith great point, is there a list of propagators that otel impls should support? Seems 64 bit traces are typically older versions?
from opentelemetry-rust.
I think B3 should be good enough for now. Vendor specific propagators can come later, and as long as we have both 128 and 64 bit IDs, we should be good 👍
from opentelemetry-rust.
Hm well we currently support b3 the same way that the go impl does, and it looks like they require 128 bits? could be 0 padded but that works with u128 just the same? https://github.com/open-telemetry/opentelemetry-go/blob/a9756528bada550d81d668a2536a4e0788faa5c4/api/core/span_context.go#L88-L90
from opentelemetry-rust.
B3 and W3C Trace-Context, which is 128-bit and should be the default.
from opentelemetry-rust.
Closing this for now, can re-open if there is renewed interest.
from opentelemetry-rust.
Related Issues (20)
- Flaky test HOT 10
- [Bug]: incorrect docs on SdkMeterProvider.builder() HOT 2
- Flaky test in CI HOT 4
- [Bug]: PeriodicReader uses sync::Mutex.
- AttributeSet in the OpenTelemetry API HOT 4
- [Bug]: constructing a tonic builder defaults to connect to 4318? HOT 6
- Add Testing for Shutdown Scenarios. HOT 2
- ObservableCounter aggregation bug for cumulative
- [Feature]: remove the grpcio gRPC backend HOT 1
- Instrumentation scope - move to builder pattern? HOT 4
- [Feature]: Move `SpanLimits` to `opentelemetry` and use the limits in `SpanBuilder` HOT 3
- Prepare opentelemetry-prometheus for new protobuf version. HOT 5
- Use parameterization to simplify tests HOT 5
- Regulating our MSRV HOT 5
- Prometheus exporter dependency HOT 1
- Flaky test HOT 1
- [Bug]: missing attributes in prometheus exporter HOT 4
- Memory optimization for metric datapoints HOT 8
- OpenTelemetry Tracing API vs Tokio-Tracing API for Distributed Tracing HOT 3
- Overview of Major blockers for GA/Stable Release
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opentelemetry-rust.