@dynatrace/opentelemetry-azure-functions
Version:
Dynatrace OpenTelemetry package for Azure Functions
43 lines • 2.02 kB
TypeScript
import { SpanAttributes } from "@opentelemetry/api";
import type { NodeTracerProvider } from "@opentelemetry/sdk-trace-node";
export declare function _testClearEndHookRegistered(): void;
type Attributes = SpanAttributes;
/**
* Creates and registers TracerProvider with all required components to export traces to Dynatrace.
*
* @param resource Resource passed to TracerProvider.
*
* @returns registered NodeTracerProvider
*/
export declare const configureDynatrace: (resource?: Attributes) => NodeTracerProvider;
/**
* Registers AzureFunction preInvocation hook for span start
*
* Use with Azure Function Programming Model V4 only.
*/
export declare function registerTraceStartHook(): void;
/**
* Registers AzureFunction postInvocation hook for span end.
*
* Use with Azure Function Programming Model V4 only.
*/
export declare function registerTraceEndHook(): void;
/**
* It registers AzureFunctions TraceStartHook and TraceEndHook to start and end function span.
* Optionally, configures OpenTelemetry tracing components and registers a TracerProvider.
*
* Use with Azure Function Programming Model V4 only.
*
* @note In case other hooks need to be registered in the same AzureFunctions app,
* consider using registerTraceStartHook, registerTraceEndHook to order them properly.
* To properly trace monitored function the TraceStartHook hook must be the first preInvocation hook in the app.
* Correspondingly the TraceEndHook must be the last postInvocation hook in the app.
*
* @param configure If set to true, configures required OTel components for tracing and returns registered NodeTracerProvider.
* Otherwise, it doesn't return a tracer provider and the components must be configured manually or by calling configureDynatrace(). Default: false.
*
* @param resource Resource passed to TracerProvider.
*/
export declare function initDynatrace(configure?: boolean, resource?: Attributes): void | NodeTracerProvider;
export {};
//# sourceMappingURL=AzureFunctionsInstrumentationV4.d.ts.map