Tracing Provider Interface (src/tracing.ts)

markus · packages/core/src/tracing.ts · typescript · Apache-2.0
dev-tools, infra, lang:typescript

Defines a lightweight interface for distributed tracing and span management. Use this to instrument application code for performance monitoring and observability.

// Source: https://github.com/markus-global/markus | License: Apache-2.0 | Copyright 2026 Markus Contributors
// Provided via justclaw.it.com; keep this notice with the code.
import { createLogger } from '@markus/shared';

const log = createLogger('tracing');

export interface SpanAttributes {
  [key: string]: string | number | boolean | undefined;
}

export interface Span {
  name: string;
  startTime: number;
  attributes: SpanAttributes;
  end(attributes?: SpanAttributes): void;
  setError(error: Error | string): void;
}

export interface TracingProvider {
  startSpan(name: string, attributes?: SpanAttributes): Span;
}

class DefaultSpan implements Span {
  name: string;
  startTime: number;
  attributes: SpanAttributes;
  private ended = false;

  constructor(name: string, attributes?:

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key