Fast, buffered, hierarchical stats collection in Java. Go here for the Go client.
Tally provides a common interface for emitting metrics, while letting you not worry about the velocity of metrics emission.
By default it buffers counters, gauges and histograms at a specified interval but does not buffer timer values. This is primarily so timer values can have all their values sampled if desired and if not they can be sampled as summaries or histograms independently by a reporter.
- Scope: Keeps track of metrics, and their common metadata.
- Metrics: Counters, Gauges, Timers and Histograms.
- Reporter: Implemented by you. Accepts aggregated values from the scope. Forwards the aggregated values to your metrics ingestion pipeline.
// Implement as you will
StatsReporter reporter = new MyStatsReporter();
Map<String, String> tags = new HashMap<>(2, 1);
tags.put("dc", "east-1");
tags.put("type", "master");
Scope scope = new RootScopeBuilder()
.reporter(reporter)
.tags(tags)
.reportEvery(Duration.ofSeconds(1))
Counter reqCounter = scope.counter("requests");
reqCounter.inc(1);
Gauge queueGauge = scope.gauge("queue_length");
queueGauge.update(42);
Use one of the inbuilt reporters or implement your own using the StatsReporter
interface.
Run the example by running:
$ ./gradlew run
This runs the PrintStatsReporterExample
class in the tally-example
project.
All artifacts are published under the group com.uber.m3
.
tally-m3
: The tally M3 reportertally-statsd
: The tally StatsD reportertally-core
: tally core functionality that includes interfaces and utilities to report metrics to M3tally-example
: Example usages with different reporterstally-prometheus
: The tally Prometheus reporter (experimental; see prometheus/README.md)
We follow semantic versioning outlined here. In summary, given a version of MAJOR.MINOR.PATCH (e.g. 1.2.0):
- MAJOR version changes are breaking changes to the public API
- MINOR version changes are backwards-compatible changes that include new functionality
- PATCH version changes are backwards-compatible bug fixes
Released under the MIT License.