UNPKG

1.5 kBTypeScriptView Raw
1import type { Tracer } from '@opentelemetry/api';
2import type { BasicTracerProvider } from '@opentelemetry/sdk-trace-base';
3import type { DynamicSamplingContext, Scope, TraceContext } from '@sentry/core';
4import { ServerRuntimeClient } from '@sentry/core';
5import type { NodeClientOptions } from '../types';
6/** A client for using Sentry with Node & OpenTelemetry. */
7export declare class NodeClient extends ServerRuntimeClient<NodeClientOptions> {
8 traceProvider: BasicTracerProvider | undefined;
9 private _tracer;
10 private _clientReportInterval;
11 private _clientReportOnExitFlushListener;
12 constructor(options: NodeClientOptions);
13 /** Get the OTEL tracer. */
14 get tracer(): Tracer;
15 flush(timeout?: number): Promise<boolean>;
16 close(timeout?: number | undefined): PromiseLike<boolean>;
17 /**
18 * Will start tracking client reports for this client.
19 *
20 * NOTICE: This method will create an interval that is periodically called and attach a `process.on('beforeExit')`
21 * hook. To clean up these resources, call `.close()` when you no longer intend to use the client. Not doing so will
22 * result in a memory leak.
23 */
24 startClientReportTracking(): void;
25 /** Custom implementation for OTEL, so we can handle scope-span linking. */
26 protected _getTraceInfoFromScope(scope: Scope | undefined): [dynamicSamplingContext: Partial<DynamicSamplingContext> | undefined, traceContext: TraceContext | undefined];
27}
28//# sourceMappingURL=client.d.ts.map
\No newline at end of file