@linzjs/tracing
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

@linzjs/tracing

Work In Progress

LINZ's base for OpenTelemetry Tracing and logging

Usage

OpenTelemetry Log Data Model Logger

import {log, LogType} from '@linzjs/tracing'

log.info('Hello World');

// Use a minimal logging type in a function typing
function doWork(logger?: LogType) {
    logger?.info('Get User', { 'http.status': 203, 'http.url': '/v1/users/3857.json' });
}

// Setup resource and trace context for the logger
log.setResources({'host.name': 'blacha', 'cloud.provider': 'aws', 'cloud.region': 'ap-southeast-2' });
log.setTrace({'TraceId': '0af7651916cd43dd8448eb211c80319c'})
log.info('With Resources & TraceContext')

Open Telemetry Tracer

import {trace} from '@linzjs/tracing'

const span = trace.startSpan();
await doWork();
span.close();

Readme

Keywords

none

Package Sidebar

Install

npm i @linzjs/tracing

Weekly Downloads

8

Version

1.1.1

License

MIT

Unpacked Size

26.5 kB

Total Files

30

Last publish

Collaborators

  • linzds
  • blacha
  • philals