WebsockexNova.Telemetry.TelemetryEvents (WebsockexNova v0.1.1)

View Source

Central registry and documentation for all telemetry events emitted by WebsockexNova.

Event Names and Payloads

Connection Events

  • [:websockex_nova, :connection, :open]

    • measurements: %{duration: integer()} (ms, optional)
    • metadata: %{connection_id: term(), host: String.t(), port: integer()}
  • [:websockex_nova, :connection, :close]

    • measurements: %{duration: integer()} (ms, optional)
    • metadata: %{connection_id: term(), host: String.t(), port: integer(), reason: term()}
  • [:websockex_nova, :connection, :websocket_upgrade]

    • measurements: %{duration: integer()} (ms, optional)
    • metadata: %{connection_id: term(), stream_ref: reference(), headers: list()}

Message Events

  • [:websockex_nova, :message, :sent]

    • measurements: %{size: integer(), latency: integer()} (bytes, ms)
    • metadata: %{connection_id: term(), stream_ref: reference(), frame_type: atom()}
  • [:websockex_nova, :message, :received]

    • measurements: %{size: integer(), latency: integer()} (bytes, ms)
    • metadata: %{connection_id: term(), stream_ref: reference(), frame_type: atom()}

Error Events

  • [:websockex_nova, :error, :occurred]
    • measurements: %{}
    • metadata: %{connection_id: term(), stream_ref: reference() | nil, reason: term(), context: map()}

Usage

Use these event names and payloads when emitting or subscribing to telemetry events.

Summary

Functions

Event emitted when an ownership transfer is received from another process.

Event emitted when a subscription restoration fails after reconnection.

Event emitted when a subscription is successfully restored after reconnection.

Functions

connection_close()

connection_open()

connection_websocket_upgrade()

error_occurred()

message_received()

message_sent()

ownership_transfer_received()

@spec ownership_transfer_received() :: [atom()]

Event emitted when an ownership transfer is received from another process.

Measurements

Empty map (timing is not relevant for this event)

Metadata

  • :gun_pid - The Gun process PID
  • :host - Hostname of the connection
  • :port - Port number of the connection
  • :stream_count - Number of active streams transferred

subscription_restoration_failed()

@spec subscription_restoration_failed() :: [atom()]

Event emitted when a subscription restoration fails after reconnection.

Measurements

  • :duration - Time taken before failure in milliseconds

Metadata

  • :connection_id - The connection identifier
  • :subscription_id - The subscription identifier
  • :channel - The channel that failed to subscribe
  • :reason - The failure reason

subscription_restored()

@spec subscription_restored() :: [atom()]

Event emitted when a subscription is successfully restored after reconnection.

Measurements

  • :duration - Time taken to restore the subscription in milliseconds

Metadata

  • :connection_id - The connection identifier
  • :subscription_id - The subscription identifier
  • :channel - The channel being subscribed to