forked from open-telemetry/opentelemetry-collector-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cmd/opampsupervisor] Add passthrough logging for collector (open-tel…
…emetry#35474) **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.--> Allow collector logs to passthrough to stdout instead of strictly being sent to a file. If configured to do so, the supervisor will capture collector output and log it using it's logger. This way, the supervisor should be configured to log to stdout if running in a containerized env. This PR follows closely with this [PR](open-telemetry#35468). Right now the supervisor exclusively logs to stdout, but under the assumption that it can be configured to log elsewhere, this change uses the supervisor logger rather than setting the collector's `exec.Cmd` to log to stdout and stderr. **Link to tracking Issue:** Closes open-telemetry#35473 **Testing:** <Describe what testing was performed and which tests were added.> I built a docker image of the supervisor and collector and ran it using the `containerized` param. This is a sample of what the output looked like: ``` 2024-09-30T12:42:47.472Z DEBUG commander/commander.go:73 Starting agent {"agent": "/collector/observiq-otel-collector"} 2024-09-30T12:42:47.472Z DEBUG commander/commander.go:163 Agent process started {"pid": 11} 2024-09-30T12:42:47.525Z INFO collector commander/commander.go:156 2024-09-30T12:42:47.525Z info [email protected]/service.go:178 Setting up own telemetry... 2024-09-30T12:42:47.525Z INFO collector commander/commander.go:156 2024-09-30T12:42:47.525Z info [email protected]/telemetry.go:98 Serving metrics {"address": ":8888", "metrics level": "Normal"} 2024-09-30T12:42:47.525Z INFO collector commander/commander.go:156 2024-09-30T12:42:47.525Z info [email protected]/service.go:263 Starting observiq-otel-collector... {"Version": "v2.0.0", "NumCPU": 12} 2024-09-30T12:42:47.525Z INFO collector commander/commander.go:156 2024-09-30T12:42:47.525Z info extensions/extensions.go:38 Starting extensions... 2024-09-30T12:42:47.525Z INFO collector commander/commander.go:156 2024-09-30T12:42:47.525Z info extensions/extensions.go:41 Extension is starting... {"kind": "extension", "name": "opamp"} 2024-09-30T12:42:47.525Z INFO collector commander/commander.go:156 2024-09-30T12:42:47.525Z info extensions/extensions.go:58 Extension started. {"kind": "extension", "name": "opamp"} 2024-09-30T12:42:47.526Z INFO collector commander/commander.go:156 2024-09-30T12:42:47.526Z info [email protected]/service.go:289 Everything is ready. Begin running and processing data. 2024-09-30T12:42:47.526Z INFO collector commander/commander.go:156 2024-09-30T12:42:47.526Z info localhostgate/featuregate.go:63 The default endpoints for all servers in components have changed to use localhost instead of 0.0.0.0. Disable the feature gate to temporarily revert to the previous default. {"feature gate ID": "component.UseLocalHostAsDefaultHost"} 2024-09-30T12:42:47.528Z DEBUG commander/commander.go:220 Stopping agent process {"pid": 11} ``` **Documentation:** <Describe the documentation added.>
- Loading branch information
1 parent
b6a059a
commit fcefa2d
Showing
5 changed files
with
111 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Use this changelog template to create an entry for release notes. | ||
|
||
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
change_type: enhancement | ||
|
||
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) | ||
component: opampsupervisor | ||
|
||
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
note: Allow collector logs to passthrough to supervisor output to facilitate running in a containerized environment. | ||
|
||
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. | ||
issues: [35473] | ||
|
||
# (Optional) One or more lines of additional information to render under the primary note. | ||
# These lines will be padded with 2 spaces and then inserted directly into the document. | ||
# Use pipe (|) for multiline entries. | ||
subtext: | ||
|
||
# If your change doesn't affect end users or the exported elements of any package, | ||
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. | ||
# Optional: The change log or logs in which this entry should be included. | ||
# e.g. '[user]' or '[user, api]' | ||
# Include 'user' if the change is relevant to end users. | ||
# Include 'api' if there is a change to a library API. | ||
# Default: '[user]' | ||
change_logs: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters