View Source OneAndDone.Telemetry (One and Done v0.1.5)
Telemetry integration to track how long it takes to process a request.
OneAndDone emits the following metrics:
Metric | Description | Measurements | Metadata |
---|---|---|---|
[:one_and_done, :request, :start] | When we begin processing a request. | conn , opts | |
[:one_and_done, :request, :stop] | When we finish processing a request, including the duration in native units. | duration | conn , opts |
[:one_and_done, :request, :exception] | When we finish processing a request, if an exception was raised. Includes the duration in native units. | duration , exception | conn , opts |
[:one_and_done, :request, :cache_hit] | Given an idempotency key, we found a cached response. | idempotency_key | conn , response |
[:one_and_done, :request, :cache_miss] | Given an idempotency key, we didn't find a cached response. | idempotency_key | conn |
[:one_and_done, :request, :idempotency_key_not_set] | The request doesn't have an idempotency key and will not be processed further by OneAndDone. | conn | |
[:one_and_done, :request, :idempotency_key_too_long] | The idempotency key is too long. A 400 error was returned to the client. | key_length , key_length_limit | conn |
[:one_and_done, :request, :cache_get, :start] | When we begin checking the cache for a request. | conn , idempotency_key | |
[:one_and_done, :request, :cache_get, :stop] | When we finish checking the cache for a request, including the duration in native units. | duration | conn , idempotency_key |
[:one_and_done, :request, :cache_get, :exception] | When we finish checking the cache for a request, if an exception was raised. Includes the duration in native units. | duration , exception | conn , idempotency_key |
[:one_and_done, :request, :cache_put, :start] | When we begin serializing and putting a response into the cache. | conn , idempotency_key | |
[:one_and_done, :request, :cache_put, :stop] | When we finish serializing and putting a response into the cache, including the duration in native units. | duration | conn , idempotency_key |
[:one_and_done, :request, :cache_put, :exception] | When we finish serializing and putting a response into the cache, if an exception was raised. Includes the duration in native units. | duration , exception | conn , idempotency_key |
The duration is emitted in native units. To convert to milliseconds, use System.convert_time_unit(duration, :native, :millisecond)
.
Link to this section Summary
Functions
Emit a telemetry event.
Return the list of events emitted by this module.
Measure the duration of a function call.
Link to this section Functions
Emit a telemetry event.
@spec events() :: list()
Return the list of events emitted by this module.
Measure the duration of a function call.