forked from openzipkin/zipkin-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
22 lines (20 loc) · 818 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import {Handler} from 'express';
import {Tracer} from 'zipkin';
/**
* When a request comes in, creates ServerRecv annotation and then passes
* the request to the next middleware. When the final middleware finishes
* the request, creates ServerSend annotation
*
* Sets the tracer.id to the span id prior to running the next middleware.
*
* Note that if the next middleware makes async calls, it should either
* store the span id manually or use a CLSContext so that the annotations
* go to the correct spans
*/
export declare function expressMiddleware(
options: {tracer: Tracer, port?: number}
): Handler;
export declare function wrapExpressHttpProxy(
proxy: (host: string, options?: any) => Handler,
options: {tracer: Tracer, remoteServiceName?: string}
): (host: string, options?: any) => Handler;