Skip to content

Latest commit

 

History

History
35 lines (24 loc) · 1.44 KB

README.md

File metadata and controls

35 lines (24 loc) · 1.44 KB

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);