TelemetryMetricsRiemann

CircleCI

Telemetry.Metrics reporter for riemann-compatible metric servers.

To use it, start the reporter with the start_link/1 function, providing it a list of Telemetry.Metrics metric definitions:

import Telemetry.Metrics

TelemetryMetricsRiemann.start_link(
  metrics: [
    counter("http.request.count"),
    sum("http.request.payload_size"),
    last_value("vm.memory.total")
  ],
  client: TelemetryMetricsRiemann.Client.Riemannx
)

or put it under a supervisor:

import Telemetry.Metrics

children = [
  {TelemetryMetricsStatsd, [
    metrics: [
      counter("http.request.count"),
      sum("http.request.payload_size"),
      last_value("vm.memory.total")
    ],
    client: TelemetryMetricsRiemann.Client.Riemannx
  ]}
]

Supervisor.start_link(children, ...)

This reporter formats every metric from telemetry to riemann event and sends using the client. A client means any supported riemann client. Currently the following riemann clients is supported:

You can also configure the prefix for all the published metrics using the :prefix option.

Note that the reporter doesn't aggregate metrics in-process - it sends metric updates to riemann whenever a relevant Telemetry event is emitted.

Installation

If available in Hex, the package can be installed by adding telemetry_metrics_riemann to your list of dependencies in mix.exs:

def deps do
  [
    {:telemetry_metrics_riemann, "~> 0.1.0"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/telemetry_metrics_riemann.

Copyright and License

TelemetryMetricsStatsd is copyright (c) 2019 João Henrique Ferreira de Freitas.

TelemetryMetricsStatsd source code is released under MIT license.

See LICENSE for more information.