0.1.2 • Published 8 years ago

atsd-statsd-backend v0.1.2

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
8 years ago

ATSD StatsD Backend

Overview

ATSD backend for StatsD enables you to forward metrics collected by StatsD daemon into Axibase Time-Series Database for retention, analytics, visualization, and alerting.

To learn how to use StatsD and its backends visit the project's GitHub page.

This backend can be installed using npm:

$ sudo npm install atsd-statsd-backend

Configuration

Configuration file example:

{
    atsd : {
        host: "atsd_server",
        port: 8081,
        protocol: "tcp",
        patterns: [
            {
                pattern: /^([^.]+\.){2}com\..+/,
                atsd_pattern: "<entity>.<>.<>.<metrics>"
            },
            {
                pattern: /.*/,
                atsd_pattern: "<entity>.<metrics>"
            }
        ]
    },
    port: 8125,
    backends: [ "./node_modules/atsd-statsd-backend/lib/atsd" ],
    debug: true
}

Possible variables:

variabledescriptiondefault value
debugenable debug logging : true or falsefalse
keyNameSanitizesanitizing metric names (remove forbidden characters): true or falsetrue
flush_countsprocessing flush counts: true or falsetrue
atsdcontainer for all backend-specific options-
atsd.hostATSD hostname-
atsd.portATSD port8081
atsd.userusername""
atsd.passwordpassword to log into ATSD""
atsd.protocolprotocol: "tcp" or "udp""tcp"
atsd.entitydefault entitylocal hostname
atsd.prefixglobal prefix for each metric""
atsd.prefixCounterprefix for counter metrics"counters"
atsd.prefixTimerprefix for timer metrics"timers"
atsd.prefixGaugeprefix for gauge metrics"gauges"
atsd.prefixSetprefix for set metrics"sets"
atsd.patternspatterns to parse statsd metric names-
atsd.commandsPerBatchmaximum number of series commands to be sent in one batch100

Other variables used by StatsD can be specified.

StatsD has an open bug regarding the inability for configuration to sometimes reload during operation. Changing the configuration file while StatsD is running, may result in StatsD crashing. Until the bug is fixed, add automaticConfigReload: false to your configuration, restart StatsD for the changed configuration to take effect.

Patterns

Patterns enable the conversion of native StatsD metric names into ATSD entity/metric/tags.

If a metric name matches regexp pattern, it will be parsed according to atsd_pattern.

If a metric name has more tokens than atsd_pattern, extra tokens are cropped.

alfa.bravo.charlie.delta is used as an example metric and the default example entity is zulu.

tokendescriptionatsd-patternresult
<metric>metric token; multiple occurrences are combined<metric>.<metric>.<metric>series e:zulu m:alfa.bravo.charlie ...
<entity>entity token to replace the default entity; multiple occurrences are combined<entity>.<metric>.<entity>.<metric>series e:alfa.charlie m:bravo.delta ...
<tag:tag_name>token for the tag named tag_name<entity>.<tag:test>.<metric>.<metric>series e:alfa m:charlie.delta t:test=bravo ...
<>token to be excluded<entity>.<tag:test>.<>.<metric>series e:alfa m:delta t:test=bravo ...
<metrics>any number of metric tokens; can be used once per pattern; can also be omitted: <entity>..<tag:url><entity>.<tag:test>.<metrics>series e:alfa m:charlie.delta t:test=bravo ...