@imqueue/opentelemetry-instrumentation-imqueue
Version:
This module provides OpenTelemetry instrumentation for @imqueue
35 lines (34 loc) • 1.14 kB
TypeScript
import { TracedOptions, TraceAttributes } from './src';
export * from './src/instrumentation';
/**
* Shorthand for making in-code traces. Starts datadog trace span with the
* given name, and assigns it given tags (if passed).
*
* @example
* ```typescript
* import {
* trace,
* traceEnd,
* } from '@imqueue/opentelemetry-instrumentation-imqueue';
*
* trace('my-trace');
* // ... do some work
* traceEnd('my-trace');
* ```
*
* @param {string} name - trace name (datadog span name
* @param {TraceAttributes} [tags] - datadog trace span tags, if passed
* @param {string} tracerName
*/
export declare function traceStart(name: string, tags?: TraceAttributes, tracerName?: string): void;
/**
* Shorthand for finishing datadog trace span.
*
* @param {string} name
*/
export declare function traceEnd(name: string): void;
/**
* Decorator factory, which return decorator function allowing to add tracing to
* decorated method calls.
*/
export declare function traced(options?: Partial<TracedOptions>): (target: any, methodName: string | symbol, descriptor: TypedPropertyDescriptor<(...args: any[]) => any>) => void;