Skip to content

@forinda/kickjs-otel

OpenTelemetry adapter for KickJS — automatic HTTP tracing and request metrics.

Installation

bash
pnpm add @forinda/kickjs-otel @opentelemetry/api
# Plus your exporter:
pnpm add @opentelemetry/exporter-trace-otlp-http  # OTLP/Jaeger
pnpm add @opentelemetry/exporter-jaeger            # Jaeger direct

Quick Start

ts
import { OtelAdapter } from '@forinda/kickjs-otel'

bootstrap({
  modules,
  adapters: [
    new OtelAdapter({
      serviceName: 'my-api',
      serviceVersion: '1.0.0',
      ignoreRoutes: ['/health', '/_debug/*'],
    }),
  ],
})

Options

OptionTypeDefaultDescription
serviceNamestring'kickjs-app'Service name in traces/metrics
serviceVersionstring'0.0.0'Service version
tracingbooleantrueEnable request span creation
metricsbooleantrueEnable request counter and histogram
ignoreRoutesstring[][]Paths to skip (exact or prefix with *)
customAttributes(req) => RecordExtra span attributes per request

Metrics

MetricTypeDescription
http.server.request.countCounterTotal requests by method/route/status
http.server.request.durationHistogramRequest duration in ms

Span Attributes

Each request span includes:

  • http.method — GET, POST, etc.
  • http.url — Full request URL
  • http.target — Request path
  • http.route — Matched route pattern
  • http.status_code — Response status
  • http.user_agent — Client user agent

Released under the MIT License.