nimwire/observability
This page is generated from the module’s exported API and ## documentation comments.
Optional request observability hooks.
McpSpanHandle
Section titled “McpSpanHandle”Opaque application-owned state returned by a span start hook.
McpSpanHandle = ref object state*: JsonNodeMcpRequestEvent
Section titled “McpRequestEvent”McpRequestEvent = object correlationId*: string requestId*: McpId methodName*: string transport*: McpTransportInfo hasTraceContext*: bool traceContext*: McpTraceContext hasLogLevel*: bool logLevel*: McpLogLevel durationMs*: float requestBytes*: int responseBytes*: int hasResultType*: bool resultType*: McpResultType errorCode*: int cancelled*: bool activeSubscriptions*: intMcpRequestLogHook
Section titled “McpRequestLogHook”McpRequestLogHook = proc (event: McpRequestEvent) {.closure.}McpMetricsHook
Section titled “McpMetricsHook”McpMetricsHook = proc (event: McpRequestEvent) {.closure.}McpSpanStartHook
Section titled “McpSpanStartHook”McpSpanStartHook = proc (event: McpRequestEvent): McpSpanHandle {.closure.}McpSpanEndHook
Section titled “McpSpanEndHook”McpSpanEndHook = proc (span: McpSpanHandle; event: McpRequestEvent) {.closure.}McpObservability
Section titled “McpObservability”All hooks are optional and remain independent of telemetry libraries.
McpObservability = object requestLog*: McpRequestLogHook metrics*: McpMetricsHook spanStart*: McpSpanStartHook spanEnd*: McpSpanEndHookProcedures
Section titled “Procedures”newMcpRequestEvent
Section titled “newMcpRequestEvent”proc newMcpRequestEvent(context: McpContext; methodName = ""; requestId = McpId(kind: mcpNullId)): McpRequestEvent {. raises: [OSError], tags: [], forbids: [].}Returns: McpRequestEvent.
Arguments
Section titled “Arguments”| Name | Type | Default |
|---|---|---|
context |
McpContext |
|
methodName |
inferred |
"" |
requestId |
inferred |
McpId(kind: mcpNullId) |
toJson
Section titled “toJson”proc toJson(event: McpRequestEvent): JsonNode {.raises: [], tags: [], forbids: [].}Returns: JsonNode.
Arguments
Section titled “Arguments”| Name | Type | Default |
|---|---|---|
event |
McpRequestEvent |