Skip to content

turn/metrics-opentsdb

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Metrics OpenTSDB Build Status Coverage Status

A Coda Hale Metrics Reporter.

OpenTsdbReporter allows your application to constantly stream metric values to an opentsdb server via the 2.0 HTTP API or the Telnet API.

This reporter also supports per-metric tags in addition to a global set of tags.

Example Usage

dropwizard 0.7.x app:

@Override
public void run(T configuration, Environment environment) throws Exception {
...
  OpenTsdbReporter.forRegistry(environment.metrics())
      .prefixedWith("app_name")
      .withTags(ImmutableMap.of("other", "tags"))
      .build(OpenTsdb.forService("http://opentsdb/")
      .create())
      .start(30L, TimeUnit.SECONDS);

The Telnet API is identical to the above, except with

OpenTsdbTelnet.forService("mycollector.example.com", 4243)

For per-metric tags, encode the tags into the metric name using

Map<String, String> myCounterTags;
String name = OpenTsdbMetric.encodeTagsInName('mycounter', myCounterTags);

Packages

No packages published

Languages

  • Java 100.0%