-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Docker] Stop returning errors when there are no metric values #39807
Conversation
The docker metricset returns an error when there are no memory metric values available. This condition can happen when there are no running containers on Docker. When no containers are running, the metricset returns an error at every collection, creating noise.
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
@fearful-symmetry, do you see any issue in replacing the error with a debug log message? I see you added the error years ago. |
Here is an example of log message: {
"log.level": "debug",
"@timestamp": "2024-06-05T22:48:55.082+0200",
"log.logger": "memory",
"log.origin": {
"function": "github.com/elastic/beats/v7/metricbeat/module/docker/memory.(*MetricSet).Fetch",
"file.name": "memory/memory.go",
"file.line": 84
},
"message": "No memory stats data available",
"service.name": "metricbeat",
"ecs.version": "1.6.0"
} It looks good, but the What's the expected format in Baats? |
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.
Nit about the logger name, otherwise looks good
Remove the const for the metricset name. Managing module and metricset name as const would require a larger change, which is out of scope. I prefer to keep things as simple as possible for this quick fix, and leave other decisions to code owners.
* Return nil instead or an error if no metrics The docker metricset returns an error when there are no memory metric values available. This condition can happen when there are no running containers on Docker. When no containers are running, the metricset returns an error at every collection, creating noise. * Add a "docker.memory" logger to write a debug message on no-metrics (cherry picked from commit 4c1d3f2)
… (#39829) * Return nil instead or an error if no metrics The docker metricset returns an error when there are no memory metric values available. This condition can happen when there are no running containers on Docker. When no containers are running, the metricset returns an error at every collection, creating noise. * Add a "docker.memory" logger to write a debug message on no-metrics (cherry picked from commit 4c1d3f2) Co-authored-by: Maurizio Branca <[email protected]>
Proposed commit message
Stop returning errors when there are no metric values for the Docker memory metricset.
The docker metricset returns an error when there are no memory metric values available. This condition can happen when there are no running containers on Docker.
When no containers are running, the metricset returns an error at every collection, creating noise.
Notes for reviewers
Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration filesCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Related issues