Skip to content

mnadel/metrics.net.influxdb

Repository files navigation

Travis CI AppVeyor
Travis CI Status AppVeyor Status

Download

Available on NuGet.org as Metrics.NET.InfluxDB.

Changelog

This version has significant (i.e. breaking) changes from the previous version. Most derived metrics (min, max, mean, percentiles, etc.) are no longer being exported. InfluxDB recommended using, instead, continuous queries on the backend to calculate these values.

Usage

Nearly identical to the usage shown in the Metrics.NET Wiki, but using WithInflux instead of WithInfluxDb:

Metric.Config.WithReporting(report => 
    report.WithInflux("192.168.1.8", 8086, "admin", "admin", "metrics", TimeSpan.FromSeconds(5))

Additional Configs

Additional configurations are available via Metrics.NET.InfluxDB.ConfigOptions. Most are passed-through to InfluxDB.

One noteworthy configuration affects the behavior of this Reporter: BreakerRate.

BreakerRate

This configures a circuit breaker that protects your InfluxDB endpoint. This configuration specifies the number of allowed errors, and a "cool-down" period where no additional requests will be made to the InfluxDB endpoint.

The rate is expressed as: # of events / timeframe where # of events is an integer, and timeframe is a string that can be parsed by TimeSpan.Parse().

So, for example, 2 / 00:00:15 would trip the circuit if two errors occur, and then will wait fifteen seconds before allowing additional requests to InfluxDB.

MetricNameConverter

This is a transformer that accepts a metric name as reported by Metrics.NET and returns the name that will be reported to InfluxDB.

The default is ConfigOptions.IdentityConverter which returns the name as-is.

Also included is ConfigOptions.CompactConverter which replaces runs of non-alpha characters with a period.

Example:

[mono-sgen - Metrics.NET] influxdb.success.meter -> mono.sgen.metrics.net.influxdb.success.meter

License

This library will always keep the same license as Metrics.NET (as long as its an open source, permisive license). This port is inspired by and contains some code from Metrics.NET.

This library (Metrics.NET.InfluxDB) is release under Apache 2.0 License (see LICENSE).

Copyright (c) 2016 Michael Nadel

About

An InfluxDB 0.9+ Reporter for Metrics.NET

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages