Skip to content

bridges/otellogrus: add kvBuffer abstraction for field conversion#8516

Open
Rahuljagwani wants to merge 5 commits intoopen-telemetry:mainfrom
Rahuljagwani:feat/otellogrus-kvbuffer
Open

bridges/otellogrus: add kvBuffer abstraction for field conversion#8516
Rahuljagwani wants to merge 5 commits intoopen-telemetry:mainfrom
Rahuljagwani:feat/otellogrus-kvbuffer

Conversation

@Rahuljagwani
Copy link
Copy Markdown

@Rahuljagwani Rahuljagwani commented Feb 5, 2026

Solves #5428

This PR introduces a kvBuffer type to otellogrus for more consistent and maintainable field conversion, following the pattern established in otelslog.

Took reference from:
https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/bridges/otelslog/handler.go#L379

@Rahuljagwani Rahuljagwani requested review from a team, dmathieu and pellared as code owners February 5, 2026 19:12
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla bot commented Feb 5, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: Rahuljagwani / name: Rahul Jagwani (1c52759)

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.2%. Comparing base (0558924) to head (4645c93).

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #8516   +/-   ##
=====================================
  Coverage   82.1%   82.2%           
=====================================
  Files        179     179           
  Lines      13700   13704    +4     
=====================================
+ Hits       11254   11269   +15     
+ Misses      2044    2033   -11     
  Partials     402     402           
Files with missing lines Coverage Δ
bridges/otellogrus/hook.go 97.8% <100.0%> (+<0.1%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@MrAlias MrAlias left a comment

Choose a reason for hiding this comment

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

This doesn’t add any behavior or capability; it just wraps a simple slice append loop in a new type and likely adds an extra allocation. Unless there’s a real follow‑on use, I don’t see the value here.

@Rahuljagwani
Copy link
Copy Markdown
Author

Hi @MrAlias, the issue mentions about the comment of using kvbuffer.

I introduced this helper anticipating reuse for attribute filtering / normalization similar to Link. If that’s premature, should we ignore for now and introduce it later?

or

Do i need to write filter rules, nil checks etc.?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants