https://github.com/clever/tracing-middleware
Moved to opentracing-contrib org
https://github.com/clever/tracing-middleware
Last synced: about 1 year ago
JSON representation
Moved to opentracing-contrib org
- Host: GitHub
- URL: https://github.com/clever/tracing-middleware
- Owner: Clever
- Created: 2016-11-30T22:31:26.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-09-23T15:35:04.000Z (almost 2 years ago)
- Last Synced: 2025-06-05T10:09:26.358Z (about 1 year ago)
- Language: JavaScript
- Homepage: https://github.com/opentracing-contrib/javascript-express
- Size: 26.4 KB
- Stars: 7
- Watchers: 50
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](http://opentracing.io)
# tracing-middleware
Middleware for express to enable opentracing.
Supports any opentracing tracer compatible with version 0.11.0 of the opentracing javascript library.
## Deprecated
Please note that this library has been moved to [https://github.com/opentracing-contrib/javascript-express](https://github.com/opentracing-contrib/javascript-express). Please use that version instead.
## Install
```
npm install --save tracing-middleware
```
## Usage
E.g., using LightStep as your tracer:
```
import * as express from "express";
import middleware from "tracing-middleware";
import * as LightStep from "lightstep-tracer";
const lsTracer = LightStep.tracer({
access_token : 'foo',
component_name : 'bar',
});
const app = express();
app.use(middleware({tracer: lsTracer}));
```
## Options
The `middleware` function takes in an options object as its only argument.
```
const options = {
tracer: [Tracer], // Defaults to the opentracing no-op tracer.
}
```