Skip to content

CloudWatch output doesn't send any metrics that has field type uint64 #4218

@wingyplus

Description

@wingyplus

Relevant telegraf.conf:

[global_tags]

[agent]
  interval = "10s"
  round_interval = true
  metric_batch_size = 1000
  metric_buffer_limit = 10000
  collection_jitter = "0s"
  flush_interval = "10s"
  flush_jitter = "0s"
  precision = ""
  debug = true
  quiet = false
  logfile = "/var/log/telegraf/telegraf.log"
  hostname = "myhostname"
  omit_hostname = false

[[inputs.varnish]]
  name_suffix = "_cloudwatch"
  binary = "/usr/bin/varnishstat"
  stats = ["VBE.boot.frontend*.conn"]

[[outputs.cloudwatch]]
  region = "ap-southeast-1"
  namespace = "PWB/Varnish"
  namepass = ["*_cloudwatch"]

System info:

Telegraf version: 1.6.3-1
Operating system name: Debian
Kernel version: 4.9.0-6-amd64

Steps to reproduce:

  1. starting telegraf with this configuration
  2. testing telegraf config that can collect from input correctly
    $ sudo telegraf --config /etc/telegraf/telegraf.conf --test
    > varnish_cloudwatch,host=myhostname,section=VBE boot.frontend.pwb-magento-frontend-dev-6f7679603bb2bdb7.elb.ap-southeast-1.amazonaws.com(10.4.6.xx).conn=14i,boot.frontend.filtered.com(10.4.7.xx).conn=191i 1527833596000000000
    
  3. wait until telegraf wrote metrics to CloudWatch

Expected behavior:

Should see metrics in namespace PWB/Varnish

Actual behavior:

Didn't see any metrics in namespace PWB/Varnish

Additional info:

After try to debug this problem. I found that varnish input try to parse number of field with uint64 (see https://github.com/influxdata/telegraf/blob/master/plugins/inputs/varnish/varnish.go#L144). But at cloudwatch output it doesn't handle type uint64 then become unsupport type (see https://github.com/influxdata/telegraf/blob/master/plugins/outputs/cloudwatch/cloudwatch.go#L173). That why it doesn't send any metrics to CloudWatch.

Currently, I fixed by handle uint64 type and cast it to float64 but I'm not sure it's the right way to do or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/awsAWS plugins including cloudwatch, ecs, kinesisbugunexpected problem or unintended behaviorregressionsomething that used to work, but is now broken

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions