Skip to content

Latest commit

 

History

History
57 lines (42 loc) · 1.48 KB

Readme.md

File metadata and controls

57 lines (42 loc) · 1.48 KB

basictracer-javascript NPM version build status Test coverage

The Javascript implementation of the BasicTracer reference implementation

Installation

npm install --save basictracer

Usage

var tracer = require('basictracer')
tracer.configure({
    sampler: mySampler,
    recorder: myRecorder,
})

var span = tracer.startSpan('someOperation')
span.tag('key', 'value')
span.log({
    event: 'read',
    paylog: {duration: 1000},
})
span.finish()

See tests for more example.

Data Model

type BasicSpan {
    operationName: String
    startTime: Number
    duration: Number
    tags: [Object]
    logs: [Array]

    traceId: Long
    spanId: Long
    parentId: [String]
    sampled: Boolean
    baggage: [Object]
}

Long type represent by long.js

Licensing

Apache 2.0 License.