Split.Telemetry (split v0.2.0-rc.0)
Telemetry events for the Split SDK.
The following events are emitted by the Split SDK:
RPC Start
[:split, :rpc, :start]
- Emitted when an RPC call is started.
Measurements
monotonic_time
- The time when the event was emitted.
Metadata
rpc_call
- The RPC call name.
RPC Stop
[:split, :rpc, :stop]
- Emitted when an RPC call ends.
Measurements
monotonic_time
- The time when the event was emitted.:duration
- Time taken from the RPC start event.
Metadata
rpc_call
- The RPC call name.response
- The response from the RPC call.error
- The error message if the RPC call fails.
RPC Fallback
[:split, :rpc, :fallback]
- Emitted when an RPC call falls back to the fallback mechanism.
Measurements
monotonic_time
- The time when the event was emitted.
Metadata
* `rpc_call` - The RPC call name.
* `response` - The generated callback response from the RPC call.
Queue Start
[:split, :queue, :start]
- Executed before checking out a socket connection from the pool.
Measurements
monotonic_time
- The time when the event was emitted.
Metadata
message
- The message being sent to the Splitd daemon.pool_name
- The name of the pool being used.
Queue Stop
[:split, :queue, :stop]
- Executed after checking out a socket connection from the pool.
Measurements
monotonic_time
- The time when the event was emitted.:duration
- The time taken to check out a pool connection.
Metadata
message
- The message being sent to the Splitd daemon.pool_name
- The name of the pool being used.error
- The error message if the RPC call fails.
Queue Exception
[:split, :queue, :exception]
- Executed when an exception occurs while checking out a socket connection from the pool.
Measurements
monotonic_time
- The time when the event was emitted.:duration
- The time taken since queue start event before raising an exception.
Metadata
message
- The message being sent to the Splitd daemon.pool_name
- The name of the pool being used.kind
- The exception type.reason
- The exception reason.stacktrace
- The exception stacktrace.
Connect Start
[:split, :connect, :start]
- Emitted when a connection to the Splitd daemon is established.
Measurements
monotonic_time
- The time when the event was emitted.
Metadata
socket_path
- The path to the socket file.pool_name
- The name of the pool being used.
Connect Stop
[:split, :connect, :stop]
- Emitted when a connection to the Splitd daemon is established.
Measurements
monotonic_time
- The time when the event was emitted.:duration
- The time taken to establish a connection.
Metadata
socket_path
- The path to the socket file.pool_name
- The name of the pool being used.error
- The error message if the connection fails.
Send Start
[:split, :send, :start]
- Emitted before message is sent to the connected Splitd socket.
Measurements
monotonic_time
- The time when the event was emitted.
Metadata
request
- The message being sent to the Splitd daemon.
Send Stop
[:split, :send, :stop]
- Emitted when a message is sent to the connected Splitd socket.
Measurements
monotonic_time
- The time when the event was emitted.:duration
- The time taken to send a message.
Metadata
request
- The message being sent to the Splitd daemon.error
- The error message if the message fails to send.
Receive Start
[:split, :receive, :start]
- Emitted before receiving a message from the connected Splitd socket.
Measurements
monotonic_time
- The time when the event was emitted.
Metadata
request
- The message being received from the Splitd daemon.
Receive Stop
[:split, :receive, :stop]
- Emitted when a message is received from the connected Splitd socket.
Measurements
monotonic_time
- The time when the event was emitted.:duration
- The time taken to receive a message.
Metadata
request
- The message being received from the Splitd daemon.response
- The response received from the Splitd daemon.error
- The error message if the message fails to receive.
Impression
[:split, :impression]
- Emitted when a treatment is assigned to a user. This is equivalent to an impression in the Split system.
measurements:
impression
- A%Split.Impression{}
struct containing the following fields:key
- The user key.feature
- The feature name.treatment
- The treatment assigned to the user.label
- The label assigned to the treatment.change_number
- The change number of the treatment.timestamp
- The timestamp of the treatment assignment.
Summary
Functions
Emits a telemetry exception
event.
Emits a telemetry impression
event when a Split treatment has been evaluated.
Wraps a function in a telemetry span.
Emits a one-off telemetry event.
Emits a start
telemetry span.
Emits a telemetry stop
event.
Types
@opaque t()
Functions
exception(start_event, kind, reason, stacktrace)
@spec exception( t(), atom(), term(), Exception.stacktrace() ) :: :ok
Emits a telemetry exception
event.
monotonic_time()
@spec monotonic_time() :: integer()
send_impression(impression)
@spec send_impression(Split.Impression.t()) :: :ok
Emits a telemetry impression
event when a Split treatment has been evaluated.
span(span_name, metadata, function)
@spec span(atom(), :telemetry.event_metadata(), :telemetry.span_function()) :: :telemetry.span_result()
Wraps a function in a telemetry span.
span_event(span_name, telemetry_span_context, metadata \\ %{}, measurements \\ %{})
@spec span_event( [atom(), ...], reference(), :telemetry.event_measurements(), :telemetry.event_metadata() ) :: :ok
Emits a one-off telemetry event.
start(span_name, metadata \\ %{}, extra_measurements \\ %{})
@spec start(atom(), :telemetry.event_metadata(), :telemetry.event_measurements()) :: t()
Emits a start
telemetry span.
stop(start_event, metadata \\ %{}, extra_measurements \\ %{})
@spec stop(t(), :telemetry.event_metadata(), :telemetry.event_measurements()) :: :ok
Emits a telemetry stop
event.