Skip to content

Commit

Permalink
Merge branch 'main' into add-grpc-instrumentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kaylareopelle authored Nov 21, 2024
2 parents 8ba7ca3 + 7ad08f9 commit 4b4fada
Show file tree
Hide file tree
Showing 158 changed files with 2,264 additions and 1,130 deletions.
5 changes: 3 additions & 2 deletions .github/actions/test_gem/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.191.0
uses: ruby/setup-ruby@v1.202.0
with:
ruby-version: "${{ inputs.ruby }}"
working-directory: "${{ steps.setup.outputs.gem_dir }}"
Expand All @@ -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.191.0
uses: ruby/setup-ruby@v1.202.0
with:
ruby-version: "${{ inputs.ruby }}"
bundler: "latest"
Expand All @@ -95,6 +95,7 @@ runs:
run: |
# 💎 Install dependencies and generate appraisals 💎
bundle install --quiet --jobs=3 --retry=4
bundle exec appraisal clean
bundle exec appraisal generate
working-directory: "${{ steps.setup.outputs.gem_dir }}"

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci-contrib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-helpers-${{ matrix.gem }}"
ruby: "jruby-9.4.8.0"
ruby: "jruby-9.4.9.0"

propagators:
strategy:
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-propagator-${{ matrix.gem }}"
ruby: "jruby-9.4.8.0"
ruby: "jruby-9.4.9.0"

resource-detectors:
strategy:
Expand Down Expand Up @@ -148,7 +148,7 @@ jobs:
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-${{ matrix.gem }}"
ruby: "jruby-9.4.8.0"
ruby: "jruby-9.4.9.0"

processors:
strategy:
Expand Down Expand Up @@ -191,4 +191,4 @@ jobs:
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-processor-${{ matrix.gem }}"
ruby: "jruby-9.4.8.0"
ruby: "jruby-9.4.9.0"
2 changes: 1 addition & 1 deletion .github/workflows/ci-instrumentation-with-services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "jruby-9.4.8.0"
ruby: "jruby-9.4.9.0"
services:
memcached:
image: memcached:alpine
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-instrumentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,4 @@ jobs:
uses: ./.github/actions/test_gem
with:
gem: "opentelemetry-instrumentation-${{ matrix.gem }}"
ruby: "jruby-9.4.8.0"
ruby: "jruby-9.4.9.0"
2 changes: 1 addition & 1 deletion .github/workflows/ci-markdownlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

# equivalent cli: markdownlint-cli2 "**/*.md" "#**/CHANGELOG.md" --config .markdownlint.json
- name: "Markdown Lint Check"
uses: DavidAnson/markdownlint-cli2-action@v16
uses: DavidAnson/markdownlint-cli2-action@v17
with:
fix: false
globs: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/installation-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- uses: actions/checkout@v4
# ATTENTION: Dependabot does not know how to update shared actions file.
# If you see it update setup-ruby here also update it as part of actions/test_gem/action.yml
- uses: ruby/setup-ruby@v1.191.0
- uses: ruby/setup-ruby@v1.202.0
with:
ruby-version: ${{ matrix.ruby-version }}
- name: "Install Latest Gem Versions on ${{ matrix.ruby-version }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-hook-on-closed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install Ruby ${{ env.ruby_version }}
uses: ruby/setup-ruby@v1.191.0
uses: ruby/setup-ruby@v1.202.0
with:
ruby-version: ${{ env.ruby_version }}
- name: Checkout repo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-hook-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install Ruby ${{ env.ruby_version }}
uses: ruby/setup-ruby@v1.191.0
uses: ruby/setup-ruby@v1.202.0
with:
ruby-version: ${{ env.ruby_version }}
- name: Checkout repo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-perform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install Ruby ${{ env.ruby_version }}
uses: ruby/setup-ruby@v1.191.0
uses: ruby/setup-ruby@v1.202.0
with:
ruby-version: ${{ env.ruby_version }}
- name: Checkout repo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-please.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,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.191.0
- uses: ruby/setup-ruby@v1.202.0
with:
ruby-version: "3.0"
bundler: latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-request-weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install Ruby ${{ env.ruby_version }}
uses: ruby/setup-ruby@v1.191.0
uses: ruby/setup-ruby@v1.202.0
with:
ruby-version: ${{ env.ruby_version }}
- name: Checkout repo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install Ruby ${{ env.ruby_version }}
uses: ruby/setup-ruby@v1.191.0
uses: ruby/setup-ruby@v1.202.0
with:
ruby-version: ${{ env.ruby_version }}
- name: Checkout repo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-retry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install Ruby ${{ env.ruby_version }}
uses: ruby/setup-ruby@v1.191.0
uses: ruby/setup-ruby@v1.202.0
with:
ruby-version: ${{ env.ruby_version }}
- name: Checkout repo
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

# Appraisals
instrumentation/**/gemfiles
instrumentation/**/tmp/**/*

# Sqlite file for tests
instrumentation/active_record/db
Expand All @@ -26,3 +27,4 @@ instrumentation/active_record/db
.ruby-version

tags
!**/*/.gitkeep
2 changes: 1 addition & 1 deletion .instrumentation_generator/templates/gemspec.tt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'rubocop', '~> 1.66.0'
spec.add_development_dependency 'rubocop-performance', '~> 1.19.1'
spec.add_development_dependency 'simplecov', '~> 0.17.1'
spec.add_development_dependency 'webmock', '~> 3.7.6'
spec.add_development_dependency 'webmock', '~> 3.24.0'
spec.add_development_dependency 'yard', '~> 0.9'

if spec.respond_to?(:metadata)
Expand Down
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

resources/container/ @scbjans @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/aws_sdk/ @NathanielRN @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/aws_sdk/ @jterapin @alextwoods @NathanielRN @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/grape/ @muripic @open-telemetry/ruby-contrib-maintainers @open-telemetry/ruby-contrib-approvers @fbogsany @mwear @robertlaurin @dazuma @ericmustin @arielvalentin @ahayworth @plantfansam @robbkidd @simi @kaylareopelle @xuan-cao-swi

Expand Down
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ For example, to test `opentelemetry-instrumentation-action_pack` you would:
2. Install the bundle with `bundle install`
3. Run the tests with `bundle exec rake`

Note: Some test suites make use of [Appraisal](https://github.com/thoughtbot/appraisal), a library for testing against different versions of dependencies. To run tests in suites that use Appraisal:

1. Change directory to the instrumentation you'd like to test, ex: `instrumentation/action_pack`
2. Install the bundle with `bundle exec appraisal install`
3. Run the tests with `bundle exec appraisal rake test`

### Docker setup

We use Docker Compose to configure and build services used in development and
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
source 'https://rubygems.org'

gem 'rake', '~> 13.0'
gem 'rubocop', '~> 1.66.0'
gem 'rubocop', '~> 1.68.0'
gem 'rubocop-performance', '~> 1.21.0'
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ services:
image: memcached:alpine
command: memcached -m 64
ports:
- "11211:11211"
- "11211:11211"

zookeeper:
image: confluentinc/cp-zookeeper:latest
Expand Down Expand Up @@ -248,8 +248,8 @@ services:
- "16686:16686"

otelcol:
image: otel/opentelemetry-collector:0.54.0
command: [ "--config=/etc/otelcol-config.yml" ]
image: otel/opentelemetry-collector:0.109.0
command: ["--config=/etc/otelcol-config.yml"]
volumes:
- ./otelcol-config.yml:/etc/otelcol-config.yml
ports:
Expand Down
4 changes: 2 additions & 2 deletions helpers/mysql/opentelemetry-helpers-mysql.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'minitest', '~> 5.0'
spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3'
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'rubocop', '~> 1.66.0'
spec.add_development_dependency 'rubocop-performance', '~> 1.21.0'
spec.add_development_dependency 'rubocop', '~> 1.68.0'
spec.add_development_dependency 'rubocop-performance', '~> 1.22.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'
Expand Down
8 changes: 6 additions & 2 deletions helpers/sql-obfuscation/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Release History: opentelemetry-helpers-sql-obfuscation
# Release History: opentelemetry-helpers-sql-obfuscation

### v0.2.0 / 2024-09-12

- BREAKING CHANGE: Return message when sql is over the obfuscation limit. Fixes a bug where sql statements with prepended comments that hit the obfuscation limit would be sent raw.

### v0.1.1 / 2024-06-18

* FIXED: Relax otel common gem constraints
- FIXED: Relax otel common gem constraints

### v0.1.0 / 2024-02-08

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
module OpenTelemetry
module Helpers
module SqlObfuscation
VERSION = '0.1.1'
VERSION = '0.2.0'
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'minitest', '~> 5.0'
spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3'
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'rubocop', '~> 1.66.0'
spec.add_development_dependency 'rubocop-performance', '~> 1.21.0'
spec.add_development_dependency 'rubocop', '~> 1.68.0'
spec.add_development_dependency 'rubocop-performance', '~> 1.22.0'
spec.add_development_dependency 'yard', '~> 0.9'
spec.add_development_dependency 'yard-doctest', '~> 0.1.6'

Expand Down
24 changes: 12 additions & 12 deletions instrumentation/action_mailer/Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
#
# SPDX-License-Identifier: Apache-2.0

appraise 'rails-6.1' do
gem 'rails', '~> 6.1.0'
end

appraise 'rails-7.0' do
gem 'rails', '~> 7.0.0'
end

appraise 'rails-7.1' do
gem 'rails', '~> 7.1.0'
%w[6.1.0 7.0.0 7.1.0].each do |version|
appraise "action_mailer-#{version}" do
gem 'rails', "~> #{version}"
end
end

if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0')
appraise 'rails-7.2' do
gem 'rails', '~> 7.2.0'
%w[7.2.0].each do |version|
appraise "action_mailer-#{version}" do
gem 'rails', "~> #{version}"
end
end

appraise 'action_mailer-latest' do
gem 'rails'
end
end
4 changes: 4 additions & 0 deletions instrumentation/action_mailer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release History: opentelemetry-instrumentation-action_mailer

### v0.2.0 / 2024-10-22

* ADDED: Subscribe to process.action_mailer notifications

### v0.1.0 / 2024-05-13

Initial release.
20 changes: 14 additions & 6 deletions instrumentation/action_mailer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ To use the instrumentation, call `use` with the name of the instrumentation:

```ruby
OpenTelemetry::SDK.configure do |c|
# Use only the ActionMailer instrumentation
# Use only the ActionMailer instrumentation
c.use 'OpenTelemetry::Instrumentation::ActionMailer'
# Use the ActionMailer instrumentation along with the rest of the Rails-related instrumentation
c.use 'OpenTelemetry::Instrumentation::Rails'
Expand All @@ -44,8 +44,8 @@ See the table below for details of what [Rails Framework Hook Events](https://gu

| Event Name | Creates Span? | Notes |
| - | - | - |
| `deliver.action_mailer` | :white_check_mark: | Creates an span with kind `internal` and email content and status|
| `process.action_mailer` | :x: | Lack of useful info so ignored |
| `deliver.action_mailer` | :white_check_mark: | Creates a span with kind `internal` and email content and status |
| `process.action_mailer` | :white_check_mark: | Creates a span with kind `internal` that will include email rendering spans |

### Options

Expand All @@ -67,9 +67,9 @@ end

## Semantic Conventions

Internal spans are named using the name of the `ActiveSupport` event that was provided (e.g. `action_mailer deliver`).
Internal spans are named using the name of the `ActiveSupport` event that was provided (e.g. `deliver.action_mailer`).

The following attributes from the notification payload for the `deliver.action_mailer` event are attached to `action_mailer deliver` spans:
### Attributes attached to the `deliver.action_mailer` event payload

| Attribute Name | Type | Notes |
| - | - | - |
Expand All @@ -79,7 +79,15 @@ The following attributes from the notification payload for the `deliver.action_m
| `email.to.address` | Array | Receiver for mail (omit by default, include when `email_address` set to `:include`) |
| `email.from.address` | Array | Sender for mail (omit by default, include when `email_address` set to `:include`) |
| `email.cc.address` | Array | mail CC (omit by default, include when `email_address` set to `:include`) |
| `email.bcc.address` | Array | mail BCC (omit by default, include when `email_address` set to `:include`) |
| `email.bcc.address` | Array | mail BCC (omit by default, include when `email_address` set to `:include`) |

### Attributes attached to the `process.action_mailer` event payload

| Attribute Name | Type | Notes |
| - | - | - |
| `mailer` | String | Mailer class that is used to render the mail |
| `action` | String | Method from the mailer class called to render the mail |
| `args` | Array | Arguments passed to the method to render the email |

## Examples

Expand Down
1 change: 1 addition & 0 deletions instrumentation/action_mailer/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ 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|
Expand Down
Loading

0 comments on commit 4b4fada

Please sign in to comment.