Agent skill

frontmcp-observability

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.

Stars 142
Forks 7

Install this agent skill to your Project

npx add-skill https://github.com/agentfront/frontmcp/tree/main/libs/skills/catalog/frontmcp-observability

Metadata

Additional technical details for this skill

SKILL.md

FrontMCP Observability

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.

When to Use This Skill

Must Use

  • Adding tracing, logging, or monitoring to a FrontMCP server
  • Connecting Coralogix, Datadog, Logz.io, Grafana, or any OTLP backend
  • Using this.telemetry to create custom spans in tools, plugins, or agents
  • Setting up structured logging with winston, pino, or NDJSON stdout
  • Testing that spans and log entries are created correctly

Recommended

  • Before going to production (see also frontmcp-production-readiness)
  • When debugging request latency or error rates
  • When building plugins that need trace context propagation

Skip When

  • Building a prototype that doesn't need observability yet
  • Configuring auth, transport, or throttle (see frontmcp-config)
  • Setting up the project from scratch (see frontmcp-setup)

Decision: Use this skill when you need to observe, trace, or log your server. Start with tracing-setup for auto-instrumentation, add structured-logging for production logs, and use telemetry-api for custom spans in your code.

Prerequisites

  • A working FrontMCP server (see frontmcp-setup)
  • npm install @frontmcp/observability

Step 1: Choose What You Need

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

Step 2: Enable Observability

The simplest way — one config line:

typescript
@FrontMcp({
  observability: true,
})

This enables auto-tracing for all 33 SDK flows. Add structured logging:

typescript
@FrontMcp({
  observability: {
    tracing: true,
    logging: { sinks: [{ type: 'stdout' }] },
    requestLogs: true,
  },
})

Step 3: Read the Relevant Reference

Follow the scenario routing table above to find the right reference for your use case.

Scenario Routing Table

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

Cross-Cutting 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

Quick Reference: What Gets Traced

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

Verification Checklist

Configuration

  • @frontmcp/observability installed
  • observability field added to @FrontMcp config
  • TracerProvider configured (via setupOTel() or external SDK)
  • Logging sinks configured for production (stdout or OTLP)

Runtime

  • Spans appear in trace backend when calling a tool
  • Log entries include trace_id and span_id
  • this.telemetry is available in tool execution contexts
  • Session tracing ID is consistent across all spans in a request
  • Errors are recorded on spans with ERROR status

Testing

  • Tests verify span creation with createTestTracer()
  • Tests verify log entries via CallbackSink
  • No test isolation issues (each test resets exporter)

Reference

Expand your agent's capabilities with these related and highly-rated skills.

agentfront/frontmcp

docs-skill

A fixture skill with references and examples for E2E testing.

142 7
Explore
agentfront/frontmcp

fix-pr

Review a CodeRabbit PR comment and produce an action plan when prompted to analyze a review comment.

142 7
Explore
agentfront/frontmcp

frontmcp-development

Use when you want to create a tool, add a resource, build a prompt, write a provider, implement an adapter, add OpenAPI integration, create a plugin, agent, job, or workflow. The skill for BUILDING any FrontMCP component.

142 7
Explore
agentfront/frontmcp

frontmcp-authorities

Use when implementing authorization, access control, RBAC, ABAC, or ReBAC for tools, resources, or prompts. Covers JWT claims mapping, authority profiles, and policy enforcement.

142 7
Explore
agentfront/frontmcp

frontmcp-setup

Domain router for project setup, scaffolding, and organization. Use this skill whenever someone asks to create a new FrontMCP project, set up an Nx monorepo, configure Redis or SQLite storage, organize project structure, compose multiple apps into one server, or manage the skills system. Also triggers for questions like 'how do I start', 'project layout', 'folder structure', 'add redis', 'set up database', or 'create a new app'.

142 7
Explore
agentfront/frontmcp

frontmcp-config

Use when you want to configure auth, set up CORS, add rate limiting, throttle requests, manage sessions, choose transport, set HTTP options, add authentication, configure JWT, or set up OAuth. The skill for server CONFIGURATION.

142 7
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results