Telemetry helpers and event conventions for Sftpd.
Sftpd depends on the lightweight :telemetry library and emits events
through the shared Erlang/Elixir instrumentation interface.
See the Telemetry extra in HexDocs for the full event reference, payload
details, examples, and caveats.
The library emits these events:
[:sftpd, :server, :start][:sftpd, :server, :stop][:sftpd, :sftp, operation]for:close,:del_dir,:delete,:get_cwd,:is_dir,:list_dir,:make_dir,:make_symlink,:open,:position,:read,:read_file_info,:read_link,:read_link_info,:rename,:write, and:write_file_info
Every event includes a :duration measurement in native time units.
Read and write events also include a :bytes measurement.
Common metadata:
- SFTP operation events include
:backend,:backend_kind,:result, and:reasonwhen an error reason exists :openalso includes:path,:requested_modes,:mode, and:open_timeout:closealso includes:io_device,:close_timeout, and:close_shutdown_grace:readalso includes:io_deviceand:bytes_requested:writealso includes:io_device- path-oriented operations include
:path :renameincludes:src_pathand:dst_path:positionincludes:io_deviceand:offset:is_diruses:directoryand:not_directoryresult values- server lifecycle events include
:backend,:backend_kind, and:result, plus:port/:max_sessionson start and:server_refon successful start or stop
Summary
Functions
Execute an event with measurements and metadata.
Measure a function call, emit a telemetry event, and return the original result.
Types
Functions
@spec execute(event_name(), measurements(), metadata()) :: :ok
Execute an event with measurements and metadata.
@spec span(event_name(), metadata(), (-> term()), finalize_fun()) :: term()
Measure a function call, emit a telemetry event, and return the original result.