Skip to content

Commit 0b0a18b

Browse files
feat: Add ActiveStorage instrumentation (#1313)
* feat: Add ActiveStorage instrumentation * fix: markdown lint error in README.md * fix: rubocop error in opentelemetry-instrumentation-all.gemspec * feat: remove support for Rails 6.1 * docs: add default value on `:disallowed_notification_payload_keys` * feat: match rubocop and opentelemetry-instrumentation-base version with other packages * test: add explicit require to `logger` * test: remove unnecessary conditions * chore: add imagemagick package to Dockerfile * feat: change active_storage instrumentation version to 0.1.0 and remove active_storage from all * chore: update instrumentation/active_storage CODEOWNERS --------- Co-authored-by: Kayla Reopelle <[email protected]>
1 parent 14a6d96 commit 0b0a18b

28 files changed

+1409
-0
lines changed

.github/actions/test_gem/action.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ runs:
6262
fi
6363
fi
6464
65+
# Install ImageMagick for active_storage testing.
66+
# Unfortunately, as of ubuntu-24.04, ImageMagick is no longer pre-installed in Github Actions.
67+
# See https://github.com/actions/runner-images/issues/10772
68+
- name: Install ImageMagick for active_storage testing
69+
if: "${{ inputs.gem == 'opentelemetry-instrumentation-active_storage' }}"
70+
shell: bash
71+
run: sudo apt update && sudo apt install -y imagemagick
72+
6573
# Install ruby and bundle dependencies and cache!
6674
# ...but not for appraisals, sadly.
6775
- name: Install Ruby ${{ inputs.ruby }} with dependencies

.github/workflows/ci-instrumentation.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
- active_job
2828
- active_model_serializers
2929
- active_record
30+
- active_storage
3031
- active_support
3132
- all
3233
- aws_sdk
@@ -86,6 +87,7 @@ jobs:
8687
[[ "${{ matrix.gem }}" == "action_view" ]] && echo "skip=true" >> $GITHUB_OUTPUT
8788
[[ "${{ matrix.gem }}" == "active_model_serializers" ]] && echo "skip=true" >> $GITHUB_OUTPUT
8889
[[ "${{ matrix.gem }}" == "active_record" ]] && echo "skip=true" >> $GITHUB_OUTPUT
90+
[[ "${{ matrix.gem }}" == "active_storage" ]] && echo "skip=true" >> $GITHUB_OUTPUT
8991
[[ "${{ matrix.gem }}" == "active_support" ]] && echo "skip=true" >> $GITHUB_OUTPUT
9092
[[ "${{ matrix.gem }}" == "aws_sdk" ]] && echo "skip=true" >> $GITHUB_OUTPUT
9193
[[ "${{ matrix.gem }}" == "aws_lambda" ]] && echo "skip=true" >> $GITHUB_OUTPUT

.toys/.data/releases.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ commit_lint:
3030
# * changelog_path: Path to CHANGLEOG.md relative to the gem directory.
3131
# (Required only if it is not in the expected location.)
3232
gems:
33+
- name: opentelemetry-instrumentation-active_storage
34+
directory: instrumentation/active_storage
35+
version_constant: [OpenTelemetry, Instrumentation, ActiveStorage, VERSION]
36+
3337
- name: opentelemetry-helpers-sql
3438
directory: helpers/sql
3539
version_constant: [OpenTelemetry, Helpers, Sql, VERSION]

CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
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
1818

19+
instrumentation/active_storage/ @ymtdzzz @open-telemetry/ruby-contrib-maintainers @open-telemetry/ruby-contrib-approvers @fbogsany @mwear @robertlaurin @dazuma @ericmustin @arielvalentin @ahayworth @plantfansam @robbkidd @simi @kaylareopelle @xuan-cao-swi
20+
1921
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
2022

2123
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

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ ARG PACKAGES="\
3838
postgresql-dev \
3939
tzdata \
4040
util-linux \
41+
imagemagick \
4142
"
4243
# Install packages
4344
RUN apk update && \
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
inherit_from: ../../.rubocop.yml
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
--no-private
2+
--title=OpenTelemetry Active Storage Instrumentation
3+
--markup=markdown
4+
--main=README.md
5+
./lib/opentelemetry/instrumentation/**/*.rb
6+
./lib/opentelemetry/instrumentation.rb
7+
-
8+
README.md
9+
CHANGELOG.md
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# frozen_string_literal: true
2+
3+
# Copyright The OpenTelemetry Authors
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
%w[7.0.0 7.1.0].each do |version|
8+
appraise "activestorage-#{version}" do
9+
gem 'sqlite3', '~> 1.4'
10+
gem 'image_processing', '~> 1.2'
11+
gem 'rails', "~> #{version}"
12+
end
13+
end
14+
15+
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0')
16+
%w[7.2.0].each do |version|
17+
appraise "activestorage-#{version}" do
18+
gem 'sqlite3', '~> 1.4'
19+
gem 'image_processing', '~> 1.2'
20+
gem 'rails', "~> #{version}"
21+
end
22+
end
23+
24+
appraise 'activestorage-latest' do
25+
gem 'sqlite3', '>= 2.1'
26+
gem 'image_processing', '~> 1.2'
27+
gem 'rails'
28+
end
29+
end
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Release History: opentelemetry-instrumentation-active_storage
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# frozen_string_literal: true
2+
3+
# Copyright The OpenTelemetry Authors
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
source 'https://rubygems.org'
8+
9+
gemspec
10+
11+
group :test do
12+
gem 'opentelemetry-instrumentation-base', path: '../base'
13+
gem 'opentelemetry-instrumentation-active_support', path: '../active_support'
14+
end

0 commit comments

Comments
 (0)