Skip to content

otellogrus: set SeverityText field to logrus hook#7553

Merged
dmathieu merged 4 commits intoopen-telemetry:mainfrom
huiyifyj:logrus-SeverityText
Jul 8, 2025
Merged

otellogrus: set SeverityText field to logrus hook#7553
dmathieu merged 4 commits intoopen-telemetry:mainfrom
huiyifyj:logrus-SeverityText

Conversation

@huiyifyj
Copy link
Copy Markdown
Contributor

@huiyifyj huiyifyj commented Jul 7, 2025

The Severity field is used to represent the severity of the log, but it can't replace human-readable level string,
the SeverityText 1 field seems a optional field, as same as log level.

This PR is to set the SeverityText field based on the logrus.Level in the otellogrus hook.

Footnotes

  1. OTEL Spec: Data Model for Logs #SeverityText

huiyifyj added 2 commits July 4, 2025 17:48
Set missing `SeverityText` property in log records when converting logrus entries to OpenTelemetry log records.
@huiyifyj huiyifyj requested review from a team, dmathieu and pellared as code owners July 7, 2025 05:24
@dmathieu
Copy link
Copy Markdown
Member

dmathieu commented Jul 7, 2025

This looks good, but it needs a changelog entry.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.5%. Comparing base (b72e8bc) to head (e2a0a7c).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #7553   +/-   ##
=====================================
  Coverage   81.5%   81.5%           
=====================================
  Files        198     198           
  Lines      17976   17977    +1     
=====================================
+ Hits       14663   14664    +1     
  Misses      2916    2916           
  Partials     397     397           
Files with missing lines Coverage Δ
bridges/otellogrus/hook.go 96.0% <100.0%> (+<0.1%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pellared pellared added enhancement New feature or request bridge: logrus Related to the logrus bridge labels Jul 7, 2025
Copy link
Copy Markdown
Member

@pellared pellared left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only needs a changelog entry.

@huiyifyj
Copy link
Copy Markdown
Contributor Author

huiyifyj commented Jul 8, 2025

This only needs a changelog entry.

👌

@dmathieu dmathieu merged commit 03c3dd0 into open-telemetry:main Jul 8, 2025
28 checks passed
@MrAlias MrAlias added this to the v1.38.0 milestone Jul 17, 2025
@MrAlias MrAlias mentioned this pull request Aug 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bridge: logrus Related to the logrus bridge enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants