Skip to content

Empty tag value causes error on InfluxDB output #2390

Closed
@lpic10

Description

Bug report

When a kubernetes label is empty, a empty tag is created and causes InfluxDB to complain:

unable to parse 'docker_container_cpu,cpu=cpu0,io.kubernetes.pod.namespace=xxxxx,io.kubernetes.container.name=POD,cluster=xxxxx,engine_host=xxxxx,io.kubernetes.container.terminationMessagePath=,container_version=v1.2.0,io.kubernetes.container.hash=4866dc9e,io.kubernetes.pod.name=xxxxx,io.kubernetes.pod.terminationGracePeriod=30,io.kubernetes.pod.uid=b3a1ef4e-ef6e-11e6-b4b8-005056835c46,io.kubernetes.container.restartCount=0,host=xxxxx,container_name=k8s_POD.4866dc9e_xxxxx_xxxxx_b3a1ef4e-ef6e-11e6-b4b8-005056835c46_6d9803e6,container_image=xxxxx usage_total=2122656i,container_id="76f7bc0453ffb0215bf9c776e9890e5e454c1ebaabd315074c646a1d0bb4956b" 1486717284000000000': missing tag value

This issue happens when using docker input and/or prometheus input reading metrics from kubelet.

I'm not sure how this needs to be fixed, possible solutions are:

  1. Fix in the prometheus and docker input plugins checking if label value is empty, but there may be more plugins doing the same
  2. Fix in the influxdb output plugin, but maybe it is a bad idea to allow the same in other outputs
  3. Fix this in the metric/tag object, not allowing empty tags to happen

Additional info:

Telegraf built from master

Metadata

Assignees

No one assigned

    Labels

    bugunexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions