Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use 64 bit trace id (for wasm-unknown-emscripten target) #522

Open
wants to merge 1 commit into
base: v2.x.x-backports
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/trace/trace_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
/// let parent_id = u64::from_str_radix("00f067aa0ba902b7", 16);
///
/// assert_eq!(context.trace_id(), trace_id.unwrap());
/// assert_eq!(context.parent_id(), parent_id.ok());

Check failure on line 33 in src/trace/trace_context.rs

View workflow job for this annotation

GitHub Actions / Build and test (ubuntu-latest, stable)

mismatched types

Check failure on line 33 in src/trace/trace_context.rs

View workflow job for this annotation

GitHub Actions / Build and test (ubuntu-latest, stable)

can't compare `u64` with `u128`

Check failure on line 33 in src/trace/trace_context.rs

View workflow job for this annotation

GitHub Actions / Build and test (ubuntu-latest, nightly)

mismatched types

Check failure on line 33 in src/trace/trace_context.rs

View workflow job for this annotation

GitHub Actions / Build and test (ubuntu-latest, nightly)

can't compare `u64` with `u128`
/// assert_eq!(context.sampled(), true);
/// #
/// # Ok(()) }
Expand All @@ -39,7 +39,7 @@
pub struct TraceContext {
id: u64,
version: u8,
trace_id: u128,
trace_id: u64,
parent_id: Option<u64>,
flags: u8,
}
Expand Down Expand Up @@ -97,7 +97,7 @@
/// let parent_id = u64::from_str_radix("00f067aa0ba902b7", 16);
///
/// assert_eq!(context.trace_id(), trace_id.unwrap());
/// assert_eq!(context.parent_id(), parent_id.ok());

Check failure on line 100 in src/trace/trace_context.rs

View workflow job for this annotation

GitHub Actions / Build and test (ubuntu-latest, stable)

mismatched types

Check failure on line 100 in src/trace/trace_context.rs

View workflow job for this annotation

GitHub Actions / Build and test (ubuntu-latest, stable)

can't compare `u64` with `u128`

Check failure on line 100 in src/trace/trace_context.rs

View workflow job for this annotation

GitHub Actions / Build and test (ubuntu-latest, nightly)

mismatched types

Check failure on line 100 in src/trace/trace_context.rs

View workflow job for this annotation

GitHub Actions / Build and test (ubuntu-latest, nightly)

can't compare `u64` with `u128`
/// assert_eq!(context.sampled(), true);
/// #
/// # Ok(()) }
Expand All @@ -115,7 +115,7 @@
Ok(Some(Self {
id: rng.gen(),
version: u8::from_str_radix(parts[0], 16)?,
trace_id: u128::from_str_radix(parts[1], 16).status(400)?,
trace_id: u64::from_str_radix(parts[1], 16).status(400)?,
parent_id: Some(u64::from_str_radix(parts[2], 16).status(400)?),
flags: u8::from_str_radix(parts[3], 16).status(400)?,
}))
Expand Down Expand Up @@ -197,7 +197,7 @@
/// Return the trace id of the TraceContext.
///
/// All children will have the same `trace_id`.
pub fn trace_id(&self) -> u128 {
pub fn trace_id(&self) -> u64 {
self.trace_id
}

Expand Down
Loading