Davy.Telemetry (davy v0.3.0)

Copy Markdown View Source

Telemetry events emitted by Davy.

All events are emitted via :telemetry.span/3, so each operation produces a :start event and either a :stop or :exception event carrying :duration and :monotonic_time measurements in :native time units.

Attach to individual events with :telemetry.attach/4 or to a group of related events with :telemetry.attach_many/4.

Request lifecycle

Emitted once per WebDAV request, after authentication succeeds and before the response is sent.

[:davy, :request, :start] [:davy, :request, :stop] [:davy, :request, :exception]

Metadata

KeyWhereDescription
:connstart, stopPlug.Conn as it entered/left the dispatcher
:methodallHTTP method string, e.g. "PROPFIND"
:pathallPath segments (URI-decoded) list of strings
:statusstopResponse status code set on the conn

Backend callbacks

One event namespace per Davy.Backend callback. <operation> is one of:

:authenticate, :resolve, :get_content, :put_content, :put_content_stream, :delete, :copy, :move, :create_collection, :get_members, :get_properties, :set_properties.

[:davy, :backend, <operation>, :start] [:davy, :backend, <operation>, :stop] [:davy, :backend, <operation>, :exception]

Metadata

KeyEventsDescription
:backendallModule implementing Davy.Backend
:operationallCallback atom
:pathmostResource path segments
:source_path:copy, :moveSource path for copy/move
:dest_path:copy, :moveDestination path for copy/move
:overwrite:copy, :moveWhether the destination may be overwritten
:propertiesproperty operationsList of {namespace, name} tuples
:conn:authenticatePlug.Conn at authentication time
:resultstop:ok | :error | :partial

Lock store callbacks

One event namespace per Davy.LockStore callback. <operation> is one of:

:lock, :unlock, :refresh, :get_locks, :get_locks_covering, :get_descendant_locks, :check_token.

[:davy, :lock_store, <operation>, :start] [:davy, :lock_store, <operation>, :stop] [:davy, :lock_store, <operation>, :exception]

Metadata

KeyEventsDescription
:lock_storeallModule implementing LockStore
:operationallCallback atom
:pathpath-addressed callbacksResource path segments
:tokentoken-addressedLock token
:scope:lock:exclusive | :shared
:depth:lock0 | :infinity
:timeout:lock, :refreshTimeout in seconds
:resultstop:ok | :error | :conflict | :not_found

Example

:telemetry.attach_many(
  "davy-logger",
  [
    [:davy, :request, :stop],
    [:davy, :backend, :put_content, :stop],
    [:davy, :lock_store, :lock, :stop]
  ],
  &MyApp.TelemetryLogger.handle/4,
  nil
)