Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/2.0' into munir/add-dd-span-links
Browse files Browse the repository at this point in the history
  • Loading branch information
mabdinur committed Mar 25, 2024
2 parents c594f94 + 22f8d40 commit 1721e3c
Show file tree
Hide file tree
Showing 441 changed files with 1,100 additions and 851 deletions.
2 changes: 1 addition & 1 deletion .circleci/images/primary/binary_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2
4
8 changes: 4 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ run the test suite, write new integrations, and more.
**2.0 Upgrade Guide notes**
<!--
(If this PR is for 1.x, please delete this section)
A public facing description that will go into the [upgrade guide](https://github.com/DataDog/dd-trace-rb/blob/master/docs/UpgradeGuide.md) for this change.
We already know what the PR does (from the PR title),
but users should know either:
If this PR introduces a breaking change, update the
https://github.com/DataDog/dd-trace-rb/blob/2.0/docs/UpgradeGuide2.md
in this PR with either:
* A migration path for this change. In other words, how to continue using their application without behavior changes
in 2.0 (e.g. environment variable 'X' renamed to 'Y').
* That there's no alternative; we completely dropped support for this feature.
* That there's no alternative; we removed support for this feature.
-->

**What does this PR do?**
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/lib-injection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ jobs:
uses: docker/setup-buildx-action@v2
- name: Login to Docker
run: docker login -u publisher -p ${{ secrets.GITHUB_TOKEN }} ghcr.io
- name: Docker latest snapshot build
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
with:
push: true
tags: ghcr.io/datadog/dd-trace-rb/dd-lib-ruby-init:latest_snapshot
platforms: 'linux/amd64,linux/arm64/v8'
build-args: DDTRACE_RUBY_SHA=${{ github.sha }}
context: ./lib-injection
- name: Docker Build
uses: docker/build-push-action@v3
with:
Expand Down
61 changes: 30 additions & 31 deletions .github/workflows/release-lib-injection.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
# name: "Release Library Injection"
# on:
# push:
# tags:
# - 'v*.*.*'

name: "Release Library Injection"
on:
push:
tags:
- 'v*.*.*'

jobs:
build-and-publish-release-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set version
id: version
run: echo "version=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Get version
run: echo "The selected version is ${{ steps.version.outputs.version }}"
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker
run: docker login -u publisher -p ${{ secrets.GITHUB_TOKEN }} ghcr.io
- name: Docker Build
uses: docker/build-push-action@v3
with:
push: true
tags: ghcr.io/datadog/dd-trace-rb/dd-lib-ruby-init:${{ steps.version.outputs.version }}
platforms: 'linux/amd64,linux/arm64/v8'
build-args: DATADOG_RUBY_GEM_VERSION=${{ steps.version.outputs.version }}
context: ./lib-injection
# jobs:
# build-and-publish-release-image:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Set version
# id: version
# run: echo "version=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
# - name: Get version
# run: echo "The selected version is ${{ steps.version.outputs.version }}"
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v2
# - name: Set up Docker Buildx
# id: buildx
# uses: docker/setup-buildx-action@v2
# - name: Login to Docker
# run: docker login -u publisher -p ${{ secrets.GITHUB_TOKEN }} ghcr.io
# - name: Docker Build
# uses: docker/build-push-action@v3
# with:
# push: true
# tags: ghcr.io/datadog/dd-trace-rb/dd-lib-ruby-init:${{ steps.version.outputs.version }}
# platforms: 'linux/amd64,linux/arm64/v8'
# build-args: DATADOG_RUBY_GEM_VERSION=${{ steps.version.outputs.version }}
# context: ./lib-injection

78 changes: 39 additions & 39 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ build-gem:
stage: package
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
when: never
when: on_success
- if: $CI_COMMIT_TAG
when: on_success
- if: $CI_COMMIT_BRANCH == 'master'
Expand All @@ -90,7 +90,7 @@ build-gem:
.gitlab/patch_gem_version.sh glci $CI_JOB_ID $CI_COMMIT_REF_NAME $CI_COMMIT_SHA
fi
- bundle install && bundle exec rake build
- bundle install && chmod go-w -R . && bundle exec rake build
- mkdir -p tmp && ruby -Ilib -rdatadog/version -e 'puts Gem::Version.new(Datadog::VERSION::STRING).to_s' >> tmp/version.txt
artifacts:
paths:
Expand Down Expand Up @@ -192,40 +192,40 @@ deploy_to_reliability_env:
UPSTREAM_PROJECT_NAME: $CI_PROJECT_NAME
UPSTREAM_COMMIT_SHA: $CI_COMMIT_SHA

deploy_to_docker_registries:
stage: deploy
rules:
- if: "$POPULATE_CACHE"
when: never
- if: "$CI_COMMIT_TAG =~ /^v.*/"
when: delayed
start_in: 1 day
- when: manual
allow_failure: true
trigger:
project: DataDog/public-images
branch: main
strategy: depend
variables:
IMG_SOURCES: ghcr.io/datadog/dd-trace-rb/dd-lib-ruby-init:$CI_COMMIT_TAG
IMG_DESTINATIONS: dd-lib-ruby-init:$CI_COMMIT_TAG
IMG_SIGNING: "false"

deploy_latest_tag_to_docker_registries:
stage: deploy
rules:
- if: "$POPULATE_CACHE"
when: never
- if: "$CI_COMMIT_TAG =~ /^v.*/"
when: delayed
start_in: 1 day
- when: manual
allow_failure: true
trigger:
project: DataDog/public-images
branch: main
strategy: depend
variables:
IMG_SOURCES: ghcr.io/datadog/dd-trace-rb/dd-lib-ruby-init:$CI_COMMIT_TAG
IMG_DESTINATIONS: dd-lib-ruby-init:latest
IMG_SIGNING: "false"
# deploy_to_docker_registries:
# stage: deploy
# rules:
# - if: "$POPULATE_CACHE"
# when: never
# - if: "$CI_COMMIT_TAG =~ /^v.*/"
# when: delayed
# start_in: 1 day
# - when: manual
# allow_failure: true
# trigger:
# project: DataDog/public-images
# branch: main
# strategy: depend
# variables:
# IMG_SOURCES: ghcr.io/datadog/dd-trace-rb/dd-lib-ruby-init:$CI_COMMIT_TAG
# IMG_DESTINATIONS: dd-lib-ruby-init:$CI_COMMIT_TAG
# IMG_SIGNING: "false"

# deploy_latest_tag_to_docker_registries:
# stage: deploy
# rules:
# - if: "$POPULATE_CACHE"
# when: never
# - if: "$CI_COMMIT_TAG =~ /^v.*/"
# when: delayed
# start_in: 1 day
# - when: manual
# allow_failure: true
# trigger:
# project: DataDog/public-images
# branch: main
# strategy: depend
# variables:
# IMG_SOURCES: ghcr.io/datadog/dd-trace-rb/dd-lib-ruby-init:$CI_COMMIT_TAG
# IMG_DESTINATIONS: dd-lib-ruby-init:latest
# IMG_SIGNING: "false"
6 changes: 5 additions & 1 deletion .gitlab/build-deb-rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ echo -n "$RUBY_PACKAGE_VERSION" > auto_inject-ruby.version

source common_build_functions.sh

chmod a+r -R ../tmp/*
# The normal settings for /tmp are 1777, which ls shows as drwxrwxrwt. That is wide open.
#
# This gives all users read access, and removes write access for group and others,
# to all files and directories in the tmp directory.
chmod -R a+r,go-w ../tmp/*

fpm_wrapper "datadog-apm-library-ruby" "$RUBY_PACKAGE_VERSION" \
--input-type dir \
Expand Down
87 changes: 86 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,62 @@

## [Unreleased]

## [2.0.0.beta1] - 2024-03-22

Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v2.0.0.beta1

Git diff: https://github.com/DataDog/dd-trace-rb/compare/v1.21.1...v2.0.0.beta1

See https://github.com/DataDog/dd-trace-rb/blob/v2.0.0.beta1/docs/UpgradeGuide2.md.

## [1.21.1] - 2024-03-20

### Added

* Backports auto instrument shim with `datadog/auto_instrument` ([#3535][])

### Fixed

* Fix ActiveRecord resolving invalid string ([#3523][])
* Revert `http.route` tagging to fix instrumentation failure for Rails 7.1 apps ([#3539][])
* Fix wrong permissions on released gem files ([#3531][])

## [1.21.0] - 2024-03-14

### Highlights
Allocation profiling is now in beta, and timeline profiling is enabled by default.
For more details, check the [release notes](https://github.com/DataDog/dd-trace-rb/releases/tag/v1.21.0)

### Added

* APM source code integration ([#3463][])
* Core: Reduce startup logs verbosity ([#3468][])
* Tracing: Add Concurrent::Async instrumentation ([#3427][])
* Profiling: System info support ([#3357][])
* Profiling: Add bin/ddprofrb ([#3501][])

### Changed

* Bump datadog-ci dependency to 0.8.1 ([#3518][])
* Upgrade to libdatadog 6 ([#3455][])
* Core: Allow suppressing error logs for Core::Remote::Negotiation ([#3495][])
* Tracing: Add `http.route` tag to rack ([#3345][])
* Tracing: Logs deprecation warning for `use` removal ([#3438][])
* Profiling: Allocation sampling overhead improvements ([#3434][], [#3440][])
* Profiling: Enable timeline by default ([#3428][])
* Profiling: Rename Profiling files to reflect "datadog" instead of "ddtrace" ([#3502][])
* Profiling: Replace `profiling.advanced.experimental_allocation_enabled` with `profiling.allocation_enabled` and remove experimental warning ([#3520][])

### Fixed

* Core: Fix rare remote configuration worker thread leak ([#3519][])
* Tracing: Fix `Datadog::Tracing.reject!` with correct metrics ([#3491][])
* Tracing: Guard PG result with `nil` check ([#3511][])
* Profiling: Add workaround for Ruby VM bug causing crash in gc_finalize_deferred ([#3473][])
* Profiling: Fix missing profiling code hotspots when using ddtrace+otel ([#3466][])
* Profiling: Stop worker on clock failure ([#3439][])
* Profiling: Upgrade libdatadog to fix incorrect platform detection for x86_64-linux-gnu/aarch64-linux-gnu ([#3503][])

## [1.20.0] - 2024-02-05

### Added
Expand Down Expand Up @@ -2728,7 +2784,10 @@ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.3.1
Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1


[Unreleased]: https://github.com/DataDog/dd-trace-rb/compare/v1.20.0...master
[Unreleased]: https://github.com/DataDog/dd-trace-rb/compare/v1.21.1...master
[2.0.0.beta1]: https://github.com/DataDog/dd-trace-rb/compare/v1.21.1...v2.0.0.beta1
[1.21.1]: https://github.com/DataDog/dd-trace-rb/compare/v1.21.0...v1.21.1
[1.21.0]: https://github.com/DataDog/dd-trace-rb/compare/v1.20.0...v1.21.0
[1.20.0]: https://github.com/DataDog/dd-trace-rb/compare/v1.19.0...v1.20.0
[1.19.0]: https://github.com/DataDog/dd-trace-rb/compare/v1.18.0...v1.19.0
[1.18.0]: https://github.com/DataDog/dd-trace-rb/compare/v1.17.0...v1.18.0
Expand Down Expand Up @@ -3979,10 +4038,12 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
[#3328]: https://github.com/DataDog/dd-trace-rb/issues/3328
[#3329]: https://github.com/DataDog/dd-trace-rb/issues/3329
[#3333]: https://github.com/DataDog/dd-trace-rb/issues/3333
[#3345]: https://github.com/DataDog/dd-trace-rb/issues/3345
[#3349]: https://github.com/DataDog/dd-trace-rb/issues/3349
[#3352]: https://github.com/DataDog/dd-trace-rb/issues/3352
[#3354]: https://github.com/DataDog/dd-trace-rb/issues/3354
[#3356]: https://github.com/DataDog/dd-trace-rb/issues/3356
[#3357]: https://github.com/DataDog/dd-trace-rb/issues/3357
[#3360]: https://github.com/DataDog/dd-trace-rb/issues/3360
[#3361]: https://github.com/DataDog/dd-trace-rb/issues/3361
[#3362]: https://github.com/DataDog/dd-trace-rb/issues/3362
Expand All @@ -3996,7 +4057,31 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
[#3408]: https://github.com/DataDog/dd-trace-rb/issues/3408
[#3420]: https://github.com/DataDog/dd-trace-rb/issues/3420
[#3426]: https://github.com/DataDog/dd-trace-rb/issues/3426
[#3427]: https://github.com/DataDog/dd-trace-rb/issues/3427
[#3428]: https://github.com/DataDog/dd-trace-rb/issues/3428
[#3431]: https://github.com/DataDog/dd-trace-rb/issues/3431
[#3434]: https://github.com/DataDog/dd-trace-rb/issues/3434
[#3438]: https://github.com/DataDog/dd-trace-rb/issues/3438
[#3439]: https://github.com/DataDog/dd-trace-rb/issues/3439
[#3440]: https://github.com/DataDog/dd-trace-rb/issues/3440
[#3455]: https://github.com/DataDog/dd-trace-rb/issues/3455
[#3463]: https://github.com/DataDog/dd-trace-rb/issues/3463
[#3466]: https://github.com/DataDog/dd-trace-rb/issues/3466
[#3468]: https://github.com/DataDog/dd-trace-rb/issues/3468
[#3473]: https://github.com/DataDog/dd-trace-rb/issues/3473
[#3491]: https://github.com/DataDog/dd-trace-rb/issues/3491
[#3495]: https://github.com/DataDog/dd-trace-rb/issues/3495
[#3501]: https://github.com/DataDog/dd-trace-rb/issues/3501
[#3502]: https://github.com/DataDog/dd-trace-rb/issues/3502
[#3503]: https://github.com/DataDog/dd-trace-rb/issues/3503
[#3511]: https://github.com/DataDog/dd-trace-rb/issues/3511
[#3518]: https://github.com/DataDog/dd-trace-rb/issues/3518
[#3519]: https://github.com/DataDog/dd-trace-rb/issues/3519
[#3520]: https://github.com/DataDog/dd-trace-rb/issues/3520
[#3523]: https://github.com/DataDog/dd-trace-rb/issues/3523
[#3531]: https://github.com/DataDog/dd-trace-rb/issues/3531
[#3535]: https://github.com/DataDog/dd-trace-rb/issues/3535
[#3539]: https://github.com/DataDog/dd-trace-rb/issues/3539
[@AdrianLC]: https://github.com/AdrianLC
[@Azure7111]: https://github.com/Azure7111
[@BabyGroot]: https://github.com/BabyGroot
Expand Down
13 changes: 2 additions & 11 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,6 @@ TEST_METADATA = {
'redis-4' => '❌ 2.1 / ❌ 2.2 / ❌ 2.3 / ✅ 2.4 / ✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby',
'redis-5' => '❌ 2.1 / ❌ 2.2 / ❌ 2.3 / ❌ 2.4 / ✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby'
},
'routetest' => {
'multi-rack-app' => '❌ 2.1 / ❌ 2.2 / ❌ 2.3 / ❌ 2.4 / ✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby'
},
'appsec:rack' => {
# Non-deprecated form of Regexp.new does not backport to Rack 1.x, see: https://github.com/rack/rack/pull/1998
'rack-1' => '✅ 2.1 / ✅ 2.2 / ✅ 2.3 / ✅ 2.4 / ✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ❌ 3.3 / ✅ jruby',
Expand Down Expand Up @@ -329,13 +326,13 @@ namespace :spec do
task all: [:main, :benchmark,
:rails, :railsredis, :railsredis_activesupport, :railsactivejob,
:elasticsearch, :http, :redis, :sidekiq, :sinatra, :hanami, :hanami_autoinstrument,
:profiling, :routetest]
:profiling]

desc '' # "Explicitly hiding from `rake -T`"
RSpec::Core::RakeTask.new(:main) do |t, args|
t.pattern = 'spec/**/*_spec.rb'
t.exclude_pattern = 'spec/**/{contrib,benchmark,redis,auto_instrument,opentelemetry,profiling}/**/*_spec.rb,'\
' spec/**/{auto_instrument,opentelemetry}_spec.rb'
' spec/**/{auto_instrument,opentelemetry}_spec.rb, spec/datadog/gem_packaging_spec.rb'
t.rspec_opts = args.to_a.join(' ')
end

Expand All @@ -358,12 +355,6 @@ namespace :spec do
t.rspec_opts = args.to_a.join(' ')
end

desc '' # "Explicitly hiding from `rake -T`"
RSpec::Core::RakeTask.new(:routetest) do |t, args|
t.pattern = 'spec/datadog/tracing/contrib/http_route_spec.rb'
t.rspec_opts = args.to_a.join(' ')
end

desc '' # "Explicitly hiding from `rake -T`"
RSpec::Core::RakeTask.new(:railsredis) do |t, args|
t.pattern = 'spec/datadog/tracing/contrib/rails/**/*redis*_spec.rb'
Expand Down
1 change: 1 addition & 0 deletions Steepfile
Original file line number Diff line number Diff line change
Expand Up @@ -618,4 +618,5 @@ target :datadog do

# TODO: gem 'libddwaf'
library 'libddwaf'
library 'libdatadog'
end
8 changes: 0 additions & 8 deletions appraisal/jruby-9.2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,3 @@
appraise 'core-old' do
gem 'dogstatsd-ruby', '~> 4'
end

appraise 'multi-rack-app' do
gem 'sinatra'
gem 'rack-contrib'
gem 'rack-test' # Dev dependencies for testing rack-based code
gem 'grape'
gem 'rails', '~> 5.2.1'
end
8 changes: 0 additions & 8 deletions appraisal/jruby-9.3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,3 @@
appraise 'core-old' do
gem 'dogstatsd-ruby', '~> 4'
end

appraise 'multi-rack-app' do
gem 'sinatra', '>= 3'
gem 'rack-contrib'
gem 'rack-test' # Dev dependencies for testing rack-based code
gem 'grape'
gem 'rails', '~> 5.2.1'
end
Loading

0 comments on commit 1721e3c

Please sign in to comment.