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: fix referencing wrong interval between cpu and cpufreq #8019

Merged
merged 1 commit into from
Oct 17, 2023

Conversation

nokute78
Copy link
Collaborator

@nokute78 nokute78 commented Oct 9, 2023

This patch is to fix referencing wrong intervals.

Following configuration doesn't output metrics.
We expect that fluent-bit output cpu metrics.

[INPUT]
    Name node_exporter_metrics
    Metrics cpu
    collector.cpufreq.scrape_interval 1

[OUTPUT]
    Name stdout
    Match *

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
  • 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.

  • [N/A] 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

  • [N/A] Documentation required for this feature

Backporting

  • [N/A] Backport to latest stable release.

Configuration

[INPUT]
    Name node_exporter_metrics
    Metrics cpu
    collector.cpufreq.scrape_interval 1

[OUTPUT]
    Name stdout
    Match *

Debug/Valgrind output

$ valgrind --leak-check=full bin/fluent-bit -c a.conf 
==39545== Memcheck, a memory error detector
==39545== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==39545== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==39545== Command: bin/fluent-bit -c a.conf
==39545== 
Fluent Bit v2.2.0
* Copyright (C) 2015-2022 The Fluent Bit Authors
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
* https://fluentbit.io

[2023/10/09 09:42:37] [ info] [fluent bit] version=2.2.0, commit=a397936438, pid=39545
[2023/10/09 09:42:37] [ info] [storage] ver=1.2.0, type=memory, sync=normal, checksum=off, max_chunks_up=128
[2023/10/09 09:42:37] [ info] [cmetrics] version=0.6.3
[2023/10/09 09:42:37] [ info] [ctraces ] version=0.3.1
[2023/10/09 09:42:37] [ info] [input:node_exporter_metrics:node_exporter_metrics.0] initializing
[2023/10/09 09:42:37] [ info] [input:node_exporter_metrics:node_exporter_metrics.0] storage_strategy='memory' (memory only)
[2023/10/09 09:42:37] [ info] [input:node_exporter_metrics:node_exporter_metrics.0] path.procfs = /proc
[2023/10/09 09:42:37] [ info] [input:node_exporter_metrics:node_exporter_metrics.0] path.sysfs  = /sys
[2023/10/09 09:42:37] [ info] [input:node_exporter_metrics:node_exporter_metrics.0] thread instance initialized
[2023/10/09 09:42:37] [ info] [output:stdout:stdout.0] worker #0 started
[2023/10/09 09:42:37] [ info] [sp] stream processor started
2023-10-09T00:42:42.447867583Z node_cpu_seconds_total{cpu="0",mode="idle"} = 19827.23
2023-10-09T00:42:42.447867583Z node_cpu_seconds_total{cpu="0",mode="iowait"} = 48.670000000000002
2023-10-09T00:42:42.447867583Z node_cpu_seconds_total{cpu="0",mode="irq"} = 0
2023-10-09T00:42:42.447867583Z node_cpu_seconds_total{cpu="0",mode="nice"} = 14.25
2023-10-09T00:42:42.447867583Z node_cpu_seconds_total{cpu="0",mode="softirq"} = 0.53000000000000003
2023-10-09T00:42:42.447867583Z node_cpu_seconds_total{cpu="0",mode="steal"} = 0
2023-10-09T00:42:42.447867583Z node_cpu_seconds_total{cpu="0",mode="system"} = 745.08000000000004
2023-10-09T00:42:42.447867583Z node_cpu_seconds_total{cpu="0",mode="user"} = 3141.9899999999998
2023-10-09T00:42:42.447867583Z node_cpu_guest_seconds_total{cpu="0",mode="user"} = 0
2023-10-09T00:42:42.447867583Z node_cpu_guest_seconds_total{cpu="0",mode="nice"} = 0
^C[2023/10/09 09:42:44] [engine] caught signal (SIGINT)
[2023/10/09 09:42:44] [ warn] [engine] service will shutdown in max 5 seconds
[2023/10/09 09:42:44] [ info] [engine] service has stopped (0 pending tasks)
[2023/10/09 09:42:44] [ info] [output:stdout:stdout.0] thread worker #0 stopping...
[2023/10/09 09:42:44] [ info] [output:stdout:stdout.0] thread worker #0 stopped
==39545== 
==39545== HEAP SUMMARY:
==39545==     in use at exit: 0 bytes in 0 blocks
==39545==   total heap usage: 2,148 allocs, 2,148 frees, 810,625 bytes allocated
==39545== 
==39545== All heap blocks were freed -- no leaks are possible
==39545== 
==39545== For lists of detected and suppressed errors, rerun with: -s
==39545== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

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.

@nokute78 nokute78 temporarily deployed to pr October 9, 2023 00:44 — with GitHub Actions Inactive
@nokute78 nokute78 temporarily deployed to pr October 9, 2023 00:44 — with GitHub Actions Inactive
@nokute78 nokute78 temporarily deployed to pr October 9, 2023 00:44 — with GitHub Actions Inactive
@nokute78 nokute78 changed the title in_node_exporter_metrics: fix referencing wrong interval in_node_exporter_metrics: fix referencing wrong interval between cpu and cpufreq Oct 9, 2023
@edsiper
Copy link
Member

edsiper commented Oct 9, 2023

assigned to @cosmo0920

@nokute78 nokute78 temporarily deployed to pr October 9, 2023 01:16 — with GitHub Actions Inactive
Copy link
Contributor

@cosmo0920 cosmo0920 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, we made a mistake. Good catch. 👍

@edsiper edsiper added this to the Fluent Bit v2.2.0 milestone Oct 17, 2023
@edsiper edsiper merged commit 3ddf3aa into fluent:master Oct 17, 2023
44 checks passed
leonardo-albertovich pushed a commit that referenced this pull request Nov 3, 2023
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.

3 participants