Skip to content

Instantly share code, notes, and snippets.

@takus
Created June 1, 2016 04:25
Show Gist options
  • Save takus/1658aaa853f8d0d3d5c4ca1b5ba3ed20 to your computer and use it in GitHub Desktop.
Save takus/1658aaa853f8d0d3d5c4ca1b5ba3ed20 to your computer and use it in GitHub Desktop.
Configuration for monitoring Fluentd by Datadog
<match smartnews.user_activity>
type copy
<store>
type flowcounter
count_keys *
unit second
aggregate all
tag fluentd.flowcounter.smartnews.user_activity
@label @dogstatsd
</store>
<store>
type s3
...
flush_at_shutdown true
</store>
<store>
type kinesis_streams
...
flush_at_shutdown true
</store>
</match>
<label @dogstatsd>
<match fluentd.flowcounter.**>
type copy
<store>
type record_reformer
renew_record
auto_typecast
tag dogstatsd.count
<record>
key "fluentd.flowcounter.bytes"
value ${bytes}
type "count"
fluentd_source ${tag_suffix[2]}
</record>
</store>
<store>
type record_reformer
renew_record
auto_typecast
tag dogstatsd.count
<record>
key "fluentd.flowcounter.count"
value ${count}
type "count"
fluentd_source ${tag_suffix[2]}
</record>
</store>
</match>
<match dogstatsd.**>
type dogstatsd
flat_tag true
</match>
</label>
@tehranian
Copy link

Nice! We came up with a solution very similar to this around the same time you did.

I wish this gist was available back in April... It would have saved me a lot of time! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment