Skip to content

Conversation

@ferrous26
Copy link

Summary

Alternative to #30 using a merge strategy instead of rebase.

Merges upstream dd-trace-rb v2.27.0 while preserving Braze-specific modifications.

Approach Comparison

Approach PR Pros Cons
Rebase #30 Clean history, 4 separate commits Requires force push, rewrites history
Merge This PR Preserves full history, easier conflict resolution Single merge commit, harder to see Braze changes

Braze modifications preserved

  1. Redis Instrumentation Enhancements - Custom tags (redis.filepath, redis.codeowner, redis.shard_index, company_name, redis.key) and metrics (redis.raw_command_length, redis.raw_response_length)

  2. Grape API Endpoint Fix - Workaround for Grape API issue #1825

  3. ActiveSupport Cache Patch Bypass - Disable patch_redis_store?

  4. CODEOWNERS - Braze ownership

Conflicts resolved

  • Took upstream version for profiling JSON changes (backport no longer needed)
  • Kept Braze CODEOWNERS

Test plan

  • dd-trace-rb CI passes
  • Platform CI passes after updating Gemfile reference

🤖 Generated with Claude Code

lloeki and others added 30 commits December 18, 2025 18:27
… keyword param in the initializer to avoid breaking datadog-ci gem (DataDog#5166)
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>
lloeki and others added 18 commits January 19, 2026 18:29
…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
* 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>
Merge upstream dd-trace-rb v2.27.0 while preserving Braze-specific modifications:

1. Redis instrumentation enhancements (custom tags & metrics)
2. Grape API endpoint workaround (issue DataDog#1825)
3. ActiveSupport::Cache Redis store patch bypass
4. CODEOWNERS for Braze

Conflicts resolved:
- Took upstream version for profiling JSON changes (backport no longer needed)
- Kept Braze CODEOWNERS

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ferrous26 ferrous26 requested a review from a team as a code owner January 31, 2026 19:39
@github-actions
Copy link

👋 Hey @DataDog/ruby-guild, please fill "Change log entry" section in the pull request description.

If changes need to be present in CHANGELOG.md you can state it this way

**Change log entry**

Yes. A brief summary to be placed into the CHANGELOG.md

(possible answers Yes/Yep/Yeah)

Or you can opt out like that

**Change log entry**

None.

(possible answers No/Nope/None)

Visited at: 2026-01-31 19:39:57 UTC

@ferrous26
Copy link
Author

Closing in favor of rebase approach in #30 - cleaner commit history makes future rebases easier.

@ferrous26 ferrous26 closed this Jan 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.