New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

@mtth/stl-telemetry

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mtth/stl-telemetry

Standard telemetry library

latest
npmnpm
Version
0.9.7
Version published
Weekly downloads
3.2K
15.89%
Maintainers
1
Weekly downloads
 
Created
Source

@mtth/stl-telemetry

Structured logging, metrics, and tracing primitives with first-class TypeScript support and OpenTelemetry integration.

Quickstart

pnpm add @mtth/stl-telemetry
import {RecordingTelemetry, instrumentsFor} from '@mtth/stl-telemetry';

const telemetry = RecordingTelemetry.forTesting({name: 'payments-service'});

const [metrics] = telemetry.metrics(
  instrumentsFor({
    requests: {
      name: 'payments.requests',
      kind: 'counter',
      unit: '{requests}',
      labels: {result: 'result'},
    },
  })
);

telemetry.logger.info('service ready');
metrics.requests.add(1, {result: 'ok'});

telemetry.withActiveSpan({name: 'charge-card'}, (span) => {
  span.addEvent('calling gateway');
  // ...do the work...
  span.end();
});

Highlights

  • A single Telemetry interface powers loggers, spans, and metrics; .via() automatically scopes library metadata.
  • Type-safe metrics with instrumentsFor() generate strongly typed recorders and guard against typo-prone label names.
  • Logger providers support dynamic thresholding, structured values, and recording destinations for tests.
  • Helpers like withActiveSpan, recordErrorOnSpan, and settingLogLevel keep OpenTelemetry plumbing consistent across services and libraries.

Keywords

stl

FAQs

Package last updated on 20 Feb 2026

Related posts