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

Internal: Add span events native serialization #4218

Merged
merged 2 commits into from
Dec 11, 2024
Merged

Conversation

marcotc
Copy link
Member

@marcotc marcotc commented Dec 11, 2024

Add native serialization for the Datadog::Tracing::SpanEvent object, when serialized as MessagePack.

This code disabled today, through the native_events_supported variable, so this PR is just adding the serialization code that will be activated in a future PR.

Change log entry
None

Additional Notes:

I've also changed the returned keys from to_hash to have String keys, instead of Symbols from before, because both the MessagePack and JSON serialization will convert all this Symbols to Strings immediately. Making this change avoids an unnecessary Symbol -> String conversion.

How to test the change?
All changes are tested, as well as some improved testing for existing Span Events methods.

@marcotc marcotc requested a review from a team as a code owner December 11, 2024 02:46
@marcotc marcotc self-assigned this Dec 11, 2024
@datadog-datadog-prod-us1
Copy link
Contributor

datadog-datadog-prod-us1 bot commented Dec 11, 2024

Datadog Report

Branch report: span-events-native
Commit report: f79fd65
Test service: dd-trace-rb

✅ 0 Failed, 22112 Passed, 1458 Skipped, 5m 47.08s Total Time

@pr-commenter
Copy link

pr-commenter bot commented Dec 11, 2024

Benchmarks

Benchmark execution time: 2024-12-11 20:21:27

Comparing candidate commit afce240 in PR branch span-events-native with baseline commit b985e32 in branch master.

Found 0 performance improvements and 1 performance regressions! Performance is the same for 30 metrics, 2 unstable metrics.

scenario:profiler - sample timeline=false

  • 🟥 throughput [-0.349op/s; -0.341op/s] or [-7.248%; -7.076%]

@codecov-commenter
Copy link

codecov-commenter commented Dec 11, 2024

Codecov Report

Attention: Patch coverage is 93.07692% with 9 lines in your changes missing coverage. Please review.

Project coverage is 97.76%. Comparing base (b985e32) to head (afce240).
Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
lib/datadog/tracing/span_event.rb 88.52% 7 Missing ⚠️
...tadog/tracing/transport/serializable_trace_spec.rb 92.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master    #4218    +/-   ##
========================================
  Coverage   97.75%   97.76%            
========================================
  Files        1357     1357            
  Lines       82130    82238   +108     
  Branches     4174     4205    +31     
========================================
+ Hits        80288    80398   +110     
+ Misses       1842     1840     -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@p-datadog p-datadog added the dev/internal Other internal work that does not need to be included in the changelog label Dec 11, 2024
@marcotc marcotc merged commit 43498ff into master Dec 11, 2024
339 checks passed
@marcotc marcotc deleted the span-events-native branch December 11, 2024 22:15
@github-actions github-actions bot added this to the 2.9.0 milestone Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev/internal Other internal work that does not need to be included in the changelog tracing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants