Skip to content

Commit b20ed1f

Browse files
committed
Merge branch 'master' into pr-4941
* master: (523 commits) DI: relax upper bound for reported long method duration (#5113) Change development guide to use Ruby 3.4 by default (#5112) Fix exception in RC on OpenFeature::Engine absence [🤖] Update Latest Dependency: https://github.com/DataDog/dd-trace-rb/actions/runs/19996135509 [🤖] Update System Tests: https://github.com/DataDog/dd-trace-rb/actions/runs/19996155319 Add ruby guikld to all dsm files add DSM to codeowners feat: add process tags to traces (#5033) DEBUG-3558 DI: chunk snapshot payloads (#5086) CI: enable push_to_test_optimization unless this is a pull request from a fork fix steep checks [🤖] Lock Dependency: https://github.com/DataDog/dd-trace-rb/actions/runs/19827679824 [🤖] Lock Dependency: https://github.com/DataDog/dd-trace-rb/actions/runs/19827296218 Add test to verify consumer backlog serialization with kafka_commit tag Remove one diagnostic output Install rubygems Add diagnostic steps Use default rubygems+bundler for each Ruby version Revert "Disable profiling specs for 4.0" Use git `datadog-ruby_core_source` having 4.0 ...
2 parents 07fbccb + 280926d commit b20ed1f

File tree

1,997 files changed

+58957
-9735
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,997 files changed

+58957
-9735
lines changed

.cursor/rules/architecture.mdc

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
description:
3+
globs:
4+
alwaysApply: false
5+
---
6+
# Architecture and Design
7+
8+
This library provides tools to get visibility into the performance and security of Ruby applications.
9+
This includes distributed tracing, profiling, app & api protection, dynamic instrumentation, metrics emission, open feature, etc.
10+
11+
## Project Structure
12+
13+
- @lib/datadog/appsec - app & api protection implementation (formely known as appsec)
14+
- @lib/datadog/appsec/contrib - app & api protection integrations with third-party libraries
15+
- @lib/datadog/core - glue and shared code
16+
- @lib/datadog/di - dynamic instrumentation
17+
- @lib/datadog/open_feature - an implementation of OpenFeature Provider https://openfeature.dev/docs/reference/sdks/server/ruby
18+
- @lib/datadog/profiling - profiling
19+
- @lib/datadog/tracing - distributed tracing
20+
- @lib/datadog/tracing/contrib - distributed tracing integrations with third-party libraries
21+
- @spec/ - Library test suite
22+
- @ext/datadog_profiling_native_extension - native extension for profiling
23+
- @ext/libdatadog_api - native extension for libdatadog apis
24+
- @docs/ - Developer documentation. Includes API documentation, upgrade guides, etc.
25+
26+
## Integration Pattern
27+
28+
Each framework integration follows a common pattern:
29+
1. `patcher.rb` - Modifies framework behavior
30+
2. `integration.rb` - Describes the integration
31+
3. `ext.rb` - Constants specific to the integration
32+
4. `configuration/settings.rb` - Integration-specific settings
33+
34+
## Native Extensions
35+
36+
The library uses native extensions which requires using Ruby C API.
37+
38+
The native extension is in `ext/` directory and compiled for each Ruby version.

.cursor/rules/code-style.mdc

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
description:
3+
globs:
4+
alwaysApply: true
5+
---
6+
7+
## Ruby usage
8+
9+
- We use Ruby 2.5 syntax
10+
- Use exceptions for exceptional cases, not for control flow.
11+
- Implement proper error logging and user-friendly messages.
12+
13+
## Type checking
14+
15+
- RBS is used for static type checking
16+
- Type definitions are in the `sig/` directory
17+
- Update type definitions when modifying code
18+
- Run `bundle exec rake steep:check` to verify type correctness
19+
- Always run `bundle exec rake steep:check` after any update to RBS files
20+
- When deleting Ruby files, delete corresponding RBS file. Run `bundle exec rake rbs:clean` to make sure that there are no unnecessary RBS files.
21+
- Avoid using `untyped` type, use it only when it is not feasible to derive the correct type
22+
- Do not write types like `(nil | Type)`, use `Type?` instead
23+
- See [StaticTypingGuide.md](mdc:docs/StaticTypingGuide.md) for details
24+
25+
## Code Quality
26+
27+
- @standardrb is used for code style enforcement
28+
- Run `bundle exec standardrb` to check code quality
29+
- Ensure all code passes style checks before submitting
30+
31+
## Commands
32+
33+
- %steep run `bundle exec rake steep:check`. If there are typechecking errors, examine and fix them.
34+
- %rbs for the files the current context examine the current changes and fix (or create) corresponding rbs files
35+
36+
## Commits and Pull Requests
37+
38+
When creating a pull request and committing code, follow the [PULL_REQUEST_TEMPLATE.md](mdc:.github/PULL_REQUEST_TEMPLATE.md) template.
39+
40+
When submitting a pull request that includes a significant amount of AI-generated code, this must be disclosed using the specific repository label "AI Generated" and at the top of the description.

.cursor/rules/testing.mdc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
description: when editing or running tests
3+
globs:
4+
alwaysApply: false
5+
---
6+
# Testing Guidelines
7+
8+
## Writing Tests
9+
10+
- Tests are written using [RSpec](mdc:https:/rspec.info)
11+
- Test files should mirror the structure of `lib`
12+
- All changes should be covered by corresponding tests
13+
- If new files in the repository are created, run `git add -A` before running tests (otherwise `release_gem_spec.rb` will fail)
14+
- Do not use `instance_variable_set` and `instance_variable_get` in tests, use mocking when needed
15+
- Do not make changes to `release_gem_spec.rb` if not asked
16+
- Do not use focused tests feature (fit, fdescribe)
17+
18+
## Running Tests
19+
20+
- Run core library tests: `bundle exec rake test:main`
21+
- Run a specific test/file from core library tests: `bundle exec rspec <relative path to the file>`
22+
23+
## Appraisal Groups
24+
25+
- Dependency configurations are managed with [Appraisal](mdc:https:/github.com/thoughtbot/appraisal)
26+
- Group definitions are in `Appraisals`
27+
- Generate gemfiles with `bundle exec appraisal generate`
28+
- Install dependencies with `bundle exec appraisal install`

.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ DD_AGENT_HOST=testagent
33
DD_API_KEY=00000000000000000000000000000000
44
DD_METRIC_AGENT_PORT=8125
55
DD_TRACE_AGENT_PORT=9126
6+
OTLP_HTTP_PORT=4318
7+
OTLP_GRPC_PORT=4317
68

79
# Values are used for proxying from APM Test Agent to real Datadog Agent
810
DD_REAL_AGENT_HOST=ddagent

.github/CODEOWNERS

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,21 @@ lib/datadog/opentelemetry.rb @DataDog/apm-sdk-capabilities-ruby
1414
lib-injection/ @DataDog/lang-platform-ruby
1515
lib/datadog/profiling/ @DataDog/profiling-rb @DataDog/ruby-guild
1616
lib/datadog/profiling.rb @DataDog/profiling-rb @DataDog/ruby-guild
17+
lib/datadog/data_streams/ @DataDog/data-streams-monitoring @DataDog/ruby-guild
18+
lib/datadog/data_streams.rb @DataDog/data-streams-monitoring @DataDog/ruby-guild
1719
ext/ @DataDog/profiling-rb @DataDog/ruby-guild
1820

1921
# RBS signatures
20-
sig/datadog/appsec/ @DataDog/asm-ruby
21-
sig/datadog/appsec.rbs @DataDog/asm-ruby
22-
sig/datadog/tracing/ @DataDog/apm-idm-ruby @DataDog/apm-sdk-capabilities-ruby
23-
sig/datadog/tracing.rbs @DataDog/apm-idm-ruby @DataDog/apm-sdk-capabilities-ruby
24-
sig/datadog/opentelemetry/ @DataDog/apm-sdk-capabilities-ruby
25-
sig/datadog/opentelemetry.rbs @DataDog/apm-sdk-capabilities-ruby
22+
sig/datadog/appsec/ @DataDog/asm-ruby @DataDog/ruby-guild
23+
sig/datadog/appsec.rbs @DataDog/asm-ruby @DataDog/ruby-guild
24+
sig/datadog/tracing/ @DataDog/apm-idm-ruby @DataDog/apm-sdk-capabilities-ruby @DataDog/ruby-guild
25+
sig/datadog/tracing.rbs @DataDog/apm-idm-ruby @DataDog/apm-sdk-capabilities-ruby @DataDog/ruby-guild
26+
sig/datadog/opentelemetry/ @DataDog/apm-sdk-capabilities-ruby @DataDog/ruby-guild
27+
sig/datadog/opentelemetry.rbs @DataDog/apm-sdk-capabilities-ruby @DataDog/ruby-guild
2628
sig/datadog/profiling/ @DataDog/profiling-rb @DataDog/ruby-guild
2729
sig/datadog/profiling.rbs @DataDog/profiling-rb @DataDog/ruby-guild
30+
sig/datadog/data_streams/ @DataDog/data-streams-monitoring @DataDog/ruby-guild
31+
sig/datadog/data_streams.rbs @DataDog/data-streams-monitoring @DataDog/ruby-guild
2832

2933
# Specs
3034
spec/datadog/appsec/ @DataDog/asm-ruby
@@ -34,3 +38,4 @@ spec/datadog/opentelemetry/ @DataDog/apm-sdk-capabilities-ruby
3438
spec/datadog/opentelemetry_spec.rb @DataDog/apm-sdk-capabilities-ruby
3539
spec/datadog/profiling/ @DataDog/profiling-rb @DataDog/ruby-guild
3640
spec/datadog/profiling_spec.rb @DataDog/profiling-rb @DataDog/ruby-guild
41+
spec/datadog/data_streams/ @DataDog/data-streams-monitoring @DataDog/ruby-guild

.github/actions/build-test/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ runs:
3030
env:
3131
COVERAGE_DIR: coverage/versions/${{ inputs.alias }}/${{ inputs.container-id }}
3232

33+
- name: Display debug info
34+
if: ${{ !cancelled() }}
35+
shell: bash
36+
run: |
37+
df -h
38+
3339
- name: Debug with SSH connection
3440
if: ${{ failure() && runner.debug == '1' }}
3541
uses: mxschmitt/action-tmate@7b6a61a73bbb9793cb80ad69b8dd8ac19261834c # v3.19.0

.github/actions/bundle-cache/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ runs:
2929
bundle lock
3030
echo "lockfile=$LOCKFILE" >> "$GITHUB_OUTPUT"
3131
- name: Upload lockfile
32-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
32+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
3333
with:
3434
name: ${{ steps.lockfile.outputs.lockfile }}
3535
path: "*.lock"
3636
- name: Restore cache
37-
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
37+
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
3838
id: restore-cache
3939
with:
4040
key: bundle-${{ runner.os }}-${{ runner.arch }}-${{ steps.ruby-alias.outputs.ruby-alias }}-${{ hashFiles('*.lock') }}
@@ -44,7 +44,7 @@ runs:
4444
run: bundle install
4545
- if: steps.restore-cache.outputs.cache-hit != 'true'
4646
name: Save cache
47-
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
47+
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
4848
with:
4949
key: "${{ steps.restore-cache.outputs.cache-primary-key }}"
5050
path: "/usr/local/bundle"

.github/actions/bundle-restore/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ runs:
1515
using: composite
1616
steps:
1717
- name: Download lockfile
18-
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
18+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
1919
with:
2020
name: ${{ inputs.lockfile }}
2121

2222
- name: Restore cache
23-
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
23+
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
2424
id: restore-cache
2525
with:
2626
key: "${{ inputs.cache-key }}"

.github/forced-tests-list.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@
1010

1111
# Example :
1212
# tests/parametric/test_config_consistency.py::Test_Stable_Config_Default::test_config_precedence
13+
14+
tests/test_config_consistency.py::Test_Config_HttpClientErrorStatuses_FeatureFlagCustom
15+
tests/test_config_consistency.py::Test_Config_HttpServerErrorStatuses_FeatureFlagCustom

0 commit comments

Comments
 (0)