LogflareEx.TelemetryReporter (logflare_ex v0.2.0-dev.236c1c6b)

A TelemetryReporter for attaching to metrics created from :telemetry_metrics. Telemetry events are sent to the Logflare API as is.

Usage

Add the following to your mix.exs

def deps do
  [
      {:telemetry, "~> 1.0"},
      {:telemetry_metrics, "~> 0.6.1"},
  ]
end

Thereafter, add the LogflareEx.TelemetryReporter to your supervision tree:

  # application.ex
  children = [
    {LogflareEx.TelemetryReporter, metrics: [
      last_value("some.event.stop.duration")
    ]}
  ]
  ...

The LogflareEx.TelemetryReporter will attach to all provided metrics.

Configuration

There are 2 levels of configuration available, and these are listed in priority order:

  1. Module level configuration via config.exs, such as config :logflare_ex, Elixir.LogflareEx.TelemetryReporter, source_token: ...
  2. Application level configuration via config.exs, such asconfig :logflare_ex, source_token: ...

Client options will then be merged together, with each level overriding the previous.

Summary

Functions

Returns a specification to start this module under a supervisor.

:telemetry.attach/4 callback for allowing attaching to telemetry events. Telemetry events attached this way are batched to Logflare.

Functions

Link to this function

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

handle_attach(event, measurements, metadata, config)

@spec handle_attach(list(), map(), map(), nil | list()) :: :ok

:telemetry.attach/4 callback for allowing attaching to telemetry events. Telemetry events attached this way are batched to Logflare.

Link to this function

start_link(opts)