Skip to content
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

in_node_exporter_metrics: Suppress error log when NVMe is not mounted #8251

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

cosmo0920
Copy link
Contributor

@cosmo0920 cosmo0920 commented Dec 5, 2023

In NVMe not mounted node, the not found error is generated by ne_utils_path_scan.
However, not every node and Linux boxes have NVMe as their storage.
So, we have to suppress the error message and suppress logs for it.

Specifically, it will occurred on the visualized/containerized environments such as EC2 instances or ChromeOS's Linux containers.


Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • Example configuration file for the change
  • Debug log output from testing the change
$ LANG=C ls /sys/class/nvme
ls: cannot access '/sys/class/nvme': No such file or directory
$ bin/fluent-bit -i node_exporter_metrics -p metrics=nvme -o stdout -v
Fluent Bit v2.2.1
* Copyright (C) 2015-2023 The Fluent Bit Authors
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
* https://fluentbit.io

[2023/12/05 16:45:01] [ info] Configuration:
[2023/12/05 16:45:01] [ info]  flush time     | 1.000000 seconds
[2023/12/05 16:45:01] [ info]  grace          | 5 seconds
[2023/12/05 16:45:01] [ info]  daemon         | 0
[2023/12/05 16:45:01] [ info] ___________
[2023/12/05 16:45:01] [ info]  inputs:
[2023/12/05 16:45:01] [ info]      node_exporter_metrics
[2023/12/05 16:45:01] [ info] ___________
[2023/12/05 16:45:01] [ info]  filters:
[2023/12/05 16:45:01] [ info] ___________
[2023/12/05 16:45:01] [ info]  outputs:
[2023/12/05 16:45:01] [ info]      stdout.0
[2023/12/05 16:45:01] [ info] ___________
[2023/12/05 16:45:01] [ info]  collectors:
[2023/12/05 16:45:01] [ info] [fluent bit] version=2.2.1, commit=5626757c8a, pid=12821
[2023/12/05 16:45:01] [debug] [engine] coroutine stack size: 196608 bytes (192.0K)
[2023/12/05 16:45:01] [ info] [storage] ver=1.5.1, type=memory, sync=normal, checksum=off, max_chunks_up=128
[2023/12/05 16:45:01] [ info] [cmetrics] version=0.6.5
[2023/12/05 16:45:01] [ info] [ctraces ] version=0.3.1
[2023/12/05 16:45:01] [ info] [input:node_exporter_metrics:node_exporter_metrics.0] initializing
[2023/12/05 16:45:01] [ info] [input:node_exporter_metrics:node_exporter_metrics.0] storage_strategy='memory' (memory only)
[2023/12/05 16:45:01] [ info] [input:node_exporter_metrics:node_exporter_metrics.0] path.procfs = /proc
[2023/12/05 16:45:01] [ info] [input:node_exporter_metrics:node_exporter_metrics.0] path.sysfs  = /sys
[2023/12/05 16:45:01] [debug] [input:node_exporter_metrics:node_exporter_metrics.0] enabled metrics nvme
[2023/12/05 16:45:01] [debug] [input:node_exporter_metrics:node_exporter_metrics.0] [thread init] initialization OK
[2023/12/05 16:45:01] [ info] [input:node_exporter_metrics:node_exporter_metrics.0] thread instance initialized
[2023/12/05 16:45:01] [debug] [node_exporter_metrics:node_exporter_metrics.0] created event channels: read=30 write=31
[2023/12/05 16:45:01] [debug] [stdout:stdout.0] created event channels: read=35 write=36
[2023/12/05 16:45:01] [ info] [sp] stream processor started
[2023/12/05 16:45:01] [ info] [output:stdout:stdout.0] worker #0 started
[2023/12/05 16:45:06] [debug] [input:node_exporter_metrics:node_exporter_metrics.0] NVMe storage is not mounted
[2023/12/05 16:45:06] [debug] [input chunk] update output instances with new chunk size diff=226, records=0, input=node_exporter_metrics.0
[2023/12/05 16:45:06] [debug] [task] created task=0x7940022650 id=0 OK
[2023/12/05 16:45:06] [debug] [output:stdout:stdout.0] task_id=0 assigned to thread #0
[2023/12/05 16:45:06] [debug] [out flush] cb_destroy coro_id=0
[2023/12/05 16:45:06] [debug] [task] destroy task=0x7940022650 (task_id=0)
^C[2023/12/05 16:45:07] [engine] caught signal (SIGINT)
[2023/12/05 16:45:07] [ warn] [engine] service will shutdown in max 5 seconds
[2023/12/05 16:45:07] [debug] [input:node_exporter_metrics:node_exporter_metrics.0] thread pause instance
[2023/12/05 16:45:07] [ info] [engine] service has stopped (0 pending tasks)
[2023/12/05 16:45:07] [debug] [input:node_exporter_metrics:node_exporter_metrics.0] thread pause instance
[2023/12/05 16:45:07] [ info] [output:stdout:stdout.0] thread worker #0 stopping...
[2023/12/05 16:45:07] [ info] [output:stdout:stdout.0] thread worker #0 stopped
[2023/12/05 16:45:07] [debug] [input:node_exporter_metrics:node_exporter_metrics.0] thread exit instance
  • Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • Run local packaging test showing all targets (including any new ones) build.
  • Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • Documentation required for this feature

Backporting

  • Backport to latest stable release.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

… in the node

Signed-off-by: Hiroshi Hatake <hatake@calyptia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants