LogflareEx.TelemetryReporter (logflare_ex v0.2.0-dev.1718053351.fca7edd)
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"},
]
endThereafter, 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:
- Module level configuration via
config.exs, such asconfig :logflare_ex, Elixir.LogflareEx.TelemetryReporter, source_token: ... - 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
child_spec(init_arg)
Returns a specification to start this module under a supervisor.
See Supervisor.
handle_attach(event, measurements, metadata, config)
:telemetry.attach/4 callback for allowing attaching to telemetry events.
Telemetry events attached this way are batched to Logflare.