-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[BUG] gohai logs error "[Debug] Error fetching info for pid 1" even when log level is >= info, in otel collector datadog exporter #21487
Comments
Getting a different log line on
This comes up as the last log line after pods start up, nothing logged after it. Can be quite confusing. |
Knowing the cause/fix here would be useful. I'm seeing this as well with version |
It sounds like this is a red herring though and not an issue with the exporter |
Still seeing this on version Example log lines from the otel collector pod:
|
FWIW I'm seeing this as well in version 0.114.0 running opentelemetry-collector-contrib docker image on underlying platform of Darwin/arm64. If |
https://github.com/DataDog/datadog-agent/tree/main/pkg/gohai emits an error like
... when invoked by the OpenTelemetry Collector Datadog Exporter's hostmetrics collector on startup. This is because there is no
/etc/passwd
or nss service etc in the container, it's a barebones os-less container.The datadog exporter doesn't seem to use a logging adapter to send logs to the collector's log sink, so this is emitted irrespective of log level. It ignores the collector's configured log format and emits non-json format logs when the collector is configured for json logging. And it's unnecessary, meaningless noise.
The message comes from
datadog-agent/pkg/gohai/processes/gops/process_info.go
Line 60 in 45c774d
I'm not immediately sure where the returned
err
is transformed into a log message with the wrong logging adapter, I didn't dig that far.If this message is necessary at all, it should:
See open-telemetry/opentelemetry-collector-contrib#14186 for details.
Agent Environment
N/A; this is about the OpenTelemetry Collector Datadog Exporter (which is managed by Datadog) running the gohai packages.
Describe what happened:
Annoying log message on every startup at all log levels. This message should NOT be emitted, given that the configured log level of my collector is
Describe what you expected:
Message not emitted at all for >debug levels.
When debug level logs enabled, the log message should be emitted with proper json wrapping, and a caller context to identify where it came from.
Steps to reproduce the issue:
Run the example opentelemetry collector config provided by Datadog using the
otel/opentelemetry-collector-contrib:0.90.1
image. Check the logs. Observe the error.Additional environment details (Operating System, Cloud provider, etc):
N/A, you'll see this in docker or k8s or anywhere really.
The text was updated successfully, but these errors were encountered: