AttestoMCP.Server.Telemetry (attesto_mcp_server v0.14.0)

Copy Markdown View Source

Telemetry helpers for protocol, auth, handler, and transport events.

The [:attesto_mcp_server, :auth, :policy_failure] event reports an invalid revocation result, a caught host-policy callback failure, or an HTTP verifier failure without including the callback reason, token claims, or principal.

The [:attesto_mcp_server, :session_store, :failure] event reports a session-store operation that failed or a corrupt persisted row discarded by the bundled Ecto adapter. Its failure-specific metadata contains only the bounded operation atom in :source and a neutral :unavailable or :corrupt_discarded outcome.

Summary

Functions

Emits a safe event after removing credential and private payload fields.

Invokes an explicitly trusted host exception reporter without changing request behavior.

Emits start/stop (or exception) events around a callback.

Validates bounded host metadata that may be attached to every server event.

Functions

execute(event, measurements \\ %{}, metadata \\ %{})

@spec execute(atom() | [atom()], map(), map()) :: :ok

Emits a safe event after removing credential and private payload fields.

report_exception(reporter, source, kind, reason, stacktrace, metadata)

@spec report_exception(term(), atom() | nil, atom(), term(), list(), map()) :: :ok

Invokes an explicitly trusted host exception reporter without changing request behavior.

span(event, metadata, fun, opts \\ [])

@spec span(atom() | [atom()], map(), (-> {term(), map()}), keyword()) :: term()

Emits start/stop (or exception) events around a callback.

validate_trusted_metadata!(metadata)

@spec validate_trusted_metadata!(map() | nil) :: :ok

Validates bounded host metadata that may be attached to every server event.