1.3.0 • Published 3 years ago
@aller/express-opentracing v1.3.0
@aller/express-opentracing
This repo is to easier allow tracing on a unanimous way with express, + having access to a tracing-middleware for express with opentracing.
Usage;
Start global
import { startGlobalTracer } from '@aller/express-opentracing'
const { tracer, options } = startGlobalTracer()
// If you use @promster/express, this is a good place to add that middleware;
import { createMiddleware } from '@promster/express'
app.use(createMiddleware({ app, options }))
Add tracing-middleware
import { tracingMiddleware } from '@aller/express-opentracing'
[...]
app.use('/', tracingMiddleware({}: ITracingOptions), (_, _) => {
[...]
})
[...]
Where with ITracingOptions
you can define certain paths you would like to exclude from the traces with .ignoreRoute
as a string-regex
Fetch-data with tracing
import { fetchWithTracing } from '@aller/express-opentracing'
const { body, headers } = await fetchWithTracing(
{...}, req.span
)
Log data
import { log } from '@aller/express-opentracing'
[...]
log({
span,
event: 'EVENTNAME',
description: 'DESCRIPTION',
error?: Error
phase: IPhase
})
[...]
1.3.0
3 years ago
1.2.0-alpha.0
3 years ago
1.2.0
3 years ago
1.1.2
3 years ago
1.1.1
3 years ago
1.1.0
3 years ago
1.0.2
3 years ago
1.0.1
3 years ago
1.0.3
3 years ago
1.0.0
3 years ago
1.0.0-beta.6
3 years ago
1.0.0-beta.5
3 years ago
1.0.0-beta.4
3 years ago
1.0.0-beta.3
3 years ago
1.0.0-beta.2
3 years ago
1.0.0-beta.1
3 years ago