Skip to content

Commit 4efdb00

Browse files
mx-psiXinRanZhAWS
authored andcommitted
[exporter/datadog] Lower gohai logs to debug level (open-telemetry#31703)
**Description:** Demote gohai logs to debug level **Link to tracking Issue:** Fixes open-telemetry#29741
1 parent a9b8e12 commit 4efdb00

File tree

2 files changed

+33
-5
lines changed

2 files changed

+33
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: bug_fix
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: exporter/datadog
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Demote noisy gohai logs to debug level
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [29741]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext: |
19+
These logs would be present at the info level when using the official Docker images but were not useful to end-users.
20+
21+
# If your change doesn't affect end users or the exported elements of any package,
22+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
23+
# Optional: The change log or logs in which this entry should be included.
24+
# e.g. '[user]' or '[user, api]'
25+
# Include 'user' if the change is relevant to end users.
26+
# Include 'api' if there is a change to a library API.
27+
# Default: '[user]'
28+
change_logs: []

exporter/datadogexporter/internal/hostmetadata/internal/gohai/gohai.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,23 @@ func newGohai(logger *zap.Logger) *gohai.Gohai {
2626
res := new(gohai.Gohai)
2727

2828
if p, err := new(cpu.Cpu).Collect(); err != nil {
29-
logger.Info("Failed to retrieve cpu metadata", zap.Error(err))
29+
logger.Debug("Failed to retrieve cpu metadata", zap.Error(err))
3030
} else if cpu, ok := p.(map[string]string); !ok {
3131
logger.Warn("Internal error: Failed to cast cpu metadata to map[string]string", zap.Any("cpu", p))
3232
} else {
3333
res.CPU = cpu
3434
}
3535

3636
if p, err := new(filesystem.FileSystem).Collect(); err != nil {
37-
logger.Info("Failed to retrieve filesystem metadata", zap.Error(err))
37+
logger.Debug("Failed to retrieve filesystem metadata", zap.Error(err))
3838
} else if fs, ok := p.([]any); !ok {
3939
logger.Warn("Internal error: Failed to cast filesystem metadata to []any", zap.Any("filesystem", p))
4040
} else {
4141
res.FileSystem = fs
4242
}
4343

4444
if p, err := new(memory.Memory).Collect(); err != nil {
45-
logger.Info("Failed to retrieve memory metadata", zap.Error(err))
45+
logger.Debug("Failed to retrieve memory metadata", zap.Error(err))
4646
} else if mem, ok := p.(map[string]string); !ok {
4747
logger.Warn("Internal error: Failed to cast memory metadata to map[string]string", zap.Any("memory", p))
4848
} else {
@@ -51,15 +51,15 @@ func newGohai(logger *zap.Logger) *gohai.Gohai {
5151

5252
// in case of containerized environment, this would return pod id not node's ip
5353
if p, err := new(network.Network).Collect(); err != nil {
54-
logger.Info("Failed to retrieve network metadata", zap.Error(err))
54+
logger.Debug("Failed to retrieve network metadata", zap.Error(err))
5555
} else if net, ok := p.(map[string]any); !ok {
5656
logger.Warn("Internal error: Failed to cast network metadata to map[string]any", zap.Any("network", p))
5757
} else {
5858
res.Network = net
5959
}
6060

6161
if p, err := new(platform.Platform).Collect(); err != nil {
62-
logger.Info("Failed to retrieve platform metadata", zap.Error(err))
62+
logger.Debug("Failed to retrieve platform metadata", zap.Error(err))
6363
} else if platform, ok := p.(map[string]string); !ok {
6464
logger.Warn("Internal error: Failed to cast platform metadata to map[string]string", zap.Any("platform", p))
6565
} else {

0 commit comments

Comments
 (0)