morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::observe::TraceSink Struct Reference

Host-supplied hooks bracketing one dispatch, for distributed tracing. More...

#include <observability.hpp>

Public Attributes

std::function< SpanId(std::string_view requestId, std::string_view modelType, std::string_view actionType)> beginSpan
 Called when an execute begins dispatch (on the model strand).
std::function< void(SpanId spanId, bool ok)> endSpan
 Called when the dispatch resolves. ok is true for a successful (ok/resolved-value) outcome, false for an error.

Detailed Description

Host-supplied hooks bracketing one dispatch, for distributed tracing.

Both members must be set for the sink to take effect (see setTraceSink) — a sink with only one of the two is treated as not installed.

Definition at line 67 of file observability.hpp.

Member Data Documentation

◆ beginSpan

std::function<SpanId(std::string_view requestId, std::string_view modelType, std::string_view actionType)> morph::observe::TraceSink::beginSpan

Called when an execute begins dispatch (on the model strand).

requestId is Context::requestId (session.hpp), the caller's correlation id (empty if unset). Returns a SpanId the framework passes back to endSpan.

Definition at line 74 of file observability.hpp.

◆ endSpan

std::function<void(SpanId spanId, bool ok)> morph::observe::TraceSink::endSpan

Called when the dispatch resolves. ok is true for a successful (ok/resolved-value) outcome, false for an error.

Definition at line 77 of file observability.hpp.


The documentation for this struct was generated from the following file: