Telemetry event catalog and instrumentation helpers for Mnemosyne.
All events are prefixed with [:mnemosyne] and follow the
[:mnemosyne, resource, action, :start | :stop | :exception] convention.
Events
LLM Adapter
[:mnemosyne, :llm, :chat, :start | :stop | :exception][:mnemosyne, :llm, :chat_structured, :start | :stop | :exception]
Embedding Adapter
[:mnemosyne, :embedding, :embed, :start | :stop | :exception][:mnemosyne, :embedding, :embed_batch, :start | :stop | :exception]
Pipeline
[:mnemosyne, :episode, :append, :start | :stop | :exception][:mnemosyne, :structuring, :extract, :start | :stop | :exception][:mnemosyne, :structuring, :extract_trajectory, :start | :stop | :exception][:mnemosyne, :retrieval, :retrieve, :start | :stop | :exception][:mnemosyne, :retrieval, :hop_refinement, :start | :stop | :exception][:mnemosyne, :reasoning, :reason, :start | :stop | :exception]
Maintenance
[:mnemosyne, :decay, :prune, :start | :stop | :exception][:mnemosyne, :consolidator, :consolidate, :start | :stop | :exception][:mnemosyne, :intent_merger, :merge, :start | :stop | :exception]
Session
[:mnemosyne, :session, :transition, :start | :stop | :exception][:mnemosyne, :session, :op_enqueue]— point event on enqueue- Metadata:
op,queue_depth,projected_state,session_id,repo_id
- Metadata:
[:mnemosyne, :session, :op_drain, :start | :stop | :exception]— span around drain- Start metadata:
queue_depth,session_id,repo_id - Stop measurements:
ops_executed,ops_failed
- Start metadata:
Repository Lifecycle
[:mnemosyne, :repo, :open, :start | :stop | :exception][:mnemosyne, :repo, :close, :start | :stop | :exception]
Queue
[:mnemosyne, :memory_store, :queue]— emitted on every queue state change- Measurements:
write_queue_size,write_active,maintenance_active,pending_recalls - Metadata:
repo_id,event(:enqueue,:dispatch,:maintenance_start,:maintenance_complete)
- Measurements:
Storage / Graph
[:mnemosyne, :graph, :apply_changeset, :start | :stop | :exception][:mnemosyne, :storage, :persist, :start | :stop | :exception][:mnemosyne, :storage, :load, :start | :stop | :exception]
Summary
Functions
@spec events() :: [[atom()]]
Returns all event prefixes emitted by Mnemosyne.
Wraps a function in a telemetry span.
The suffix is appended to [:mnemosyne] to form the event prefix.
The fun must return {result, extra_measurements} where
extra_measurements is a map merged into the :stop event.