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

Introduce component logger with appropriate attributes #12259

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

djaglowski
Copy link
Member

@djaglowski djaglowski commented Feb 3, 2025

Implements the logger described in #12217

Alternative to #12057

Resolves #11814

component/componentattribute:

  • Initializes new module
  • Defines constants for component telemetry attribute keys
  • Defines a zapcore.Core which can remove attributes from the root logger

service:

  • Rebases component instantiation on attribute sets
  • Internal constructors for attribute sets for each component type
  • Constructs loggers from componentattribute

otlpreceiver:

  • Uses componentattribute to remove otelcol.signal attribute from logger

memorylimiter:

  • Uses componentattribute to remove otelcol.signal, otelcol.pipeline.id and otelcol.component.id attributes from logger


var _ zapcore.Core = (*Logger)(nil)

type Logger struct {
Copy link
Member

Choose a reason for hiding this comment

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

nit: I would call this Core or ZapCore instead of Logger

@djaglowski djaglowski force-pushed the component-logger branch 8 times, most recently from 8845f3e to e8565de Compare February 4, 2025 16:32
@djaglowski djaglowski force-pushed the component-logger branch 4 times, most recently from 8ebe64f to 0cdc5de Compare February 4, 2025 17:05
Copy link

codecov bot commented Feb 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.28%. Comparing base (fc34c23) to head (a9d57b9).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #12259   +/-   ##
=======================================
  Coverage   91.27%   91.28%           
=======================================
  Files         466      465    -1     
  Lines       25586    25599   +13     
=======================================
+ Hits        23354    23367   +13     
  Misses       1816     1816           
  Partials      416      416           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@djaglowski djaglowski force-pushed the component-logger branch 2 times, most recently from ddc480f to 39415d7 Compare February 4, 2025 17:59
@djaglowski djaglowski marked this pull request as ready for review February 4, 2025 18:42
@djaglowski djaglowski requested a review from a team as a code owner February 4, 2025 18:42
@djaglowski djaglowski requested a review from dmitryax February 4, 2025 18:42
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.

Loggers for shared components should not report signal type.
2 participants