diff --git a/.github/actions/test_gem/action.yml b/.github/actions/test_gem/action.yml index a2d722181..f479cd697 100644 --- a/.github/actions/test_gem/action.yml +++ b/.github/actions/test_gem/action.yml @@ -66,7 +66,7 @@ runs: # ...but not for appraisals, sadly. - name: Install Ruby ${{ inputs.ruby }} with dependencies if: "${{ steps.setup.outputs.appraisals == 'false' }}" - uses: ruby/setup-ruby@v1.165.1 + uses: ruby/setup-ruby@v1.176.0 with: ruby-version: "${{ inputs.ruby }}" working-directory: "${{ steps.setup.outputs.gem_dir }}" @@ -77,7 +77,7 @@ runs: # If we're using appraisals, do it all manually. - name: Install Ruby ${{ inputs.ruby }} without dependencies if: "${{ steps.setup.outputs.appraisals == 'true' }}" - uses: ruby/setup-ruby@v1.165.1 + uses: ruby/setup-ruby@v1.176.0 with: ruby-version: "${{ inputs.ruby }}" bundler: "latest" diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9e4ed404b..5cf3f91db 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -89,6 +89,10 @@ updates: directory: "/instrumentation/aws_sdk" schedule: interval: weekly +- package-ecosystem: bundler + directory: "/instrumentation/aws_lambda" + schedule: + interval: weekly - package-ecosystem: bundler directory: "/instrumentation/active_record" schedule: diff --git a/.github/workflows/ci-contrib-canary.yml b/.github/workflows/ci-contrib-canary.yml deleted file mode 100644 index 90c6b236f..000000000 --- a/.github/workflows/ci-contrib-canary.yml +++ /dev/null @@ -1,171 +0,0 @@ -name: CI Contrib - Canary - -on: - workflow_dispatch: - schedule: - - cron: "0 0 * * *" - -jobs: - helpers: - strategy: - fail-fast: false - matrix: - gem: - - mysql - - sql-obfuscation - os: - - ubuntu-latest - - macos-latest - - windows-latest - name: "helpers-${{ matrix.gem }} / ${{ matrix.os }}" - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - name: "Test Ruby 3.2" - uses: ./.github/actions/test_gem - with: - gem: "opentelemetry-helpers-${{ matrix.gem }}" - ruby: "3.2" - - name: "Test Ruby 3.1" - uses: ./.github/actions/test_gem - with: - gem: "opentelemetry-helpers-${{ matrix.gem }}" - ruby: "3.1" - - name: "Test Ruby 3.0" - if: "${{ matrix.os == 'ubuntu-latest' }}" - uses: ./.github/actions/test_gem - with: - gem: "opentelemetry-helpers-${{ matrix.gem }}" - ruby: "3.0" - yard: true - rubocop: true - build: true - - name: "Test JRuby" - if: "${{ matrix.os == 'ubuntu-latest' }}" - uses: ./.github/actions/test_gem - with: - gem: "opentelemetry-helpers-${{ matrix.gem }}" - ruby: "jruby-9.4.2.0" - - name: "Test truffleruby" - if: "${{ matrix.os == 'ubuntu-latest' }}" - uses: ./.github/actions/test_gem - with: - gem: "opentelemetry-helpers-${{ matrix.gem }}" - ruby: "truffleruby" - - propagators: - strategy: - fail-fast: false - matrix: - gem: - - ottrace - - xray - os: - - ubuntu-latest - - macos-latest - - windows-latest - name: "propagator-${{ matrix.gem }} / ${{ matrix.os }}" - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - name: "Test Ruby 3.3" - uses: ./.github/actions/test_gem - with: - gem: "opentelemetry-propagator-${{ matrix.gem }}" - ruby: "3.3" - latest: "true" - - name: "Test Ruby 3.2" - uses: ./.github/actions/test_gem - with: - gem: "opentelemetry-propagator-${{ matrix.gem }}" - ruby: "3.2" - latest: "true" - - name: "Test Ruby 3.1" - uses: ./.github/actions/test_gem - with: - gem: "opentelemetry-propagator-${{ matrix.gem }}" - ruby: "3.1" - latest: "true" - - name: "Test Ruby 3.0" - if: "${{ matrix.os == 'ubuntu-latest' }}" - uses: ./.github/actions/test_gem - with: - gem: "opentelemetry-propagator-${{ matrix.gem }}" - ruby: "3.0" - latest: "true" - yard: true - rubocop: true - build: true - - name: "Test JRuby" - if: "${{ matrix.os == 'ubuntu-latest' }}" - uses: ./.github/actions/test_gem - with: - gem: "opentelemetry-propagator-${{ matrix.gem }}" - ruby: "jruby-9.4.2.0" - latest: "true" - - name: "Test truffleruby" - if: "${{ matrix.os == 'ubuntu-latest' }}" - uses: ./.github/actions/test_gem - with: - gem: "opentelemetry-propagator-${{ matrix.gem }}" - ruby: "truffleruby" - latest: "true" - - resource-detectors: - strategy: - fail-fast: false - matrix: - gem: - - resource-detector-azure - - resource-detector-container - - resource-detector-google_cloud_platform - os: - - ubuntu-latest - - macos-latest - - windows-latest - name: "opentelemetry-${{ matrix.gem }} / ${{ matrix.os }}" - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - name: "Test Ruby 3.3" - uses: ./.github/actions/test_gem - with: - gem: "opentelemetry-${{ matrix.gem }}" - ruby: "3.3" - latest: "true" - - name: "Test Ruby 3.2" - uses: ./.github/actions/test_gem - with: - gem: "opentelemetry-${{ matrix.gem }}" - ruby: "3.2" - latest: "true" - - name: "Test Ruby 3.1" - uses: ./.github/actions/test_gem - with: - gem: "opentelemetry-${{ matrix.gem }}" - ruby: "3.1" - latest: "true" - - name: "Test Ruby 3.0" - if: "${{ matrix.os == 'ubuntu-latest' }}" - uses: ./.github/actions/test_gem - with: - gem: "opentelemetry-${{ matrix.gem }}" - ruby: "3.0" - latest: "true" - yard: true - rubocop: true - build: true - - name: "Test JRuby" - if: "${{ matrix.os == 'ubuntu-latest' }}" - uses: ./.github/actions/test_gem - with: - gem: "opentelemetry-${{ matrix.gem }}" - ruby: "jruby-9.4.2.0" - latest: "true" - - name: "Test truffleruby" - if: "${{ matrix.os == 'ubuntu-latest' }}" - uses: ./.github/actions/test_gem - with: - gem: "opentelemetry-${{ matrix.gem }}" - ruby: "truffleruby" - latest: "true" diff --git a/.github/workflows/ci-contrib.yml b/.github/workflows/ci-contrib.yml index eac8ffd30..f11bf4e30 100644 --- a/.github/workflows/ci-contrib.yml +++ b/.github/workflows/ci-contrib.yml @@ -8,6 +8,12 @@ on: pull_request: branches: - main + schedule: + - cron: "0 0 * * *" + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} # Ensure that only one instance of this workflow is running per Pull Request + cancel-in-progress: true # Cancel any previous runs of this workflow jobs: helpers: @@ -47,7 +53,7 @@ jobs: uses: ./.github/actions/test_gem with: gem: "opentelemetry-helpers-${{ matrix.gem }}" - ruby: "jruby-9.4.2.0" + ruby: "jruby-9.4.6.0" propagators: strategy: @@ -91,7 +97,7 @@ jobs: uses: ./.github/actions/test_gem with: gem: "opentelemetry-propagator-${{ matrix.gem }}" - ruby: "jruby-9.4.2.0" + ruby: "jruby-9.4.6.0" resource-detectors: strategy: @@ -136,4 +142,47 @@ jobs: uses: ./.github/actions/test_gem with: gem: "opentelemetry-${{ matrix.gem }}" - ruby: "jruby-9.4.2.0" + ruby: "jruby-9.4.6.0" + + processors: + strategy: + fail-fast: false + matrix: + gem: + - baggage + os: + - ubuntu-latest + name: "processors-${{ matrix.gem }} / ${{ matrix.os }}" + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - name: "Test Ruby 3.3" + uses: ./.github/actions/test_gem + with: + gem: "opentelemetry-processor-${{ matrix.gem }}" + ruby: "3.3" + - name: "Test Ruby 3.2" + uses: ./.github/actions/test_gem + with: + gem: "opentelemetry-processor-${{ matrix.gem }}" + ruby: "3.2" + - name: "Test Ruby 3.1" + uses: ./.github/actions/test_gem + with: + gem: "opentelemetry-processor-${{ matrix.gem }}" + ruby: "3.1" + - name: "Test Ruby 3.0" + if: "${{ matrix.os == 'ubuntu-latest' }}" + uses: ./.github/actions/test_gem + with: + gem: "opentelemetry-processor-${{ matrix.gem }}" + ruby: "3.0" + yard: true + rubocop: true + build: true + - name: "Test JRuby" + if: "${{ matrix.os == 'ubuntu-latest' && steps.jruby_skip.outputs.skip == 'false' }}" + uses: ./.github/actions/test_gem + with: + gem: "opentelemetry-processor-${{ matrix.gem }}" + ruby: "jruby-9.4.6.0" diff --git a/.github/workflows/ci-instrumentation-canary.yml b/.github/workflows/ci-instrumentation-canary.yml deleted file mode 100644 index e3e1afe16..000000000 --- a/.github/workflows/ci-instrumentation-canary.yml +++ /dev/null @@ -1,139 +0,0 @@ -name: CI Instrumentation - Canary - -on: - workflow_dispatch: - schedule: - - cron: "0 0 * * *" - -jobs: - instrumentation: - strategy: - fail-fast: false - matrix: - gem: - - action_pack - - action_view - - active_job - - active_model_serializers - - active_record - - active_support - - all - - aws_sdk - - base - - concurrent_ruby - - delayed_job - - ethon - - excon - - faraday - - grape - - graphql - - gruf - - http - - http_client - - koala - - lmdb - - net_http - - httpx - - rack - - rails - - restclient - - rspec - - sinatra - os: - - ubuntu-latest - - macos-latest - - windows-latest - exclude: - - os: windows-latest - gem: ethon - - os: windows-latest - gem: action_pack - - os: windows-latest - gem: restclient - - os: windows-latest - gem: rails - - os: macos-latest - gem: lmdb - - name: ${{ matrix.gem }} / ${{ matrix.os }} - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - name: "Test Ruby 3.3" - uses: ./.github/actions/test_gem - with: - gem: "opentelemetry-instrumentation-${{ matrix.gem }}" - ruby: "3.3" - latest: "true" - - name: "Test Ruby 3.2" - uses: ./.github/actions/test_gem - with: - gem: "opentelemetry-instrumentation-${{ matrix.gem }}" - ruby: "3.2" - latest: "true" - - name: "Test Ruby 3.1" - uses: ./.github/actions/test_gem - with: - gem: "opentelemetry-instrumentation-${{ matrix.gem }}" - ruby: "3.1" - latest: "true" - - name: "Test Ruby 3.0" - if: "${{ matrix.os == 'ubuntu-latest' }}" - uses: ./.github/actions/test_gem - with: - gem: "opentelemetry-instrumentation-${{ matrix.gem }}" - ruby: "3.0" - latest: "true" - yard: true - rubocop: true - build: true - - name: "JRuby Filter" - id: jruby_skip - shell: bash - run: | - echo "skip=false" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "action_pack" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "action_view" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "active_model_serializers" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "active_record" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "active_support" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "aws_sdk" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "delayed_job" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "graphql" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "http" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "http_client" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "koala" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "lmdb" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "rack" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "rails" ]] && echo "skip=true" >> $GITHUB_OUTPUT - # This is essentially a bash script getting evaluated, so we need to return true or the whole job fails. - true - - name: "Test JRuby" - if: "${{ matrix.os == 'ubuntu-latest' && steps.jruby_skip.outputs.skip == 'false' }}" - uses: ./.github/actions/test_gem - with: - gem: "opentelemetry-instrumentation-${{ matrix.gem }}" - latest: "true" - ruby: "jruby-9.4.2.0" - - name: "Truffleruby Filter" - id: truffleruby_skip - shell: bash - run: | - echo "skip=false" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "action_pack" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "action_view" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "active_job" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "active_record" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "active_support" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "delayed_job" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "lmdb" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "rails" ]] && echo "skip=true" >> $GITHUB_OUTPUT - # This is essentially a bash script getting evaluated, so we need to return true or the whole job fails. - true - - name: "Test Truffleruby" - if: "${{ matrix.os == 'ubuntu-latest' && steps.truffleruby_skip.outputs.skip == 'false' }}" - uses: ./.github/actions/test_gem - with: - gem: "opentelemetry-instrumentation-${{ matrix.gem }}" - ruby: "truffleruby" - latest: "true" diff --git a/.github/workflows/ci-instrumentation-with-services-canary.yml b/.github/workflows/ci-instrumentation-with-services-canary.yml deleted file mode 100644 index 63d2d087c..000000000 --- a/.github/workflows/ci-instrumentation-with-services-canary.yml +++ /dev/null @@ -1,161 +0,0 @@ -name: CI Instrumentation With Services - Canary - -on: - workflow_dispatch: - schedule: - - cron: "0 0 * * *" - -jobs: - # These builds require sidecar services (postgres, redis, etc) in order to run their test suites. - instrumentation_with_services: - strategy: - fail-fast: false - # We don't run on macos and windows since service containers aren't supported there. - matrix: - gem: - - bunny - - dalli - - mongo - - mysql2 - - pg - - que - - rdkafka - - redis - - resque - - ruby_kafka - - sidekiq - - trilogy - name: ${{ matrix.gem }} / ubuntu-latest / services - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: "Test Ruby 3.3" - uses: ./.github/actions/test_gem - with: - gem: "opentelemetry-instrumentation-${{ matrix.gem }}" - ruby: "3.3" - latest: "true" - - name: "Test Ruby 3.2" - uses: ./.github/actions/test_gem - with: - gem: "opentelemetry-instrumentation-${{ matrix.gem }}" - ruby: "3.2" - latest: "true" - - name: "Test Ruby 3.1" - uses: ./.github/actions/test_gem - with: - gem: "opentelemetry-instrumentation-${{ matrix.gem }}" - ruby: "3.1" - latest: "true" - - name: "Test Ruby 3.0" - uses: ./.github/actions/test_gem - with: - gem: "opentelemetry-instrumentation-${{ matrix.gem }}" - ruby: "3.0" - latest: "true" - yard: true - rubocop: true - build: true - - name: "JRuby Filter" - id: jruby_skip - shell: bash - run: | - echo "skip=false" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "bunny" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "mysql2" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "pg" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "que" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "rdkafka" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "redis" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "resque" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "ruby_kafka" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "sidekiq" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "trilogy" ]] && echo "skip=true" >> $GITHUB_OUTPUT - # This is essentially a bash script getting evaluated, so we need to return true or the whole job fails. - true - - name: "Test JRuby" - if: "${{ steps.jruby_skip.outputs.skip == 'false' }}" - uses: ./.github/actions/test_gem - with: - gem: "opentelemetry-instrumentation-${{ matrix.gem }}" - ruby: "jruby-9.4.2.0" - latest: "true" - - name: "Truffleruby Filter" - id: truffleruby_skip - shell: bash - run: | - echo "skip=false" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "que" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "rdkafka" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "ruby_kafka" ]] && echo "skip=true" >> $GITHUB_OUTPUT - # This is essentially a bash script getting evaluated, so we need to return true or the whole job fails. - true - - name: "Test Truffleruby" - if: "${{ steps.truffleruby_skip.outputs.skip == 'false' }}" - uses: ./.github/actions/test_gem - with: - gem: "opentelemetry-instrumentation-${{ matrix.gem }}" - ruby: "truffleruby" - latest: "true" - services: - zookeeper: - image: confluentinc/cp-zookeeper:latest - ports: - - 2181:2181 - env: - ZOOKEEPER_CLIENT_PORT: 2181 - ZOOKEEPER_TICK_TIME: 2000 - kafka: - image: confluentinc/cp-kafka:latest - ports: - - 9092:9092 - - 29092:29092 - env: - KAFKA_BROKER_ID: 1 - KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 - KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:29092,PLAINTEXT_HOST://localhost:9092 - KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT - KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT - KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 - memcached: - image: memcached:alpine - ports: - - 11211:11211 - mongodb: - image: mongo:4.4 - ports: - - 27017:27017 - redis: - image: bitnami/redis:6.2 - ports: - - 6379:6379 - options: >- - --health-cmd "redis-cli ping" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - env: - REDIS_PASSWORD: "passw0rd" - mysql: - image: mysql:8.0.31 - env: - MYSQL_DATABASE: mysql - MYSQL_ROOT_PASSWORD: root - MYSQL_PASSWORD: mysql - MYSQL_USER: mysql - ports: - - 3306:3306 - options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 - rabbitmq: - image: rabbitmq:3.8-alpine - ports: - - "5672:5672" - postgres: - image: postgres:13 - env: - POSTGRES_PASSWORD: postgres - ports: - - 5432:5432 - options: --health-cmd="pg_isready" --health-interval=5s --health-timeout=2s --health-retries=3 - volumes: - - "/var/run/postgresql:/var/run/postgresql" diff --git a/.github/workflows/ci-instrumentation-with-services.yml b/.github/workflows/ci-instrumentation-with-services.yml index 259d97127..0aeb807d2 100644 --- a/.github/workflows/ci-instrumentation-with-services.yml +++ b/.github/workflows/ci-instrumentation-with-services.yml @@ -8,6 +8,12 @@ on: pull_request: branches: - main + schedule: + - cron: "0 0 * * *" + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} # Ensure that only one instance of this workflow is running per Pull Request + cancel-in-progress: true # Cancel any previous runs of this workflow jobs: instrumentation_with_services: @@ -50,7 +56,7 @@ jobs: uses: ./.github/actions/test_gem with: gem: "opentelemetry-instrumentation-${{ matrix.gem }}" - ruby: "jruby-9.4.2.0" + ruby: "jruby-9.4.6.0" services: memcached: image: memcached:alpine diff --git a/.github/workflows/ci-instrumentation.yml b/.github/workflows/ci-instrumentation.yml index 59088633a..9f8466a8a 100644 --- a/.github/workflows/ci-instrumentation.yml +++ b/.github/workflows/ci-instrumentation.yml @@ -8,6 +8,12 @@ on: pull_request: branches: - main + schedule: + - cron: "0 0 * * *" + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} # Ensure that only one instance of this workflow is running per Pull Request + cancel-in-progress: true # Cancel any previous runs of this workflow jobs: instrumentation: @@ -23,6 +29,7 @@ jobs: - active_support - all - aws_sdk + - aws_lambda - base - concurrent_ruby - delayed_job @@ -85,6 +92,7 @@ jobs: [[ "${{ matrix.gem }}" == "active_record" ]] && echo "skip=true" >> $GITHUB_OUTPUT [[ "${{ matrix.gem }}" == "active_support" ]] && echo "skip=true" >> $GITHUB_OUTPUT [[ "${{ matrix.gem }}" == "aws_sdk" ]] && echo "skip=true" >> $GITHUB_OUTPUT + [[ "${{ matrix.gem }}" == "aws_lambda" ]] && echo "skip=true" >> $GITHUB_OUTPUT [[ "${{ matrix.gem }}" == "delayed_job" ]] && echo "skip=true" >> $GITHUB_OUTPUT [[ "${{ matrix.gem }}" == "graphql" ]] && echo "skip=true" >> $GITHUB_OUTPUT [[ "${{ matrix.gem }}" == "http" ]] && echo "skip=true" >> $GITHUB_OUTPUT @@ -101,4 +109,4 @@ jobs: uses: ./.github/actions/test_gem with: gem: "opentelemetry-instrumentation-${{ matrix.gem }}" - ruby: "jruby-9.4.2.0" + ruby: "jruby-9.4.6.0" diff --git a/.github/workflows/conventional-commits.yaml b/.github/workflows/conventional-commits.yaml index cc3a3ef71..6e9344b7d 100644 --- a/.github/workflows/conventional-commits.yaml +++ b/.github/workflows/conventional-commits.yaml @@ -22,7 +22,7 @@ jobs: name: Conventional Commits Validation runs-on: ubuntu-latest steps: - - uses: dev-build-deploy/commit-me@v1.3.1 + - uses: dev-build-deploy/commit-me@v1.4.1 env: FORCE_COLOR: 3 with: diff --git a/.github/workflows/installation-tests.yml b/.github/workflows/installation-tests.yml index 2c159d6b1..280b6e743 100644 --- a/.github/workflows/installation-tests.yml +++ b/.github/workflows/installation-tests.yml @@ -23,7 +23,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: ruby/setup-ruby@v1.173.0 + - uses: ruby/setup-ruby@v1.176.0 with: ruby-version: ${{ matrix.ruby-version }} - name: "Install Latest Gem Versions on ${{ matrix.ruby-version }}" diff --git a/.github/workflows/release-hook-on-closed.yml b/.github/workflows/release-hook-on-closed.yml index 1fbf42b57..dcb11de79 100644 --- a/.github/workflows/release-hook-on-closed.yml +++ b/.github/workflows/release-hook-on-closed.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Install Ruby ${{ env.ruby_version }} - uses: ruby/setup-ruby@v1.173.0 + uses: ruby/setup-ruby@v1.176.0 with: ruby-version: ${{ env.ruby_version }} - name: Checkout repo diff --git a/.github/workflows/release-hook-on-push.yml b/.github/workflows/release-hook-on-push.yml index 0f309d3b7..3c56f7650 100644 --- a/.github/workflows/release-hook-on-push.yml +++ b/.github/workflows/release-hook-on-push.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Install Ruby ${{ env.ruby_version }} - uses: ruby/setup-ruby@v1.173.0 + uses: ruby/setup-ruby@v1.176.0 with: ruby-version: ${{ env.ruby_version }} - name: Checkout repo diff --git a/.github/workflows/release-perform.yml b/.github/workflows/release-perform.yml index 5edb164d8..f9ed945c0 100644 --- a/.github/workflows/release-perform.yml +++ b/.github/workflows/release-perform.yml @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Install Ruby ${{ env.ruby_version }} - uses: ruby/setup-ruby@v1.173.0 + uses: ruby/setup-ruby@v1.176.0 with: ruby-version: ${{ env.ruby_version }} - name: Checkout repo diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml index e061257d9..1c58a7909 100644 --- a/.github/workflows/release-please.yaml +++ b/.github/workflows/release-please.yaml @@ -13,10 +13,11 @@ permissions: jobs: prepare: + if: ${{ github.repository == 'open-telemetry/opentelemetry-ruby-contrib' }} name: Process Release runs-on: ubuntu-latest steps: - - uses: google-github-actions/release-please-action@v4.0.2 + - uses: google-github-actions/release-please-action@v4.1.0 id: prepare outputs: @@ -47,7 +48,7 @@ jobs: chmod 0600 $HOME/.gem/credentials printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials - - uses: ruby/setup-ruby@v1.173.0 + - uses: ruby/setup-ruby@v1.176.0 with: ruby-version: "3.0" bundler: latest diff --git a/.github/workflows/release-request-weekly.yml b/.github/workflows/release-request-weekly.yml new file mode 100644 index 000000000..c1e4b2465 --- /dev/null +++ b/.github/workflows/release-request-weekly.yml @@ -0,0 +1,28 @@ +name: Open release request - Weekly + +on: + schedule: + - cron: "0 15 * * 2" + +jobs: + release-request: + if: ${{ github.repository == 'open-telemetry/opentelemetry-ruby-contrib' }} + env: + ruby_version: "3.0" + runs-on: ubuntu-latest + steps: + - name: Install Ruby ${{ env.ruby_version }} + uses: ruby/setup-ruby@v1.176.0 + with: + ruby-version: ${{ env.ruby_version }} + - name: Checkout repo + uses: actions/checkout@v4 + - name: Install Toys + run: "gem install --no-document toys -v 0.15.5" + - name: Open release pull request + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + toys release request --yes --verbose \ + "--release-ref=${{ github.ref }}" \ + < /dev/null diff --git a/.github/workflows/release-request.yml b/.github/workflows/release-request.yml index 3261a81b3..3547b055f 100644 --- a/.github/workflows/release-request.yml +++ b/.github/workflows/release-request.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Install Ruby ${{ env.ruby_version }} - uses: ruby/setup-ruby@v1.173.0 + uses: ruby/setup-ruby@v1.176.0 with: ruby-version: ${{ env.ruby_version }} - name: Checkout repo diff --git a/.github/workflows/release-retry.yml b/.github/workflows/release-retry.yml index ff9312a8f..6641d698f 100644 --- a/.github/workflows/release-retry.yml +++ b/.github/workflows/release-retry.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Install Ruby ${{ env.ruby_version }} - uses: ruby/setup-ruby@v1.173.0 + uses: ruby/setup-ruby@v1.176.0 with: ruby-version: ${{ env.ruby_version }} - name: Checkout repo diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 4f2fb0487..b66849230 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -16,6 +16,7 @@ "instrumentation/base": "0.22.3", "instrumentation/active_record": "0.7.0", "instrumentation/aws_sdk": "0.5.0", + "instrumentation/aws_lambda": "0.1.0", "instrumentation/lmdb": "0.22.1", "instrumentation/http": "0.23.2", "instrumentation/graphql": "0.27.0", @@ -43,6 +44,7 @@ "instrumentation/sidekiq": "0.25.0", "instrumentation/sinatra": "0.23.2", "instrumentation/all": "0.56.0", + "processor/baggage": "0.1.0", "propagator/ottrace": "0.21.2", "propagator/xray": "0.22.1", "resources/azure": "0.1.0", diff --git a/.toys/.data/releases.yml b/.toys/.data/releases.yml index 12cbf01e6..db5722c22 100644 --- a/.toys/.data/releases.yml +++ b/.toys/.data/releases.yml @@ -100,6 +100,10 @@ gems: directory: instrumentation/aws_sdk version_constant: [OpenTelemetry, Instrumentation, AwsSdk, VERSION] + - name: opentelemetry-instrumentation-aws_lambda + directory: instrumentation/aws_lambda + version_constant: [OpenTelemetry, Instrumentation, AwsLambda, VERSION] + - name: opentelemetry-instrumentation-lmdb directory: instrumentation/lmdb version_constant: [OpenTelemetry, Instrumentation, LMDB, VERSION] @@ -209,6 +213,10 @@ gems: directory: instrumentation/all version_constant: [OpenTelemetry, Instrumentation, All, VERSION] + - name: opentelemetry-processor-baggage + directory: processor/baggage + version_constant: [OpenTelemetry, Processor, Baggage, VERSION] + - name: opentelemetry-propagator-ottrace directory: propagator/ottrace version_constant: [OpenTelemetry, Propagator, OTTrace, VERSION] diff --git a/CODEOWNERS b/CODEOWNERS index f24644798..732650bfb 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -31,3 +31,5 @@ instrumentation/racecar/ @chrisholmes @open-telemetry/ruby-contrib-maintainers @ instrumentation/rspec/ @chrisholmes @open-telemetry/ruby-contrib-maintainers @open-telemetry/ruby-contrib-approvers @fbogsany @mwear @robertlaurin @dazuma @ericmustin @arielvalentin @ahayworth @plantfansam @robbkidd @simi @kaylareopelle @xuan-cao-swi instrumentation/que/ @indrekj @open-telemetry/ruby-contrib-maintainers @open-telemetry/ruby-contrib-approvers @fbogsany @mwear @robertlaurin @dazuma @ericmustin @arielvalentin @ahayworth @plantfansam @robbkidd @simi @kaylareopelle @xuan-cao-swi + +processor/baggage/ @robbkidd @mikegoldsmith @open-telemetry/ruby-contrib-maintainers @open-telemetry/ruby-contrib-approvers @fbogsany @mwear @robertlaurin @dazuma @ericmustin @arielvalentin @ahayworth @plantfansam @robbkidd @simi @kaylareopelle @xuan-cao-swi diff --git a/Dockerfile b/Dockerfile index 0e534bc0a..a52d46c22 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,6 +33,7 @@ ARG PACKAGES="\ libxml2-dev \ libxslt-dev \ mariadb-dev \ + sqlite-dev \ openssl \ postgresql-dev \ tzdata \ diff --git a/Gemfile b/Gemfile index 2753d8388..4e53eb8d0 100644 --- a/Gemfile +++ b/Gemfile @@ -8,4 +8,4 @@ source 'https://rubygems.org' gem 'rake', '~> 13.0' gem 'rubocop', '~> 1.62' -gem 'rubocop-performance', '~> 1.20.2' +gem 'rubocop-performance', '~> 1.21.0' diff --git a/LICENSE b/LICENSE index 1ef7dad2c..261eeb9e9 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright The OpenTelemetry Authors + Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index 291f36bbc..926def2f1 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,6 @@ The Ruby special interest group (SIG) meets regularly. See the OpenTelemetry Approvers ([@open-telemetry/ruby-contrib-approvers](https://github.com/orgs/open-telemetry/teams/ruby-contrib-approvers)): - [Josef Šimánek](https://github.com/simi) -- [Kayla Reopelle](https://github.com/kaylareopelle), New Relic - [Xuan Cao](https://github.com/xuan-cao-swi), Solarwinds *Find more about the approver role in [community repository](https://github.com/open-telemetry/community/blob/master/community-membership.md#approver).* @@ -39,6 +38,7 @@ Maintainers ([@open-telemetry/ruby-contrib-maintainers](https://github.com/orgs/ - [Daniel Azuma](https://github.com/dazuma), Google - [Eric Mustin](https://github.com/ericmustin) - [Francis Bogsanyi](https://github.com/fbogsany), Shopify +- [Kayla Reopelle](https://github.com/kaylareopelle), New Relic - [Matthew Wear](https://github.com/mwear), Lightstep - [Robb Kidd](https://github.com/robbkidd), Honeycomb - [Robert Laurin](https://github.com/robertlaurin), Shopify diff --git a/helpers/mysql/opentelemetry-helpers-mysql.gemspec b/helpers/mysql/opentelemetry-helpers-mysql.gemspec index b8b161ead..afa78c3ed 100644 --- a/helpers/mysql/opentelemetry-helpers-mysql.gemspec +++ b/helpers/mysql/opentelemetry-helpers-mysql.gemspec @@ -33,7 +33,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rubocop', '~> 1.62' - spec.add_development_dependency 'rubocop-performance', '~> 1.20.1' + spec.add_development_dependency 'rubocop-performance', '~> 1.21.0' spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'yard', '~> 0.9' spec.add_development_dependency 'yard-doctest', '~> 0.1.6' diff --git a/helpers/sql-obfuscation/opentelemetry-helpers-sql-obfuscation.gemspec b/helpers/sql-obfuscation/opentelemetry-helpers-sql-obfuscation.gemspec index 7d038e319..ab7c31959 100644 --- a/helpers/sql-obfuscation/opentelemetry-helpers-sql-obfuscation.gemspec +++ b/helpers/sql-obfuscation/opentelemetry-helpers-sql-obfuscation.gemspec @@ -32,7 +32,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rubocop', '~> 1.62' - spec.add_development_dependency 'rubocop-performance', '~> 1.20.1' + spec.add_development_dependency 'rubocop-performance', '~> 1.21.0' spec.add_development_dependency 'yard', '~> 0.9' spec.add_development_dependency 'yard-doctest', '~> 0.1.6' diff --git a/instrumentation/active_record/CHANGELOG.md b/instrumentation/active_record/CHANGELOG.md index 0da241da2..54f1c74ca 100644 --- a/instrumentation/active_record/CHANGELOG.md +++ b/instrumentation/active_record/CHANGELOG.md @@ -1,5 +1,13 @@ # Release History: opentelemetry-instrumentation-active_record +### v0.7.2 / 2024-04-30 + +* FIXED: Resolve active_record testing issue + +### v0.7.1 / 2024-04-05 + +* FIXED: Instrumentation/active_record: add `:allow_retry` option to `find_by_sql` patch + ### v0.7.0 / 2023-11-22 * BREAKING CHANGE: Drop Rails 6.0 EOL diff --git a/instrumentation/active_record/Gemfile b/instrumentation/active_record/Gemfile index 200584109..4475d27bf 100644 --- a/instrumentation/active_record/Gemfile +++ b/instrumentation/active_record/Gemfile @@ -12,5 +12,5 @@ group :test do gem 'byebug' gem 'opentelemetry-instrumentation-base', path: '../base' gem 'pry-byebug' - gem 'sqlite3-ruby' + gem 'sqlite3', '~> 1.4' end diff --git a/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/querying.rb b/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/querying.rb index d359c31ff..41280b1f1 100644 --- a/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/querying.rb +++ b/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/querying.rb @@ -18,7 +18,7 @@ class << base # Contains ActiveRecord::Querying to be patched module ClassMethods - def find_by_sql(sql, binds = [], preparable: nil, &block) + def find_by_sql(...) tracer.in_span("#{self}.find_by_sql") do super end diff --git a/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/version.rb b/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/version.rb index 4d95d58c4..7d198a293 100644 --- a/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/version.rb +++ b/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module ActiveRecord - VERSION = '0.7.0' + VERSION = '0.7.2' end end end diff --git a/instrumentation/aws_lambda/.rubocop.yml b/instrumentation/aws_lambda/.rubocop.yml new file mode 100644 index 000000000..1248a2f82 --- /dev/null +++ b/instrumentation/aws_lambda/.rubocop.yml @@ -0,0 +1 @@ +inherit_from: ../../.rubocop.yml diff --git a/instrumentation/aws_lambda/.yardopts b/instrumentation/aws_lambda/.yardopts new file mode 100644 index 000000000..7bd7686dc --- /dev/null +++ b/instrumentation/aws_lambda/.yardopts @@ -0,0 +1,9 @@ +--no-private +--title=OpenTelemetry AWS Lambda Instrumentation +--markup=markdown +--main=README.md +./lib/opentelemetry/instrumentation/**/*.rb +./lib/opentelemetry/instrumentation.rb +- +README.md +CHANGELOG.md diff --git a/instrumentation/aws_lambda/CHANGELOG.md b/instrumentation/aws_lambda/CHANGELOG.md new file mode 100644 index 000000000..1fb233945 --- /dev/null +++ b/instrumentation/aws_lambda/CHANGELOG.md @@ -0,0 +1 @@ +# Release History: opentelemetry-instrumentation-aws_lambda diff --git a/instrumentation/aws_lambda/Gemfile b/instrumentation/aws_lambda/Gemfile new file mode 100644 index 000000000..a03fdb17e --- /dev/null +++ b/instrumentation/aws_lambda/Gemfile @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +source 'https://rubygems.org' + +gemspec + +group :test do + gem 'opentelemetry-instrumentation-base', path: '../base' + gem 'webrick', '~> 1.7' +end diff --git a/instrumentation/aws_lambda/LICENSE b/instrumentation/aws_lambda/LICENSE new file mode 100644 index 000000000..1ef7dad2c --- /dev/null +++ b/instrumentation/aws_lambda/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright The OpenTelemetry Authors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/instrumentation/aws_lambda/README.md b/instrumentation/aws_lambda/README.md new file mode 100644 index 000000000..90dc918c9 --- /dev/null +++ b/instrumentation/aws_lambda/README.md @@ -0,0 +1,58 @@ +# OpenTelemetry AWS-Lambda Instrumentation + +The OpenTelemetry `aws-lambda` gem is a community-maintained instrumentation for [AWS Lambda functions](https://docs.aws.amazon.com/lambda/latest/dg/ruby-handler.html). + +## How do I get started? + +Installation of the `opentelemetry-instrumentation-aws_lambda` gem is handled by the [OpenTelemetry Lambda Layer for Ruby](https://github.com/open-telemetry/opentelemetry-lambda/tree/main/ruby). + +We do not advise installing the `opentelemetry-instrumentation-aws_lambda` gem directly into your Ruby lambda. Instead, clone the [OpenTelemetry Lambda Layer for Ruby](https://github.com/open-telemetry/opentelemetry-lambda/tree/main/ruby) and build the layer locally. Then, save it in your AWS account. + +## Usage + +From the Lambda Layer side, create the wrapper. More information can be found at https://github.com/open-telemetry/opentelemetry-lambda/tree/main/ruby + +Below is an example of `ruby/src/layer/wrapper.rb`, where you can configure the layer to suit your needs before building it: +```ruby +require 'opentelemetry/sdk' +require 'opentelemetry/instrumentation/aws_lambda' +OpenTelemetry::SDK.configure do |c| + c.service_name = '' + c.use 'OpenTelemetry::Instrumentation::AwsLambda' +end + +def otel_wrapper(event:, context:) + otel_wrapper = OpenTelemetry::Instrumentation::AwsLambda::Handler.new() + otel_wrapper.call_wrapped(event: event, context: context) +end +``` + +## Example + +To run the example: + +1. `cd` to the examples directory and install gems + * `cd example` + * `bundle install` +2. Run the sample client script + * `ruby trace_demonstration.rb` + +This will run SNS publish command, printing OpenTelemetry traces to the console as it goes. + +## How can I get involved? + +The `opentelemetry-instrumentation-aws_lambda` gem source is [on github][repo-github], along with related gems including `opentelemetry-api` and `opentelemetry-sdk`. + +The OpenTelemetry Ruby gems are maintained by the OpenTelemetry-Ruby special interest group (SIG). You can get involved by joining us in [GitHub Discussions][discussions-url] or attending our weekly meeting. See the [meeting calendar][community-meetings] for dates and times. For more information on this and other language SIGs, see the OpenTelemetry [community page][ruby-sig]. + +## License + +Apache 2.0 license. See [LICENSE][license-github] for more information. + +[aws-sdk-home]: https://github.com/aws/aws-sdk-ruby +[bundler-home]: https://bundler.io +[repo-github]: https://github.com/open-telemetry/opentelemetry-ruby +[license-github]: https://github.com/open-telemetry/opentelemetry-ruby-contrib/blob/main/LICENSE +[ruby-sig]: https://github.com/open-telemetry/community#ruby-sig +[community-meetings]: https://github.com/open-telemetry/community#community-meetings +[discussions-url]: https://github.com/open-telemetry/opentelemetry-ruby/discussions diff --git a/instrumentation/aws_lambda/Rakefile b/instrumentation/aws_lambda/Rakefile new file mode 100644 index 000000000..4b0e9b5a8 --- /dev/null +++ b/instrumentation/aws_lambda/Rakefile @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +require 'bundler/gem_tasks' +require 'rake/testtask' +require 'yard' +require 'rubocop/rake_task' + +RuboCop::RakeTask.new + +Rake::TestTask.new :test do |t| + t.libs << 'test' + t.libs << 'lib' + t.test_files = FileList['test/**/*_test.rb'] + t.warning = false +end + +YARD::Rake::YardocTask.new do |t| + t.stats_options = ['--list-undoc'] +end + +if RUBY_ENGINE == 'truffleruby' + task default: %i[test] +else + task default: %i[test rubocop yard] +end diff --git a/instrumentation/aws_lambda/example/Gemfile b/instrumentation/aws_lambda/example/Gemfile new file mode 100644 index 000000000..934ac342f --- /dev/null +++ b/instrumentation/aws_lambda/example/Gemfile @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +source 'https://rubygems.org' + +gem 'opentelemetry-instrumentation-aws_lambda', path: '../' +gem 'opentelemetry-sdk' diff --git a/instrumentation/aws_lambda/example/sample.rb b/instrumentation/aws_lambda/example/sample.rb new file mode 100644 index 000000000..7efc9561a --- /dev/null +++ b/instrumentation/aws_lambda/example/sample.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +def handler(event:, context:) + puts "Success" +end diff --git a/instrumentation/aws_lambda/example/trace_demonstration.rb b/instrumentation/aws_lambda/example/trace_demonstration.rb new file mode 100755 index 000000000..b135bad5b --- /dev/null +++ b/instrumentation/aws_lambda/example/trace_demonstration.rb @@ -0,0 +1,102 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +require 'rubygems' +require 'bundler/setup' +require_relative './sample' + +Bundler.require + +# Export traces to console by default +ENV['OTEL_TRACES_EXPORTER'] ||= 'console' +ENV['ORIG_HANDLER'] ||= 'sample.handler' + +OpenTelemetry::SDK.configure do |c| + c.use 'OpenTelemetry::Instrumentation::AwsLambda' +end + +class MockLambdaContext + attr_reader :aws_request_id, :invoked_function_arn, :function_name + + def initialize(aws_request_id:, invoked_function_arn:, function_name:) + @aws_request_id = aws_request_id + @invoked_function_arn = invoked_function_arn + @function_name = function_name + end +end + +# To accommendate the test case, handler class doesn't need to require the sample file if it's required here +# In lambda environment, the env will find the handler file. +module OpenTelemetry + module Instrumentation + module AwsLambda + class Handler + def resolve_original_handler + original_handler = ENV['ORIG_HANDLER'] || ENV['_HANDLER'] || '' + original_handler_parts = original_handler.split('.') + if original_handler_parts.size == 2 + handler_file, @handler_method = original_handler_parts + elsif original_handler_parts.size == 3 + handler_file, @handler_class, @handler_method = original_handler_parts + else + OpenTelemetry.logger.warn("aws-lambda instrumentation: Invalid handler #{original_handler}, must be of form FILENAME.METHOD or FILENAME.CLASS.METHOD.") + end + + # require handler_file #-> don't require file for this sample test + + original_handler + end + end + end + end +end + +def otel_wrapper(event:, context:) + otel_wrapper = OpenTelemetry::Instrumentation::AwsLambda::Handler.new() + otel_wrapper.call_wrapped(event: event, context: context) +end + +# sample event obtained from sample test +event = { + "body" => nil, + "headers" => { + "Accept" => "*/*", + "Host" => "127.0.0.1:3000", + "User-Agent" => "curl/8.1.2", + "X-Forwarded-Port" => 3000, + "X-Forwarded-Proto" => "http" + }, + "httpMethod" => "GET", + "isBase64Encoded" => false, + "multiValueHeaders" => {}, + "multiValueQueryStringParameters" => nil, + "path" => "/", + "pathParameters" => nil, + "queryStringParameters" => nil, + "requestContext" => { + "accountId" => 123456789012, + "apiId" => 1234567890, + "domainName" => "127.0.0.1:3000", + "extendedRequestId" => nil, + "httpMethod" => "GET", + "identity" => {}, + "path" => "/", + "protocol" => "HTTP/1.1", + "requestId" => "db7f8e7a-4cc5-4f6d-987b-713d0d9052c3", + "requestTime" => "08/Nov/2023:19:09:59 +0000", + "requestTimeEpoch" => 1699470599, + "resourceId" => "123456", + "resourcePath" => "/", + "stage" => "api" + }, + "resource" => "/", + "stageVariables" => nil, + "version" => "1.0" +} + +context = MockLambdaContext.new(aws_request_id: "aws_request_id",invoked_function_arn: "invoked_function_arn",function_name: "function") + +otel_wrapper(event: event, context: context) # you should see Success before the trace diff --git a/instrumentation/aws_lambda/lib/opentelemetry-instrumentation-aws_lambda.rb b/instrumentation/aws_lambda/lib/opentelemetry-instrumentation-aws_lambda.rb new file mode 100644 index 000000000..c034f140f --- /dev/null +++ b/instrumentation/aws_lambda/lib/opentelemetry-instrumentation-aws_lambda.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +require_relative 'opentelemetry/instrumentation' diff --git a/instrumentation/aws_lambda/lib/opentelemetry/instrumentation.rb b/instrumentation/aws_lambda/lib/opentelemetry/instrumentation.rb new file mode 100644 index 000000000..8dd0f5127 --- /dev/null +++ b/instrumentation/aws_lambda/lib/opentelemetry/instrumentation.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +# OpenTelemetry is an open source observability framework, providing a +# general-purpose API, SDK, and related tools required for the instrumentation +# of cloud-native software, frameworks, and libraries. +# +# The OpenTelemetry module provides global accessors for telemetry objects. +# See the documentation for the `opentelemetry-api` gem for details. +module OpenTelemetry + # "Instrumentation" are specified by + # https://github.com/open-telemetry/opentelemetry-specification/blob/784635d01d8690c8f5fcd1f55bdbc8a13cf2f4f2/specification/glossary.md#instrumentation-library + # + # Instrumentation should be able to handle the case when the library is not installed on a user's system. + module Instrumentation + end +end + +require_relative 'instrumentation/aws_lambda' diff --git a/instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda.rb b/instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda.rb new file mode 100644 index 000000000..fb8d41885 --- /dev/null +++ b/instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +require 'opentelemetry' +require 'opentelemetry-instrumentation-base' + +module OpenTelemetry + module Instrumentation + # Contains the OpenTelemetry instrumentation for the aws_lambda gem + module AwsLambda + end + end +end + +require_relative 'aws_lambda/instrumentation' +require_relative 'aws_lambda/version' diff --git a/instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda/handler.rb b/instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda/handler.rb new file mode 100644 index 000000000..7c9a32c18 --- /dev/null +++ b/instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda/handler.rb @@ -0,0 +1,198 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +module OpenTelemetry + module Instrumentation + module AwsLambda + AWS_TRIGGERS = ['aws:sqs', 'aws:s3', 'aws:sns', 'aws:dynamodb'].freeze + + # Handler class that creates a span around the _HANDLER + class Handler + attr_reader :handler_method, :handler_class + + # anytime when the code in a Lambda function is updated or the functional configuration is changed, + # the next invocation results in a cold start; therefore these instance variables will be up-to-date + def initialize + @flush_timeout = ENV.fetch('OTEL_INSTRUMENTATION_AWS_LAMBDA_FLUSH_TIMEOUT', '30000').to_i + @original_handler = ENV['ORIG_HANDLER'] || ENV['_HANDLER'] || '' + @handler_class = nil + @handler_method = nil + @handler_file = nil + + resolve_original_handler + end + + # Try to record and re-raise any exception from the wrapped function handler + # Instrumentation should never raise its own exception + def call_wrapped(event:, context:) + parent_context = extract_parent_context(event) + + span_kind = nil + span_kind = if event['Records'] && AWS_TRIGGERS.include?(event['Records'].dig(0, 'eventSource')) + :consumer + else + :server + end + + original_handler_error = nil + original_response = nil + OpenTelemetry::Context.with_current(parent_context) do + span_attributes = otel_attributes(event, context) + span = tracer.start_span( + @original_handler, + attributes: span_attributes, + kind: span_kind + ) + + begin + response = call_original_handler(event: event, context: context) + status_code = response['statusCode'] || response[:statusCode] if response.is_a?(Hash) + span.set_attribute(OpenTelemetry::SemanticConventions::Trace::HTTP_STATUS_CODE, status_code) if status_code + rescue StandardError => e + original_handler_error = e + ensure + original_response = response + end + rescue StandardError => e + OpenTelemetry.logger.error("aws-lambda instrumentation #{e.class}: #{e.message}") + ensure + if original_handler_error + span&.record_exception(original_handler_error) + span&.status = OpenTelemetry::Trace::Status.error(original_handler_error.message) + end + span&.finish + OpenTelemetry.tracer_provider.force_flush(timeout: @flush_timeout) + end + + raise original_handler_error if original_handler_error + + original_response + end + + def instrumentation_config + AwsLambda::Instrumentation.instance.config + end + + def tracer + AwsLambda::Instrumentation.instance.tracer + end + + private + + # we don't expose error if our code cause issue that block user's code + def resolve_original_handler + original_handler_parts = @original_handler.split('.') + if original_handler_parts.size == 2 + @handler_file, @handler_method = original_handler_parts + elsif original_handler_parts.size == 3 + @handler_file, @handler_class, @handler_method = original_handler_parts + else + OpenTelemetry.logger.error("aws-lambda instrumentation: Invalid handler #{original_handler}, must be of form FILENAME.METHOD or FILENAME.CLASS.METHOD.") + end + + require @handler_file if @handler_file + end + + def call_original_handler(event:, context:) + if @handler_class + Kernel.const_get(@handler_class).send(@handler_method, event: event, context: context) + else + __send__(@handler_method, event: event, context: context) + end + end + + # Extract parent context from request headers + # Downcase Traceparent and Tracestate because TraceContext::TextMapPropagator's TRACEPARENT_KEY and TRACESTATE_KEY are all lowercase + # If any error occur, rescue and give empty context + def extract_parent_context(event) + headers = event['headers'] || {} + headers.transform_keys! do |key| + %w[Traceparent Tracestate].include?(key) ? key.downcase : key + end + + OpenTelemetry.propagation.extract( + headers, + getter: OpenTelemetry::Context::Propagation.text_map_getter + ) + rescue StandardError => e + OpenTelemetry.logger.error("aws-lambda instrumentation exception occurred while extracting the parent context: #{e.message}") + OpenTelemetry::Context.empty + end + + # lambda event version 1.0 and version 2.0 + # https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html + def v1_proxy_attributes(event) + attributes = { + OpenTelemetry::SemanticConventions::Trace::HTTP_METHOD => event['httpMethod'], + OpenTelemetry::SemanticConventions::Trace::HTTP_ROUTE => event['resource'], + OpenTelemetry::SemanticConventions::Trace::HTTP_TARGET => event['resource'] + } + attributes[OpenTelemetry::SemanticConventions::Trace::HTTP_TARGET] += "?#{event['queryStringParameters']}" if event['queryStringParameters'] + + headers = event['headers'] + if headers + attributes[OpenTelemetry::SemanticConventions::Trace::HTTP_USER_AGENT] = headers['User-Agent'] + attributes[OpenTelemetry::SemanticConventions::Trace::HTTP_SCHEME] = headers['X-Forwarded-Proto'] + attributes[OpenTelemetry::SemanticConventions::Trace::NET_HOST_NAME] = headers['Host'] + end + attributes + end + + def v2_proxy_attributes(event) + request_context = event['requestContext'] + attributes = { + OpenTelemetry::SemanticConventions::Trace::NET_HOST_NAME => request_context['domainName'], + OpenTelemetry::SemanticConventions::Trace::HTTP_METHOD => request_context['http']['method'], + OpenTelemetry::SemanticConventions::Trace::HTTP_USER_AGENT => request_context['http']['userAgent'], + OpenTelemetry::SemanticConventions::Trace::HTTP_ROUTE => request_context['http']['path'], + OpenTelemetry::SemanticConventions::Trace::HTTP_TARGET => request_context['http']['path'] + } + attributes[OpenTelemetry::SemanticConventions::Trace::HTTP_TARGET] += "?#{event['rawQueryString']}" if event['rawQueryString'] + attributes + end + + # fass.trigger set to http: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/faas/aws-lambda.md#api-gateway + # TODO: need to update Semantic Conventions for invocation_id, trigger and resource_id + def otel_attributes(event, context) + span_attributes = {} + span_attributes['faas.invocation_id'] = context.aws_request_id + span_attributes['cloud.resource_id'] = context.invoked_function_arn + span_attributes[OpenTelemetry::SemanticConventions::Trace::AWS_LAMBDA_INVOKED_ARN] = context.invoked_function_arn + span_attributes[OpenTelemetry::SemanticConventions::Resource::CLOUD_ACCOUNT_ID] = context.invoked_function_arn.split(':')[4] + + if event['requestContext'] + request_attributes = event['version'] == '2.0' ? v2_proxy_attributes(event) : v1_proxy_attributes(event) + request_attributes[OpenTelemetry::SemanticConventions::Trace::FAAS_TRIGGER] = 'http' + span_attributes.merge!(request_attributes) + end + + if event['Records'] + trigger_attributes = trigger_type_attributes(event) + span_attributes.merge!(trigger_attributes) + end + + span_attributes + rescue StandardError => e + OpenTelemetry.logger.error("aws-lambda instrumentation exception occurred while preparing span attributes: #{e.message}") + {} + end + + # sqs spec for lambda: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/faas/aws-lambda.md#sqs + # current there is no spec for 'aws:sns', 'aws:s3' and 'aws:dynamodb' + def trigger_type_attributes(event) + attributes = {} + case event['Records'].dig(0, 'eventSource') + when 'aws:sqs' + attributes[OpenTelemetry::SemanticConventions::Trace::FAAS_TRIGGER] = 'pubsub' + attributes[OpenTelemetry::SemanticConventions::Trace::MESSAGING_OPERATION] = 'process' + attributes[OpenTelemetry::SemanticConventions::Trace::MESSAGING_SYSTEM] = 'AmazonSQS' + end + attributes + end + end + end + end +end diff --git a/instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda/instrumentation.rb b/instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda/instrumentation.rb new file mode 100644 index 000000000..62f25aee5 --- /dev/null +++ b/instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda/instrumentation.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +module OpenTelemetry + module Instrumentation + module AwsLambda + # Instrumentation class that detects and installs the AwsLambda instrumentation + class Instrumentation < OpenTelemetry::Instrumentation::Base + install do |_config| + require_dependencies + end + + # determine if current environment is lambda by checking _HANLDER or ORIG_HANDLER + present do + (ENV.key?('_HANDLER') || ENV.key?('ORIG_HANDLER')) + end + + private + + def require_dependencies + require_relative 'handler' + end + end + end + end +end diff --git a/instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda/version.rb b/instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda/version.rb new file mode 100644 index 000000000..6723022fd --- /dev/null +++ b/instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda/version.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +module OpenTelemetry + module Instrumentation + module AwsLambda + VERSION = '0.1.0' + end + end +end diff --git a/instrumentation/aws_lambda/opentelemetry-instrumentation-aws_lambda.gemspec b/instrumentation/aws_lambda/opentelemetry-instrumentation-aws_lambda.gemspec new file mode 100644 index 000000000..972f1ee70 --- /dev/null +++ b/instrumentation/aws_lambda/opentelemetry-instrumentation-aws_lambda.gemspec @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +lib = File.expand_path('lib', __dir__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) +require 'opentelemetry/instrumentation/aws_lambda/version' + +Gem::Specification.new do |spec| + spec.name = 'opentelemetry-instrumentation-aws_lambda' + spec.version = OpenTelemetry::Instrumentation::AwsLambda::VERSION + spec.authors = ['OpenTelemetry Authors'] + spec.email = ['cncf-opentelemetry-contributors@lists.cncf.io'] + + spec.summary = 'AWS Lambda instrumentation for the OpenTelemetry framework' + spec.description = 'AWS Lambda instrumentation for the OpenTelemetry framework' + spec.homepage = 'https://github.com/open-telemetry/opentelemetry-ruby-contrib' + spec.license = 'Apache-2.0' + + spec.files = Dir.glob('lib/**/*.rb') + + Dir.glob('*.md') + + ['LICENSE', '.yardopts'] + spec.require_paths = ['lib'] + spec.required_ruby_version = '>= 3.0' + + spec.add_dependency 'opentelemetry-api', '~> 1.0' + spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.22.1' + + spec.add_development_dependency 'appraisal', '~> 2.5' + spec.add_development_dependency 'bundler', '~> 2.4' + spec.add_development_dependency 'minitest', '~> 5.0' + spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' + spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' + spec.add_development_dependency 'pry' + spec.add_development_dependency 'pry-byebug' unless RUBY_ENGINE == 'jruby' + spec.add_development_dependency 'rspec-mocks' + spec.add_development_dependency 'rubocop', '~> 1.56.1' + spec.add_development_dependency 'rubocop-performance', '~> 1.19.1' + spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'webmock', '~> 3.19' + spec.add_development_dependency 'yard', '~> 0.9' + + if spec.respond_to?(:metadata) + spec.metadata['changelog_uri'] = "https://rubydoc.info/gems/#{spec.name}/#{spec.version}/file/CHANGELOG.md" + spec.metadata['source_code_uri'] = 'https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/aws_lambda' + spec.metadata['bug_tracker_uri'] = 'https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues' + spec.metadata['documentation_uri'] = "https://rubydoc.info/gems/#{spec.name}/#{spec.version}" + end +end diff --git a/instrumentation/aws_lambda/test/opentelemetry/instrumentation_test.rb b/instrumentation/aws_lambda/test/opentelemetry/instrumentation_test.rb new file mode 100644 index 000000000..e737544f6 --- /dev/null +++ b/instrumentation/aws_lambda/test/opentelemetry/instrumentation_test.rb @@ -0,0 +1,217 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +require 'test_helper' + +describe OpenTelemetry::Instrumentation::AwsLambda do + let(:instrumentation) { OpenTelemetry::Instrumentation::AwsLambda::Instrumentation.instance } + let(:exporter) { EXPORTER } + let(:event_v1) { EVENT_V1 } + let(:event_v2) { EVENT_V2 } + let(:event_record) { EVENT_RECORD } + let(:sqs_record) { SQS_RECORD } + let(:context) { CONTEXT } + let(:last_span) { exporter.finished_spans.last } + + it 'has #name' do + _(instrumentation.name).must_equal 'OpenTelemetry::Instrumentation::AwsLambda' + end + + it 'has #version' do + _(instrumentation.version).wont_be_nil + _(instrumentation.version).wont_be_empty + end + + describe '#compatible' do + it 'returns true for supported gem versions' do + _(instrumentation.compatible?).must_equal true + end + end + + describe '#install' do + it 'accepts argument' do + _(instrumentation.install({})).must_equal(true) + instrumentation.instance_variable_set(:@installed, false) + end + end + + describe 'validate_wrapper' do + it 'result should be span' do + otel_wrapper = OpenTelemetry::Instrumentation::AwsLambda::Handler.new + otel_wrapper.stub(:call_original_handler, {}) do + otel_wrapper.call_wrapped(event: event_v1, context: context) + _(last_span).must_be_kind_of(OpenTelemetry::SDK::Trace::SpanData) + end + end + + it 'validate_spans' do + otel_wrapper = OpenTelemetry::Instrumentation::AwsLambda::Handler.new + otel_wrapper.stub(:call_original_handler, {}) do + otel_wrapper.call_wrapped(event: event_v1, context: context) + + _(last_span.name).must_equal 'sample.test' + _(last_span.kind).must_equal :server + _(last_span.status.code).must_equal 1 + _(last_span.hex_parent_span_id).must_equal '0000000000000000' + + _(last_span.attributes['aws.lambda.invoked_arn']).must_equal 'arn:aws:lambda:location:id:function_name:function_name' + _(last_span.attributes['faas.invocation_id']).must_equal '41784178-4178-4178-4178-4178417855e' + _(last_span.attributes['faas.trigger']).must_equal 'http' + _(last_span.attributes['cloud.resource_id']).must_equal 'arn:aws:lambda:location:id:function_name:function_name' + _(last_span.attributes['cloud.account.id']).must_equal 'id' + _(last_span.attributes['http.method']).must_equal 'GET' + _(last_span.attributes['http.route']).must_equal '/' + _(last_span.attributes['http.target']).must_equal '/' + _(last_span.attributes['http.user_agent']).must_equal 'curl/8.1.2' + _(last_span.attributes['http.scheme']).must_equal 'http' + _(last_span.attributes['net.host.name']).must_equal '127.0.0.1:3000' + + _(last_span.instrumentation_scope).must_be_kind_of OpenTelemetry::SDK::InstrumentationScope + _(last_span.instrumentation_scope.name).must_equal 'OpenTelemetry::Instrumentation::AwsLambda' + _(last_span.instrumentation_scope.version).must_equal '0.1.0' + + _(last_span.hex_span_id.size).must_equal 16 + _(last_span.hex_trace_id.size).must_equal 32 + _(last_span.trace_flags.sampled?).must_equal true + _(last_span.tracestate.to_h.to_s).must_equal '{}' + end + end + + it 'validate_spans_with_parent_context' do + event_v1['headers']['Traceparent'] = '00-48b05d64abe4690867685635f72bdbac-ff40ea9699e62af2-01' + event_v1['headers']['Tracestate'] = 'otel=ff40ea9699e62af2-01' + + otel_wrapper = OpenTelemetry::Instrumentation::AwsLambda::Handler.new + otel_wrapper.stub(:call_original_handler, {}) do + otel_wrapper.call_wrapped(event: event_v1, context: context) + + _(last_span.name).must_equal 'sample.test' + _(last_span.kind).must_equal :server + + _(last_span.hex_parent_span_id).must_equal 'ff40ea9699e62af2' + _(last_span.hex_span_id.size).must_equal 16 + _(last_span.hex_trace_id.size).must_equal 32 + _(last_span.trace_flags.sampled?).must_equal true + _(last_span.tracestate.to_h.to_s).must_equal '{"otel"=>"ff40ea9699e62af2-01"}' + end + event_v1['headers'].delete('traceparent') + event_v1['headers'].delete('tracestate') + end + + it 'validate_spans_with_v2_events' do + otel_wrapper = OpenTelemetry::Instrumentation::AwsLambda::Handler.new + otel_wrapper.stub(:call_original_handler, {}) do + otel_wrapper.call_wrapped(event: event_v2, context: context) + + _(last_span.name).must_equal 'sample.test' + _(last_span.kind).must_equal :server + _(last_span.status.code).must_equal 1 + _(last_span.hex_parent_span_id).must_equal '0000000000000000' + + _(last_span.attributes['aws.lambda.invoked_arn']).must_equal 'arn:aws:lambda:location:id:function_name:function_name' + _(last_span.attributes['faas.invocation_id']).must_equal '41784178-4178-4178-4178-4178417855e' + _(last_span.attributes['faas.trigger']).must_equal 'http' + _(last_span.attributes['cloud.account.id']).must_equal 'id' + _(last_span.attributes['cloud.resource_id']).must_equal 'arn:aws:lambda:location:id:function_name:function_name' + _(last_span.attributes['net.host.name']).must_equal 'id.execute-api.us-east-1.amazonaws.com' + _(last_span.attributes['http.method']).must_equal 'POST' + _(last_span.attributes['http.user_agent']).must_equal 'agent' + _(last_span.attributes['http.route']).must_equal '/path/to/resource' + _(last_span.attributes['http.target']).must_equal '/path/to/resource?parameter1=value1¶meter1=value2¶meter2=value' + end + end + + it 'validate_spans_with_records_from_non_gateway_request' do + otel_wrapper = OpenTelemetry::Instrumentation::AwsLambda::Handler.new + otel_wrapper.stub(:call_original_handler, {}) do + otel_wrapper.call_wrapped(event: event_record, context: context) + + _(last_span.name).must_equal 'sample.test' + _(last_span.kind).must_equal :consumer + _(last_span.status.code).must_equal 1 + _(last_span.hex_parent_span_id).must_equal '0000000000000000' + + _(last_span.attributes['aws.lambda.invoked_arn']).must_equal 'arn:aws:lambda:location:id:function_name:function_name' + _(last_span.attributes['faas.invocation_id']).must_equal '41784178-4178-4178-4178-4178417855e' + _(last_span.attributes['cloud.resource_id']).must_equal 'arn:aws:lambda:location:id:function_name:function_name' + _(last_span.attributes['cloud.account.id']).must_equal 'id' + + assert_nil(last_span.attributes['faas.trigger']) + assert_nil(last_span.attributes['http.method']) + assert_nil(last_span.attributes['http.user_agent']) + assert_nil(last_span.attributes['http.route']) + assert_nil(last_span.attributes['http.target']) + assert_nil(last_span.attributes['net.host.name']) + end + end + + it 'validate_spans_with_records_from_sqs' do + otel_wrapper = OpenTelemetry::Instrumentation::AwsLambda::Handler.new + otel_wrapper.stub(:call_original_handler, {}) do + otel_wrapper.call_wrapped(event: sqs_record, context: context) + + _(last_span.name).must_equal 'sample.test' + _(last_span.kind).must_equal :consumer + _(last_span.status.code).must_equal 1 + _(last_span.hex_parent_span_id).must_equal '0000000000000000' + + _(last_span.attributes['aws.lambda.invoked_arn']).must_equal 'arn:aws:lambda:location:id:function_name:function_name' + _(last_span.attributes['faas.invocation_id']).must_equal '41784178-4178-4178-4178-4178417855e' + _(last_span.attributes['cloud.resource_id']).must_equal 'arn:aws:lambda:location:id:function_name:function_name' + _(last_span.attributes['cloud.account.id']).must_equal 'id' + _(last_span.attributes['faas.trigger']).must_equal 'pubsub' + _(last_span.attributes['messaging.operation']).must_equal 'process' + _(last_span.attributes['messaging.system']).must_equal 'AmazonSQS' + + assert_nil(last_span.attributes['http.method']) + assert_nil(last_span.attributes['http.user_agent']) + assert_nil(last_span.attributes['http.route']) + assert_nil(last_span.attributes['http.target']) + assert_nil(last_span.attributes['net.host.name']) + end + end + end + + describe 'validate_error_handling' do + it 'handle error if original handler cause issue' do + otel_wrapper = OpenTelemetry::Instrumentation::AwsLambda::Handler.new + otel_wrapper.stub(:call_original_handler, ->(**_args) { raise StandardError, 'Simulated Error' }) do + otel_wrapper.call_wrapped(event: event_v1, context: context) + rescue StandardError + _(last_span.name).must_equal 'sample.test' + _(last_span.kind).must_equal :server + + _(last_span.status.code).must_equal 2 + _(last_span.status.description).must_equal 'Simulated Error' + _(last_span.hex_parent_span_id).must_equal '0000000000000000' + + _(last_span.events[0].name).must_equal 'exception' + _(last_span.events[0].attributes['exception.type']).must_equal 'StandardError' + _(last_span.events[0].attributes['exception.message']).must_equal 'Simulated Error' + + _(last_span.hex_span_id.size).must_equal 16 + _(last_span.hex_trace_id.size).must_equal 32 + _(last_span.trace_flags.sampled?).must_equal true + _(last_span.tracestate.to_h.to_s).must_equal '{}' + end + end + + it 'if wrapped handler cause otel-related issue, wont break the entire lambda call' do + otel_wrapper = OpenTelemetry::Instrumentation::AwsLambda::Handler.new + otel_wrapper.stub(:call_wrapped, { 'test' => 'ok' }) do + otel_wrapper.stub(:call_original_handler, {}) do + OpenTelemetry::Context.stub(:with_current, lambda { |_context| + tracer.start_span('test_span', attributes: {}, kind: :server) + raise StandardError, 'OTEL Error' + }) do + response = otel_wrapper.call_wrapped(event: event_v1, context: context) + _(response['test']).must_equal 'ok' + end + end + end + end + end +end diff --git a/instrumentation/aws_lambda/test/test_helper.rb b/instrumentation/aws_lambda/test/test_helper.rb new file mode 100644 index 000000000..cf3cde320 --- /dev/null +++ b/instrumentation/aws_lambda/test/test_helper.rb @@ -0,0 +1,162 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +require 'bundler/setup' +Bundler.require(:default, :development, :test) + +require 'opentelemetry-instrumentation-aws_lambda' + +require 'minitest/autorun' +require 'rspec/mocks/minitest_integration' + +class MockLambdaContext + attr_reader :aws_request_id, :invoked_function_arn, :function_name + + def initialize(aws_request_id:, invoked_function_arn:, function_name:) + @aws_request_id = aws_request_id + @invoked_function_arn = invoked_function_arn + @function_name = function_name + end +end + +EXPORTER = OpenTelemetry::SDK::Trace::Export::InMemorySpanExporter.new +span_processor = OpenTelemetry::SDK::Trace::Export::SimpleSpanProcessor.new(EXPORTER) + +EVENT_V1 = { + 'body' => nil, + 'headers' => { + 'Accept' => '*/*', + 'Host' => '127.0.0.1:3000', + 'User-Agent' => 'curl/8.1.2', + 'X-Forwarded-Port' => 3000, + 'X-Forwarded-Proto' => 'http' + }, + 'httpMethod' => 'GET', + 'isBase64Encoded' => false, + 'multiValueHeaders' => {}, + 'multiValueQueryStringParameters' => nil, + 'path' => '/', + 'pathParameters' => nil, + 'queryStringParameters' => nil, + 'requestContext' => { + 'accountId' => 123_456_789_012, + 'apiId' => 1_234_567_890, + 'domainName' => '127.0.0.1:3000', + 'extendedRequestId' => nil, + 'httpMethod' => 'GET', + 'identity' => {}, + 'path' => '/', + 'protocol' => 'HTTP/1.1', + 'requestId' => 'db7f8e7a-4cc5-4f6d-987b-713d0d9052c3', + 'requestTime' => '08/Nov/2023:19:09:59 +0000', + 'requestTimeEpoch' => 1_699_470_599, + 'resourceId' => '123456', + 'resourcePath' => '/', + 'stage' => 'api' + }, + 'resource' => '/', + 'stageVariables' => nil, + 'version' => '1.0' +}.freeze + +EVENT_V2 = { + 'version' => '2.0', + 'routeKey' => '$default', + 'rawPath' => '/path/to/resource', + 'rawQueryString' => 'parameter1=value1¶meter1=value2¶meter2=value', + 'cookies' => %w[cookie1 cookie2], + 'headers' => { 'header1' => 'value1', 'Header2' => 'value1,value2' }, + 'queryStringParameters' => {}, + 'requestContext' => { + 'accountId' => '123456789012', + 'apiId' => 'api-id', + 'authentication' => { 'clientCert' => {} }, + 'authorizer' => {}, + 'domainName' => 'id.execute-api.us-east-1.amazonaws.com', + 'domainPrefix' => 'id', + 'http' => { + 'method' => 'POST', + 'path' => '/path/to/resource', + 'protocol' => 'HTTP/1.1', + 'sourceIp' => '192.168.0.1/32', + 'userAgent' => 'agent' + }, + 'requestId' => 'id', + 'routeKey' => '$default', + 'stage' => '$default', + 'time' => '12/Mar/2020:19:03:58 +0000', + 'timeEpoch' => 1_583_348_638_390 + }, + 'body' => 'eyJ0ZXN0IjoiYm9keSJ9', + 'pathParameters' => { 'parameter1' => 'value1' }, + 'isBase64Encoded' => true, + 'stageVariables' => { 'stageVariable1' => 'value1', 'stageVariable2' => 'value2' } +}.freeze + +EVENT_RECORD = { + 'Records' => + [ + { 'eventVersion' => '2.0', + 'eventSource' => 'aws:s3', + 'awsRegion' => 'us-east-1', + 'eventTime' => '1970-01-01T00:00:00.000Z', + 'eventName' => 'ObjectCreated:Put', + 'userIdentity' => { 'principalId' => 'EXAMPLE' }, + 'requestParameters' => { 'sourceIPAddress' => '127.0.0.1' }, + 'responseElements' => { + 'x-amz-request-id' => 'EXAMPLE123456789', + 'x-amz-id-2' => 'EXAMPLE123/5678abcdefghijklambdaisawesome/mnopqrstuvwxyzABCDEFGH' + }, + 's3' => { + 's3SchemaVersion' => '1.0', + 'configurationId' => 'testConfigRule', + 'bucket' => { + 'name' => 'mybucket', + 'ownerIdentity' => { + 'principalId' => 'EXAMPLE' + }, + 'arn' => 'arn:aws:s3:::mybucket' + }, + 'object' => { + 'key' => 'test/key', + 'size' => 1024, + 'eTag' => '0123456789abcdef0123456789abcdef', + 'sequencer' => '0A1B2C3D4E5F678901' + } + } } + ] +}.freeze + +SQS_RECORD = { + 'Records' => + [{ 'messageId' => '19dd0b57-b21e-4ac1-bd88-01bbb068cb78', + 'receiptHandle' => 'MessageReceiptHandle', + 'body' => 'Hello from SQS!', + 'attributes' => + { 'ApproximateReceiveCount' => '1', + 'SentTimestamp' => '1523232000000', + 'SenderId' => '123456789012', + 'ApproximateFirstReceiveTimestamp' => '1523232000001' }, + 'messageAttributes' => {}, + 'md5OfBody' => '7b270e59b47ff90a553787216d55d91d', + 'eventSource' => 'aws:sqs', + 'eventSourceARN' => 'arn:aws:sqs:us-east-1:123456789012:MyQueue', + 'awsRegion' => 'us-east-1' }] +}.freeze + +CONTEXT = MockLambdaContext.new(aws_request_id: '41784178-4178-4178-4178-4178417855e', + invoked_function_arn: 'arn:aws:lambda:location:id:function_name:function_name', + function_name: 'funcion') + +$LOAD_PATH.unshift("#{Dir.pwd}/example/") +ENV['ORIG_HANDLER'] = 'sample.test' +ENV['_HANDLER'] = 'sample.test' +OpenTelemetry::SDK.configure do |c| + c.error_handler = ->(exception:, message:) { raise(exception || message) } + c.logger = Logger.new($stderr, level: ENV.fetch('OTEL_LOG_LEVEL', 'fatal').to_sym) + c.use 'OpenTelemetry::Instrumentation::AwsLambda' + c.add_span_processor span_processor +end diff --git a/instrumentation/aws_sdk/CHANGELOG.md b/instrumentation/aws_sdk/CHANGELOG.md index 6ef39ea6a..a8653eec7 100644 --- a/instrumentation/aws_sdk/CHANGELOG.md +++ b/instrumentation/aws_sdk/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-aws_sdk +### v0.5.2 / 2024-04-30 + +* FIXED: Bundler conflict warnings + ### v0.5.1 / 2024-02-08 * FIXED: Return nil for non-existant key in AwsSdk::MessageAttributeGetter diff --git a/instrumentation/aws_sdk/lib/opentelemetry/instrumentation/aws_sdk/version.rb b/instrumentation/aws_sdk/lib/opentelemetry/instrumentation/aws_sdk/version.rb index bd5d2d66f..11bc5af23 100644 --- a/instrumentation/aws_sdk/lib/opentelemetry/instrumentation/aws_sdk/version.rb +++ b/instrumentation/aws_sdk/lib/opentelemetry/instrumentation/aws_sdk/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module AwsSdk - VERSION = '0.5.1' + VERSION = '0.5.2' end end end diff --git a/instrumentation/aws_sdk/opentelemetry-instrumentation-aws_sdk.gemspec b/instrumentation/aws_sdk/opentelemetry-instrumentation-aws_sdk.gemspec index ad5de23a0..d94b5fd1d 100644 --- a/instrumentation/aws_sdk/opentelemetry-instrumentation-aws_sdk.gemspec +++ b/instrumentation/aws_sdk/opentelemetry-instrumentation-aws_sdk.gemspec @@ -29,7 +29,6 @@ Gem::Specification.new do |spec| spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.22.1' spec.add_development_dependency 'appraisal', '~> 2.5' - spec.add_development_dependency 'aws-sdk', '>= 2.0' spec.add_development_dependency 'bundler', '~> 2.4' spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' diff --git a/instrumentation/bunny/CHANGELOG.md b/instrumentation/bunny/CHANGELOG.md index 55b1101d5..bbbe07d1b 100644 --- a/instrumentation/bunny/CHANGELOG.md +++ b/instrumentation/bunny/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-bunny +### v0.21.3 / 2024-04-30 + +* FIXED: Bundler conflict warnings + ### v0.21.2 / 2024-02-08 * FIXED: Remove disable directives leftover from older version of Rubocop diff --git a/instrumentation/bunny/lib/opentelemetry/instrumentation/bunny/version.rb b/instrumentation/bunny/lib/opentelemetry/instrumentation/bunny/version.rb index 8a6743c0a..dc5eb7c73 100644 --- a/instrumentation/bunny/lib/opentelemetry/instrumentation/bunny/version.rb +++ b/instrumentation/bunny/lib/opentelemetry/instrumentation/bunny/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module Bunny - VERSION = '0.21.2' + VERSION = '0.21.3' end end end diff --git a/instrumentation/bunny/opentelemetry-instrumentation-bunny.gemspec b/instrumentation/bunny/opentelemetry-instrumentation-bunny.gemspec index 12ce8b6e8..9947e694e 100644 --- a/instrumentation/bunny/opentelemetry-instrumentation-bunny.gemspec +++ b/instrumentation/bunny/opentelemetry-instrumentation-bunny.gemspec @@ -30,7 +30,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'appraisal', '~> 2.5' spec.add_development_dependency 'bundler', '~> 2.4' - spec.add_development_dependency 'bunny' spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' diff --git a/instrumentation/concurrent_ruby/CHANGELOG.md b/instrumentation/concurrent_ruby/CHANGELOG.md index bbb0b992b..8182bda89 100644 --- a/instrumentation/concurrent_ruby/CHANGELOG.md +++ b/instrumentation/concurrent_ruby/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-concurrent_ruby +### v0.21.3 / 2024-04-30 + +* FIXED: Bundler conflict warnings + ### v0.21.2 / 2023-11-23 * CHANGED: Applied Rubocop Performance Recommendations [#727](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/727) diff --git a/instrumentation/concurrent_ruby/lib/opentelemetry/instrumentation/concurrent_ruby/version.rb b/instrumentation/concurrent_ruby/lib/opentelemetry/instrumentation/concurrent_ruby/version.rb index 027e6d324..d92667088 100644 --- a/instrumentation/concurrent_ruby/lib/opentelemetry/instrumentation/concurrent_ruby/version.rb +++ b/instrumentation/concurrent_ruby/lib/opentelemetry/instrumentation/concurrent_ruby/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module ConcurrentRuby - VERSION = '0.21.2' + VERSION = '0.21.3' end end end diff --git a/instrumentation/concurrent_ruby/opentelemetry-instrumentation-concurrent_ruby.gemspec b/instrumentation/concurrent_ruby/opentelemetry-instrumentation-concurrent_ruby.gemspec index 285692497..49acf9bf8 100644 --- a/instrumentation/concurrent_ruby/opentelemetry-instrumentation-concurrent_ruby.gemspec +++ b/instrumentation/concurrent_ruby/opentelemetry-instrumentation-concurrent_ruby.gemspec @@ -30,7 +30,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'appraisal', '~> 2.5' spec.add_development_dependency 'bundler', '~> 2.4' - spec.add_development_dependency 'concurrent-ruby', '~> 1.0' spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' diff --git a/instrumentation/dalli/CHANGELOG.md b/instrumentation/dalli/CHANGELOG.md index 1a89d2a85..444e51488 100644 --- a/instrumentation/dalli/CHANGELOG.md +++ b/instrumentation/dalli/CHANGELOG.md @@ -1,5 +1,13 @@ # Release History: opentelemetry-instrumentation-dalli +### v0.25.2 / 2024-05-09 + +* FIXED: Untrace entire request + +### v0.25.1 / 2024-04-30 + +* FIXED: Bundler conflict warnings + ### v0.25.0 / 2023-10-16 * BREAKING CHANGE: Obfuscation for mysql2, dalli and postgresql as default option for db_statement diff --git a/instrumentation/dalli/lib/opentelemetry/instrumentation/dalli/version.rb b/instrumentation/dalli/lib/opentelemetry/instrumentation/dalli/version.rb index a5f393b3b..c08c8100d 100644 --- a/instrumentation/dalli/lib/opentelemetry/instrumentation/dalli/version.rb +++ b/instrumentation/dalli/lib/opentelemetry/instrumentation/dalli/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module Dalli - VERSION = '0.25.0' + VERSION = '0.25.2' end end end diff --git a/instrumentation/dalli/opentelemetry-instrumentation-dalli.gemspec b/instrumentation/dalli/opentelemetry-instrumentation-dalli.gemspec index ad8b0e6fa..daede6d14 100644 --- a/instrumentation/dalli/opentelemetry-instrumentation-dalli.gemspec +++ b/instrumentation/dalli/opentelemetry-instrumentation-dalli.gemspec @@ -26,12 +26,11 @@ Gem::Specification.new do |spec| spec.required_ruby_version = '>= 3.0' spec.add_dependency 'opentelemetry-api', '~> 1.0' - spec.add_dependency 'opentelemetry-common', '~> 0.20.0' + spec.add_dependency 'opentelemetry-common', '~> 0.21.0' spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.22.1' spec.add_development_dependency 'appraisal', '~> 2.5' spec.add_development_dependency 'bundler', '~> 2.4' - spec.add_development_dependency 'dalli', '>= 2.7' spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' diff --git a/instrumentation/delayed_job/Appraisals b/instrumentation/delayed_job/Appraisals index 61ac8e82d..e4d86e84f 100644 --- a/instrumentation/delayed_job/Appraisals +++ b/instrumentation/delayed_job/Appraisals @@ -4,6 +4,10 @@ # # SPDX-License-Identifier: Apache-2.0 +appraise 'delayed_job_4.1-rails-latest' do + gem 'activejob' +end + appraise 'delayed_job_4.1-rails-7.1' do gem 'activejob', '~> 7.1.0' end diff --git a/instrumentation/delayed_job/CHANGELOG.md b/instrumentation/delayed_job/CHANGELOG.md index ac8bd79d9..e25709896 100644 --- a/instrumentation/delayed_job/CHANGELOG.md +++ b/instrumentation/delayed_job/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-delayed_job +### v0.22.2 / 2024-04-30 + +* FIXED: Bundler conflict warnings + ### v0.22.1 / 2023-11-23 * CHANGED: Applied Rubocop Performance Recommendations [#727](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/727) diff --git a/instrumentation/delayed_job/Gemfile b/instrumentation/delayed_job/Gemfile index 2baf57ac4..3c182227f 100644 --- a/instrumentation/delayed_job/Gemfile +++ b/instrumentation/delayed_job/Gemfile @@ -9,5 +9,6 @@ source 'https://rubygems.org' gemspec group :test do + gem 'delayed_job', '~> 4.1' gem 'opentelemetry-instrumentation-base', path: '../base' end diff --git a/instrumentation/delayed_job/lib/opentelemetry/instrumentation/delayed_job/version.rb b/instrumentation/delayed_job/lib/opentelemetry/instrumentation/delayed_job/version.rb index 642c8c07e..4c24b08ca 100644 --- a/instrumentation/delayed_job/lib/opentelemetry/instrumentation/delayed_job/version.rb +++ b/instrumentation/delayed_job/lib/opentelemetry/instrumentation/delayed_job/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module DelayedJob - VERSION = '0.22.1' + VERSION = '0.22.2' end end end diff --git a/instrumentation/delayed_job/opentelemetry-instrumentation-delayed_job.gemspec b/instrumentation/delayed_job/opentelemetry-instrumentation-delayed_job.gemspec index 70a772a33..79e1048ea 100644 --- a/instrumentation/delayed_job/opentelemetry-instrumentation-delayed_job.gemspec +++ b/instrumentation/delayed_job/opentelemetry-instrumentation-delayed_job.gemspec @@ -30,7 +30,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'appraisal', '~> 2.5' spec.add_development_dependency 'bundler', '~> 2.4' - spec.add_development_dependency 'delayed_job', '~> 4.1.7' spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' diff --git a/instrumentation/ethon/CHANGELOG.md b/instrumentation/ethon/CHANGELOG.md index a579ed745..35f7b1a85 100644 --- a/instrumentation/ethon/CHANGELOG.md +++ b/instrumentation/ethon/CHANGELOG.md @@ -1,5 +1,13 @@ # Release History: opentelemetry-instrumentation-ethon +### v0.21.5 / 2024-05-09 + +* FIXED: Untrace entire request + +### v0.21.4 / 2024-04-30 + +* FIXED: Bundler conflict warnings + ### v0.21.3 / 2023-11-23 * CHANGED: Applied Rubocop Performance Recommendations [#727](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/727) diff --git a/instrumentation/ethon/lib/opentelemetry/instrumentation/ethon/version.rb b/instrumentation/ethon/lib/opentelemetry/instrumentation/ethon/version.rb index ff7e5ce1d..e62d8793b 100644 --- a/instrumentation/ethon/lib/opentelemetry/instrumentation/ethon/version.rb +++ b/instrumentation/ethon/lib/opentelemetry/instrumentation/ethon/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module Ethon - VERSION = '0.21.3' + VERSION = '0.21.5' end end end diff --git a/instrumentation/ethon/opentelemetry-instrumentation-ethon.gemspec b/instrumentation/ethon/opentelemetry-instrumentation-ethon.gemspec index 40d6b69ce..c0ab94171 100644 --- a/instrumentation/ethon/opentelemetry-instrumentation-ethon.gemspec +++ b/instrumentation/ethon/opentelemetry-instrumentation-ethon.gemspec @@ -26,12 +26,11 @@ Gem::Specification.new do |spec| spec.required_ruby_version = '>= 3.0' spec.add_dependency 'opentelemetry-api', '~> 1.0' - spec.add_dependency 'opentelemetry-common', '~> 0.20.0' + spec.add_dependency 'opentelemetry-common', '~> 0.21.0' spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.22.1' spec.add_development_dependency 'appraisal', '~> 2.5' spec.add_development_dependency 'bundler', '~> 2.4' - spec.add_development_dependency 'ethon', '~> 0.11' spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' diff --git a/instrumentation/excon/CHANGELOG.md b/instrumentation/excon/CHANGELOG.md index b007f45e6..95ba63b54 100644 --- a/instrumentation/excon/CHANGELOG.md +++ b/instrumentation/excon/CHANGELOG.md @@ -1,5 +1,13 @@ # Release History: opentelemetry-instrumentation-excon +### v0.22.2 / 2024-05-09 + +* FIXED: Untrace entire request + +### v0.22.1 / 2024-04-30 + +* FIXED: Bundler conflict warnings + ### v0.22.0 / 2023-11-28 * BREAKING CHANGE: Add a connect span to excon diff --git a/instrumentation/excon/lib/opentelemetry/instrumentation/excon/version.rb b/instrumentation/excon/lib/opentelemetry/instrumentation/excon/version.rb index 45107d5c0..c1d732bfb 100644 --- a/instrumentation/excon/lib/opentelemetry/instrumentation/excon/version.rb +++ b/instrumentation/excon/lib/opentelemetry/instrumentation/excon/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module Excon - VERSION = '0.22.0' + VERSION = '0.22.2' end end end diff --git a/instrumentation/excon/opentelemetry-instrumentation-excon.gemspec b/instrumentation/excon/opentelemetry-instrumentation-excon.gemspec index 1db852915..1921c50c5 100644 --- a/instrumentation/excon/opentelemetry-instrumentation-excon.gemspec +++ b/instrumentation/excon/opentelemetry-instrumentation-excon.gemspec @@ -26,12 +26,11 @@ Gem::Specification.new do |spec| spec.required_ruby_version = '>= 3.0' spec.add_dependency 'opentelemetry-api', '~> 1.0' - spec.add_dependency 'opentelemetry-common', '~> 0.20.0' + spec.add_dependency 'opentelemetry-common', '~> 0.21.0' spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.22.1' spec.add_development_dependency 'appraisal', '~> 2.5' spec.add_development_dependency 'bundler', '~> 2.4' - spec.add_development_dependency 'excon' spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' diff --git a/instrumentation/faraday/CHANGELOG.md b/instrumentation/faraday/CHANGELOG.md index c994213bf..25e1b92a3 100644 --- a/instrumentation/faraday/CHANGELOG.md +++ b/instrumentation/faraday/CHANGELOG.md @@ -1,5 +1,13 @@ # Release History: opentelemetry-instrumentation-faraday +### v0.24.3 / 2024-05-09 + +* FIXED: Untrace entire request + +### v0.24.2 / 2024-04-30 + +* FIXED: Bundler conflict warnings + ### v0.24.1 / 2024-03-22 * FIXED: Propagate response attributes on Faraday::Error. diff --git a/instrumentation/faraday/lib/opentelemetry/instrumentation/faraday/version.rb b/instrumentation/faraday/lib/opentelemetry/instrumentation/faraday/version.rb index 2883887b0..370cde384 100644 --- a/instrumentation/faraday/lib/opentelemetry/instrumentation/faraday/version.rb +++ b/instrumentation/faraday/lib/opentelemetry/instrumentation/faraday/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module Faraday - VERSION = '0.24.1' + VERSION = '0.24.3' end end end diff --git a/instrumentation/faraday/opentelemetry-instrumentation-faraday.gemspec b/instrumentation/faraday/opentelemetry-instrumentation-faraday.gemspec index dab361e74..41aa04b68 100644 --- a/instrumentation/faraday/opentelemetry-instrumentation-faraday.gemspec +++ b/instrumentation/faraday/opentelemetry-instrumentation-faraday.gemspec @@ -26,12 +26,11 @@ Gem::Specification.new do |spec| spec.required_ruby_version = '>= 3.0' spec.add_dependency 'opentelemetry-api', '~> 1.0' - spec.add_dependency 'opentelemetry-common', '~> 0.20.0' + spec.add_dependency 'opentelemetry-common', '~> 0.21.0' spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.22.1' spec.add_development_dependency 'appraisal', '~> 2.5' spec.add_development_dependency 'bundler', '~> 2.4' - spec.add_development_dependency 'faraday' spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' diff --git a/instrumentation/grape/CHANGELOG.md b/instrumentation/grape/CHANGELOG.md index 640a501fe..f9728d3d3 100644 --- a/instrumentation/grape/CHANGELOG.md +++ b/instrumentation/grape/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-grape +### v0.1.7 / 2024-04-30 + +* FIXED: Bundler conflict warnings + ### v0.1.6 / 2023-11-23 * CHANGED: Applied Rubocop Performance Recommendations [#727](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/727) diff --git a/instrumentation/grape/lib/opentelemetry/instrumentation/grape/version.rb b/instrumentation/grape/lib/opentelemetry/instrumentation/grape/version.rb index 4e913a982..b585b5cd5 100644 --- a/instrumentation/grape/lib/opentelemetry/instrumentation/grape/version.rb +++ b/instrumentation/grape/lib/opentelemetry/instrumentation/grape/version.rb @@ -8,7 +8,7 @@ module OpenTelemetry module Instrumentation module Grape # Current gem version - VERSION = '0.1.6' + VERSION = '0.1.7' end end end diff --git a/instrumentation/grape/opentelemetry-instrumentation-grape.gemspec b/instrumentation/grape/opentelemetry-instrumentation-grape.gemspec index 9a73d7929..ef438aed7 100644 --- a/instrumentation/grape/opentelemetry-instrumentation-grape.gemspec +++ b/instrumentation/grape/opentelemetry-instrumentation-grape.gemspec @@ -32,7 +32,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'activesupport' spec.add_development_dependency 'appraisal', '~> 2.5' spec.add_development_dependency 'bundler', '~> 2.4' - spec.add_development_dependency 'grape', '~> 1.2' spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.0' spec.add_development_dependency 'opentelemetry-test-helpers' diff --git a/instrumentation/graphql/CHANGELOG.md b/instrumentation/graphql/CHANGELOG.md index f95201393..327842397 100644 --- a/instrumentation/graphql/CHANGELOG.md +++ b/instrumentation/graphql/CHANGELOG.md @@ -1,5 +1,13 @@ # Release History: opentelemetry-instrumentation-graphql +### v0.28.2 / 2024-04-30 + +* FIXED: Bundler conflict warnings + +### v0.28.1 / 2024-04-10 + +* FIXED: Analyze span names in GraphQL instrumentation + ### v0.28.0 / 2024-02-16 * BREAKING CHANGE: GraphQL Legacy Tracer perf improvements [#867](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/867). diff --git a/instrumentation/graphql/lib/opentelemetry/instrumentation/graphql/tracers/graphql_trace.rb b/instrumentation/graphql/lib/opentelemetry/instrumentation/graphql/tracers/graphql_trace.rb index 84ebae562..70c966623 100644 --- a/instrumentation/graphql/lib/opentelemetry/instrumentation/graphql/tracers/graphql_trace.rb +++ b/instrumentation/graphql/lib/opentelemetry/instrumentation/graphql/tracers/graphql_trace.rb @@ -89,11 +89,11 @@ def validate(query:, validate:, &block) end def analyze_multiplex(multiplex:, &block) - tracer.in_span('graphql.analyze_query', &block) + tracer.in_span('graphql.analyze_multiplex', &block) end def analyze_query(query:, &block) - tracer.in_span('graphql.analyze_multiplex', &block) + tracer.in_span('graphql.analyze_query', &block) end def execute_query(query:, &block) diff --git a/instrumentation/graphql/lib/opentelemetry/instrumentation/graphql/version.rb b/instrumentation/graphql/lib/opentelemetry/instrumentation/graphql/version.rb index e864e46c7..03976e332 100644 --- a/instrumentation/graphql/lib/opentelemetry/instrumentation/graphql/version.rb +++ b/instrumentation/graphql/lib/opentelemetry/instrumentation/graphql/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module GraphQL - VERSION = '0.28.0' + VERSION = '0.28.2' end end end diff --git a/instrumentation/graphql/opentelemetry-instrumentation-graphql.gemspec b/instrumentation/graphql/opentelemetry-instrumentation-graphql.gemspec index cfa1d3e16..508a8a800 100644 --- a/instrumentation/graphql/opentelemetry-instrumentation-graphql.gemspec +++ b/instrumentation/graphql/opentelemetry-instrumentation-graphql.gemspec @@ -30,7 +30,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'appraisal', '~> 2.5' spec.add_development_dependency 'bundler', '~> 2.4' - spec.add_development_dependency 'graphql', '>= 1.9.0', '< 3.0.0' spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' diff --git a/instrumentation/graphql/test/instrumentation/graphql/tracers/graphql_trace_test.rb b/instrumentation/graphql/test/instrumentation/graphql/tracers/graphql_trace_test.rb index 4ae7fb15e..22e194036 100644 --- a/instrumentation/graphql/test/instrumentation/graphql/tracers/graphql_trace_test.rb +++ b/instrumentation/graphql/test/instrumentation/graphql/tracers/graphql_trace_test.rb @@ -47,8 +47,8 @@ 'graphql.lex', 'graphql.parse', 'graphql.validate', - 'graphql.analyze_multiplex', 'graphql.analyze_query', + 'graphql.analyze_multiplex', 'graphql.execute_query', 'graphql.execute_query_lazy', 'graphql.execute_multiplex' diff --git a/instrumentation/gruf/CHANGELOG.md b/instrumentation/gruf/CHANGELOG.md index 942d02b20..87dfd51a0 100644 --- a/instrumentation/gruf/CHANGELOG.md +++ b/instrumentation/gruf/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-gruf +### v0.2.1 / 2024-04-30 + +* FIXED: Bundler conflict warnings + ### v0.2.0 / 2024-02-20 * ADDED: Add support gruf 2.19 diff --git a/instrumentation/gruf/lib/opentelemetry/instrumentation/gruf/version.rb b/instrumentation/gruf/lib/opentelemetry/instrumentation/gruf/version.rb index 49b772fc0..8cb09a5a8 100644 --- a/instrumentation/gruf/lib/opentelemetry/instrumentation/gruf/version.rb +++ b/instrumentation/gruf/lib/opentelemetry/instrumentation/gruf/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module Gruf - VERSION = '0.2.0' + VERSION = '0.2.1' end end end diff --git a/instrumentation/gruf/opentelemetry-instrumentation-gruf.gemspec b/instrumentation/gruf/opentelemetry-instrumentation-gruf.gemspec index edb6ab6b4..e6294067f 100644 --- a/instrumentation/gruf/opentelemetry-instrumentation-gruf.gemspec +++ b/instrumentation/gruf/opentelemetry-instrumentation-gruf.gemspec @@ -31,7 +31,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'appraisal', '~> 2.5' spec.add_development_dependency 'bundler', '>= 1.17' spec.add_development_dependency 'grpc_mock' - spec.add_development_dependency 'gruf', '>= 2.19.0' spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.0' spec.add_development_dependency 'opentelemetry-test-helpers' diff --git a/instrumentation/http/CHANGELOG.md b/instrumentation/http/CHANGELOG.md index 4063891f7..59ab58139 100644 --- a/instrumentation/http/CHANGELOG.md +++ b/instrumentation/http/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-http +### v0.23.3 / 2024-04-30 + +* FIXED: Bundler conflict warnings + ### v0.23.2 / 2023-11-23 * CHANGED: Applied Rubocop Performance Recommendations [#727](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/727) diff --git a/instrumentation/http/lib/opentelemetry/instrumentation/http/version.rb b/instrumentation/http/lib/opentelemetry/instrumentation/http/version.rb index 03c0bd0ab..9e392212c 100644 --- a/instrumentation/http/lib/opentelemetry/instrumentation/http/version.rb +++ b/instrumentation/http/lib/opentelemetry/instrumentation/http/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module HTTP - VERSION = '0.23.2' + VERSION = '0.23.3' end end end diff --git a/instrumentation/http/opentelemetry-instrumentation-http.gemspec b/instrumentation/http/opentelemetry-instrumentation-http.gemspec index 2a37b6d47..979719a9a 100644 --- a/instrumentation/http/opentelemetry-instrumentation-http.gemspec +++ b/instrumentation/http/opentelemetry-instrumentation-http.gemspec @@ -30,7 +30,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'appraisal', '~> 2.5' spec.add_development_dependency 'bundler', '~> 2.4' - spec.add_development_dependency 'http' spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' diff --git a/instrumentation/http_client/CHANGELOG.md b/instrumentation/http_client/CHANGELOG.md index 45889acfb..57272442c 100644 --- a/instrumentation/http_client/CHANGELOG.md +++ b/instrumentation/http_client/CHANGELOG.md @@ -1,5 +1,13 @@ # Release History: opentelemetry-instrumentation-http_client +### v0.22.5 / 2024-05-09 + +* FIXED: Untrace entire request + +### v0.22.4 / 2024-04-30 + +* FIXED: Bundler conflict warnings + ### v0.22.3 / 2023-11-23 * CHANGED: Applied Rubocop Performance Recommendations [#727](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/727) diff --git a/instrumentation/http_client/lib/opentelemetry/instrumentation/http_client/version.rb b/instrumentation/http_client/lib/opentelemetry/instrumentation/http_client/version.rb index df4af6cac..93dfe3a64 100644 --- a/instrumentation/http_client/lib/opentelemetry/instrumentation/http_client/version.rb +++ b/instrumentation/http_client/lib/opentelemetry/instrumentation/http_client/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module HttpClient - VERSION = '0.22.3' + VERSION = '0.22.5' end end end diff --git a/instrumentation/http_client/opentelemetry-instrumentation-http_client.gemspec b/instrumentation/http_client/opentelemetry-instrumentation-http_client.gemspec index f9d073ed3..50996ac35 100644 --- a/instrumentation/http_client/opentelemetry-instrumentation-http_client.gemspec +++ b/instrumentation/http_client/opentelemetry-instrumentation-http_client.gemspec @@ -26,12 +26,11 @@ Gem::Specification.new do |spec| spec.required_ruby_version = '>= 3.0' spec.add_dependency 'opentelemetry-api', '~> 1.0' - spec.add_dependency 'opentelemetry-common', '~> 0.20.0' + spec.add_dependency 'opentelemetry-common', '~> 0.21.0' spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.22.1' spec.add_development_dependency 'appraisal', '~> 2.5' spec.add_development_dependency 'bundler', '~> 2.4' - spec.add_development_dependency 'httpclient' spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' diff --git a/instrumentation/httpx/CHANGELOG.md b/instrumentation/httpx/CHANGELOG.md index d77ecae3c..74a508b72 100644 --- a/instrumentation/httpx/CHANGELOG.md +++ b/instrumentation/httpx/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-httpx +### v0.1.2 / 2024-04-30 + +* FIXED: Bundler conflict warnings + ### v0.1.1 / 2023-11-23 * CHANGED: Applied Rubocop Performance Recommendations [#727](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/727) diff --git a/instrumentation/httpx/lib/opentelemetry/instrumentation/httpx/version.rb b/instrumentation/httpx/lib/opentelemetry/instrumentation/httpx/version.rb index da576ff94..d5df1b2da 100644 --- a/instrumentation/httpx/lib/opentelemetry/instrumentation/httpx/version.rb +++ b/instrumentation/httpx/lib/opentelemetry/instrumentation/httpx/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module HTTPX - VERSION = '0.1.1' + VERSION = '0.1.2' end end end diff --git a/instrumentation/httpx/opentelemetry-instrumentation-httpx.gemspec b/instrumentation/httpx/opentelemetry-instrumentation-httpx.gemspec index 0c436df23..358f85a2b 100644 --- a/instrumentation/httpx/opentelemetry-instrumentation-httpx.gemspec +++ b/instrumentation/httpx/opentelemetry-instrumentation-httpx.gemspec @@ -30,7 +30,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'appraisal', '~> 2.5' spec.add_development_dependency 'bundler', '~> 2.4' - spec.add_development_dependency 'httpx' spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' diff --git a/instrumentation/koala/CHANGELOG.md b/instrumentation/koala/CHANGELOG.md index 3c4b93039..a222a5fc1 100644 --- a/instrumentation/koala/CHANGELOG.md +++ b/instrumentation/koala/CHANGELOG.md @@ -1,5 +1,13 @@ # Release History: opentelemetry-instrumentation-koala +### v0.20.4 / 2024-05-09 + +* FIXED: Untrace entire request + +### v0.20.3 / 2024-04-30 + +* FIXED: Bundler conflict warnings + ### v0.20.2 / 2023-07-21 * ADDED: Update `opentelemetry-common` from [0.19.3 to 0.20.0](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/537) diff --git a/instrumentation/koala/lib/opentelemetry/instrumentation/koala/version.rb b/instrumentation/koala/lib/opentelemetry/instrumentation/koala/version.rb index 3786defde..eb721f1ca 100644 --- a/instrumentation/koala/lib/opentelemetry/instrumentation/koala/version.rb +++ b/instrumentation/koala/lib/opentelemetry/instrumentation/koala/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module Koala - VERSION = '0.20.2' + VERSION = '0.20.4' end end end diff --git a/instrumentation/koala/opentelemetry-instrumentation-koala.gemspec b/instrumentation/koala/opentelemetry-instrumentation-koala.gemspec index c03072d80..561ad7a86 100644 --- a/instrumentation/koala/opentelemetry-instrumentation-koala.gemspec +++ b/instrumentation/koala/opentelemetry-instrumentation-koala.gemspec @@ -26,12 +26,11 @@ Gem::Specification.new do |spec| spec.required_ruby_version = '>= 3.0' spec.add_dependency 'opentelemetry-api', '~> 1.0' - spec.add_dependency 'opentelemetry-common', '~> 0.20.0' + spec.add_dependency 'opentelemetry-common', '~> 0.21.0' spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.22.1' spec.add_development_dependency 'appraisal', '~> 2.5' spec.add_development_dependency 'bundler', '~> 2.4' - spec.add_development_dependency 'koala', '~> 3.0.0' spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' diff --git a/instrumentation/lmdb/CHANGELOG.md b/instrumentation/lmdb/CHANGELOG.md index 3a2998617..83403f938 100644 --- a/instrumentation/lmdb/CHANGELOG.md +++ b/instrumentation/lmdb/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-lmdb +### v0.22.2 / 2024-04-30 + +* FIXED: Bundler conflict warnings + ### v0.22.1 / 2023-06-05 * FIXED: Base config options diff --git a/instrumentation/lmdb/lib/opentelemetry/instrumentation/lmdb/version.rb b/instrumentation/lmdb/lib/opentelemetry/instrumentation/lmdb/version.rb index b89bdf81e..998d9a01e 100644 --- a/instrumentation/lmdb/lib/opentelemetry/instrumentation/lmdb/version.rb +++ b/instrumentation/lmdb/lib/opentelemetry/instrumentation/lmdb/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module LMDB - VERSION = '0.22.1' + VERSION = '0.22.2' end end end diff --git a/instrumentation/lmdb/opentelemetry-instrumentation-lmdb.gemspec b/instrumentation/lmdb/opentelemetry-instrumentation-lmdb.gemspec index 785b6071a..51ed47f00 100644 --- a/instrumentation/lmdb/opentelemetry-instrumentation-lmdb.gemspec +++ b/instrumentation/lmdb/opentelemetry-instrumentation-lmdb.gemspec @@ -30,7 +30,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'appraisal', '~> 2.5' spec.add_development_dependency 'bundler', '~> 2.4' - spec.add_development_dependency 'lmdb' spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' diff --git a/instrumentation/mongo/CHANGELOG.md b/instrumentation/mongo/CHANGELOG.md index 671a8b733..6c8e51b2a 100644 --- a/instrumentation/mongo/CHANGELOG.md +++ b/instrumentation/mongo/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-mongo +### v0.22.3 / 2024-04-30 + +* FIXED: Bundler conflict warnings + ### v0.22.2 / 2023-11-23 * CHANGED: Applied Rubocop Performance Recommendations [#727](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/727) diff --git a/instrumentation/mongo/lib/opentelemetry/instrumentation/mongo/version.rb b/instrumentation/mongo/lib/opentelemetry/instrumentation/mongo/version.rb index db4bb7e65..57c5f676f 100644 --- a/instrumentation/mongo/lib/opentelemetry/instrumentation/mongo/version.rb +++ b/instrumentation/mongo/lib/opentelemetry/instrumentation/mongo/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module Mongo - VERSION = '0.22.2' + VERSION = '0.22.3' end end end diff --git a/instrumentation/mongo/opentelemetry-instrumentation-mongo.gemspec b/instrumentation/mongo/opentelemetry-instrumentation-mongo.gemspec index 7507b1dd2..4efee70ab 100644 --- a/instrumentation/mongo/opentelemetry-instrumentation-mongo.gemspec +++ b/instrumentation/mongo/opentelemetry-instrumentation-mongo.gemspec @@ -31,7 +31,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'appraisal', '~> 2.5' spec.add_development_dependency 'bundler', '~> 2.4' spec.add_development_dependency 'minitest', '~> 5.0' - spec.add_development_dependency 'mongo', '~> 2.5' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'pry' diff --git a/instrumentation/mysql2/CHANGELOG.md b/instrumentation/mysql2/CHANGELOG.md index d2ad6cc5b..bf4abc390 100644 --- a/instrumentation/mysql2/CHANGELOG.md +++ b/instrumentation/mysql2/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-mysql2 +### v0.27.1 / 2024-04-30 + +* FIXED: Bundler conflict warnings + ### v0.27.0 / 2024-02-15 * ADDED: Instrument mysql2 prepare statement diff --git a/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2/version.rb b/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2/version.rb index 7d86b76a0..13538dc20 100644 --- a/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2/version.rb +++ b/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module Mysql2 - VERSION = '0.27.0' + VERSION = '0.27.1' end end end diff --git a/instrumentation/mysql2/opentelemetry-instrumentation-mysql2.gemspec b/instrumentation/mysql2/opentelemetry-instrumentation-mysql2.gemspec index b4be3e3b4..d8dae91b9 100644 --- a/instrumentation/mysql2/opentelemetry-instrumentation-mysql2.gemspec +++ b/instrumentation/mysql2/opentelemetry-instrumentation-mysql2.gemspec @@ -33,7 +33,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'appraisal', '~> 2.5' spec.add_development_dependency 'bundler', '~> 2.4' spec.add_development_dependency 'minitest', '~> 5.0' - spec.add_development_dependency 'mysql2', '>= 0.4.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'pry' diff --git a/instrumentation/net_http/CHANGELOG.md b/instrumentation/net_http/CHANGELOG.md index 1e4c9deca..ab2aee20a 100644 --- a/instrumentation/net_http/CHANGELOG.md +++ b/instrumentation/net_http/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-net_http +### v0.22.5 / 2024-05-09 + +* FIXED: Untrace entire request + ### v0.22.4 / 2023-11-23 * CHANGED: Applied Rubocop Performance Recommendations [#727](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/727) diff --git a/instrumentation/net_http/lib/opentelemetry/instrumentation/net/http/version.rb b/instrumentation/net_http/lib/opentelemetry/instrumentation/net/http/version.rb index b61097b9c..e432ec226 100644 --- a/instrumentation/net_http/lib/opentelemetry/instrumentation/net/http/version.rb +++ b/instrumentation/net_http/lib/opentelemetry/instrumentation/net/http/version.rb @@ -8,7 +8,7 @@ module OpenTelemetry module Instrumentation module Net module HTTP - VERSION = '0.22.4' + VERSION = '0.22.5' end end end diff --git a/instrumentation/net_http/opentelemetry-instrumentation-net_http.gemspec b/instrumentation/net_http/opentelemetry-instrumentation-net_http.gemspec index c64b20f13..1df1dcf52 100644 --- a/instrumentation/net_http/opentelemetry-instrumentation-net_http.gemspec +++ b/instrumentation/net_http/opentelemetry-instrumentation-net_http.gemspec @@ -26,7 +26,7 @@ Gem::Specification.new do |spec| spec.required_ruby_version = '>= 3.0' spec.add_dependency 'opentelemetry-api', '~> 1.0' - spec.add_dependency 'opentelemetry-common', '~> 0.20.0' + spec.add_dependency 'opentelemetry-common', '~> 0.21.0' spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.22.1' spec.add_development_dependency 'bundler', '~> 2.4' diff --git a/instrumentation/pg/CHANGELOG.md b/instrumentation/pg/CHANGELOG.md index 14898572e..45901ccbc 100644 --- a/instrumentation/pg/CHANGELOG.md +++ b/instrumentation/pg/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-pg +### v0.27.2 / 2024-04-30 + +* FIXED: Bundler conflict warnings + ### v0.27.1 / 2024-02-08 * FIXED: Add missing requires for sql-helpers to mysql, pg, and trilogy instrumentation diff --git a/instrumentation/pg/lib/opentelemetry/instrumentation/pg/version.rb b/instrumentation/pg/lib/opentelemetry/instrumentation/pg/version.rb index 8137db18e..bbd9e6c4c 100644 --- a/instrumentation/pg/lib/opentelemetry/instrumentation/pg/version.rb +++ b/instrumentation/pg/lib/opentelemetry/instrumentation/pg/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module PG - VERSION = '0.27.1' + VERSION = '0.27.2' end end end diff --git a/instrumentation/pg/opentelemetry-instrumentation-pg.gemspec b/instrumentation/pg/opentelemetry-instrumentation-pg.gemspec index 9108956f8..b391b2fc9 100644 --- a/instrumentation/pg/opentelemetry-instrumentation-pg.gemspec +++ b/instrumentation/pg/opentelemetry-instrumentation-pg.gemspec @@ -35,7 +35,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' - spec.add_development_dependency 'pg', '>= 1.1.0' spec.add_development_dependency 'pry' spec.add_development_dependency 'pry-byebug' unless RUBY_ENGINE == 'jruby' spec.add_development_dependency 'rubocop', '~> 1.62' diff --git a/instrumentation/que/Appraisals b/instrumentation/que/Appraisals index d5b7c5b72..7792e4821 100644 --- a/instrumentation/que/Appraisals +++ b/instrumentation/que/Appraisals @@ -4,11 +4,14 @@ # # SPDX-License-Identifier: Apache-2.0 -appraise 'que-1.2' do - gem 'que', '1.2.0' +appraise 'que-1.x' do + gem 'que', '~> 1.4' end -appraise 'que-2.1' do - ruby '>= 2.7' - gem 'que', '2.1.0' +appraise 'que-2.x' do + gem 'que', '~> 2.3' +end + +appraise 'que-latest' do + gem 'que' end diff --git a/instrumentation/que/CHANGELOG.md b/instrumentation/que/CHANGELOG.md index 6e7ffc785..334c4dee1 100644 --- a/instrumentation/que/CHANGELOG.md +++ b/instrumentation/que/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-que +### v0.8.1 / 2024-04-30 + +* FIXED: Bundler conflict warnings + ### v0.8.0 / 2024-02-08 * BREAKING CHANGE: Move shared sql behavior to helper gems diff --git a/instrumentation/que/Gemfile b/instrumentation/que/Gemfile index a1fad5525..46bfbfb01 100644 --- a/instrumentation/que/Gemfile +++ b/instrumentation/que/Gemfile @@ -9,8 +9,9 @@ source 'https://rubygems.org' gemspec group :test do + gem 'activerecord' + gem 'pg' gem 'opentelemetry-helpers-sql-obfuscation', path: '../../helpers/sql-obfuscation' gem 'opentelemetry-instrumentation-base', path: '../base' gem 'opentelemetry-instrumentation-pg', path: '../pg' - gem 'appraisal' end diff --git a/instrumentation/que/lib/opentelemetry/instrumentation/que/version.rb b/instrumentation/que/lib/opentelemetry/instrumentation/que/version.rb index 63a140151..be7152f54 100644 --- a/instrumentation/que/lib/opentelemetry/instrumentation/que/version.rb +++ b/instrumentation/que/lib/opentelemetry/instrumentation/que/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module Que - VERSION = '0.8.0' + VERSION = '0.8.1' end end end diff --git a/instrumentation/que/opentelemetry-instrumentation-que.gemspec b/instrumentation/que/opentelemetry-instrumentation-que.gemspec index 3284f99b8..d3c5f7dd9 100644 --- a/instrumentation/que/opentelemetry-instrumentation-que.gemspec +++ b/instrumentation/que/opentelemetry-instrumentation-que.gemspec @@ -28,15 +28,11 @@ Gem::Specification.new do |spec| spec.add_dependency 'opentelemetry-api', '~> 1.0' spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.22.1' - spec.add_development_dependency 'activerecord', '~> 6.0' spec.add_development_dependency 'appraisal', '~> 2.5' spec.add_development_dependency 'bundler', '~> 2.4' spec.add_development_dependency 'minitest', '~> 5.0' - spec.add_development_dependency 'opentelemetry-instrumentation-pg', '~> 0.20' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' - spec.add_development_dependency 'pg', '~> 1.1' - spec.add_development_dependency 'que' spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rubocop', '~> 1.62' spec.add_development_dependency 'rubocop-performance', '~> 1.20' diff --git a/instrumentation/que/test/test_helper.rb b/instrumentation/que/test/test_helper.rb index 5660b9bda..27414d2f3 100644 --- a/instrumentation/que/test/test_helper.rb +++ b/instrumentation/que/test/test_helper.rb @@ -54,12 +54,7 @@ def prepare_que ActiveRecord::Base.connection.execute('CREATE SCHEMA public') Que.connection = ActiveRecord - - if que_version >= Gem::Version.new('2.1.0') - Que.migrate!(version: 7) - else - Que.migrate!(version: 4) - end + Que.migrate!(version: Que::Migrations::CURRENT_VERSION) end def database_name diff --git a/instrumentation/racecar/CHANGELOG.md b/instrumentation/racecar/CHANGELOG.md index cb0cce4a4..a88b20ba9 100644 --- a/instrumentation/racecar/CHANGELOG.md +++ b/instrumentation/racecar/CHANGELOG.md @@ -1,5 +1,13 @@ # Release History: opentelemetry-instrumentation-racecar +### v0.3.2 / 2024-04-30 + +* FIXED: Bundler conflict warnings + +### v0.3.1 / 2024-04-05 + +* FIXED: Fix markdown header + ### v0.3.0 / 2023-09-07 * FIXED: Align messaging instrumentation operation names diff --git a/instrumentation/racecar/README.md b/instrumentation/racecar/README.md index cd41cdaf1..393f32069 100644 --- a/instrumentation/racecar/README.md +++ b/instrumentation/racecar/README.md @@ -13,7 +13,7 @@ gem install opentelemetry-instrumentation-racecar Or, if you use [bundler][bundler-home], include `opentelemetry-instrumentation-racecar` in your `Gemfile`. -## Runtime requirements +## Runtime requirements This instrumentation is built on top of Racecar's integration with `ActiveSupport::Notifications`. `ActiveSupport::Notification` will need to be loaded before the instrumentation is installed (as below) or the installation will cancel. diff --git a/instrumentation/racecar/lib/opentelemetry/instrumentation/racecar/version.rb b/instrumentation/racecar/lib/opentelemetry/instrumentation/racecar/version.rb index 86a2d94b4..e429ed599 100644 --- a/instrumentation/racecar/lib/opentelemetry/instrumentation/racecar/version.rb +++ b/instrumentation/racecar/lib/opentelemetry/instrumentation/racecar/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module Racecar - VERSION = '0.3.0' + VERSION = '0.3.2' end end end diff --git a/instrumentation/racecar/opentelemetry-instrumentation-racecar.gemspec b/instrumentation/racecar/opentelemetry-instrumentation-racecar.gemspec index f75b3486d..f5fc628b2 100644 --- a/instrumentation/racecar/opentelemetry-instrumentation-racecar.gemspec +++ b/instrumentation/racecar/opentelemetry-instrumentation-racecar.gemspec @@ -28,13 +28,11 @@ Gem::Specification.new do |spec| spec.add_dependency 'opentelemetry-api', '~> 1.0' spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.22.1' - spec.add_development_dependency 'activesupport' spec.add_development_dependency 'appraisal', '~> 2.5' spec.add_development_dependency 'bundler', '~> 2.4' spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.0' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' - spec.add_development_dependency 'racecar', '~> 2.7' spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rspec-mocks' spec.add_development_dependency 'rubocop', '~> 1.62' diff --git a/instrumentation/rack/Appraisals b/instrumentation/rack/Appraisals index a62cdf541..6f96b3584 100644 --- a/instrumentation/rack/Appraisals +++ b/instrumentation/rack/Appraisals @@ -4,6 +4,10 @@ # # SPDX-License-Identifier: Apache-2.0 +appraise 'rack-latest' do + gem 'rack' +end + appraise 'rack-3.0' do gem 'rack', '~> 3.0.0' end diff --git a/instrumentation/rack/CHANGELOG.md b/instrumentation/rack/CHANGELOG.md index 56fabc661..ec2b37d58 100644 --- a/instrumentation/rack/CHANGELOG.md +++ b/instrumentation/rack/CHANGELOG.md @@ -1,5 +1,21 @@ # Release History: opentelemetry-instrumentation-rack +### v0.24.4 / 2024-05-09 + +* FIXED: Untrace entire request + +### v0.24.3 / 2024-05-08 + +* FIXED: Rack event baggage handling + +### v0.24.2 / 2024-04-30 + +* FIXED: Bundler conflict warnings + +### v0.24.1 / 2024-04-05 + +* DOCS: Fix typo where Rake is mentioned instead of Rack + ### v0.24.0 / 2024-01-06 * BREAKING CHANGE: Use Rack Events By Default diff --git a/instrumentation/rack/Gemfile b/instrumentation/rack/Gemfile index 5b7d54b64..c8b2ad72f 100644 --- a/instrumentation/rack/Gemfile +++ b/instrumentation/rack/Gemfile @@ -10,5 +10,6 @@ gemspec group :test do gem 'opentelemetry-instrumentation-base', path: '../base' + gem 'rack-test', '~> 2.1.0' gem 'pry-byebug' end diff --git a/instrumentation/rack/README.md b/instrumentation/rack/README.md index 1c6672829..290ad59bc 100644 --- a/instrumentation/rack/README.md +++ b/instrumentation/rack/README.md @@ -45,7 +45,7 @@ end ## Rack Middleware vs Rack Events -Since `v0.24.0`, this instrumentation uses `Rake::Events` as opposed to `Middleware` to support Requests that use Buffered Response Bodies. +Since `v0.24.0`, this instrumentation uses `Rack::Events` as opposed to `Middleware` to support Requests that use Buffered Response Bodies. If your application does not support `Rack::Events`, you may disable it by setting `use_rack_events: false`, e.g. diff --git a/instrumentation/rack/lib/opentelemetry/instrumentation/rack/middlewares/event_handler.rb b/instrumentation/rack/lib/opentelemetry/instrumentation/rack/middlewares/event_handler.rb index 338bd95dd..5475a4fc5 100644 --- a/instrumentation/rack/lib/opentelemetry/instrumentation/rack/middlewares/event_handler.rb +++ b/instrumentation/rack/lib/opentelemetry/instrumentation/rack/middlewares/event_handler.rb @@ -42,7 +42,7 @@ module Middlewares class EventHandler include ::Rack::Events::Abstract - TOKENS_KEY = 'otel.context.tokens' + OTEL_TOKEN_AND_SPAN = 'otel.rack.token_and_span' GOOD_HTTP_STATUSES = (100..499) # Creates a server span for this current request using the incoming parent context @@ -52,11 +52,16 @@ class EventHandler # @param [Rack::Response] This is nil in practice # @return [void] def on_start(request, _) - return if untraced_request?(request.env) + parent_context = if untraced_request?(request.env) + extract_remote_context(request, OpenTelemetry::Common::Utilities.untraced) + else + extract_remote_context(request) + end - parent_context = extract_remote_context(request) span = create_span(parent_context, request) - request.env[TOKENS_KEY] = register_current_span(span) + span_ctx = OpenTelemetry::Trace.context_with_span(span, parent_context: parent_context) + rack_ctx = OpenTelemetry::Instrumentation::Rack.context_with_span(span, parent_context: span_ctx) + request.env[OTEL_TOKEN_AND_SPAN] = [OpenTelemetry::Context.attach(rack_ctx), span] rescue StandardError => e OpenTelemetry.handle_error(exception: e) end @@ -108,7 +113,7 @@ def on_finish(request, response) rescue StandardError => e OpenTelemetry.handle_error(exception: e) ensure - detach_contexts(request) + detach_context(request) end private @@ -171,9 +176,10 @@ def create_request_span_name(request) end end - def extract_remote_context(request) + def extract_remote_context(request, context = Context.current) OpenTelemetry.propagation.extract( request.env, + context: context, getter: OpenTelemetry::Common::Propagation.rack_env_getter ) end @@ -191,11 +197,12 @@ def request_span_attributes(env) attributes end - def detach_contexts(request) - request.env[TOKENS_KEY]&.reverse_each do |token| - OpenTelemetry::Context.detach(token) - OpenTelemetry::Trace.current_span.finish - end + def detach_context(request) + return nil unless request.env[OTEL_TOKEN_AND_SPAN] + + token, span = request.env[OTEL_TOKEN_AND_SPAN] + span.finish + OpenTelemetry::Context.detach(token) rescue StandardError => e OpenTelemetry.handle_error(exception: e) end @@ -244,15 +251,6 @@ def config OpenTelemetry::Instrumentation::Rack::Instrumentation.instance.config end - def register_current_span(span) - ctx = OpenTelemetry::Trace.context_with_span(span) - rack_ctx = OpenTelemetry::Instrumentation::Rack.context_with_span(span, parent_context: ctx) - - contexts = [ctx, rack_ctx] - contexts.compact! - contexts.map { |context| OpenTelemetry::Context.attach(context) } - end - def create_span(parent_context, request) span = tracer.start_span( create_request_span_name(request), diff --git a/instrumentation/rack/lib/opentelemetry/instrumentation/rack/version.rb b/instrumentation/rack/lib/opentelemetry/instrumentation/rack/version.rb index 0c1c489cc..e2957bcbd 100644 --- a/instrumentation/rack/lib/opentelemetry/instrumentation/rack/version.rb +++ b/instrumentation/rack/lib/opentelemetry/instrumentation/rack/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module Rack - VERSION = '0.24.0' + VERSION = '0.24.4' end end end diff --git a/instrumentation/rack/opentelemetry-instrumentation-rack.gemspec b/instrumentation/rack/opentelemetry-instrumentation-rack.gemspec index ba2c1e1f1..3add31a61 100644 --- a/instrumentation/rack/opentelemetry-instrumentation-rack.gemspec +++ b/instrumentation/rack/opentelemetry-instrumentation-rack.gemspec @@ -26,7 +26,7 @@ Gem::Specification.new do |spec| spec.required_ruby_version = '>= 3.0' spec.add_dependency 'opentelemetry-api', '~> 1.0' - spec.add_dependency 'opentelemetry-common', '~> 0.20.0' + spec.add_dependency 'opentelemetry-common', '~> 0.21.0' spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.22.1' spec.add_development_dependency 'appraisal', '~> 2.5' @@ -35,8 +35,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-sdk-experimental', '~> 0.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' - spec.add_development_dependency 'rack' - spec.add_development_dependency 'rack-test' spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rspec-mocks' spec.add_development_dependency 'rubocop', '~> 1.62' diff --git a/instrumentation/rack/test/opentelemetry/instrumentation/rack/middlewares/event_handler_test.rb b/instrumentation/rack/test/opentelemetry/instrumentation/rack/middlewares/event_handler_test.rb index d08857637..b106a5d0d 100644 --- a/instrumentation/rack/test/opentelemetry/instrumentation/rack/middlewares/event_handler_test.rb +++ b/instrumentation/rack/test/opentelemetry/instrumentation/rack/middlewares/event_handler_test.rb @@ -67,6 +67,27 @@ instrumentation.install(config) end + # Simulating buggy instrumentation that starts a span, sets the ctx + # but fails to detach or close the span + describe 'broken instrumentation' do + let(:service) do + lambda do |_env| + span = OpenTelemetry.tracer_provider.tracer('buggy').start_span('I never close') + OpenTelemetry::Context.attach(OpenTelemetry::Trace.context_with_span(span)) + [200, { 'Content-Type' => 'text/plain' }, response_body] + end + end + + it 'still closes the rack span' do + assert_raises OpenTelemetry::Context::DetachError do + get uri, {}, headers + end + _(finished_spans.size).must_equal 1 + _(rack_span.name).must_equal 'HTTP GET' + OpenTelemetry::Context.clear + end + end + describe '#call' do before do get uri, {}, headers @@ -84,6 +105,25 @@ _(proxy_event).must_be_nil end + describe 'when baggage is set' do + let(:headers) do + Hash( + 'baggage' => 'foo=123' + ) + end + + let(:service) do + lambda do |_env| + _(OpenTelemetry::Baggage.raw_entries['foo'].value).must_equal('123') + [200, { 'Content-Type' => 'text/plain' }, response_body] + end + end + + it 'sets baggage in the request context' do + _(rack_span.name).must_equal 'HTTP GET' + end + end + describe 'when a query is passed in' do let(:uri) { '/endpoint?query=true' } @@ -94,17 +134,22 @@ end describe 'config[:untraced_endpoints]' do + let(:service) do + lambda do |_env| + OpenTelemetry.tracer_provider.tracer('req').in_span('in_req_span') {} + [200, { 'Content-Type' => 'text/plain' }, response_body] + end + end + describe 'when an array is passed in' do + let(:uri) { '/ping' } let(:untraced_endpoints) { ['/ping'] } it 'does not trace paths listed in the array' do - get '/ping' - ping_span = finished_spans.find { |s| s.attributes['http.target'] == '/ping' } _(ping_span).must_be_nil - root_span = finished_spans.find { |s| s.attributes['http.target'] == '/' } - _(root_span).wont_be_nil + _(finished_spans.size).must_equal 0 end end @@ -124,19 +169,24 @@ end describe 'config[:untraced_requests]' do + let(:service) do + lambda do |_env| + OpenTelemetry.tracer_provider.tracer('req').in_span('in_req_span') {} + [200, { 'Content-Type' => 'text/plain' }, response_body] + end + end + describe 'when a callable is passed in' do + let(:uri) { '/assets' } let(:untraced_requests) do ->(env) { env['PATH_INFO'] =~ %r{^\/assets} } end it 'does not trace requests in which the callable returns true' do - get '/assets' - assets_span = finished_spans.find { |s| s.attributes['http.target'] == '/assets' } _(assets_span).must_be_nil - root_span = finished_spans.find { |s| s.attributes['http.target'] == '/' } - _(root_span).wont_be_nil + _(finished_spans.size).must_equal 0 end end diff --git a/instrumentation/rails/CHANGELOG.md b/instrumentation/rails/CHANGELOG.md index 7ac7b5e63..d675a1c6a 100644 --- a/instrumentation/rails/CHANGELOG.md +++ b/instrumentation/rails/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-rails +### v0.30.1 / 2024-04-30 + +* FIXED: Bundler conflict warnings + ### v0.30.0 / 2024-01-09 * BREAKING CHANGE: Use ActiveSupport instead of patches #703 diff --git a/instrumentation/rails/lib/opentelemetry/instrumentation/rails/version.rb b/instrumentation/rails/lib/opentelemetry/instrumentation/rails/version.rb index 915937bd6..9975f21a2 100644 --- a/instrumentation/rails/lib/opentelemetry/instrumentation/rails/version.rb +++ b/instrumentation/rails/lib/opentelemetry/instrumentation/rails/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module Rails - VERSION = '0.30.0' + VERSION = '0.30.1' end end end diff --git a/instrumentation/rails/opentelemetry-instrumentation-rails.gemspec b/instrumentation/rails/opentelemetry-instrumentation-rails.gemspec index 71a7ef872..6a97e5bb7 100644 --- a/instrumentation/rails/opentelemetry-instrumentation-rails.gemspec +++ b/instrumentation/rails/opentelemetry-instrumentation-rails.gemspec @@ -39,7 +39,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rack-test', '~> 2.1.0' - spec.add_development_dependency 'rails', '>= 6.1' spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rubocop', '~> 1.62' spec.add_development_dependency 'rubocop-performance', '~> 1.20' diff --git a/instrumentation/rake/CHANGELOG.md b/instrumentation/rake/CHANGELOG.md index 342835891..65c061e76 100644 --- a/instrumentation/rake/CHANGELOG.md +++ b/instrumentation/rake/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-rake +### v0.2.2 / 2024-04-30 + +* FIXED: Bundler conflict warnings + ### v0.2.1 / 2023-06-05 * FIXED: Base config options diff --git a/instrumentation/rake/lib/opentelemetry/instrumentation/rake/version.rb b/instrumentation/rake/lib/opentelemetry/instrumentation/rake/version.rb index b0aeebb26..2d86b5213 100644 --- a/instrumentation/rake/lib/opentelemetry/instrumentation/rake/version.rb +++ b/instrumentation/rake/lib/opentelemetry/instrumentation/rake/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module Rake - VERSION = '0.2.1' + VERSION = '0.2.2' end end end diff --git a/instrumentation/rake/opentelemetry-instrumentation-rake.gemspec b/instrumentation/rake/opentelemetry-instrumentation-rake.gemspec index 5d07b5b1f..43050c695 100644 --- a/instrumentation/rake/opentelemetry-instrumentation-rake.gemspec +++ b/instrumentation/rake/opentelemetry-instrumentation-rake.gemspec @@ -33,7 +33,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.0' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' - spec.add_development_dependency 'rake', '>= 0.9.0' spec.add_development_dependency 'rubocop', '~> 1.62' spec.add_development_dependency 'rubocop-performance', '~> 1.20' spec.add_development_dependency 'simplecov', '~> 0.17.1' diff --git a/instrumentation/rdkafka/CHANGELOG.md b/instrumentation/rdkafka/CHANGELOG.md index 9cdc2fbbb..bcbbd9d17 100644 --- a/instrumentation/rdkafka/CHANGELOG.md +++ b/instrumentation/rdkafka/CHANGELOG.md @@ -1,5 +1,17 @@ # Release History: opentelemetry-instrumentation-rdkafka +### v0.4.5 / 2024-05-09 + +* FIXED: Untrace entire request + +### v0.4.4 / 2024-04-30 + +* FIXED: Bundler conflict warnings + +### v0.4.3 / 2024-04-05 + +* FIXED: Suppress deprecation warning in Rdkafka Instrumentation + ### v0.4.2 / 2023-11-23 * FIXED: Retry Release of 0.4.1 [#730](https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues/730) diff --git a/instrumentation/rdkafka/lib/opentelemetry/instrumentation/rdkafka/patches/consumer.rb b/instrumentation/rdkafka/lib/opentelemetry/instrumentation/rdkafka/patches/consumer.rb index 97f3dd2b5..0186128a3 100644 --- a/instrumentation/rdkafka/lib/opentelemetry/instrumentation/rdkafka/patches/consumer.rb +++ b/instrumentation/rdkafka/lib/opentelemetry/instrumentation/rdkafka/patches/consumer.rb @@ -10,6 +10,13 @@ module Rdkafka module Patches # The Consumer module contains the instrumentation patch for the Consumer class module Consumer + GETTER = if Gem::Version.new(::Rdkafka::VERSION) >= Gem::Version.new('0.13.0') + Context::Propagation.text_map_getter + else + OpenTelemetry::Common::Propagation.symbol_key_getter + end + private_constant :GETTER + def each super do |message| attributes = { @@ -23,7 +30,7 @@ def each message_key = extract_message_key(message.key) attributes['messaging.kafka.message_key'] = message_key if message_key - parent_context = OpenTelemetry.propagation.extract(message.headers, getter: OpenTelemetry::Common::Propagation.symbol_key_getter) + parent_context = OpenTelemetry.propagation.extract(message.headers, getter: GETTER) span_context = OpenTelemetry::Trace.current_span(parent_context).context links = [OpenTelemetry::Trace::Link.new(span_context)] if span_context.valid? @@ -47,7 +54,7 @@ def each_batch(max_items: 100, bytes_threshold: Float::INFINITY, timeout_ms: 250 } links = messages.map do |message| - trace_context = OpenTelemetry.propagation.extract(message.headers, getter: OpenTelemetry::Common::Propagation.symbol_key_getter) + trace_context = OpenTelemetry.propagation.extract(message.headers, getter: GETTER) span_context = OpenTelemetry::Trace.current_span(trace_context).context OpenTelemetry::Trace::Link.new(span_context) if span_context.valid? end diff --git a/instrumentation/rdkafka/lib/opentelemetry/instrumentation/rdkafka/version.rb b/instrumentation/rdkafka/lib/opentelemetry/instrumentation/rdkafka/version.rb index 747ab970e..b29aba3d5 100644 --- a/instrumentation/rdkafka/lib/opentelemetry/instrumentation/rdkafka/version.rb +++ b/instrumentation/rdkafka/lib/opentelemetry/instrumentation/rdkafka/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module Rdkafka - VERSION = '0.4.2' + VERSION = '0.4.5' end end end diff --git a/instrumentation/rdkafka/opentelemetry-instrumentation-rdkafka.gemspec b/instrumentation/rdkafka/opentelemetry-instrumentation-rdkafka.gemspec index 9b5204ae8..0e99ce549 100644 --- a/instrumentation/rdkafka/opentelemetry-instrumentation-rdkafka.gemspec +++ b/instrumentation/rdkafka/opentelemetry-instrumentation-rdkafka.gemspec @@ -26,7 +26,7 @@ Gem::Specification.new do |spec| spec.required_ruby_version = '>= 3.0' spec.add_dependency 'opentelemetry-api', '~> 1.0' - spec.add_dependency 'opentelemetry-common', '~> 0.20.0' + spec.add_dependency 'opentelemetry-common', '~> 0.21.0' spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.22.1' spec.add_development_dependency 'appraisal', '~> 2.5' @@ -36,7 +36,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'pry-byebug' unless RUBY_ENGINE == 'jruby' spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'rdkafka', '>= 0.12' spec.add_development_dependency 'rubocop', '~> 1.62' spec.add_development_dependency 'rubocop-performance', '~> 1.20' spec.add_development_dependency 'simplecov', '~> 0.17.1' diff --git a/instrumentation/redis/Appraisals b/instrumentation/redis/Appraisals index 0f8374dc8..7939892cf 100644 --- a/instrumentation/redis/Appraisals +++ b/instrumentation/redis/Appraisals @@ -1,29 +1,6 @@ # frozen_string_literal: true -appraise 'redis-4.6' do - gem 'redis', '~> 4.1.0' -end - -appraise 'redis-4.5' do - gem 'redis', '~> 4.1.0' -end - -appraise 'redis-4.4' do - gem 'redis', '~> 4.1.0' -end - -appraise 'redis-4.3' do - gem 'redis', '~> 4.1.0' -end - -appraise 'redis-4.2' do - gem 'redis', '~> 4.1.0' -end - -appraise 'redis-4.1' do - gem 'redis', '~> 4.1.0' -end - -appraise 'redis-4.0' do - gem 'redis', '~> 4.0.0' +appraise 'redis-4.x' do + gem 'redis-client', '~> 0.22' + gem 'redis', '~> 4.8' end diff --git a/instrumentation/redis/CHANGELOG.md b/instrumentation/redis/CHANGELOG.md index 1b116a11a..50976b1bf 100644 --- a/instrumentation/redis/CHANGELOG.md +++ b/instrumentation/redis/CHANGELOG.md @@ -1,5 +1,13 @@ # Release History: opentelemetry-instrumentation-redis +### v0.25.5 / 2024-05-09 + +* FIXED: Untrace entire request + +### v0.25.4 / 2024-04-30 + +* FIXED: Bundler conflict warnings + ### v0.25.3 / 2023-08-03 * FIXED: Remove inline linter rules diff --git a/instrumentation/redis/lib/opentelemetry/instrumentation/redis/version.rb b/instrumentation/redis/lib/opentelemetry/instrumentation/redis/version.rb index 22eef6963..60eb007b2 100644 --- a/instrumentation/redis/lib/opentelemetry/instrumentation/redis/version.rb +++ b/instrumentation/redis/lib/opentelemetry/instrumentation/redis/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module Redis - VERSION = '0.25.3' + VERSION = '0.25.5' end end end diff --git a/instrumentation/redis/opentelemetry-instrumentation-redis.gemspec b/instrumentation/redis/opentelemetry-instrumentation-redis.gemspec index ee821d0a0..5aab9d961 100644 --- a/instrumentation/redis/opentelemetry-instrumentation-redis.gemspec +++ b/instrumentation/redis/opentelemetry-instrumentation-redis.gemspec @@ -26,7 +26,7 @@ Gem::Specification.new do |spec| spec.required_ruby_version = '>= 3.0' spec.add_dependency 'opentelemetry-api', '~> 1.0' - spec.add_dependency 'opentelemetry-common', '~> 0.20.0' + spec.add_dependency 'opentelemetry-common', '~> 0.21.0' spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.22.1' spec.add_development_dependency 'appraisal', '~> 2.5' @@ -34,8 +34,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' - spec.add_development_dependency 'redis', '~> 4.1' - spec.add_development_dependency 'redis-client', '~> 0.7' spec.add_development_dependency 'rubocop', '~> 1.62' spec.add_development_dependency 'rubocop-performance', '~> 1.20' spec.add_development_dependency 'simplecov', '~> 0.17.1' diff --git a/instrumentation/resque/CHANGELOG.md b/instrumentation/resque/CHANGELOG.md index a94cf31dd..7f8682447 100644 --- a/instrumentation/resque/CHANGELOG.md +++ b/instrumentation/resque/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-resque +### v0.5.2 / 2024-04-30 + +* FIXED: Bundler conflict warnings + ### v0.5.1 / 2024-02-08 * DOCS: Relocate Resque config option comments to render in Yard docs diff --git a/instrumentation/resque/lib/opentelemetry/instrumentation/resque/version.rb b/instrumentation/resque/lib/opentelemetry/instrumentation/resque/version.rb index 3b1baea6b..54309f2cd 100644 --- a/instrumentation/resque/lib/opentelemetry/instrumentation/resque/version.rb +++ b/instrumentation/resque/lib/opentelemetry/instrumentation/resque/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module Resque - VERSION = '0.5.1' + VERSION = '0.5.2' end end end diff --git a/instrumentation/resque/opentelemetry-instrumentation-resque.gemspec b/instrumentation/resque/opentelemetry-instrumentation-resque.gemspec index 88292d616..7c0904212 100644 --- a/instrumentation/resque/opentelemetry-instrumentation-resque.gemspec +++ b/instrumentation/resque/opentelemetry-instrumentation-resque.gemspec @@ -34,7 +34,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'resque' spec.add_development_dependency 'rubocop', '~> 1.62' spec.add_development_dependency 'rubocop-performance', '~> 1.20' spec.add_development_dependency 'simplecov', '~> 0.17.1' diff --git a/instrumentation/restclient/CHANGELOG.md b/instrumentation/restclient/CHANGELOG.md index 93f93e602..415181a70 100644 --- a/instrumentation/restclient/CHANGELOG.md +++ b/instrumentation/restclient/CHANGELOG.md @@ -1,5 +1,13 @@ # Release History: opentelemetry-instrumentation-restclient +### v0.22.5 / 2024-05-09 + +* FIXED: Untrace entire request + +### v0.22.4 / 2024-04-30 + +* FIXED: Bundler conflict warnings + ### v0.22.3 / 2023-11-23 * CHANGED: Applied Rubocop Performance Recommendations [#727](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/727) diff --git a/instrumentation/restclient/lib/opentelemetry/instrumentation/restclient/version.rb b/instrumentation/restclient/lib/opentelemetry/instrumentation/restclient/version.rb index 47e4b1e0b..3b51ebd04 100644 --- a/instrumentation/restclient/lib/opentelemetry/instrumentation/restclient/version.rb +++ b/instrumentation/restclient/lib/opentelemetry/instrumentation/restclient/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module RestClient - VERSION = '0.22.3' + VERSION = '0.22.5' end end end diff --git a/instrumentation/restclient/opentelemetry-instrumentation-restclient.gemspec b/instrumentation/restclient/opentelemetry-instrumentation-restclient.gemspec index 2ec1dc672..cf5a00531 100644 --- a/instrumentation/restclient/opentelemetry-instrumentation-restclient.gemspec +++ b/instrumentation/restclient/opentelemetry-instrumentation-restclient.gemspec @@ -26,7 +26,7 @@ Gem::Specification.new do |spec| spec.required_ruby_version = '>= 3.0' spec.add_dependency 'opentelemetry-api', '~> 1.0' - spec.add_dependency 'opentelemetry-common', '~> 0.20.0' + spec.add_dependency 'opentelemetry-common', '~> 0.21.0' spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.22.1' spec.add_development_dependency 'appraisal', '~> 2.5' @@ -34,7 +34,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' - spec.add_development_dependency 'rest-client', '~> 2.0' spec.add_development_dependency 'rubocop', '~> 1.62' spec.add_development_dependency 'rubocop-performance', '~> 1.20' spec.add_development_dependency 'simplecov', '~> 0.17.1' diff --git a/instrumentation/rspec/CHANGELOG.md b/instrumentation/rspec/CHANGELOG.md index 3d8448414..6c22f2db1 100644 --- a/instrumentation/rspec/CHANGELOG.md +++ b/instrumentation/rspec/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-rspec +### v0.3.3 / 2024-04-30 + +* FIXED: Bundler conflict warnings + ### v0.3.2 / 2023-11-23 * CHANGED: Applied Rubocop Performance Recommendations [#727](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/727) diff --git a/instrumentation/rspec/Gemfile b/instrumentation/rspec/Gemfile index 2baf57ac4..74a39f083 100644 --- a/instrumentation/rspec/Gemfile +++ b/instrumentation/rspec/Gemfile @@ -9,5 +9,6 @@ source 'https://rubygems.org' gemspec group :test do + gem 'rspec', '~> 3.0' gem 'opentelemetry-instrumentation-base', path: '../base' end diff --git a/instrumentation/rspec/lib/opentelemetry/instrumentation/rspec/version.rb b/instrumentation/rspec/lib/opentelemetry/instrumentation/rspec/version.rb index b27e31705..57f53a5e7 100644 --- a/instrumentation/rspec/lib/opentelemetry/instrumentation/rspec/version.rb +++ b/instrumentation/rspec/lib/opentelemetry/instrumentation/rspec/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module RSpec - VERSION = '0.3.2' + VERSION = '0.3.3' end end end diff --git a/instrumentation/rspec/opentelemetry-instrumentation-rspec.gemspec b/instrumentation/rspec/opentelemetry-instrumentation-rspec.gemspec index 29db8d4e5..e4c2d37cb 100644 --- a/instrumentation/rspec/opentelemetry-instrumentation-rspec.gemspec +++ b/instrumentation/rspec/opentelemetry-instrumentation-rspec.gemspec @@ -34,7 +34,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-sdk' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'rspec', '~> 3.10.0' spec.add_development_dependency 'rubocop', '~> 1.62' spec.add_development_dependency 'rubocop-performance', '~> 1.20' spec.add_development_dependency 'simplecov', '~> 0.17.1' diff --git a/instrumentation/ruby_kafka/CHANGELOG.md b/instrumentation/ruby_kafka/CHANGELOG.md index cad2b514d..e19742155 100644 --- a/instrumentation/ruby_kafka/CHANGELOG.md +++ b/instrumentation/ruby_kafka/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-ruby_kafka +### v0.21.1 / 2024-04-30 + +* FIXED: Bundler conflict warnings + ### v0.21.0 / 2023-09-07 * FIXED: Align messaging instrumentation operation names diff --git a/instrumentation/ruby_kafka/lib/opentelemetry/instrumentation/ruby_kafka/version.rb b/instrumentation/ruby_kafka/lib/opentelemetry/instrumentation/ruby_kafka/version.rb index ec39acf71..3bc93c1e7 100644 --- a/instrumentation/ruby_kafka/lib/opentelemetry/instrumentation/ruby_kafka/version.rb +++ b/instrumentation/ruby_kafka/lib/opentelemetry/instrumentation/ruby_kafka/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module RubyKafka - VERSION = '0.21.0' + VERSION = '0.21.1' end end end diff --git a/instrumentation/ruby_kafka/opentelemetry-instrumentation-ruby_kafka.gemspec b/instrumentation/ruby_kafka/opentelemetry-instrumentation-ruby_kafka.gemspec index 58f8afba4..ee61abdd5 100644 --- a/instrumentation/ruby_kafka/opentelemetry-instrumentation-ruby_kafka.gemspec +++ b/instrumentation/ruby_kafka/opentelemetry-instrumentation-ruby_kafka.gemspec @@ -36,7 +36,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rspec-mocks' spec.add_development_dependency 'rubocop', '~> 1.62' spec.add_development_dependency 'rubocop-performance', '~> 1.20' - spec.add_development_dependency 'ruby-kafka' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/sidekiq/CHANGELOG.md b/instrumentation/sidekiq/CHANGELOG.md index 351704d54..12acfff9f 100644 --- a/instrumentation/sidekiq/CHANGELOG.md +++ b/instrumentation/sidekiq/CHANGELOG.md @@ -1,5 +1,13 @@ # Release History: opentelemetry-instrumentation-sidekiq +### v0.25.4 / 2024-05-09 + +* FIXED: Untrace entire request + +### v0.25.3 / 2024-04-30 + +* FIXED: Bundler conflict warnings + ### v0.25.2 / 2024-02-08 * DOCS: Fix doc for sidekiq options. diff --git a/instrumentation/sidekiq/lib/opentelemetry/instrumentation/sidekiq/version.rb b/instrumentation/sidekiq/lib/opentelemetry/instrumentation/sidekiq/version.rb index 665a404f6..c7482c923 100644 --- a/instrumentation/sidekiq/lib/opentelemetry/instrumentation/sidekiq/version.rb +++ b/instrumentation/sidekiq/lib/opentelemetry/instrumentation/sidekiq/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module Sidekiq - VERSION = '0.25.2' + VERSION = '0.25.4' end end end diff --git a/instrumentation/sidekiq/opentelemetry-instrumentation-sidekiq.gemspec b/instrumentation/sidekiq/opentelemetry-instrumentation-sidekiq.gemspec index 5337b516b..dd23a0e7e 100644 --- a/instrumentation/sidekiq/opentelemetry-instrumentation-sidekiq.gemspec +++ b/instrumentation/sidekiq/opentelemetry-instrumentation-sidekiq.gemspec @@ -26,7 +26,7 @@ Gem::Specification.new do |spec| spec.required_ruby_version = '>= 3.0' spec.add_dependency 'opentelemetry-api', '~> 1.0' - spec.add_dependency 'opentelemetry-common', '~> 0.20.0' + spec.add_dependency 'opentelemetry-common', '~> 0.21.0' spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.22.1' spec.add_development_dependency 'activejob', '>= 6.0' @@ -38,7 +38,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rspec-mocks' spec.add_development_dependency 'rubocop', '~> 1.62' spec.add_development_dependency 'rubocop-performance', '~> 1.20' - spec.add_development_dependency 'sidekiq' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/sinatra/CHANGELOG.md b/instrumentation/sinatra/CHANGELOG.md index 4ca2ae8ac..f593edcbd 100644 --- a/instrumentation/sinatra/CHANGELOG.md +++ b/instrumentation/sinatra/CHANGELOG.md @@ -1,5 +1,13 @@ # Release History: opentelemetry-instrumentation-sinatra +### v0.23.4 / 2024-05-09 + +* FIXED: Untrace entire request + +### v0.23.3 / 2024-04-30 + +* FIXED: Bundler conflict warnings + ### v0.23.2 / 2023-07-21 * ADDED: Update `opentelemetry-common` from [0.19.3 to 0.20.0](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/537) diff --git a/instrumentation/sinatra/lib/opentelemetry/instrumentation/sinatra/version.rb b/instrumentation/sinatra/lib/opentelemetry/instrumentation/sinatra/version.rb index 8bb6b015b..b4878fbde 100644 --- a/instrumentation/sinatra/lib/opentelemetry/instrumentation/sinatra/version.rb +++ b/instrumentation/sinatra/lib/opentelemetry/instrumentation/sinatra/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module Sinatra - VERSION = '0.23.2' + VERSION = '0.23.4' end end end diff --git a/instrumentation/sinatra/opentelemetry-instrumentation-sinatra.gemspec b/instrumentation/sinatra/opentelemetry-instrumentation-sinatra.gemspec index 69608652e..df089208a 100644 --- a/instrumentation/sinatra/opentelemetry-instrumentation-sinatra.gemspec +++ b/instrumentation/sinatra/opentelemetry-instrumentation-sinatra.gemspec @@ -26,7 +26,7 @@ Gem::Specification.new do |spec| spec.required_ruby_version = '>= 3.0' spec.add_dependency 'opentelemetry-api', '~> 1.0' - spec.add_dependency 'opentelemetry-common', '~> 0.20.0' + spec.add_dependency 'opentelemetry-common', '~> 0.21.0' spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.22.1' spec.add_dependency 'opentelemetry-instrumentation-rack', '~> 0.21' @@ -39,7 +39,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rubocop', '~> 1.62' spec.add_development_dependency 'rubocop-performance', '~> 1.20' spec.add_development_dependency 'simplecov', '~> 0.17.1' - spec.add_development_dependency 'sinatra' spec.add_development_dependency 'webmock', '~> 3.19' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/trilogy/CHANGELOG.md b/instrumentation/trilogy/CHANGELOG.md index 7d9ffccd1..6b9fe2acf 100644 --- a/instrumentation/trilogy/CHANGELOG.md +++ b/instrumentation/trilogy/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-trilogy +### v0.59.3 / 2024-04-30 + +* FIXED: Bundler conflict warnings + ### v0.59.2 / 2024-02-20 * FIXED: Dup string if frozen in trilogy query diff --git a/instrumentation/trilogy/lib/opentelemetry/instrumentation/trilogy/version.rb b/instrumentation/trilogy/lib/opentelemetry/instrumentation/trilogy/version.rb index e5a4b0b2e..24cedba17 100644 --- a/instrumentation/trilogy/lib/opentelemetry/instrumentation/trilogy/version.rb +++ b/instrumentation/trilogy/lib/opentelemetry/instrumentation/trilogy/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module Trilogy - VERSION = '0.59.2' + VERSION = '0.59.3' end end end diff --git a/instrumentation/trilogy/opentelemetry-instrumentation-trilogy.gemspec b/instrumentation/trilogy/opentelemetry-instrumentation-trilogy.gemspec index de77da391..7d2639cb9 100644 --- a/instrumentation/trilogy/opentelemetry-instrumentation-trilogy.gemspec +++ b/instrumentation/trilogy/opentelemetry-instrumentation-trilogy.gemspec @@ -44,7 +44,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rubocop', '~> 1.62' spec.add_development_dependency 'rubocop-performance', '~> 1.20' spec.add_development_dependency 'simplecov', '~> 0.17.1' - spec.add_development_dependency 'trilogy', '>= 2.0', '< 3.0' spec.add_development_dependency 'yard', '~> 0.9' if spec.respond_to?(:metadata) diff --git a/processor/baggage/.rubocop.yml b/processor/baggage/.rubocop.yml new file mode 100644 index 000000000..1248a2f82 --- /dev/null +++ b/processor/baggage/.rubocop.yml @@ -0,0 +1 @@ +inherit_from: ../../.rubocop.yml diff --git a/processor/baggage/.yardopts b/processor/baggage/.yardopts new file mode 100644 index 000000000..6046da39e --- /dev/null +++ b/processor/baggage/.yardopts @@ -0,0 +1,9 @@ +--no-private +--title=OpenTelemetry Processor Baggage +--markup=markdown +--main=README.md +./lib/opentelemetry/processor/baggage/**/*.rb +./lib/opentelemetry/processor/baggage.rb +- +README.md +CHANGELOG.md diff --git a/processor/baggage/CHANGELOG.md b/processor/baggage/CHANGELOG.md new file mode 100644 index 000000000..a054e650e --- /dev/null +++ b/processor/baggage/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History: opentelemetry-processor-baggage + +### v0.1.0 / 2024-04-18 + +* Initial release. diff --git a/processor/baggage/Gemfile b/processor/baggage/Gemfile new file mode 100644 index 000000000..52eb0ed2e --- /dev/null +++ b/processor/baggage/Gemfile @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +source 'https://rubygems.org' + +# Specify your gem's dependencies in opentelemetry-processor-baggage.gemspec +gemspec diff --git a/processor/baggage/LICENSE b/processor/baggage/LICENSE new file mode 100644 index 000000000..1ef7dad2c --- /dev/null +++ b/processor/baggage/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright The OpenTelemetry Authors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/processor/baggage/README.md b/processor/baggage/README.md new file mode 100644 index 000000000..b880f1150 --- /dev/null +++ b/processor/baggage/README.md @@ -0,0 +1,75 @@ +# Baggage Span Processor + +This is an OpenTelemetry [span processor](https://opentelemetry.io/docs/specs/otel/trace/sdk/#span-processor) that reads key/values stored in [Baggage](https://opentelemetry.io/docs/specs/otel/baggage/api/) in the starting span's parent context and adds them as attributes to the span. + +Keys and values added to Baggage will appear on all subsequent child spans for a trace within this service *and* will be propagated to external services via propagation headers. +If the external services also have a Baggage span processor, the keys and values will appear in those child spans as well. + +⚠️ Waning ⚠️ +To repeat: a consequence of adding data to Baggage is that the keys and values will appear in all outgoing HTTP headers from the application. +Do not put sensitive information in Baggage. + +## How do I get started? + +Install the gem using: + +```shell +gem install opentelemetry-processor-baggage +``` + +Or, if you use [bundler][bundler-home], include `opentelemetry-processor-baggage` to your `Gemfile`. + +### Version Compatibility + +* OpenTelemetry API v1.0+ + +## Usage + +To install the instrumentation, add the gem to your Gemfile: + +```ruby +gem 'opentelemetry-processor-baggage' +``` + +Then add the processor to an SDK's configuration: + +```ruby +require 'rubygems' +require 'bundler/setup' + +Bundler.require + +OpenTelemetry::SDK.configure do |c| + # Add the BaggageSpanProcessor to the collection of span processors + c.add_span_processor(OpenTelemetry::Processor::Baggage::BaggageSpanProcessor.new) + + # Because the span processor list is no longer empty, the SDK will not use the + # values in OTEL_TRACES_EXPORTER to instantiate exporters. + # You'll need to declare your own here in the configure block. + # + # These lines setup the default: a batching OTLP exporter. + c.add_span_processor( + # these constructors without arguments will pull config from the environment + OpenTelemetry::SDK::Trace::Export::BatchSpanProcessor.new( + OpenTelemetry::Exporter::OTLP::Exporter.new() + ) + ) +end +``` + +## How can I get involved? + +The `opentelemetry-processor-baggage` gem source is [on github][repo-github], along with related gems including `opentelemetry-api` and `opentelemetry-sdk`. + +The OpenTelemetry Ruby gems are maintained by the OpenTelemetry-Ruby special interest group (SIG). You can get involved by joining us in [GitHub Discussions][discussions-url] or attending our weekly meeting. See the [meeting calendar][community-meetings] for dates and times. For more information on this and other language SIGs, see the OpenTelemetry [community page][ruby-sig]. + +## License + +The `opentelemetry-instrumentation-sinatra` gem is distributed under the Apache 2.0 license. See [LICENSE][license-github] for more information. + +[bundler-home]: https://bundler.io +[repo-github]: https://github.com/open-telemetry/opentelemetry-ruby-contrib +[license-github]: https://github.com/open-telemetry/opentelemetry-ruby-contrib/blob/main/LICENSE +[ruby-sig]: https://github.com/open-telemetry/community#ruby-sig +[community-meetings]: https://github.com/open-telemetry/community#community-meetings +[discussions-url]: https://github.com/open-telemetry/opentelemetry-ruby/discussions diff --git a/processor/baggage/Rakefile b/processor/baggage/Rakefile new file mode 100644 index 000000000..88f3670a3 --- /dev/null +++ b/processor/baggage/Rakefile @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +require 'bundler/gem_tasks' +require 'rake/testtask' +require 'yard' +require 'rubocop/rake_task' + +ENV['ENABLE_COVERAGE'] ||= '1' + +RuboCop::RakeTask.new + +Rake::TestTask.new :test do |t| + t.libs << 'test' + t.libs << 'lib' + t.test_files = FileList['test/**/*_test.rb'] +end + +YARD::Rake::YardocTask.new do |t| + t.stats_options = ['--list-undoc'] +end + +if RUBY_ENGINE == 'truffleruby' + task default: %i[test] +else + task default: %i[test rubocop yard] +end diff --git a/processor/baggage/lib/opentelemetry-processor-baggage.rb b/processor/baggage/lib/opentelemetry-processor-baggage.rb new file mode 100644 index 000000000..a1b22b5a5 --- /dev/null +++ b/processor/baggage/lib/opentelemetry-processor-baggage.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# Copyright OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +require_relative 'opentelemetry/processor/baggage/baggage_span_processor' diff --git a/processor/baggage/lib/opentelemetry/processor/baggage/baggage_span_processor.rb b/processor/baggage/lib/opentelemetry/processor/baggage/baggage_span_processor.rb new file mode 100644 index 000000000..c5e840cec --- /dev/null +++ b/processor/baggage/lib/opentelemetry/processor/baggage/baggage_span_processor.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +require 'opentelemetry-api' +require 'opentelemetry-sdk' + +module OpenTelemetry + module Processor + module Baggage + # The BaggageSpanProcessor reads key/values stored in Baggage in the + # starting span's parent context and adds them as attributes to the span. + # + # Keys and values added to Baggage will appear on all subsequent child spans + # for a trace within this service *and* will be propagated to external services + # via propagation headers. If the external services also have a Baggage span + # processor, the keys and values will appear in those child spans as well. + # + # ⚠️ + # To repeat: a consequence of adding data to Baggage is that the keys and + # values will appear in all outgoing HTTP headers from the application. + # Do not put sensitive information in Baggage. + # ⚠️ + # + # @example + # OpenTelemetry::SDK.configure do |c| + # # Add the BaggageSpanProcessor to the collection of span processors + # c.add_span_processor(OpenTelemetry::Processor::Baggage::BaggageSpanProcessor.new) + # + # # Because the span processor list is no longer empty, the SDK will not use the + # # values in OTEL_TRACES_EXPORTER to instantiate exporters. + # # You'll need to declare your own here in the configure block. + # # + # # These lines setup the default: a batching OTLP exporter. + # c.add_span_processor( + # # these constructors without arguments will pull config from the environment + # OpenTelemetry::SDK::Trace::Export::BatchSpanProcessor.new( + # OpenTelemetry::Exporter::OTLP::Exporter.new() + # ) + # ) + # end + class BaggageSpanProcessor < OpenTelemetry::SDK::Trace::SpanProcessor + # Called when a `Span` is started, adds Baggage keys/values to the span as attributes. + # + # @param [Span] span the `Span` that just started, expected to conform + # to the concrete `Span` interface from the SDK and respond to :add_attributes. + # @param [Context] parent_context the parent `Context` of the newly + # started span. + def on_start(span, parent_context) + return unless span.respond_to?(:add_attributes) && parent_context.is_a?(::OpenTelemetry::Context) + + span.add_attributes(::OpenTelemetry::Baggage.values(context: parent_context)) + end + + # Called when a Span is ended, does nothing. + # + # NO-OP method to satisfy the SpanProcessor duck type. + # + # @param [Span] span the {OpenTelemetry::Trace::Span} that just ended. + def on_finish(span); end + + # Always successful; this processor does not maintain any state to flush. + # + # NO-OP method to satisfy the `SpanProcessor` duck type. + # + # @param [optional Numeric] timeout An optional timeout in seconds. + # @return [Integer] 0 for success and there is nothing to flush so always successful. + def force_flush(timeout: nil) + 0 + end + + # Always successful; this processor does not maintain any state to clean up or processes to close on shutdown. + # + # NO-OP method to satisfy the `SpanProcessor` duck type. + # + # @param [optional Numeric] timeout An optional timeout in seconds. + # @return [Integer] 0 for success and there is nothing to stop so always successful. + def shutdown(timeout: nil) + 0 + end + end + end + end +end diff --git a/processor/baggage/lib/opentelemetry/processor/baggage/version.rb b/processor/baggage/lib/opentelemetry/processor/baggage/version.rb new file mode 100644 index 000000000..1544ac3f1 --- /dev/null +++ b/processor/baggage/lib/opentelemetry/processor/baggage/version.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +# OpenTelemetry is an open source observability framework, providing a +# general-purpose API, SDK, and related tools required for the instrumentation +# of cloud-native software, frameworks, and libraries. +# +# The OpenTelemetry module provides global accessors for telemetry objects. +# See the documentation for the `opentelemetry-api` gem for details. +module OpenTelemetry + # Namespace for OpenTelemetry processor extension libraries + module Processor + # Namespace for OpenTelemetry Baggage processor + module Baggage + VERSION = '0.1.0' + end + end +end diff --git a/processor/baggage/opentelemetry-processor-baggage.gemspec b/processor/baggage/opentelemetry-processor-baggage.gemspec new file mode 100644 index 000000000..adaaf13be --- /dev/null +++ b/processor/baggage/opentelemetry-processor-baggage.gemspec @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +require_relative 'lib/opentelemetry/processor/baggage/version' + +Gem::Specification.new do |spec| + spec.name = 'opentelemetry-processor-baggage' + spec.version = OpenTelemetry::Processor::Baggage::VERSION + spec.authors = ['OpenTelemetry Authors'] + spec.email = ['cncf-opentelemetry-contributors@lists.cncf.io'] + + spec.summary = 'Baggage Span Processor for the OpenTelemetry framework' + spec.description = 'Baggage Span Processor for the OpenTelemetry framework' + spec.homepage = 'https://github.com/open-telemetry/opentelemetry-ruby-contrib' + spec.license = 'Apache-2.0' + + spec.files = Dir.glob('lib/**/*.rb') + + Dir.glob('*.md') + + ['LICENSE', '.yardopts'] + spec.require_paths = ['lib'] + spec.required_ruby_version = '>= 3.0' + + spec.add_dependency 'opentelemetry-api', '~> 1.0' + spec.add_dependency 'opentelemetry-sdk', '~> 1.0' + + spec.add_development_dependency 'bundler', '~> 2.4' + spec.add_development_dependency 'minitest', '~> 5.0' + spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' + spec.add_development_dependency 'rake', '~> 13.0' + spec.add_development_dependency 'rubocop', '~> 1.62' + spec.add_development_dependency 'rubocop-performance', '~> 1.20' + spec.add_development_dependency 'simplecov', '~> 0.22.0' + spec.add_development_dependency 'yard', '~> 0.9' + + if spec.respond_to?(:metadata) + spec.metadata['changelog_uri'] = "https://rubydoc.info/gems/#{spec.name}/#{spec.version}/file/CHANGELOG.md" + spec.metadata['source_code_uri'] = 'https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/processor/baggage' + spec.metadata['bug_tracker_uri'] = 'https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues' + spec.metadata['documentation_uri'] = "https://rubydoc.info/gems/#{spec.name}/#{spec.version}" + end +end diff --git a/processor/baggage/test/opentelemetry/processor/baggage/baggage_span_processor_test.rb b/processor/baggage/test/opentelemetry/processor/baggage/baggage_span_processor_test.rb new file mode 100644 index 000000000..1f7bfc779 --- /dev/null +++ b/processor/baggage/test/opentelemetry/processor/baggage/baggage_span_processor_test.rb @@ -0,0 +1,95 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +require 'test_helper' + +require 'opentelemetry/sdk' + +TEST_EXPORTER = OpenTelemetry::SDK::Trace::Export::InMemorySpanExporter.new + +OpenTelemetry::SDK.configure do |c| + # the baggage processor getting wired in for testing + c.add_span_processor OpenTelemetry::Processor::Baggage::BaggageSpanProcessor.new + + # use a simple processor and in-memory export for testing sent spans + c.add_span_processor( + OpenTelemetry::SDK::Trace::Export::SimpleSpanProcessor.new(TEST_EXPORTER) + ) + + c.error_handler = ->(exception:, message:) { raise(exception || message) } + c.logger = Logger.new($stderr, level: ENV.fetch('OTEL_LOG_LEVEL', 'fatal').to_sym) +end + +describe OpenTelemetry::Processor::Baggage::BaggageSpanProcessor do + let(:processor) { OpenTelemetry::Processor::Baggage::BaggageSpanProcessor.new } + let(:span) { Minitest::Mock.new } + let(:context_with_baggage) { OpenTelemetry::Baggage.set_value('a_key', 'a_value') } + + describe '#on_start' do + it 'adds current baggage keys/values as attributes when a span starts' do + span.expect(:add_attributes, span, [{ 'a_key' => 'a_value' }]) + + processor.on_start(span, context_with_baggage) + + span.verify + end + + it 'does not blow up when given nil context' do + processor.on_start(span, nil) + assert true # nothing above raised an exception + end + it 'does not blow up when given nil span' do + processor.on_start(nil, context_with_baggage) + assert true # nothing above raised an exception + end + it 'does not blow up when given nil span and context' do + processor.on_start(nil, nil) + assert true # nothing above raised an exception + end + it 'does not blow up when given a context that is not a Context' do + processor.on_start(span, :not_a_context) + assert true # nothing above raised an exception + end + it 'does not blow up when given a span that is not a Span' do + processor.on_start(:not_a_span, context_with_baggage) + assert true # nothing above raised an exception + end + end + + describe 'satisfies the SpanProcessor duck type with no-op methods' do + it 'implements #on_finish' do + processor.on_finish(span) + assert true # nothing above raised an exception + end + + it 'implements #force_flush' do + _(processor.force_flush).must_equal(OpenTelemetry::SDK::Trace::Export::SUCCESS) + end + + it 'implements #shutdown' do + _(processor.shutdown).must_equal(OpenTelemetry::SDK::Trace::Export::SUCCESS) + end + end + + describe 'integration test with an exporter' do + let(:tracer) { OpenTelemetry.tracer_provider.tracer('🧳') } + let(:exporter) { TEST_EXPORTER } + + before do + exporter.reset + end + + it 'adds baggage attributes to spans' do + tracer + .start_span('integration test span', with_parent: context_with_baggage) + .finish + + _(exporter.finished_spans.size).must_equal(1) + _(exporter.finished_spans.first.name).must_equal('integration test span') + _(exporter.finished_spans.first.attributes).must_equal('a_key' => 'a_value') + end + end +end diff --git a/processor/baggage/test/test_helper.rb b/processor/baggage/test/test_helper.rb new file mode 100644 index 000000000..8c1eb5932 --- /dev/null +++ b/processor/baggage/test/test_helper.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +require 'bundler/setup' +Bundler.require(:default, :development, :test) + +require 'minitest/autorun' +require 'opentelemetry-processor-baggage' diff --git a/release-please-config.json b/release-please-config.json index 8686eb523..eba2f3786 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -81,6 +81,10 @@ "package-name": "opentelemetry-instrumentation-aws_sdk", "version-file": "lib/opentelemetry/instrumentation/aws_sdk/version.rb" }, + "instrumentation/aws_lambda": { + "package-name": "opentelemetry-instrumentation-aws_lambda", + "version-file": "lib/opentelemetry/instrumentation/aws_lambda/version.rb" + }, "instrumentation/lmdb": { "package-name": "opentelemetry-instrumentation-lmdb", "version-file": "lib/opentelemetry/instrumentation/lmdb/version.rb" diff --git a/resources/azure/opentelemetry-resource-detector-azure.gemspec b/resources/azure/opentelemetry-resource-detector-azure.gemspec index 59863492b..e87fa3510 100644 --- a/resources/azure/opentelemetry-resource-detector-azure.gemspec +++ b/resources/azure/opentelemetry-resource-detector-azure.gemspec @@ -33,7 +33,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rubocop', '~> 1.62' spec.add_development_dependency 'rubocop-performance', '~> 1.20' spec.add_development_dependency 'simplecov', '~> 0.17' - spec.add_development_dependency 'webmock', '~> 3.19.1' + spec.add_development_dependency 'webmock', '~> 3.23.0' spec.add_development_dependency 'yard', '~> 0.9' if spec.respond_to?(:metadata) diff --git a/resources/google_cloud_platform/opentelemetry-resource-detector-google_cloud_platform.gemspec b/resources/google_cloud_platform/opentelemetry-resource-detector-google_cloud_platform.gemspec index d43d93682..23fd482b5 100644 --- a/resources/google_cloud_platform/opentelemetry-resource-detector-google_cloud_platform.gemspec +++ b/resources/google_cloud_platform/opentelemetry-resource-detector-google_cloud_platform.gemspec @@ -34,7 +34,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rubocop', '~> 1.62' spec.add_development_dependency 'rubocop-performance', '~> 1.20' spec.add_development_dependency 'simplecov', '~> 0.17' - spec.add_development_dependency 'webmock', '~> 3.19.1' + spec.add_development_dependency 'webmock', '~> 3.23.0' spec.add_development_dependency 'yard', '~> 0.9' if spec.respond_to?(:metadata)