Skip to content
/ filter Public

Whistlist and rename metrics and chain into another sink

Notifications You must be signed in to change notification settings

statsd/filter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

filter

Statsite filter command, allowing you to whitelist and rename metrics based on a simple JSON configuration file containing regular expression rules. This allows you to send specific metrics to a given service.

Examples

Sample input:

gauges.api-1.memory.percent|80|1421164536386
gauges.api-2.memory.percent|30|1421164536386
gauges.ingestion-2.memory.percent|50|1421164536386
gauges.api-3.memory.percent|50|1421164536386
gauges.cdn-1.memory.percent|50|1421164536386
gauges.cdn-2.memory.percent|50|1421164536386
counts.app.signups|10|1421164536386
gauges.ingestion-1.memory.percent|50|1421164536386

Strip all counts., gauges., and .timers prefixes:

{
  "^(?:counts|gauges|timers)\\.(.*)": "$1"
}

Outputs:

api-1.memory.percent|80|1421164536386
api-2.memory.percent|30|1421164536386
ingestion-2.memory.percent|50|1421164536386
api-3.memory.percent|50|1421164536386
cdn-1.memory.percent|50|1421164536386
cdn-2.memory.percent|50|1421164536386
app.signups|10|1421164536386
ingestion-1.memory.percent|50|1421164536386

Include all counters as-is, but strip gauges. prefix from api metrics:

{
  "^gauges\\.(api-.*)": "$1",
  "^counts\\.": true
}

Outputs:

api-1.memory.percent|80|1421164536386
api-2.memory.percent|30|1421164536386
api-3.memory.percent|50|1421164536386
counts.app.signups|10|1421164536386

Clean up some metric names for services like Stathat which have minimal realestate:

{
  "^gauges\\.(api-.*)\\.(memory|disk)\\.percent": "$1.$2"
}

Outputs:

api-1.memory|80|1421164536386
api-2.memory|30|1421164536386
api-3.memory|50|1421164536386

License

MIT

About

Whistlist and rename metrics and chain into another sink

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published