forked from DataDog/dd-trace-rb
-
Notifications
You must be signed in to change notification settings - Fork 1
[STREAM-126] Upgrade to dd-trace-rb v2.27.0 with Braze modifications #30
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
Draft
ferrous26
wants to merge
2,259
commits into
deployed-in-platform
Choose a base branch
from
upgrade-v2.27.0-braze
base: deployed-in-platform
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Update system tests
Co-authored-by: Oleg Pudeyev <code@olegp.name>
…ns/runs/20401907816 (DataDog#5179) Co-authored-by: dd-apm-ecosystems-autobot[bot] <214617597+dd-apm-ecosystems-autobot[bot]@users.noreply.github.com>
Co-authored-by: Oleg Pudeyev <code@olegp.name>
…robe with the same id (DataDog#5169) Co-authored-by: Oleg Pudeyev <code@olegp.name>
…actions/runs/20401889084 (DataDog#5180) Co-authored-by: dd-apm-ecosystems-autobot[bot] <214617597+dd-apm-ecosystems-autobot[bot]@users.noreply.github.com>
…tem-tests [🤖] Update System Tests
…elpers.c` The use of `telemetry_message_id` was moved to `datadog_ruby_common.h/.c` directly, this was no longer needed.
…-client-typespecs [APPSEC-60626] Return rest_client to be checked by Steep
…iation-custom-profiler-code Telemetry-safe error reporting for native extensions
…9-jan Fix typing for AppSec::Component
* Add initial attempt at adding process related tags on trace payloads. This is still missing memoization and additional tests. * Add test for multiple calls to the formatter tags * Add tests for trace formatter spec to assert that the first span of the payload has the process tag only when the feature is enabled. * it turns out you cannot just pin things to rails 7 due to newer ruby versions so this fixes that. * Update lib/datadog/core/environment/process.rb Co-authored-by: Marco Costa <marco.costa@datadoghq.com> * fix string and rename formatted_process_tags_k1_v1 to serialized * remove unneeded line * remove server type for now until more research is done * Add new tag normalizer logic following the trace agent. * lint fix * add missing files from prototype command * Add missing constants to ext rbs file * jruby fix for the process spec * remove the active record during rails creation because it caused a jruby conflict with sqlite and it is not needed for this test * Bring tag normalization to 1:1 parity with the Trace Agent * Add changes from code review around comments and add test for the new environment variable. * Remove the rails gem install from process_spec * Remove 1 sec delay. * Update sig/datadog/core/environment/ext.rbs Co-authored-by: Sergey Fedorov <oni.strech@gmail.com> * Update lib/datadog/tracing/transport/trace_formatter.rb Co-authored-by: Sergey Fedorov <oni.strech@gmail.com> * Add improvements for long strings. * small improvement to the whitespace removal. * Add upper bound to regex to avoid the polynomial regex on uncontrolled data error. * Change untyped to string. * Use possessive quantifiers in regex instead of limiting the upper bound to 200 characters * Fix types for steep check command * Remove unneeded Core prefix * lint fixes * restructure folder lookup so it works on the macos ci tests * fixes for local mac development. * Add missing trace agent test cases. * Fix lint * Change methods to private. Also add comments with examples * Fix basedir logic and adjust tests (and also fix the private change) * Fix steepcheck error * Add in byte logic to handle emojis with early backoff and allow starting digits for tag values. * Move process tags only to the first span and adjust tests * Add a special character into the test app name to show that it gets normalized * Add process tags to the profiling payloads. * Update lib/datadog/core/normalizer.rb Co-authored-by: Marco Costa <marco.costa@datadoghq.com> * Update lib/datadog/core/normalizer.rb Co-authored-by: Marco Costa <marco.costa@datadoghq.com> * Fixes for new constant names * Change to byteslice * fix lint. * remove process_spec from main rake task * Update spec/datadog/core/normalizer_spec.rb Co-authored-by: Oleg Pudeyev <156273877+p-datadog@users.noreply.github.com> * Update spec/datadog/tracing/transport/trace_formatter_spec.rb Co-authored-by: Oleg Pudeyev <156273877+p-datadog@users.noreply.github.com> * Remove the unless check and replace with an assertion that the file exist, small fixes, and add comments to the normalizer.rb explaining the expected usage * Update spec/datadog/core/environment/process_spec.rb Co-authored-by: Oleg Pudeyev <156273877+p-datadog@users.noreply.github.com> * fix lint * Rename Normalizer to TagNormalizer. * Update lib/datadog/core/environment/process.rb Co-authored-by: Oleg Pudeyev <156273877+p-datadog@users.noreply.github.com> * Add api private comment to the tag normalizer and refactor away the extend self on process.rb * Fix steep errors on the process rbs file * Refactor the utils encode call so it can be used in the tag normalizer and update tests to show some new assertions * Update Rakefile Co-authored-by: Sergey Fedorov <oni.strech@gmail.com> * Update lib/datadog/core/tag_normalizer.rb Co-authored-by: Sergey Fedorov <oni.strech@gmail.com> * Add lint fixes and remove unneeded regex at the end. * fix rbs file for deleted variable * remove unneeded conditional * Add a log if the process tags cannot be obtained * Fix regex and reuse the same test cases to show that the leading digits are allowed for tag values * Attempt to retrieve as many non empty string process tags as possible before setting process tags. * Fix hard to spot missing comma in Rakefile that was breaking tests * Update lib/datadog/core/environment/process.rb Co-authored-by: Oleg Pudeyev <156273877+p-datadog@users.noreply.github.com> * Remove the usage of utils from the tag normalizer until 3.0 due to the requirement to change the default encoding behavior and adjust tag normalizer variables. * Add tests to show the values based on different 0 overrides. * Fix test string. * refactor out the rescue and process and update the test * Fix mocking. * Update Matrixfile Co-authored-by: Marco Costa <marco.costa@datadoghq.com> * Do not run tests for all ruby versions. * Update lib/datadog/core/environment/process.rb Co-authored-by: Oleg Pudeyev <156273877+p-datadog@users.noreply.github.com> * Update lib/datadog/core/environment/process.rb Co-authored-by: Oleg Pudeyev <156273877+p-datadog@users.noreply.github.com> * Add a foo bar test condition with colons and commas, which revealed a need to add the additional process values normalization logic for service names since they can only be 100 characters and cannot have colons. * use around syntax * Update lib/datadog/core/tag_normalizer.rb Co-authored-by: Oleg Pudeyev <156273877+p-datadog@users.noreply.github.com> * Update lib/datadog/core/tag_normalizer.rb Co-authored-by: Sergey Fedorov <oni.strech@gmail.com> * Rename process_values_normalize to normalize_process_value and adjust tests for the singular version of MAX_PROCESS_VALUE_BYTE_SIZE * refactor profiling changes based on the new profiling payload changes in 25.0.0 of libdatadog * Fix flush_spec.rb * Fix benchmark test * update profiling_http_transport so that it is backwards compatible. * Update benchmarks/profiling_http_transport.rb Co-authored-by: Ivo Anjo <ivo.anjo@datadoghq.com> * Update benchmarks/profiling_http_transport.rb Co-authored-by: Sergey Fedorov <oni.strech@gmail.com> * Remove changes to the todo to leave process discovery out * Send empty string instead of nil for blank process tags * Fix tests based on the change in nil vs empty string. * Update spec/datadog/profiling/http_transport_spec.rb Co-authored-by: Sergey Fedorov <oni.strech@gmail.com> --------- Co-authored-by: Marco Costa <marco.costa@datadoghq.com> Co-authored-by: Sergey Fedorov <oni.strech@gmail.com> Co-authored-by: Oleg Pudeyev <156273877+p-datadog@users.noreply.github.com> Co-authored-by: Oleg Pudeyev <code@olegp.name> Co-authored-by: Ivo Anjo <ivo.anjo@datadoghq.com>
Bump to version 2.27.0
775414b to
8d5d1c1
Compare
8d5d1c1 to
813137f
Compare
Add custom tags and metrics to Redis spans for improved observability: Tags (via thread-local storage): - redis.filepath: source file making the Redis call - redis.codeowner: team owning the code - redis.shard_index: which shard the call targets - company_name: company context - redis.key: the Redis key being accessed Metrics: - redis.raw_command_length: size of command sent - redis.raw_response_length: size of response received Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Workaround for Grape API issue DataDog#1825 that doesn't work with Braze's usage pattern. Instead of calling api_view() directly, first try api.to_s and only fall back to api_view(api) if the result is blank. See: ruby-grape/grape#1825 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Braze does not use Redis with ActiveSupport::Cache, and the default patching behavior causes the wrong Store to be patched. This disables patch_redis_store? by always returning false. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Set Braze ownership for the forked repository. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
813137f to
5b52565
Compare
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Upgrades the dd-trace-rb fork from v2.15.0 to v2.27.0 while preserving Braze-specific modifications.
Changes from upstream (v2.15.0 → v2.27.0)
Braze modifications preserved
Redis Instrumentation Enhancements
redis.filepath,redis.codeowner,redis.shard_index,company_name,redis.keyredis.raw_command_length,redis.raw_response_lengthGrape API Endpoint Fix
api.to_sfirst, fallback toapi_view(api)if blankActiveSupport Cache Patch Bypass
patch_redis_store?to prevent wrong Store patchingActiveSupport::CacheCODEOWNERS
Dropped changes (now in upstream)
Test plan
🤖 Generated with Claude Code