ExZarr.Telemetry (ExZarr v1.1.0)

View Source

Telemetry instrumentation for ExZarr operations.

ExZarr emits :telemetry events for chunk I/O, streaming, and storage operations. Attach handlers to monitor throughput, latency, and errors in production.

Chunk read and write use :telemetry.span/3, which emits :start, :stop, and :exception suffixed events. Attach to the :stop events for duration measurements.

Events

EventMeasurementsMetadata
[:ex_zarr, :chunk, :read, :stop]%{duration: native_time}%{array: ref, chunk_index: tuple}
[:ex_zarr, :chunk, :write, :stop]%{duration: native_time, bytes: integer}%{array: ref, chunk_index: tuple}
[:ex_zarr, :stream, :start]%{}%{array: ref, type: atom, opts: keyword}
[:ex_zarr, :stream, :stop]%{duration: native_time, count: integer}%{array: ref, type: atom}

Examples

:telemetry.attach(
  "ex-zarr-chunk-reads",
  [:ex_zarr, :chunk, :read, :stop],
  fn _event, measurements, metadata, _config ->
    IO.inspect({measurements.duration, metadata.chunk_index})
  end,
  nil
)

array
|> ExZarr.Array.stream_chunks()
|> Enum.to_list()

Summary

Functions

Returns telemetry event names for attaching handlers.

Functions

events()

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

Returns telemetry event names for attaching handlers.

Chunk events include :start, :stop, and :exception variants from :telemetry.span/3. Stream events are single :execute calls.