# `Julep.Telemetry`
[🔗](https://github.com/RiverFinancial/julep/blob/v0.1.0-rc.1/lib/julep/telemetry.ex#L1)

Telemetry events emitted by Julep clients.

Every event's metadata includes `:module`, the client module, and `:url`, the
URL the client connects to without its query, since a query can carry a
signature. No event carries a frame's payload.

Durations are in native time units; convert them with
`System.convert_time_unit/3`.

## Connection attempts

  * `[:julep, :connect, :start]` - a connection attempt begins.
    * Measurements: `:system_time`.
    * Metadata: `:attempt`, the attempt number since the last successful
      connection, starting at 1.

  * `[:julep, :connect, :stop]` - the attempt ends.
    * Measurements: `:duration`.
    * Metadata: `:attempt`, and `:result`, which is `:ok` or
      `{:error, reason}` with a `t:Julep.disconnect_reason/0`.

## Disconnects

  * `[:julep, :disconnect]` - an established connection ends.
    * Measurements: `:duration`, how long it was connected.
    * Metadata: `:reason`, a `t:Julep.disconnect_reason/0`, and `:action`,
      which is `{:reconnect, delay}` or `:stop`.

## Frames

  * `[:julep, :frame, :received]` and `[:julep, :frame, :sent]` - a frame
    arrives or is written, control frames included.
    * Measurements: `:size`, the payload's length in bytes.
    * Metadata: `:type`, such as `:text`, `:binary`, `:ping` or `:close`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
