1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | import { TraceParams } from '../config/types';
|
17 | import { Sampler } from './types';
|
18 |
|
19 | export declare class AlwaysSampler implements Sampler {
|
20 | readonly description = "always";
|
21 | shouldSample(traceId: string): boolean;
|
22 | }
|
23 |
|
24 | export declare class NeverSampler implements Sampler {
|
25 | readonly description = "never";
|
26 | shouldSample(traceId: string): boolean;
|
27 | }
|
28 |
|
29 | export declare class ProbabilitySampler implements Sampler {
|
30 | private idUpperBound;
|
31 | readonly description: string;
|
32 | |
33 |
|
34 |
|
35 | constructor(probability: number);
|
36 | /**
|
37 | * Checks if trace belong the sample.
|
38 | * @param traceId Used to check the probability
|
39 | * @returns a boolean. True if the traceId is in probability
|
40 | * False if the traceId is not in probability.
|
41 | */
|
42 | shouldSample(traceId: string): boolean;
|
43 | }
|
44 | /** Builder class of Samplers */
|
45 | export declare class SamplerBuilder {
|
46 | private static readonly ALWAYS;
|
47 | private static readonly NEVER;
|
48 | |
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 | static getSampler(probability: number): Sampler;
|
57 | }
|
58 |
|
59 |
|
60 |
|
61 |
|
62 | export declare const DEFAULT_SAMPLING_RATE = 0.0001;
|
63 |
|
64 | export declare const DEFAULT_SPAN_MAX_NUM_ANNOTATIONS = 32;
|
65 |
|
66 | export declare const DEFAULT_SPAN_MAX_NUM_MESSAGE_EVENTS = 128;
|
67 |
|
68 | export declare const DEFAULT_SPAN_MAX_NUM_ATTRIBUTES = 32;
|
69 |
|
70 | export declare const DEFAULT_SPAN_MAX_NUM_LINKS = 32;
|
71 |
|
72 | export declare class TraceParamsBuilder {
|
73 | static getNumberOfAnnotationEventsPerSpan(traceParameters: TraceParams): number;
|
74 | static getNumberOfAttributesPerSpan(traceParameters: TraceParams): number;
|
75 | static getNumberOfMessageEventsPerSpan(traceParameters: TraceParams): number;
|
76 | static getNumberOfLinksPerSpan(traceParameters: TraceParams): number;
|
77 | }
|