Skip to content

Latest commit

 

History

History
36 lines (29 loc) · 1.05 KB

README.md

File metadata and controls

36 lines (29 loc) · 1.05 KB

Logs to Datadog Metrics Build Status

Parse process logs for patterns and send metrics to Datadog

Lots of programs generate logs but do not generate metrics. This is a simple program that reads from stdin, matches a pattern of your choice, and sends metrics to Datadog.

Installation

via curl:

curl -sfL <PICK URL FROM RELEASES PAGE> | \
tar -zx && \
chmod +x logs_to_datadog_metrics

via go:

go get github.com/eatwithforks/logs_to_datadog_metrics

Setup

Create a config yaml file with specified patterns.

patterns:
- pattern: 'this is bad'
  metric: 'foo.bad'
  tags: ['foo:bar']

To use:

execute <your-program-here> | STATSD_HOST="localhost" STATSD_PORT=8125 logs_to_datadog_metrics -config_path /path/to/config/file"

Note: if important stuff comes out on stderr, you need to add 2>&1 before the pipe.

Todo:

  1. Add a way to make pattern matches appear in tags.