Use when you want to add tracing, structured logging, or monitoring to your FrontMCP server. Covers OpenTelemetry instrumentation, vendor integrations (Coralogix, Datadog, Logz.io, Grafana), this.telemetry API for custom spans, structured JSON logging with sinks, and testing observability. Triggers: observability, telemetry, tracing, logging, monitoring, opentelemetry, otel, spans, datadog, coralogix, logz, grafana, winston, pino.
Router for adding observability to FrontMCP servers. Covers distributed tracing (OpenTelemetry), structured JSON logging, per-request log collection, the this.telemetry developer API, and vendor integrations.
this.telemetry to create custom spans in tools, plugins, or agentsfrontmcp-production-readiness)frontmcp-config)frontmcp-setup)Decision: Use this skill when you need to observe, trace, or log your server. Start with
tracing-setupfor auto-instrumentation, addstructured-loggingfor production logs, and usetelemetry-apifor custom spans in your code.
frontmcp-setup)npm install @frontmcp/observability| I want to... | Reference |
|---|---|
| Enable auto-tracing for all flows | references/tracing-setup.md |
| Add structured JSON logging with trace correlation | references/structured-logging.md |
| Create custom spans in tools/plugins | references/telemetry-api.md |
| Connect Coralogix, Datadog, Logz.io, Grafana | references/vendor-integrations.md |
| Test that spans and logs are correct | references/testing-observability.md |
The simplest way — one config line:
@FrontMcp({
observability: true,
})
This enables auto-tracing for all 33 SDK flows. Add structured logging:
@FrontMcp({
observability: {
tracing: true,
logging: { sinks: [{ type: 'stdout' }] },
requestLogs: true,
},
})
Follow the scenario routing table above to find the right reference for your use case.
| Scenario | Reference | Description |
|---|---|---|
| Enable OpenTelemetry tracing | references/tracing-setup.md | Zero-config auto-instrumentation, setupOTel(), span hierarchy |
| Add JSON logs with trace correlation | references/structured-logging.md | Sinks (stdout, console, OTLP, winston, pino), redaction, log format |
| Custom spans in tools/plugins | references/telemetry-api.md | this.telemetry.startSpan(), withSpan(), addEvent(), setAttributes() |
| Connect to monitoring platforms | references/vendor-integrations.md | Coralogix, Datadog, Logz.io, Grafana — OTLP and direct |
| Test spans and log entries | references/testing-observability.md | createTestTracer(), assertSpanExists(), integration test patterns |
| Pattern | Correct | Incorrect | Why |
|---|---|---|---|
| Enable observability | observability: true in @FrontMcp config | Import and install ObservabilityPlugin manually | Config-driven is the standard pattern since v1.0 |
| Custom spans | this.telemetry.withSpan('op', fn) | trace.getTracer().startSpan() directly | this.telemetry auto-inherits trace context |
| Log correlation | this.logger.info('msg', { key: val }) | console.log('msg') | SDK logger flows through StructuredLogTransport with trace_id |
| Session ID | Use mcp.session.id attribute (hashed) | Log the real session ID | Privacy: the hash is sufficient for correlation |
| Vendor integration | Use { type: 'otlp', endpoint } sink | Build vendor-specific HTTP clients | OTLP is the universal standard |
| Category | Flows | Attributes |
|---|---|---|
| HTTP requests | traceRequest, auth, route, finalize | http.request.method, url.path |
| Tool calls | parseInput → findTool → execute → finalize | mcp.component.type=tool, enduser.id |
| Resource reads | parseInput → findResource → execute | mcp.component.type=resource, mcp.resource.uri |
| Prompts | parseInput → findPrompt → execute | mcp.component.type=prompt |
| Agents | parseInput → findAgent → execute (nested tool calls) | mcp.component.type=agent |
| Auth | verify, session verify, OAuth flows | frontmcp.auth.mode, frontmcp.auth.result |
| Transport | SSE, Streamable HTTP, Stateless HTTP | frontmcp.transport.type |
| Skills | search, load, HTTP endpoints | frontmcp.flow.name |
@frontmcp/observability installedobservability field added to @FrontMcp configsetupOTel() or external SDK)trace_id and span_idthis.telemetry is available in tool execution contextsERROR statuscreateTestTracer()CallbackSinkfrontmcp-production-readiness, frontmcp-config, frontmcp-testing, frontmcp-development