Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: WIP: Ruby Logger instrumentation #1

Draft
wants to merge 79 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
ec2c192
WIP initial commit logger instrumentation
kaylareopelle Sep 19, 2023
f4add62
Rubocop require_relative
kaylareopelle Sep 25, 2023
456d25b
Add :: to find Ruby logger instead of OTel logger
kaylareopelle Sep 25, 2023
e39763a
Remove commented out option LOC
kaylareopelle Sep 25, 2023
976f329
Add skip_instrumenting? method
kaylareopelle Sep 25, 2023
ffd3fc5
Skip ActiveSupport::Logger#broadcast loggers
kaylareopelle Sep 25, 2023
bf2f998
Add logger instrumentation library and version
kaylareopelle Sep 25, 2023
2df26a6
Update severity_number logic, return orig value
kaylareopelle Sep 25, 2023
b0ab18f
Make instrumentation name a constant
kaylareopelle Oct 3, 2023
595ecc5
WIP test active support logger
kaylareopelle Oct 3, 2023
cf920dd
Merge branch 'main' into logger-instrumentation
kaylareopelle Mar 29, 2024
f510b3d
Merge branch 'main' of https://github.com/kaylareopelle/opentelemetry…
khushijain21 Mar 29, 2024
90c6820
Merge branch 'logger-instrumentation' of https://github.com/kaylareop…
khushijain21 Mar 29, 2024
58c82a7
Map logger level to OTel level
khushijain21 Mar 29, 2024
c587212
Install WIP logs dependencies from git, not local
kaylareopelle Mar 29, 2024
a4e980d
Update rubocop dependencies
kaylareopelle Mar 29, 2024
4604a96
Disable active_support_logger tests
kaylareopelle Mar 29, 2024
f995baa
Merge pull request #1 from kaylareopelle/disable-rails-testing
khushijain21 Mar 30, 2024
6e96fcd
Merge branch 'main' of https://github.com/kaylareopelle/opentelemetry…
khushijain21 Apr 4, 2024
b8ae0d9
maps otel log level
khushijain21 Apr 4, 2024
9bac90d
Merge branch 'main' into logger-instrumentation
kaylareopelle Apr 4, 2024
595e7aa
Merge branch 'logger-instrumentation' of https://github.com/kaylareop…
khushijain21 Apr 4, 2024
33f81f6
Merge pull request #2 from khushijain21/logger-instrumentation
kaylareopelle Apr 4, 2024
97ea4c9
Use the updated method name to emit, `on_emit`
kaylareopelle Apr 15, 2024
f7646f8
Update tests referencing severity numbers
kaylareopelle Apr 15, 2024
d838da7
Merge branch 'main' into logger-instrumentation
kaylareopelle Apr 23, 2024
483343c
Loosen dependency version restrictions
kaylareopelle Apr 23, 2024
c35df18
fix: Remove NAME constant from gemspec
kaylareopelle Apr 23, 2024
686f2d9
chore: Address Rubocop require_relative linter
kaylareopelle Apr 23, 2024
1bd3ead
Rubocop
kaylareopelle Apr 23, 2024
8b06c93
fix: Bring back the NAME constant
kaylareopelle Apr 24, 2024
747f3cd
Merge branch 'main' into logger-instrumentation
kaylareopelle May 10, 2024
66d3b3f
chore: Correct version number, add TODOs in README
kaylareopelle May 14, 2024
2358235
Merge branch 'main' into logger-instrumentation
kaylareopelle May 14, 2024
4c6d6f1
fix: Revert version for now
kaylareopelle May 14, 2024
0527726
change
khushijain21 May 7, 2024
7dfba21
move options
khushijain21 May 9, 2024
03868bc
accomodated changes
khushijain21 May 13, 2024
c96243b
removed configuring logger_provider
khushijain21 May 14, 2024
2c9a3e3
removed corresponding test
khushijain21 May 14, 2024
fb0b5c8
Merge pull request #5 from khushijain21/rubybridge2
kaylareopelle May 15, 2024
236bf1f
chore: Add tests for name and version config
kaylareopelle May 10, 2024
e3162e0
Merge pull request #6 from kaylareopelle/config-tests
kaylareopelle May 15, 2024
b0b301f
chore: Rubocop
kaylareopelle May 16, 2024
e6799ff
add check for logs sdk
khushijain21 May 17, 2024
b0da0f1
Merge pull request #7 from khushijain21/rubybridge2
kaylareopelle May 21, 2024
18a45d1
test: Reinstate active support logger tests
kaylareopelle Jul 12, 2024
09778b7
Merge branch 'main' into logger-instrumentation
kaylareopelle Sep 17, 2024
d00bc1d
style: Add language to code fence
kaylareopelle Sep 17, 2024
d129337
Update instrumentation/logger/lib/opentelemetry/instrumentation.rb
kaylareopelle Sep 17, 2024
97b42de
docs: add some config info
kaylareopelle Sep 17, 2024
6276944
feat: Remove config options
kaylareopelle Sep 17, 2024
ef88293
chore: Add TODO for version number update
kaylareopelle Sep 17, 2024
00c8687
feat: Update example and readme
kaylareopelle Sep 17, 2024
96a4a1b
Merge branch 'logger-instrumentation' of github.com:kaylareopelle/ope…
kaylareopelle Sep 17, 2024
7f8dce1
test: remove appraisals for eol'd rails versions
kaylareopelle Sep 17, 2024
e5cc573
feat: Support ActiveSupport::BroadcastLogger
kaylareopelle Sep 17, 2024
ea3351e
test: Remove config option tests
kaylareopelle Sep 17, 2024
192b262
fix: get correct table name if table name is quoted (#1234)
HielkeJ Nov 24, 2024
5970bd3
chore: Update rubocop-performance to ~> 1.23.0 (#1257)
kaylareopelle Nov 24, 2024
c387a8d
chore: bump DavidAnson/markdownlint-cli2-action from 17 to 18 (#1243)
dependabot[bot] Nov 24, 2024
ad8988b
refactor: Freeze all range objects #1172 (#1222)
Victorsesan Nov 24, 2024
81cbe08
chore: Update release-please-config.json
arielvalentin Nov 24, 2024
0e5dd05
chore: sync release-please-versions
arielvalentin Nov 24, 2024
0f3df26
Merge branch 'main' into logger-instrumentation
kaylareopelle Nov 25, 2024
aae89d7
chore: Add EoL Post Install Messages (#1264)
arielvalentin Nov 26, 2024
2886fae
feat: add grpc instrumentation (#1164)
hibachrach Nov 26, 2024
f4b89c3
release: Release 20 gems (#1270)
github-actions[bot] Nov 27, 2024
f963bc9
ci: fix installation tests. (#1272)
scbjans Nov 29, 2024
2d07298
fix: include the gRPC gem in the installation tests (#1275)
michal-kazmierczak Dec 2, 2024
92d59eb
fix: use AS::N subscriber for serialize events (#1075)
robbkidd Dec 2, 2024
45d0a54
release: Release opentelemetry-instrumentation-active_model_serialize…
github-actions[bot] Dec 4, 2024
227fef3
Merge branch 'main' into logger-instrumentation
kaylareopelle Dec 5, 2024
c9f47c6
chore: Prepare bridge for review
kaylareopelle Dec 5, 2024
8f9038c
Merge branch 'logger-instrumentation' of github.com:kaylareopelle/ope…
kaylareopelle Dec 5, 2024
40f4b9a
chore: Rename skip_instrumenting to skip_otel_emit
kaylareopelle Dec 5, 2024
b0cace2
chore: Bump instrumentation-logger version in all
kaylareopelle Dec 5, 2024
eda40db
chore: Remove simplecov
kaylareopelle Dec 6, 2024
d7ea817
test: Update ActiveSupportLogger tests
kaylareopelle Dec 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Map logger level to OTel level
  • Loading branch information
khushijain21 committed Mar 29, 2024
commit 58c82a710815b798db6015c3a1df14ccf07dee99
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def format_message(severity, datetime, progname, msg)
timestamp: datetime,
body: msg # New Relic uses formatted_message here. This also helps us with not recording progname, because it is included in the formatted message by default. Which seems more appropriate?
)

formatted_message
end

Expand All @@ -38,10 +37,20 @@ def skip_instrumenting?
end

def severity_number(severity)
::Logger::Severity.const_get(severity)
rescue NameError => e
OpenTelemetry.logger.warn(message: "Unable to coerce severity text #{severity} into severity_number. Setting severity_number to nil.", exception: e)
nil
case severity.downcase
when 'debug'
Opentelemetry::Proto::Logs::V1::SeverityNumber::SEVERITY_NUMBER_DEBUG
when 'info'
Opentelemetry::Proto::Logs::V1::SeverityNumber::SEVERITY_NUMBER_INFO
when 'warn'
Opentelemetry::Proto::Logs::V1::SeverityNumber::SEVERITY_NUMBER_WARN
when 'error'
Opentelemetry::Proto::Logs::V1::SeverityNumber::SEVERITY_NUMBER_ERROR
when 'fatal'
Opentelemetry::Proto::Logs::V1::SeverityNumber::SEVERITY_NUMBER_FATAL
else
Opentelemetry::Proto::Logs::V1::SeverityNumber::SEVERITY_NUMBER_UNSPECIFIED
end
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
ruby_logger.debug(msg)
assert_equal(msg, log_record.body)
assert_equal('DEBUG', log_record.severity_text)
assert_equal(0, log_record.severity_number)
assert_equal(5, log_record.severity_number)
assert_equal(timestamp, log_record.timestamp)
end
end
Expand Down
Loading