-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[cmd/opampsupervisor] Add configurable supervisor logging #35468
Merged
evan-bradley
merged 9 commits into
open-telemetry:main
from
observIQ:configurable-supervisor-logging
Oct 3, 2024
Merged
[cmd/opampsupervisor] Add configurable supervisor logging #35468
evan-bradley
merged 9 commits into
open-telemetry:main
from
observIQ:configurable-supervisor-logging
Oct 3, 2024
Conversation
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
github-actions
bot
requested review from
atoulme,
BinaryFissionGames,
evan-bradley and
tigrannajaryan
September 27, 2024 15:32
dpaasman00
force-pushed
the
configurable-supervisor-logging
branch
2 times, most recently
from
September 27, 2024 17:07
83eed76
to
3873c2d
Compare
djaglowski
approved these changes
Oct 1, 2024
evan-bradley
reviewed
Oct 2, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this.
dpaasman00
force-pushed
the
configurable-supervisor-logging
branch
from
October 3, 2024 14:08
6f49984
to
0409490
Compare
evan-bradley
approved these changes
Oct 3, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks.
codeboten
pushed a commit
that referenced
this pull request
Oct 3, 2024
**Description:** Follow up to #35468. This should fix issues like the following: ``` testing.go:1231: TempDir RemoveAll cleanup: remove C:\Users\RUNNER~1\AppData\Local\Temp\TestSupervisorInfoLoggingLevel3383092187\001\supervisor_log.log: The process cannot access the file because it is being used by another process. ``` I believe this error is caused by the temp directory doing a cleanup before all `defer` statements can run, but I'm not sure. This is how I've seen this error fixed in other tests.
djaglowski
pushed a commit
that referenced
this pull request
Oct 4, 2024
**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](#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 #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.>
jriguera
pushed a commit
to springernature/opentelemetry-collector-contrib
that referenced
this pull request
Oct 4, 2024
…etry#35468) **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.--> Adds configurable logging for the supervisor. Lays ground work to expand with more config options and to configure other telemetry signals. Meant to mimic how collector telemetry/logging is configured. **Link to tracking Issue:** <Issue number if applicable> Closes open-telemetry#35466 **Testing:** <Describe what testing was performed and which tests were added.> Tested running the supervisor with default and different log levels and outputs specified. **Documentation:** <Describe the documentation added.>
jriguera
pushed a commit
to springernature/opentelemetry-collector-contrib
that referenced
this pull request
Oct 4, 2024
**Description:** Follow up to open-telemetry#35468. This should fix issues like the following: ``` testing.go:1231: TempDir RemoveAll cleanup: remove C:\Users\RUNNER~1\AppData\Local\Temp\TestSupervisorInfoLoggingLevel3383092187\001\supervisor_log.log: The process cannot access the file because it is being used by another process. ``` I believe this error is caused by the temp directory doing a cleanup before all `defer` statements can run, but I'm not sure. This is how I've seen this error fixed in other tests.
jriguera
pushed a commit
to springernature/opentelemetry-collector-contrib
that referenced
this pull request
Oct 4, 2024
…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.>
Eromosele-SM
pushed a commit
to sematext/opentelemetry-collector-contrib
that referenced
this pull request
Oct 9, 2024
…etry#35468) **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.--> Adds configurable logging for the supervisor. Lays ground work to expand with more config options and to configure other telemetry signals. Meant to mimic how collector telemetry/logging is configured. **Link to tracking Issue:** <Issue number if applicable> Closes open-telemetry#35466 **Testing:** <Describe what testing was performed and which tests were added.> Tested running the supervisor with default and different log levels and outputs specified. **Documentation:** <Describe the documentation added.>
Eromosele-SM
pushed a commit
to sematext/opentelemetry-collector-contrib
that referenced
this pull request
Oct 9, 2024
**Description:** Follow up to open-telemetry#35468. This should fix issues like the following: ``` testing.go:1231: TempDir RemoveAll cleanup: remove C:\Users\RUNNER~1\AppData\Local\Temp\TestSupervisorInfoLoggingLevel3383092187\001\supervisor_log.log: The process cannot access the file because it is being used by another process. ``` I believe this error is caused by the temp directory doing a cleanup before all `defer` statements can run, but I'm not sure. This is how I've seen this error fixed in other tests.
Eromosele-SM
pushed a commit
to sematext/opentelemetry-collector-contrib
that referenced
this pull request
Oct 9, 2024
…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.>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
Adds configurable logging for the supervisor. Lays ground work to expand with more config options and to configure other telemetry signals. Meant to mimic how collector telemetry/logging is configured.
Link to tracking Issue: Closes #35466
Testing:
Tested running the supervisor with default and different log levels and outputs specified.
Documentation: