-
Notifications
You must be signed in to change notification settings - Fork 39
/
types.ts
37 lines (29 loc) · 930 Bytes
/
types.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
import { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base'
import { OTLPExporterConfig } from './exporter'
import { FetcherConfig } from './instrumentation/fetch'
import { TailSampleFn } from './sampling'
export type PostProcessorFn = (spans: ReadableSpan[]) => ReadableSpan[]
export type ExporterConfig = OTLPExporterConfig | SpanExporter
export interface GlobalsConfig {
fetch?: FetcherConfig
}
export interface ServiceConfig {
name: string
namespace?: string
version?: string
}
export interface SamplingConfig {
tailSampleFn: TailSampleFn
}
export interface TraceConfig {
exporter: ExporterConfig
globals?: GlobalsConfig
sampling?: SamplingConfig
postProcessorFn?: PostProcessorFn
service: ServiceConfig
}
export interface ResolvedTraceConfig extends TraceConfig {
globals: Required<GlobalsConfig>
postProcessorFn: PostProcessorFn
}
export type Trigger = Request | MessageBatch | 'do-alarm'