Type aliases
ApmBootstrap
Apm
Bootstrap: { features: Partial<Record<ApmFeatures, any>> }
ApmFactory
ApmFactory<T>: T extends TimerWrapperFactory | CounterFactory<any> | GaugeFactory<any> | HistogramFactory<unknown> ? { name: string } : never
Type parameters
ApmFactoryInstance
ApmFactoryInstance<T, I>: T extends ApmFactory<any> ? I extends T ? I : never : any
Type parameters
BootstrapOptions
Type declaration
-
-
appName: string
-
Optional envLoaders?: Supplier<Record<string, string>>[]
-
-
Optional profiler?: Profiler
-
Optional register?: [[any, string | { name: string }]]
ConsoleApi
ConsoleApi: { assert?: undefined | ((value: any, message?: undefined | string, ...optionalParams: any[]) => void); clear?: undefined | (() => void); context?: unknown; count: (label?: undefined | string) => void; countReset: (label?: undefined | string) => void; debug: (message?: any, ...optionalParams: any[]) => void; dir?: undefined | ((obj: any, optional?: any) => void); dirxml?: undefined | ((...data: any[]) => void); error: (message?: any, ...optionalParams: any[]) => void; group: (...label: any[]) => void; groupCollapsed: (...label: any[]) => void; groupEnd: () => void; info: (message?: any, ...optionalParams: any[]) => void; log: (message?: any, ...optionalParams: any[]) => void; memory?: undefined | { jsHeapSizeLimit: number; totalJSHeapSize: number; usedJSHeapSize: number }; profile: (label?: undefined | string) => void; profileEnd: (label?: undefined | string) => void; table: (tabularData: any, properties?: string[]) => void; time: (label?: undefined | string) => void; timeEnd: (label?: undefined | string) => void; timeLog: (label?: undefined | string) => void; timeStamp: (label?: undefined | string) => void; trace: (message?: any, ...optionalParams: any[]) => void; warn: (message?: any, ...optionalParams: any[]) => void } | Console
ConsoleMetricFeature
Console
MetricFeature: { name: ApmFeatures extends string ? "counter" | "timer" : never; options: ConsoleMetricOptions }
Type declaration
-
name: ApmFeatures extends string ? "counter" | "timer" : never
-
ConsoleMetricOptions
Console
MetricOptions: { console?: Console; env?: Props; parent?: ConsoleMetric; prefix?: undefined | string; suffix?: undefined | string; tags?: Tags }
Type declaration
-
Optional console?: Console
-
Optional env?: Props
-
-
Optional prefix?: undefined | string
-
Optional suffix?: undefined | string
-
Optional tags?: Tags
Constructor
Constructor<T>: {}
Type parameters
CountOptions
Type parameters
Type declaration
-
Optional counterFactory?: CounterFactory<T>
-
Optional filter?: Filter
-
Optional name?: undefined | string
-
Optional tags?: Tags
Counter
Counter<T>
: Metric & { increment
: (val
: T, tags
?: Tags) => void }
Type parameters
DatadogInterceptorOptions
Datadog
InterceptorOptions: { datadog?: StatsD; eventOptions: EventOptions; extractText: (context: Message) => string | undefined; extractTitle: (context: Message) => string; filter: FilterLogMessage; onErr?: undefined | ((err: Error) => void); tags?: undefined | ((context: Message) => Tags) }
Type declaration
-
Optional datadog?: StatsD
-
eventOptions: EventOptions
-
extractText: (context: Message) => string | undefined
-
- (context: Message): string | undefined
-
Parameters
Returns string | undefined
-
extractTitle: (context: Message) => string
-
- (context: Message): string
-
Parameters
Returns string
-
filter: FilterLogMessage
-
Optional onErr?: undefined | ((err: Error) => void)
-
Optional tags?: undefined | ((context: Message) => Tags)
DayOfMonth
DayOfMonth: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31
DayOfWeek
DayOfWeek: 1 | 2 | 3 | 4 | 5 | 6 | 7
False
False: 0 | "false" | "False" | "FALSE" | "no" | "No" | "NO" | "n"
GaugeOptions
Type parameters
Type declaration
-
Optional filter?: Filter
-
Optional gaugeFactory?: GaugeFactory<T>
-
Optional name?: undefined | string
-
Optional tags?: Tags
GaugeWrapperContext
Gauge
WrapperContext<T>: { args: unknown[]; error?: unknown; result?: T }
Type parameters
Type declaration
-
args: unknown[]
-
Optional error?: unknown
-
Optional result?: T
GcpProject
GcpProject: "GCP_PROJECT" | "GCLOUD_PROJECT" | "GOOGLE_CLOUD_PROJECT"
Histogram
Type parameters
Hour
Hour: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 18 | 19 | 20 | 21 | 22 | 23 | 24
HrTime
HrTime: [number, number]
HystrixCommandOptions
HystrixCommandOptions: CommandOptions & { circuitBreakerErrorThresholdPercentage?: undefined | number; circuitBreakerForceClosed?: unknown; circuitBreakerForceOpened?: unknown; circuitBreakerRequestVolumeThreshold?: undefined | number; circuitBreakerSleepWindowInMilliseconds?: undefined | number; cleanup?: unknown; context?: unknown; errorHandler?: undefined | ((err: unknown, ...args: unknown[]) => unknown); fallbackTo?: undefined | ((err: unknown, ...args: unknown[]) => unknown); percentileWindowLength?: undefined | number; percentileWindowNumberOfBuckets?: undefined | number; requestVolumeRejectionThreshold?: unknown; statisticalWindowLength?: undefined | number; statisticalWindowNumberOfBuckets?: undefined | number; timeout?: undefined | number }
InternalLogOptions
InternalLogOptions: { console?: Console; enable: { debug: boolean; table: boolean; warn: boolean }; parent?: string | { fqn: string } }
Type declaration
-
Optional console?: Console
-
enable: { debug: boolean; table: boolean; warn: boolean }
-
debug: boolean
-
table: boolean
-
warn: boolean
-
Optional parent?: string | { fqn: string }
JoinOptions
Join
Options: { execute: (err?: unknown, result?: unknown) => void; filter?: Filter; join: Join; original: (...args: unknown[]) => unknown; target: unknown }
Type declaration
-
execute: (err?: unknown, result?: unknown) => void
-
- (err?: unknown, result?: unknown): void
-
Parameters
-
Optional err: unknown
-
Optional result: unknown
Returns void
-
Optional filter?: Filter
-
-
original: (...args: unknown[]) => unknown
-
- (...args: unknown[]): unknown
-
Parameters
Returns unknown
-
target: unknown
KeyFallback
KeyFallback: { global?: undefined | string; name: string }
Type declaration
-
Optional global?: undefined | string
-
name: string
LocalTimerOptions
Type declaration
-
Optional env?: Props
-
-
Optional prefix?: undefined | string
-
Optional suffix?: undefined | string
-
Optional tags?: Tags
-
LogBoostrap
Log
Boostrap: { root: Log }
LogInvocationOptions
Log
InvocationOptions: { filter?: Filter; includeResult?: undefined | false | true; level: LogLevel; name?: undefined | string; parent?: Log }
Type declaration
-
Optional filter?: Filter
-
Optional includeResult?: undefined | false | true
-
-
Optional name?: undefined | string
-
Optional parent?: Log
LogOptions
Type declaration
-
[key: string]: unknown | undefined
-
-
Optional env?: Env
-
Optional name?: undefined | string
-
Optional parent?: Log
Metric
Metric
: { name
: string; tags
: Tags }
Milliseconds
Milliseconds: number | bigint
Month
Month: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
Nanoseconds
Nanoseconds: bigint
NotPromise
Not
Promise<T>: Exclude<T, Promise<T>>
Type parameters
Numeric
Numeric: number | bigint
PerformanceTimerOptions
Performance
TimerOptions: { endSuffix?: undefined | string; env?: Props; measureSuffix?: undefined | string; parent?: PerformanceTimer<any>; performance?: Performance; startSuffix?: undefined | string; tags?: Tags }
Type declaration
-
Optional endSuffix?: undefined | string
-
Optional env?: Props
-
Optional measureSuffix?: undefined | string
-
-
Optional performance?: Performance
-
Optional startSuffix?: undefined | string
-
Optional tags?: Tags
ProfileOptions
Profile
Options: { filter?: Filter; label?: undefined | string; profiler?: Profiler }
Type declaration
-
Optional filter?: Filter
-
Optional label?: undefined | string
-
Optional profiler?: Profiler
PromFeature
Type declaration
-
-
-
Optional prefix?: undefined | string
PromOptions
Prom
Options: { additionalTagNames?: string[]; aggregator?: Aggregator; help: string; prefix?: undefined | string; registry?: Registry; suffix?: undefined | string; tags?: Tags }
Type declaration
-
Optional additionalTagNames?: string[]
-
Optional aggregator?: Aggregator
-
help: string
-
Optional prefix?: undefined | string
-
Optional registry?: Registry
-
Optional suffix?: undefined | string
-
Optional tags?: Tags
RangeOptions
RangeOptions: { from?: undefined | number; to?: undefined | number }
Type declaration
-
Optional from?: undefined | number
-
Optional to?: undefined | number
RequestIdleCallbackDeadline
RequestIdleCallbackDeadline: { didTimeout: boolean; timeRemaining: () => number }
Type declaration
-
Readonly didTimeout: boolean
-
timeRemaining: () => number
RequestIdleCallbackHandle
RequestIdleCallbackHandle: any
RequestIdleCallbackOptions
RequestIdleCallbackOptions: { timeout: number }
RetryOptions
RetryOptions: { backoff?: number | number[]; interval?: number | number[]; maxAttempts: number; name?: undefined | string }
Type declaration
-
Optional backoff?: number | number[]
-
Optional interval?: number | number[]
-
maxAttempts: number
-
Optional name?: undefined | string
Settable
Settable<T>
: Metric & { set
: any }
Type parameters
StackdriverInterceptorOptions
Stackdriver
InterceptorOptions: { callback?: undefined | ((err: Error, response: ServerResponse | null, body: {}) => void); errorBuilder: ErrorBuilder; errors?: ErrorReporting; filter: (context: Message) => boolean }
Type declaration
-
Optional callback?: undefined | ((err: Error, response: ServerResponse | null, body: {}) => void)
-
-
Optional errors?: ErrorReporting
-
filter: (context: Message) => boolean
-
- (context: Message): boolean
-
Parameters
Returns boolean
StackdriverJsonFormat
StackdriverJsonFormat: { @type: string; context: { httpRequest: { method: string; referrer: string; remoteIp: string; responseStatusCode: number; url: string; userAgent: string }; reportLocation: { filePath: string; functionName: string; lineNumber: number }; user: string }; eventTime: string; message: string; serviceContext: { service: string; version: string } }
Type declaration
-
@type: string
-
context: { httpRequest: { method: string; referrer: string; remoteIp: string; responseStatusCode: number; url: string; userAgent: string }; reportLocation: { filePath: string; functionName: string; lineNumber: number }; user: string }
-
httpRequest: { method: string; referrer: string; remoteIp: string; responseStatusCode: number; url: string; userAgent: string }
-
method: string
-
referrer: string
-
remoteIp: string
-
responseStatusCode: number
-
url: string
-
userAgent: string
-
reportLocation: { filePath: string; functionName: string; lineNumber: number }
-
filePath: string
-
functionName: string
-
lineNumber: number
-
user: string
-
eventTime: string
-
message: string
-
serviceContext: { service: string; version: string }
-
service: string
-
version: string
StatsDOptions
StatsDOptions
: { prefix
?: undefined | string; sampleRate
?: undefined | number; statsd
?: StatsD; suffix
?: undefined | string; tags
?: Tags }
Type declaration
-
Optional prefix?: undefined | string
-
Optional sampleRate?: undefined | number
-
Optional statsd?: StatsD
-
Optional suffix?: undefined | string
-
Optional tags?: Tags
StdOutOptions
StdOutOptions: { stderr?: Writable; stdout?: Writable }
Type declaration
-
Optional stderr?: Writable
-
Optional stdout?: Writable
Tags
Tags: Record<string, string>
TimeAndRemainder
TimeAndRemainder: [bigint, bigint]
TimedOptions
Type declaration
-
Optional filter?: Filter
-
Optional name?: undefined | string
-
Optional tags?: Tags
-
True
True: 1 | "true" | "True" | "TRUE" | "yes" | "Yes" | "YES" | "y"
Value
Value<T>
: Metric & { value
: T }
Type parameters
Variables
Const ACCESS_TEMPLATE
ACCESS_TEMPLATE: "${ctx.data.req.ip} - - [${ctx.data.ts}] ${ctx.data.pid} "${ctx.data.req.method} ${ctx.data.req.url} " ${ctx.data.res.status} ${ctx.data.res.length} - "${ctx.data.req.userAgent}" ${ctx.message}" = "${ctx.data.req.ip} - - [${ctx.data.ts}] ${ctx.data.pid} "${ctx.data.req.method} ${ctx.data.req.url} " ${ctx.data.res.status} ${ctx.data.res.length} - "${ctx.data.req.userAgent}" ${ctx.message}"
Const APM_ENV
APM_
ENV: ApmEnv = new ApmEnv()
Const BASE_ROOT
BASE_ROOT: "ts-base" = "ts-base"
Const ENV_PROFILER
ENV_PROFILER: "profiler" = "profiler"
Const LOG_ENV
LOG_
ENV: LogEnv = new LogEnv()
Const MS_IN_SEC
MS_IN_SEC: bigint = BigInt(1000)
Const NANOS_IN_CENTURY
NANOS_IN_CENTURY: bigint = NANOS_IN_DECADE * BigInt(100)
Const NANOS_IN_DAY
NANOS_IN_DAY: bigint = NANOS_IN_HOUR * BigInt(24)
Const NANOS_IN_DECADE
NANOS_IN_DECADE: bigint = NANOS_IN_YEAR * BigInt(10)
Const NANOS_IN_HOUR
NANOS_IN_HOUR: bigint = NANOS_IN_MIN * BigInt(60)
Const NANOS_IN_MIN
NANOS_IN_MIN: bigint = NANOS_IN_SEC * BigInt(60)
Const NANOS_IN_MONTH
NANOS_IN_MONTH: bigint = NANOS_IN_DAY * BigInt(30)
Const NANOS_IN_MS
NANOS_IN_MS: bigint = BigInt(1000000)
Const NANOS_IN_SEC
NANOS_IN_SEC: bigint = NANOS_IN_MS * MS_IN_SEC
Const NANOS_IN_WEEK
NANOS_IN_WEEK: bigint = NANOS_IN_DAY * BigInt(7)
Const NANOS_IN_YEAR
NANOS_IN_YEAR: bigint = NANOS_IN_MONTH * BigInt(12)
Const TRUE
TRUE: "true" = "true"
Const system
system: { hasWindow: boolean; isNode: boolean } = _system
Type declaration
-
hasWindow: boolean
-
isNode: boolean
prom-client
requires configuring the tags that will be used before calling collection methods. You can provide names for tags that can't be set until the method invocation here.