-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[pkg/stanza] Switch from SugaredLogger to Logger #32177
[pkg/stanza] Switch from SugaredLogger to Logger #32177
Conversation
871279f
to
1a24d74
Compare
7bb8633
to
1a5a872
Compare
1a5a872
to
a6c670a
Compare
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
…erface (#32662) **Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> This PR resumes the work from #31618. The goal is to pass in the `component.TelemetrySettings` so as to use them later in various ways: 1) report the filelog's state stats: #31544 2) switch from `SugaredLogger` to `Logger`: #32177 More about the breaking change decision at #31618 (comment). **Link to tracking Issue:** <Issue number if applicable> #31256 **Testing:** <Describe what testing was performed and which tests were added.> Testing suite got updated. #### Manual Testing 1. ```yaml receivers: filelog: start_at: end include: - /var/log/busybox/refactroring_test.log operators: - id: addon type: add field: attributes.extra value: my-val exporters: debug: verbosity: detailed service: pipelines: logs: receivers: [filelog] exporters: [debug] processors: [] ``` 2. `./bin/otelcontribcol_linux_amd64 --config ~/otelcol/config.yaml` 3. `echo 'some line' >> /var/log/busybox/refactroring_test.log` 4. ```console 2024-04-24T09:29:17.104+0300 info LogsExporter {"kind": "exporter", "data_type": "logs", "name": "debug", "resource logs": 1, "log records": 1} 2024-04-24T09:29:17.104+0300 info ResourceLog #0 Resource SchemaURL: ScopeLogs #0 ScopeLogs SchemaURL: InstrumentationScope LogRecord #0 ObservedTimestamp: 2024-04-24 06:29:17.005433317 +0000 UTC Timestamp: 1970-01-01 00:00:00 +0000 UTC SeverityText: SeverityNumber: Unspecified(0) Body: Str(some line) Attributes: -> extra: Str(my-val) -> log.file.name: Str(1.log) Trace ID: Span ID: Flags: 0 {"kind": "exporter", "data_type": "logs", "name": "debug"} ``` **Documentation:** <Describe the documentation added.> TBA. Signed-off-by: ChrsMark <[email protected]>
4bbbdf8
to
8b59da2
Compare
8b59da2
to
6d3666e
Compare
4af70a1
to
74c9667
Compare
74c9667
to
e5d5060
Compare
e5d5060
to
9921a8e
Compare
This is just waiting on a review @open-telemetry/collector-contrib-approvers @ChrsMark |
9921a8e
to
d3733b1
Compare
d3733b1
to
06da547
Compare
Remove usage of incorrect logger inherited from stanza InputOperator and removed in 0.101.0 as part of open-telemetry/opentelemetry-collector-contrib#32177
Remove usage of incorrect logger inherited from stanza InputOperator and removed in 0.101.0 as part of open-telemetry/opentelemetry-collector-contrib#32177
This seems to have broken drop_quiet and send_quiet from what I can tell. Now my failed "move" operator is logging even though i have it on send_quiet |
@fordneild would you mind opening a separate issue for this? cc @djaglowski |
#32662 updated many exported functions to accept
component.TelemetrySettings
instead ofzap.SugaredLogger
. This PR continues from there by passingcomponent.TelemetrySettings
deeper into the inner packages, and migrates from usingzap.SugaredLogger
to instead usingzap.Logger
(as provided bycomponent.TelemetrySettings
).