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

"time" field from libvirt input plugin never reach influxdb #16443

Open
elacour opened this issue Jan 28, 2025 · 2 comments
Open

"time" field from libvirt input plugin never reach influxdb #16443

elacour opened this issue Jan 28, 2025 · 2 comments
Assignees
Labels
bug unexpected problem or unintended behavior

Comments

@elacour
Copy link

elacour commented Jan 28, 2025

Relevant telegraf.conf

[[inputs.libvirt]]
statistics_groups = ["cpu_total"]

Logs from Telegraf

libvirt_cpu,domain_name=xxxxx,host=yyyyyy system=1595411964000u,time=16924971591000u,user=15329559626000u 1738079263000000000

System info

telegraf 1.33.1-1, debian 12, influxdb 2.7.11-1

Docker

No response

Steps to reproduce

Configure libvirt input plugin to export cpu stats to influxdb

Expected behavior

Cpu "time" is available as a field in influxdb

Actual behavior

Only "system" and "user" fields are available on InfluxDB.

Additional info

Seems related to InfluxDB "bug" influxdata/influxdb#23024 suggesting "time" cannot be used as a field name. Solution may be to use another name such as using metric prefix like "cpu_time" ?

@elacour elacour added the bug unexpected problem or unintended behavior label Jan 28, 2025
@srebhan
Copy link
Member

srebhan commented Jan 30, 2025

@elacour while I agree that naming the field time is unfortunate, renaming it will cause trouble for users of other outputs. So we do have three ways forward:

  1. Keep the current naming and use
[[processors.rename]]
  namepass = ["libvirt_cpu"]
  [[processors.rename.replace]]
    field = "time"
    dest = "cpu_time"
  [[processors.rename.replace]]
    field = "user"
    dest = "cpu_user"
  [[processors.rename.replace]]
    field = "system"
    dest = "cpu_system"
  1. Add a flag to prefix the three CPU fields with cpu_ and make this the default in some future.
  2. Rename the fields and add a big fat warning to the readme (and changelog).

I will discuss this with the team and come back to you next week...

@srebhan srebhan self-assigned this Jan 30, 2025
@elacour
Copy link
Author

elacour commented Jan 30, 2025

I agree that renaming the field can cause trouble. The work around is ok for me, thank you ! I would suggest letting this bug report open to help others with your proposed workaround untile a true rename is included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants