Skip to content

Interface: FusionTracer

Defined in: packages/core/src/observability/Tracing.ts:158

Minimal tracer interface — structural subtype of OTel's Tracer.

OTel's Tracer.startSpan() accepts (name, options?, context?). Our interface matches the first two parameters, so an OTel Tracer can be assigned to FusionTracer without any adapter.

Context propagation limitation: Since we don't use OTel's Context API (which would require a runtime dependency), auto-instrumented downstream calls (Prisma, HTTP client, Redis) inside tool handlers will NOT appear as children of the MCP span. They will be siblings in the trace. This is an intentional trade-off for zero dependencies.

See

OTel Spec: Tracer

Methods

startSpan()

ts
startSpan(name, options?): FusionSpan;

Defined in: packages/core/src/observability/Tracing.ts:166

Create and start a new span.

Parameters

ParameterTypeDescription
namestringSpan name (e.g. 'mcp.tool.projects')
options?{ attributes?: Record<string, FusionAttributeValue>; }Optional span creation options
options.attributes?Record<string, FusionAttributeValue>-

Returns

FusionSpan

A started span that MUST be ended via span.end()