-
Notifications
You must be signed in to change notification settings - Fork 15
feat: support disablement of APM Tracing (the product) #224
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
Conversation
33c8913 to
c65356d
Compare
ba4291a to
2b1e5a8
Compare
2b1e5a8 to
55684de
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #224 +/- ##
==========================================
+ Coverage 86.45% 86.51% +0.05%
==========================================
Files 80 82 +2
Lines 5251 5346 +95
==========================================
+ Hits 4540 4625 +85
- Misses 711 721 +10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| bool validate_trace_source(StringView source_str) { | ||
| if (source_str.size() > 2) return false; | ||
|
|
||
| auto maybe_ts_uint = parse_uint64(source_str, 10); | ||
| if (maybe_ts_uint.if_error()) return false; | ||
|
|
||
| // Bit twiddling magic is coming from | ||
| // <http://www.graphics.stanford.edu/~seander/bithacks.html> <3. | ||
| auto is_power_of_2 = [](uint64_t v) -> bool { return v && !(v & (v - 1)); }; | ||
|
|
||
| return is_power_of_2(*maybe_ts_uint); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You document that it is a bitmap, but then require that only one flag be set (that it is a power of two).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thank you. Fixed in ff2c7ea
Description
Supersede #217
Motivation
While the original approach worked, I identified a more straightforward way to reach the same goals with fewer moving parts and a clearer mental model.
Some behaviors, especially around context extraction, aren’t fully defined in the RFC yet. Rather than making assumptions, we took the opportunity to clarify and solidify these behaviors.
Reusing existing constructs and patterns makes the codebase easier to understand, test, and evolve. This rework brings the implementation closer to that goal.
Improvements (non-exhaustive)