Skip to content

Add deployment mode to Ruby SSI#5892

Merged
lloeki merged 11 commits intomainfrom
lloeki/add-deployment-mode-to-ssi
Dec 18, 2025
Merged

Add deployment mode to Ruby SSI#5892
lloeki merged 11 commits intomainfrom
lloeki/add-deployment-mode-to-ssi

Conversation

@lloeki
Copy link
Copy Markdown
Member

@lloeki lloeki commented Dec 18, 2025

Motivation

Test SSI on deployment mode

Changes

  • Add two test apps with BUNDLE_DEPLOYMENT set
  • Lock with update to mimic regular bundle install without installing, set config, then install under deployment mode

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes
  3. Mark it as ready for review
    • Test logic is modified? -> Get a review from RFC owner.
    • Framework is modified, or non obvious usage of it -> get a review from R&P team

🚀 Once your PR is reviewed and the CI green, you can merge it!

🛟 #apm-shared-testing 🛟

Reviewer checklist

  • If PR title starts with [<language>], double-check that only <language> is impacted by the change
  • No system-tests internal is modified. Otherwise, I have the approval from R&P team
  • A docker base image is modified?
    • the relevant build-XXX-image label is present
  • A scenario is added (or removed)?

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 18, 2025

CODEOWNERS have been resolved as:

utils/build/ssi/ruby/rails6-app-deployment-mode.Dockerfile              @DataDog/system-tests-core
utils/build/ssi/ruby/ruby-app-deployment-mode.Dockerfile                @DataDog/system-tests-core
manifests/ruby.yml                                                      @DataDog/ruby-guild @DataDog/asm-ruby
tests/docker_ssi/test_docker_ssi.py                                     @DataDog/system-tests-core
tests/docker_ssi/test_docker_ssi_appsec.py                              @DataDog/system-tests-core
tests/docker_ssi/test_docker_ssi_crash.py                               @DataDog/system-tests-core
tests/docker_ssi/test_docker_ssi_servicenaming.py                       @DataDog/system-tests-core
utils/scripts/ci_orchestrators/docker_ssi.json                          @DataDog/system-tests-core
manifests/dd_apm_inject.yml                                             @DataDog/system-tests-core

@lloeki
Copy link
Copy Markdown
Member Author

lloeki commented Dec 18, 2025

This should somewhat fail since deployment mode is only made available with DataDog/dd-trace-rb#5053

I'm not sure how to describe that with the decorators

In my mind it should be something like:

@missing_feature(context.library < "[email protected]", weblog=["ruby-app", "rails6-app"], reason="Not implemented yet")
@missing_feature(context.library < "[email protected]", weblog=["ruby-app-deployment-mode", "rails6-app-deployment-mode"], reason="Not implemented yet")

But I'm not sure really.

@lloeki lloeki force-pushed the lloeki/add-deployment-mode-to-ssi branch from d7a3b14 to f42d99f Compare December 18, 2025 14:08
- webserver could return 406
- there could be >1 crash reports

Both make the test fail but the behaviour is essentially correct in both
cases.
@lloeki lloeki marked this pull request as ready for review December 18, 2025 16:38
@lloeki lloeki requested review from a team as code owners December 18, 2025 16:38
@lloeki
Copy link
Copy Markdown
Member Author

lloeki commented Dec 18, 2025

1466e33 was 100% green.

40fe6ec was 100% green except for linter which was not run before, apparently being enabled by requesting review.

65297eb addressed the linter issue but started getting a strange and entirely unrelated failure on dd-gitlab/compute_pipeline.

$ python utils/scripts/compute-workflow-parameters.py nodejs -s "$scenarios" -g "$scenarios_groups" --parametric-job-count 1 --ci-environment "${CI_ENVIRONMENT}" --format gitlab
Traceback (most recent call last):
  File "/go/src/github.com/DataDog/system-tests/utils/scripts/compute-workflow-parameters.py", line 302, in <module>
    CiData(
  File "/go/src/github.com/DataDog/system-tests/utils/scripts/compute-workflow-parameters.py", line 74, in __init__
    scenario_map = self._get_workflow_map(
                   ^^^^^^^^^^^^^^^^^^^^^^^
  File "/go/src/github.com/DataDog/system-tests/utils/scripts/compute-workflow-parameters.py", line 198, in _get_workflow_map
    raise ValueError(f"Scenario {name} does not exists")
ValueError: Scenario FEATURE_FLAG_EXPOSURE does not exists

Merged main in e6fa394, which resolved the strange issue above.

Since having merged main in, all Test the tests language tests (which are entirely untouched by this PR) appear to deterministically fail on one identical case with:

19:04:50.564 ERROR    /app/logs/interfaces/agent/01216__support_flare.json host: 7-75-0-flare.agent.datad0g.com

Otherwise this is green on all relevant checks.

@lloeki
Copy link
Copy Markdown
Member Author

lloeki commented Dec 18, 2025

Cherry-picked this likely candidate of a fix:

commit f880832e5d9788c6dcb96159bf37f5c20030a0b7 (origin/leo/fix-support-flare-fqdn)
Author: Leo Romanovsky <[email protected]>
Date:   Thu Dec 18 13:52:23 2025 -0500

    fix: exclude support_flare from FQDN check in test_good_backend_partial

    The support_flare endpoint does not yet use the FQDN helper in the agent,
    similar to intake.profile and debugger-intake.

diff --git a/tests/test_smoke.py b/tests/test_smoke.py
index d7a98b7fc..c43cf1925 100644
--- a/tests/test_smoke.py
+++ b/tests/test_smoke.py
@@ -24,7 +24,7 @@ class Test_Backend:
     def test_good_backend_partial(self):
         """Agent reads and use DD_SITE env var"""
         self._assert_good_backend(
-            expected_domain=context.dd_site, excluded_sub_domains=("intake.profile", "debugger-intake")
+            expected_domain=context.dd_site, excluded_sub_domains=("intake.profile", "debugger-intake", "support_flare")
         )

     @staticmethod

... to get an early head-start on the 3h+ long CI.

@lloeki lloeki force-pushed the lloeki/add-deployment-mode-to-ssi branch from 00767a2 to f055966 Compare December 18, 2025 21:22
@lloeki
Copy link
Copy Markdown
Member Author

lloeki commented Dec 18, 2025

Test was bailed out of: #5900

Removed 00767a2 (cherry-pick) and merged main in.

@lloeki lloeki enabled auto-merge (squash) December 18, 2025 21:48
@lloeki lloeki merged commit badfb64 into main Dec 18, 2025
1598 of 1623 checks passed
@lloeki lloeki deleted the lloeki/add-deployment-mode-to-ssi branch December 18, 2025 22:42
@lloeki lloeki restored the lloeki/add-deployment-mode-to-ssi branch December 18, 2025 23:00
@cbeauchesne cbeauchesne deleted the lloeki/add-deployment-mode-to-ssi branch January 16, 2026 14:10
p-datadog added a commit to DataDog/dd-trace-rb that referenced this pull request Mar 3, 2026
* Heap profiling for ruby 4.x - Prototype

The idea is to delay the time at which we record object ids.
Once we are outside of the allocation code path, we can request the object ID.

* heap profiling 4.x - Remove unnecessary check

* Heap profiling 4.x: fix compilation warning for ruby <4 versions

* profiling: heap 4.x - Batch postoned jobs & fixes

- Avoid scheduling many postponed jobs
This fixes some of the issues we had with accuracy
Also I suspect that this has less overhead
- Avoid re-entrancy based on Ivo's comments

* Heap profiling 4.x - Adjust error handling & flag naming

* profiling heap profiling for ruby4: add an experimental flag & fixups

* Profiling experimental 4.0 support - Add a changelog entry

* Remove a few of the ifdefs to simplify code

Although some of this code is dead code on legacy Rubies, always
compiling it in means less ifdefs spread throughout and it helps
keep the code focused on modern rubies, rather than on legacy ones.

* Minor: Remove check for `active_deferred_object`

This check is already covered by
`heap_recorder->active_recording != NULL` (they're set and unset
together).

* Minor: Move error checking closer to return

* Minor: Simplify marking code

* Make env flag to enable ruby 4 heap profiler internal for now

* Tweak testing of heap profiling enabling logic

* Minor: Simplify new stats by removing ifdefs

* Fix C to Ruby conversions that should be unsigned

* Return heap profiler debugging state as objects, not a string

This makes it easier to use this in tests.

* Minor: Expose `pending_recordings_count` using heap recorder state to avoid extra helper

* Refactor heap finalization to move decision inside thread context collector

This moves the logic closer to the heap profiler and helps focus the
CpuAndWallTimeWorker on what (triggering or not) and not why (doesn't
care?).

* Allow `after_allocation` to signal failures using exceptions

* Use new `raise_error` API from latest master

This API only became available after I rebased.

* Revert "Profiling experimental 4.0 support - Add a changelog entry"

This reverts commit e153759.

(Avoid touching CHANGELOG for nicer diff)

* Further cleanups for `after_allocation` calling

* Start piping mechanism for heap recorder to signal when after_sample is needed

This will replace the more heavy-handed query in
`thread_context_collector_heap_pending_buffer_pressure`.

* Make requests for flushing `pending_recordings` be driven by heap profiler directly

This avoids other parts of the profiler needing to care about this --
they only need to care to run the `after_sample` callback.

* Avoid having thread context collector needing to know about heap profiler

* Refactor `heap_recorder_finalize_pending_recordings` to raise exceptions directly

We no longer need to ask other parts of the code to raise instead :)

* A few more cleanups

This probably needs adjusting for non-4.0 rubies, will do it as
a separate pass.

* Minor: Clean up TODO

* Reduce ifdefs, just let legacy rubies compile code too

In the future we may end up using the deferred recording for legacy
rubies as well, so might as well lay the groundwork.

* Small simplifications

* More small simplifications

* Extract out common code in a slightly different way

* Remove header reference (not available on all Rubies)

* Make linter happy

* Get rid of `DD_PROFILING_EXPERIMENTAL_HEAP_RUBY4_ENABLED`

Allow heap profiling to be enabled on Ruby 4 without any extra flags.

* Add reporting of waf.init telemetry

* Add reporting of waf.updates metric via telemetry

* Fix typo in AppSec::SecurityEngine::Engine specs

* Fix AppSec tests that were failing due to unexpected telemetry

* Fix linter and type checker warnings

* Fix failing Datadog::Kit::AppSec specs

* Fix AppSec ActiveRecord contrib specs

* Introduce state for request lifecycle

State is a shared mutable storage for counters, flags,
and data accumulated during the request's lifecycle.

* Update type specs for simple modules

* Add note about `Context#state` structure

* Extract function for reporting waf.init and waf.updates metrics

* [🤖] Update System Tests: https://github.com/DataDog/dd-trace-rb/actions/runs/21669260824

* [🤖] Update datadog gem version to 2.29.0

* DEBUG-5077 Core+: lift after fork handling to components (#5303)

* Update SYSTEM_TESTS_SCENARIOS_GROUPS for tests (#5310)

* DEBUG-5077 RC: replace Client after fork (#5304)

* Rename SecurityEngine::Engine#increment_waf_metric to #metric

* Remove unnecessary stubs for AppSec tests

* Fix linter warnings

* Remove .once from SecurityEngine::Engine specs

* Extract valid uuid matcher (#5306)

* [NO-TICKET] Minor: Add AI callout/suggestion to PR template

**What does this PR do?**

This PR tweaks the "Additional Notes" for the GitHub pull request
template to add a prompt suggesting the use of that section to
explain if there are some questions/doubts about AI-generated code
details.

**Motivation:**

Improve our PR template!

**Additional Notes:**

I did not use AI for this PR ;)

**How to test the change?**

Check that it'll show up after we merge it!

* [NO-TICKET] Remove unused `MINIMUM_VERSION` in net/http integration

**What does this PR do?**

Remove unused constant in net/http (that wasn't even correct as
per #2184).

**Motivation:**

Simplify things + Fix #2184

**Additional Notes:**

N/A

**How to test the change?**

Existing coverage for this integration should be enough!

* Update Nix

* Fix incorrect return types on `ResolutionDetails`

The error was:

    [::Datadog::OpenFeature::ResolutionDetails <: instance] `T <: instance`
    doesn't hold generally, but testing it with
    `::Datadog::OpenFeature::ResolutionDetails <: instance && instance <: ::Datadog::OpenFeature::ResolutionDetails`
    for compatibility

IOW from a logical POV it can't be ensured that `instance` is
always `ResolutionDetails`; steep tries to save us some trouble
automatically because this behaviour evolved.

Since we can't subclass a class - and neither a singleton - these can
only return `ResolutionDetails` so `instance` isn't useful anyway.

* Fix logger call to `super` with block

* Implement simple method tracing

* Remove graft

* Allow more dynamic class support

Reduce reliance on stub const

* Improve comments and naming

* Use `...` wich is faster on Ruby 3.4+

Also, gets rid of `ruby2_keywords`.

* Return early if outside of a trace context

* Minimise test harness

* Add safety check for `eval`

* Wrap ternary condition

This seems a bit heavy handed when the 'complex' comparison is `>=`:

    Style/TernaryParentheses: Use parentheses for ternary expressions with complex conditions.

* Apply standardrb

* Allow extending a `Module`

* Add YARD annotations

* Add sanity check for module argument

* Add user-friendly name when inspecting modules

* Guard against hooking private methods

* Test for exception messages consistently

* Preserve `protected` status

* Comply with standardrb

* Fix typo

* Support private methods

* Test anonymous module/class

The other tests have a name for the dynamic class because it gets
assigned to a stub constant.

* Test exception behaviour

* Test multiple wrapping

* Test return value consistently

* Test hooking on an instance singleton class

* Support dynamic methods (`method_missing`)

* Make `span_name` a kwarg

* Ensure `span_name` is safe through `eval`

* Add standard comment

* Use absolute reference for `Tracing`

* Ignore some files with `FATAL` errors in Steep

* Add `@public_api` tag

* Improve documentation

* Update error message

* Fix broken type annotations

Tradeoff: iterate once vs allocate once

* Scan path to infer

* Minor: Extract out `needs_after_allocation` to simplify code

* Minor: `&SKIPPED_RECORD` should not show up inside this function

`end_heap_allocation_recording` should not be called directly, we
always go through `end_heap_allocation_recording_with_rb_protect` and
thus observing `SKIPPED_RECORD` inside `end_heap_allocation_recording`
is a bug.

* Use `split` instead of `scan`

* Use with_env helper when altering environment with literal values (#5316)

* Pass progname through to logger

* Disable standardrb `StringLiteralsInInterpolation`

This is inconsitent with disabling `StringLiterals`

* Work around `split` not taking a block on Ruby 2.5

* Evaluate version-specific `split` at load-time

This saves doing the check at runtime.

Co-authored-by: Marco Costa <[email protected]>

* Remove a couple redundant spec cases

* Revert "Ignore some files with `FATAL` errors in Steep"

This reverts commit 71268e6.

* Add Datadog/nix-guild as CODEOWNERS of Nix files

* Add support for the `kicks` gem (#5305)

Co-authored-by: Marco Costa <[email protected]>
Co-authored-by: marcotc <[email protected]>
Co-authored-by: dd-apm-ecosystems-autobot[bot] <214617597+dd-apm-ecosystems-autobot[bot]@users.noreply.github.com>
Co-authored-by: domalessi <[email protected]>

* Revert "Revert "Add DBM back propagation with container tags and process tags…" (#5293)

This reverts commit b7c9a1d.

* fix: add controls over the back propagation setting for DBM (#5296)

* Revert "Revert "Add DBM back propagation with container tags and process tags…"

This reverts commit b7c9a1d.

* Add missing checks to the back propagation feature for DBM, including a new environment variable called DD_DBM_INJECT_SQL_BASEHASH

* fix comment

* Use less variables

* Update lib/datadog/core/environment/agent_info.rb

Co-authored-by: Sergey Fedorov <[email protected]>

* Apply suggestion from @marcotc

Co-authored-by: Marco Costa <[email protected]>

* Apply suggestion from @marcotc

Co-authored-by: Marco Costa <[email protected]>

* Address review comments

* Update lib/datadog/core/environment/agent_info.rb

Co-authored-by: Oleg Pudeyev <[email protected]>

* Update lib/datadog/core/environment/agent_info.rb

Co-authored-by: Oleg Pudeyev <[email protected]>

* Update lib/datadog/tracing/contrib/propagation/sql_comment.rb

Co-authored-by: Marco Costa <[email protected]>

* Update lib/datadog/tracing/contrib/propagation/sql_comment.rb

Co-authored-by: Marco Costa <[email protected]>

* Refactor agent_info to use mocks for the fnv hash

* remove comment

* Address review comments in agent_info

* Remove the tests where process tags were enabled but we expected no propagation hash because the process tags are always available so no need for the nil check

* Add comment about basehash

* Address test fixes in agent_info_spec

* Add helper method inject_hash to check if the user has inject_sql_basehash and experimental_propagate_process_tags_enabled enabled.

---------

Co-authored-by: Sergey Fedorov <[email protected]>
Co-authored-by: Marco Costa <[email protected]>
Co-authored-by: Oleg Pudeyev <[email protected]>

* Update GraphQL integration documentation (#5322)

For the instructions about the environment variable configuration:
* Move it to the top of the GraphQL section.
* Make it a warning, which gets visually "louder" when rendered.

* DRY at fork monkey patch state reset (#5315)

* [🤖] Update System Tests: https://github.com/DataDog/dd-trace-rb/actions/runs/21789186142

* [NO-TICKET] Minor: Update Ruby/Rails supported versions list

**What does this PR do?**

This PR updates the Rails section of `GettingStarted.md` to mention
that Ruby 4.0 and Rails 8.1 are supported.

**Motivation:**

Document that we support them!

**Additional Notes:**

N/A

**How to test the change?**

N/A

* Add parsed body to the excon client

* Add response body parsing

* Add new helpers into MediaType class

* Remove multipart/form-data from supported types

* Add Utils::HTTP::URLEncoded module

* Add Utils::HTTP::Body module

* Add Utils::HTTP::MediaRange.parse method

* Update Rack request query parsing

* Add body parsing to excon contrib

* Add request body processing to faraday contrib

* Add request body processing to rest_client contrib

* Add AppSec::CounterSampler with counter

* Add downstream body analysis configuration

* Add simple registry into AppSec::Context

* Add downstream request body sampler into Context

* Update Faraday contrib with body analysis conditions
* Update Faraday vendor RBS stab

* Update MediaType and MediaRange typespecs

* Add body sampling into excon and rest_client

* Update RestClient RBS stab

* Refactor http libraries contribs to look the same

* Correct typing for ephemeral data

* Remove certain "anything" checks in tests

* Fix wrong type of the ENV variable

* Add singleton class method tracing

* Update documentation comments

* Update AppSec blocking HTML template

* feat(crashtracking): capture unhandled exception with the crashtracker  (#5321)

* Remove VS Code config files from tracking

* Gitignore weird files that keep popping up (will pop this commit later)

Signal based crash report (crash done, need to do ping)

Revert "Gitignore weird files that keep popping up (will pop this commit later)"

This reverts commit aeb3017.

Revert "Remove VS Code config files from tracking"

This reverts commit 2b30b86.

Use locations array

Clean

Lazy logging

Fix memory leak

* Crash ping

Fmt

fmt

Do work on ruby side, fix sus calls

Remove noisy log

Update symbol name

Check result, build message in ruby

unit test and test cleanup

Inline + no order dependency + cleanup

Number of frames logic on ruby side

frame processing in helper

Restore accidentally deleted comment

Update tags on fork

Fmt

Fix potential mem leak

move to core

clean

Extract into helper

Fix more potential leaks

Fmt

Remove comment from Ruby exception crash reporting context

Removed comment about Ruby exception crash reporting tests.

Respond to oleg -(rescuing all exceptions)

Flip negation

No more do-while, crash vs exception naming, test sleep fix, minor refactoring

Tag builder helper func, move all logic into ct component, move builder into build function

* Comprehensive testing

* Timestamp is handled by libdatadog

Trigger CI

rbs file

Trigger CI

CI debug

We need to explicitly check, not depend on order

Be explicit with typing

Trigger CI

Incomplete stack

Clarity in tests

* Final cleanups

* Add counter for how many times dynamic sampling rate had to kick in

* Document profiler sampling statistics and how they can be used

* chore(ci) update one-pipeline

* Add downstream redirects tracking for Faraday

* Add downstream redirects tracking for RestClient

* Add downstream redirects tracking for Excon

* Add follow redirect gem for Faraday contrib

* Extract redirect status codes as constant

* Bump Ruby 3.4 Faraday gemfile

* Remove JRuby 9.2 Faraday follow-redirect gem

* [🤖] Lock Dependency: https://github.com/DataDog/dd-trace-rb/actions/runs/21904888752

* chore(crashtracking): update max frames collected by unhandled exception collector to 512 and clarify comment (#5345)

* Fix comment and update to 512 from 400

* further claity

* Check result and drop error (#5348)

* Fix Ruby 2.5 Faraday follow redirect gem

* Transports: remove Parcel classes other than the core one (#5329)

* chore(crashtracking): update unhandled exception report message to have parity with other runtimes (#5349)

* Update report message for report parity

* Test exact message match

* Merge pull request #5342 from DataDog/brian.marks/startup-log

Change default logger output from stdout to stderr

* Deduplicate version-independent gems

* Make symlink relative

* Reduce image size threshold

* Remove debug output

* Remove vaccine from CI

Obsoleted by:

- DataDog/system-tests#5730
- DataDog/system-tests#5735
- DataDog/system-tests#5736
- DataDog/system-tests#5834
- DataDog/system-tests#5870
- DataDog/system-tests#5892
- DataDog/system-tests#5901

* Add AGENTS.md (#5307)

* Add AGENTS.md

* Apply suggestions from code review

Co-authored-by: Ivo Anjo <[email protected]>
Co-authored-by: Loic Nageleisen <[email protected]>

* Update .cursor/rules/code-style.mdc

Co-authored-by: Ivo Anjo <[email protected]>

* Deleted deprecated release:gem task

* Add `expect { }.to change` example

* Update .cursor/rules/code-style.mdc

* Add: Rake task to discover custom matchers

* [🤖] Update Latest Dependency: https://github.com/DataDog/dd-trace-rb/actions/runs/21789157204

* Remove controversial code example

* Restore master gemfiles

* Exclude AGENTS files from release gem file expectation

---------

Co-authored-by: Ivo Anjo <[email protected]>
Co-authored-by: Loic Nageleisen <[email protected]>
Co-authored-by: dd-apm-ecosystems-autobot[bot] <214617597+dd-apm-ecosystems-autobot[bot]@users.noreply.github.com>

* Remove Faraday from Steep ignore list

* Fix flaky benchmark validation tests by skipping fork in validation mode (#5353)

In validation mode (VALIDATE_BENCHMARK=true), `run_benchmark` no longer
forks each individual benchmark. This eliminates the root cause of timeout
flakiness: 7-8 nested fork+init+shutdown cycles inside the already-forked
`expect_in_fork` test, where each cycle pays ~265ms of Datadog stack
init/teardown overhead and risks hanging on an unbounded `thread.join` in
the remote config worker shutdown path.

Co-authored-by: Claude Opus 4.6 <[email protected]>
Co-authored-by: Ivo Anjo <[email protected]>

* Update Elasticsearch for Github Actions to 8.19.11

* Use official Elasticsearch image from dockerhub

* Add ruby-ver and test type flags to coverage uploads

Tag each coverage upload with --flags "ruby-ver:<alias>" and
--flags "type:<test-type>" so reports can be grouped and filtered
by Ruby version and test category (standard/misc) in Datadog.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* Bump datadog/ci image to v5.7.0 for coverage upload job

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* Improve CI Elasticsearch healthchecks

* Remove GraphQL AppSec contrib from Steep ignored files

* Add user_auth telemetry metrics

* Add API Security schema telemetry to rack middleware

* Add integration test for API Security schema telemetry

* Add API Security schema telemetry test for Sinatra contrib

* Change AppSec::Context#extract_schema to handle event creation

* Add API Security telemetry to AppSec telemetry exporter

* Remove dependency from Context in AppSec telemetry exporter

* Add settings of web framework to AppSec context state

* Remove accidential changes to Devise contrib

* Improve specs for API Security telemetry

* Fix flaky AppSec schema extraction spec

* Change export_api_security_metrics to receive context state

* Fix linter warning

* Update injector to v1.3.0

* DEBUG-5005 DI: circuit breaker when instrumentation exceeds CPU time threshold (#5335)

* Improve AppSec::Context spec

* DEBUG-5005 RC product logging (#5369)

* DEBUG-5005 DI: use exception field in probe status when reporting errors (#5371)

* DEBUG-5005 DI: log probe id, location and status when sending probe status (#5370)

* Add appsec.api_security.missing_route telemetry metric

* Add process and container tags support for DSM (#5209)

* Refactor fnv logic out of data streams code since it needs to be reused for other parts of the process tags implementation

* Add BaseHash for back propagation

* Add container tags extraction logic when getting an agent response with Datadog-Container-Tags-Hash

* Add base hash to DBM SQL comments

* Add DBM base hash to span metric for trace correlation.

* Compute bash hash when retrieving agent info

* Fix test and add a default bash hash of nil so it doesn't mess with the other tests.

* Add back propagation support to add container and process tags to DSM

* Apply suggestions from code review

* Update lib/datadog/tracing/contrib/propagation/sql_comment/ext.rb

Co-authored-by: Marco Costa <[email protected]>

* Update spec/datadog/core/environment/agent_info_spec.rb

Co-authored-by: Sergey Fedorov <[email protected]>

* Refactor out base hash in favor of putting things under agent info and simplify tests. Also add comment to the fnv file.

* Update spec/datadog/core/environment/agent_info_spec.rb

Co-authored-by: Sergey Fedorov <[email protected]>

* Remove duplicate end

* Remove BaseHash and replace with propagation hash. Refactor tests

* Refactor fnv to use constants and refactor methods in agent_info, along with test adjustments

* Fix ci error related to the sql_comment_spec.

* Add missing propagation_hash for steep check

* address review comments by refactoring agent_info

* Update lib/datadog/core/environment/agent_info.rb

Co-authored-by: Oleg Pudeyev <[email protected]>

* Rename variable from container_tags to container_tags_checksum

* Address review comments by adding clarifying comments and refactoring some variables

* Change _dd.propagated_hash to show up under meta instead of metrics

* Removing the early return showed errors with http response missing headers so that has been fixed. Remove defined? check for propagation_hash because it prevented span tags from having the propagated hash

* add tests to cover the edge case of the span not being annotated with the _dd.propagated_hash in the meta section

* Remove the extra annotate call and adjust tests to test for annotate being called by db integrations instead of within sql_comment

* Update lib/datadog/core/environment/agent_info.rb

Co-authored-by: Oleg Pudeyev <[email protected]>

* Update lib/datadog/core/environment/agent_info.rb

Co-authored-by: Sergey Fedorov <[email protected]>

* Update comments and fix steep error for @container_tags_checksum

* Update lib/datadog/core/environment/agent_info.rb

Co-authored-by: Marco Costa <[email protected]>

* Refactor concerns so that update_container_tags modifies the propagation_checksum and container_tags_checksum whenver the headers are extracted, while we have a separate call to get the propagation_checksum (renamed from propagation_hash to avoid confusion) by the sql_commenter code. Fix tests.

* Transfer Github comments into PR description to expand on possible errors

* Add more tests to cover fetch concerns, retries, and other logic arising from agent_info

* Remove the fetch call if nil because there is no way to address the agent timeout without refactoring a lot. Update tests.

* remove duplicated test

* Add revisions to dsm process tags logic based on actually sending data

* Update lib/datadog/core/environment/agent_info.rb

Co-authored-by: Oleg Pudeyev <[email protected]>

* remove unneeded elsif for propagation_checksum

* Revert "Revert "Add DBM back propagation with container tags and process tags…"

This reverts commit b7c9a1d.

* Add missing checks to the back propagation feature for DBM, including a new environment variable called DD_DBM_INJECT_SQL_BASEHASH

* fix comment

* Use less variables

* Update lib/datadog/core/environment/agent_info.rb

Co-authored-by: Sergey Fedorov <[email protected]>

* Apply suggestion from @marcotc

Co-authored-by: Marco Costa <[email protected]>

* Apply suggestion from @marcotc

Co-authored-by: Marco Costa <[email protected]>

* Address review comments

* Update lib/datadog/core/environment/agent_info.rb

Co-authored-by: Oleg Pudeyev <[email protected]>

* Update lib/datadog/core/environment/agent_info.rb

Co-authored-by: Oleg Pudeyev <[email protected]>

* Update lib/datadog/tracing/contrib/propagation/sql_comment.rb

Co-authored-by: Marco Costa <[email protected]>

* Update lib/datadog/tracing/contrib/propagation/sql_comment.rb

Co-authored-by: Marco Costa <[email protected]>

* Refactor agent_info to use mocks for the fnv hash

* remove comment

* Address review comments in agent_info

* Remove the tests where process tags were enabled but we expected no propagation hash because the process tags are always available so no need for the nil check

* Add comment about basehash

* Update lib/datadog/data_streams/processor.rb

Co-authored-by: Marco Costa <[email protected]>

* Address review comments

* Refactor tests since some of the assertions were repeated

* Clean up test descriptions

* Test using expect/change

* Address review comments for steep check and test comments

* Add shorter comment

* Update comment + style fix

* Improved typing and some refactoring

* Remove global reference and add agent_info to Datadog::DataStreams::Processor.new

* Update integration_spec for changes to DataStreams::Processor

* Update sig/datadog/data_streams/processor.rbs

Co-authored-by: Sergey Fedorov <[email protected]>

* Update lib/datadog/data_streams/processor.rb

Co-authored-by: Sergey Fedorov <[email protected]>

* Remove shared examples

---------

Co-authored-by: Marco Costa <[email protected]>
Co-authored-by: Sergey Fedorov <[email protected]>
Co-authored-by: Oleg Pudeyev <[email protected]>

* Change export_api_security_metrics to accept context

* Add process tags and container id to process discovery (#5336)

* Add process and container id following java

* turns out process tags should only be added to process discovery when enabled per the system tests.

* Address review comments and add more tests

* Refactor tests

* Fix CI errors.

* [🤖] Update System Tests: https://github.com/DataDog/dd-trace-rb/actions/runs/22191009051 (#5366)

Co-authored-by: dd-apm-ecosystems-autobot[bot] <214617597+dd-apm-ecosystems-autobot[bot]@users.noreply.github.com>

* Add 2.29.0 to CHANGELOG.md

* [🤖] Update System Tests: https://github.com/DataDog/dd-trace-rb/actions/runs/22222520276

* Update changelog

---------

Co-authored-by: Erwan Viollet <[email protected]>
Co-authored-by: Ivo Anjo <[email protected]>
Co-authored-by: Yury Lebedev <[email protected]>
Co-authored-by: Sergey Fedorov <[email protected]>
Co-authored-by: dd-apm-ecosystems-autobot[bot] <214617597+dd-apm-ecosystems-autobot[bot]@users.noreply.github.com>
Co-authored-by: Yury Lebedev <[email protected]>
Co-authored-by: Oleg Pudeyev <[email protected]>
Co-authored-by: Alberto Vara <[email protected]>
Co-authored-by: Sergey Fedorov <[email protected]>
Co-authored-by: Loic Nageleisen <[email protected]>
Co-authored-by: Marco Costa <[email protected]>
Co-authored-by: Victor Pellan <[email protected]>
Co-authored-by: marcotc <[email protected]>
Co-authored-by: domalessi <[email protected]>
Co-authored-by: wantsui <[email protected]>
Co-authored-by: Gyuheon Oh <[email protected]>
Co-authored-by: campaigner-prod[bot] <87874424+campaigner-prod[bot]@users.noreply.github.com>
Co-authored-by: Brian Marks <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
Co-authored-by: Nikita Tkachenko <[email protected]>
Co-authored-by: Nikita Tkachenko <[email protected]>
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.

3 participants