-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathentrypoint.d.ts
80 lines (66 loc) · 2.14 KB
/
entrypoint.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// Type definitions for jaeger-client
// Project: https://github.com/uber/jaeger-client-node
// Definitions by: Julian Steger <https://github.com/julianste>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import * as opentracing from "opentracing";
export = jaeger;
declare namespace jaeger {
export interface TracingConfig {
serviceName?: string;
disable?: boolean;
sampler?: SamplerConfig;
reporter?: ReporterConfig;
}
export interface TracingOptions {
reporter?: Reporter;
metrics?: MetricsFactory;
logger?: Logger;
tags?: any;
}
export interface ReporterConfig {
logSpans?: boolean;
agentHost?: string;
agentPort?: number;
flushIntervalMs?: number;
}
export interface SamplerConfig {
type: string;
param: number;
host?: string;
port?: number;
refreshIntervalMs?: number;
}
export interface Logger {
info(msg: string): void;
error(msg: string): void;
}
export interface Reporter {
report(span: opentracing.Span): void;
close(callback?: () => void): void;
setProcess(serviceName: string, tags: any): void;
}
export interface MetricsFactory {
createCounter(name: string, tags: any): Counter;
createTimer(name: string, tags: any): Timer;
createGauge(name: string, tags: any): Gauge;
}
// Counter tracks the number of times an event has occurred
export interface Counter {
// Adds the given value to the counter.
increment(delta: number): void;
}
// Timer tracks how long an operation took and also computes percentiles.
export interface Timer {
// Records the time passed in.
record(value: number): void;
}
// Gauge returns instantaneous measurements of something as an int64 value
export interface Gauge {
// Update the gauge to the value passed in.
update(value: number): void;
}
export function initTracer(
tracingConfig: TracingConfig,
tracingOptions: TracingOptions,
): opentracing.Tracer;
}