Skip to content

feat(app): OpenTelemetry-compatible request tracing #625

Description

@SisyphusZheng

Summary

Add OpenTelemetry-compatible request tracing to the openElement request pipeline. SvelteKit (2025) shipped native OTel tracing as an experimental feature; openElement should provide equivalent observability for production operations.

Competitive context

Framework Observability
SvelteKit Native OTel tracing (experimental, 2025): auto-traces handle hooks, load functions, form actions
Astro No built-in
Next.js No built-in (Vercel provides proprietary)
Fresh No built-in
openElement reportError telemetry hook only — no request tracing

Proposed design

// instrumentation.server.ts (new convention)
import { initTracing } from '@openelement/app/tracing';

export default initTracing({
  serviceName: 'my-app',
  // OTel SDK config passthrough
});

Auto-traced spans:

  • loader execution (route path, duration, status)
  • action execution (route path, method, status, validation outcome)
  • DSD render (component tag, duration, nesting depth)
  • SSG prerender (page count, total time)

Scope

  • @openelement/app/tracing subpath (optional import, zero cost when unused)
  • Span emission via OTel SDK protocol (not bundled — peer dependency)
  • Dev-mode: console-friendly span logging
  • Prod-mode: OTLP export

Non-goals

  • No bundled OTel SDK (peer dep or user-provided)
  • No metrics/gauges (traces only for v1)
  • No dashboard (user brings Grafana/Datadog/etc.)

Target version

0.44.0 (Production Runtime)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions