Skip to content

Observability Module (OpenTelemetry)

Composable OpenTelemetry instrumentation module for TypeScript services. Provides one-call SDK initialization with pluggable exporters (console, OTLP, Datadog), structured logging with trace context propagation, and optional metrics and tracing helpers. Designed to be layered into any TypeScript service as a drop-in telemetry layer.

Namemodule-observability-ts
Version0.1.0
Categorycomposable-modules
LicenseApache-2.0
Personaengineering
Tagsobservability, opentelemetry, tracing, metrics, typescript
Sourcetemplates/module-observability-ts

Render it

Three front doors, one catalog. Pick whichever suits the caller.

# CLI
npx @nanohype/sdk render module-observability-ts --out ./my-app

# SDK
import { LocalSource, renderTemplate } from "@nanohype/sdk";
const result = await renderTemplate(source, "module-observability-ts", variables);

# MCP — from an agent
get_template({ name: "module-observability-ts" })

Prerequisites

ToolVersionWhy
node>=22Node.js runtime for OpenTelemetry SDK

Variables

Required

ProjectName string
Kebab-case project name, used as package name and directory Must be lowercase kebab-case starting with a letter.

Optional

Description string — defaults to OpenTelemetry observability module
Short project description for package.json and README
Exporter string — defaults to console
Default telemetry exporter (console, otlp, datadog, or a custom name)
IncludeMetrics bool — defaults to true
Include metrics helpers (counters, histograms)
IncludeTracing bool — defaults to true
Include tracing helpers (tracer wrapper, span creation)

What it produces

20 files. Placeholder names such as __APP_NAME__ are what the renderer substitutes into.

.env.example
.gitignore
biome.json
package.json
README.md
src/telemetry/__tests__/logger.test.ts
src/telemetry/__tests__/registry.test.ts
src/telemetry/bootstrap.ts
src/telemetry/exporters/console.ts
src/telemetry/exporters/datadog.ts
src/telemetry/exporters/index.ts
src/telemetry/exporters/otlp.ts
src/telemetry/exporters/registry.ts
src/telemetry/exporters/types.ts
src/telemetry/index.ts
src/telemetry/logger.ts
src/telemetry/metrics.ts
src/telemetry/tracer.ts
tsconfig.json
vitest.config.ts

Composes with

Composites that use it

  • AI Web Application — Full-stack web application with Next.js frontend, RAG pipeline, authentication, database, and deployment..
  • Background Processor — Async job processing service with queue, database, storage, observability, and deployment.
  • Enterprise AI Infrastructure — Full enterprise AI stack with agents, tool servers, safety guardrails, evaluation, prompt management, observability, and Kubernetes deployment..
  • Production API Service — Production-grade TypeScript API service with auth, database, caching, rate limiting, background jobs, observability, and deployment..