Telemetry instrumentation for Aurinko.
Events emitted
| Event | Measurements | Metadata |
|---|---|---|
[:aurinko, :request, :start] | system_time | method, path |
[:aurinko, :request, :stop] | duration | method, path, result, cached |
[:aurinko, :request, :retry] | count | method, path, reason |
[:aurinko, :circuit_breaker, :opened] | count | circuit, reason |
[:aurinko, :circuit_breaker, :closed] | count | circuit |
[:aurinko, :circuit_breaker, :rejected] | count | circuit |
[:aurinko, :sync, :complete] | updated, deleted, duration_ms | resource |
Attach default structured logger
Aurinko.Telemetry.attach_default_logger(:info)TelemetryMetrics definitions for reporters
def metrics do
Aurinko.Telemetry.metrics()
end
Summary
Functions
Attach a structured logger for all Aurinko telemetry events.
Returns a specification to start this module under a supervisor.
Detach the default logger.
All telemetry event names emitted by Aurinko.
Telemetry.Metrics definitions for reporters (Prometheus, StatsD, etc.).
Functions
@spec attach_default_logger(Logger.level()) :: :ok | {:error, :already_exists}
Attach a structured logger for all Aurinko telemetry events.
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec detach_default_logger() :: :ok | {:error, :not_found}
Detach the default logger.
@spec events() :: [
[
:aurinko
| :circuit_breaker
| :closed
| :complete
| :opened
| :rejected
| :request
| :retry
| :start
| :stop
| :sync,
...
],
...
]
All telemetry event names emitted by Aurinko.
@spec metrics() :: [Telemetry.Metrics.t()]
Telemetry.Metrics definitions for reporters (Prometheus, StatsD, etc.).
Add to your Phoenix Telemetry module:
def metrics do
[...your_metrics..., Aurinko.Telemetry.metrics()]
|> List.flatten()
end