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

Consider using GetHashCode in TraceIdRatioBasedSampler? #4365

Closed
pbiggar opened this issue Apr 5, 2023 · 3 comments
Closed

Consider using GetHashCode in TraceIdRatioBasedSampler? #4365

pbiggar opened this issue Apr 5, 2023 · 3 comments
Labels
Stale Issues and pull requests which have been flagged for closing due to inactivity

Comments

@pbiggar
Copy link

pbiggar commented Apr 5, 2023

I've been looking at a TraceIdRatioSampler, which has some bitwise operations to try and get a ratio from the traceID. It copies the TraceID into a span, then iterates over its lower 8 bits to get an int64.

It seems like calling GetHashCode would have the same probability distribution, and be faster?

@cijothomas
Copy link
Member

See this: open-telemetry/opentelemetry-specification#1413

I believe the current implementation is aligned with other languages, though not formally spec-ed, and changes this could have significant impact.

Copy link
Contributor

github-actions bot commented Oct 8, 2024

This issue was marked stale due to lack of activity and will be closed in 7 days. Commenting will instruct the bot to automatically remove the label. This bot runs once per day.

@github-actions github-actions bot added the Stale Issues and pull requests which have been flagged for closing due to inactivity label Oct 8, 2024
Copy link
Contributor

Closed as inactive. Feel free to reopen if this issue is still a concern.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale Issues and pull requests which have been flagged for closing due to inactivity
Projects
None yet
Development

No branches or pull requests

2 participants