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

Add cache_key.enabled option for ActiveSupport #4022

Merged
merged 3 commits into from
Dec 17, 2024

Conversation

bouwkast
Copy link
Contributor

@bouwkast bouwkast commented Oct 23, 2024

Change log entry

Adds a new option for ActiveSupport to disable adding the cache_key as a Span Tag with the cache_key_enabled option.

What does this PR do?

  • Adds cache_key.enabled to ActiveSupport (defaults to true)
  • When cache_key.enabled is false it will no longer set the cache_key as a Span Tag

Motivation:

Customer feature request #4017

Additional Notes:

I have basic grasp on Ruby.
An alternative here is to obfuscate/quantize cache_key values when we add them, the issue here is I'm not entirely sure what these values would look like and if they'd be valuable if they were obfuscated/quantized.

How to test the change?

Unsure? Have a question? Request a review!

@pr-commenter
Copy link

pr-commenter bot commented Oct 23, 2024

Benchmarks

Benchmark execution time: 2024-11-29 20:06:00

Comparing candidate commit 3c24e29 in PR branch steven/activesupport-cachekey-config with baseline commit 28675b6 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.479op/s; -0.469op/s] or [-7.318%; -7.164%]

@bouwkast bouwkast force-pushed the steven/activesupport-cachekey-config branch from 8049a04 to e8188fc Compare October 23, 2024 15:36
Copy link
Member

@marcotc marcotc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Clean and well tested 👍

I thing that is missing is the public facing documentation, at https://github.com/DataDog/dd-trace-rb/blob/master/docs/GettingStarted.md#active-support.

@ivoanjo
Copy link
Member

ivoanjo commented Oct 24, 2024

(I guess this is related to #4017 ?)

@bouwkast
Copy link
Contributor Author

(I guess this is related to #4017 ?)

Yes it is @ivoanjo! I posted in the slack channel some context surrounding this

I didn't link to it yet as this was just a draft and was waiting to determine whether or not this is something acceptable to do within the Ruby Datadog SDK or if the expected solution would be to add obfuscation rules to this.

Copy link
Contributor

@delner delner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall the implementation is clean! I do have one suggestion for the public API, I think should be weighed before we merge.

@bouwkast bouwkast force-pushed the steven/activesupport-cachekey-config branch from 45ef5e6 to d90c4f7 Compare November 27, 2024 18:18
@github-actions github-actions bot added integrations Involves tracing integrations tracing labels Nov 27, 2024
@datadog-datadog-prod-us1
Copy link
Contributor

datadog-datadog-prod-us1 bot commented Nov 27, 2024

Datadog Report

Branch report: steven/activesupport-cachekey-config
Commit report: 3c24e29
Test service: dd-trace-rb

✅ 0 Failed, 22050 Passed, 1461 Skipped, 5m 23.17s Total Time

@codecov-commenter
Copy link

codecov-commenter commented Nov 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.75%. Comparing base (28675b6) to head (3c24e29).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4022      +/-   ##
==========================================
- Coverage   97.76%   97.75%   -0.01%     
==========================================
  Files        1351     1351              
  Lines       81733    81845     +112     
  Branches     4147     4150       +3     
==========================================
+ Hits        79904    80009     +105     
- Misses       1829     1836       +7     

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

@bouwkast bouwkast force-pushed the steven/activesupport-cachekey-config branch from d90c4f7 to 2933c34 Compare November 27, 2024 21:39
@bouwkast bouwkast changed the title Add cache_key_enabled option for ActiveSupport Add cache_key.enabled option for ActiveSupport Nov 27, 2024
@bouwkast bouwkast marked this pull request as ready for review November 27, 2024 21:39
@bouwkast bouwkast requested a review from a team as a code owner November 27, 2024 21:39
@DataDog DataDog deleted a comment from datadog-datadog-prod-us1 bot Nov 29, 2024
@marcotc marcotc enabled auto-merge November 29, 2024 19:27
@ivoanjo
Copy link
Member

ivoanjo commented Dec 9, 2024

Hey @bouwkast thoughts on merging this in? Looks like a nice improvement

@marcotc marcotc merged commit be1c39a into master Dec 17, 2024
319 checks passed
@marcotc marcotc deleted the steven/activesupport-cachekey-config branch December 17, 2024 14:11
@github-actions github-actions bot added this to the 2.9.0 milestone Dec 17, 2024
@bouwkast
Copy link
Contributor Author

Hey @bouwkast thoughts on merging this in? Looks like a nice improvement

I was out on PTO, looked like I just had a couple of conversations that needed to be resolved for it to be merged, so did that

@ivoanjo
Copy link
Member

ivoanjo commented Dec 17, 2024

No worries! I was doing a big clean-up and leaving a similar comment on PRs I saw in good shape :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrations Involves tracing integrations tracing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants