8000 Handle NaN values by replacing with 0 (zero) to allow publishing to CloudWatch · Issue #78 · awslabs/collectd-cloudwatch · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Handle NaN values by replacing with 0 (zero) to allow publishing to CloudWatch #78
Open
@seans11

Description

@seans11

I am attempting to use the Collectd Tail Plugin for tracking my Postfix log file. I would like to publish Postfix frequency metrics to CloudWatch using the DSType:CountInc/Type:frequency (value:gauge:0:U) settings. I am using the csv plugin to view the output and it appears that Collectd is recording "nan" for the intervals where no metrics are received from the Postfix log file. With CloudWatch you are unable to publish "nan" values. Is there a method or setting I am missing that would allow me to substitute "nan" with "0" in publishing to CloudWatch? During the intervals where nan results occur, CloudWatch metrics do not get recorded resulting in a broken chart.

Plugin tail configuration:

<Plugin "tail">
<File "/var/log/maillog">
    Instance "postfix"
    Interval 60
    #Since 5.8, Collectd supports new options:
    #Plugin "postfix"
    #Instance "main"

    # number of connections
    # (incoming)
    <Match>
      Regex "\\<postfix\\/smtpd\\[[0-9]+\\]: connect from\\>"
      DSType "GaugeInc"
      Type "frequency"
      Instance "connection-in-open"
    </Match>
    <Match>
      Regex "\\<postfix\\/smtpd\\[[0-9]+\\]: disconnect from\\>"
      DSType "GaugeInc"
      Type "frequency"
      Instance "connection-in-close"
    </Match>
</File>
</Plugin>

Output sample of csv plugin for one of the Postfix metrics:

1547744157.415,nan
1547744217.415,nan
1547744277.415,nan
1547744337.415,nan
1547744397.415,nan
1547744457.415,1.000000
1547744517.415,nan
1547744577.415,nan
1547744637.415,nan
1547744697.415,nan
1547744757.415,nan
1547744817.415,nan

Output of what I would like to see:

1547744277.415,0
1547744337.415,0
1547744397.415,0
1547744457.415,1.000000
1547744517.415,0
1547744577.415,0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0