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

DEBUG-2334 add new_record flag to ActiveRecord model custom serializer #4165

Merged
merged 3 commits into from
Nov 27, 2024

Conversation

p-datadog
Copy link
Member

What does this PR do?
Dynamic Instrumentation ships with a custom serializer for ActiveRecord models which lifts the interesting fields (i.e. attributes) to the top level of the serialized object.

This PR adds the new_record? flag to the serialized object.

Motivation:
The current rendering of AR models in dynamic instrumentation UI is somewhat "weird" because the attributes are nested under the "attributes" field, but there are no other fields. It's confusing why the attributes aren't just rendered on the top level.

Adding the new_record flag, in my opinion, improves the UI to where it looks more polished and doesn't look like something is wrong with it.

Change log entry
None (part of initial DI release)

Additional Notes:

How to test the change?

Unit tests are included

@p-datadog p-datadog requested a review from a team as a code owner November 26, 2024 17:12
@pr-commenter
Copy link

pr-commenter bot commented Nov 26, 2024

Benchmarks

Benchmark execution time: 2024-11-26 17:59:27

Comparing candidate commit 35b0afd in PR branch di-ar-new-record with baseline commit ce4393e in branch master.

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

scenario:profiler - sample timeline=false

  • 🟩 throughput [+0.588op/s; +0.597op/s] or [+9.887%; +10.041%]

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.78%. Comparing base (ce4393e) to head (35b0afd).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4165   +/-   ##
=======================================
  Coverage   97.78%   97.78%           
=======================================
  Files        1353     1353           
  Lines       81817    81818    +1     
  Branches     4145     4145           
=======================================
+ Hits        80001    80008    +7     
+ Misses       1816     1810    -6     

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

@p-datadog p-datadog merged commit 0e6590d into master Nov 27, 2024
290 checks passed
@p-datadog p-datadog deleted the di-ar-new-record branch November 27, 2024 15:20
@github-actions github-actions bot added this to the 2.8.0 milestone Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants