@datadog/mobile-react-native
Version:
A client-side React Native module to interact with Datadog
44 lines (38 loc) • 1.53 kB
text/typescript
/*
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2016-Present Datadog, Inc.
*/
/* eslint-disable @typescript-eslint/ban-types */
import type { TurboModule } from 'react-native';
import { TurboModuleRegistry } from 'react-native';
/**
* Do not import this Spec directly, use DdNativeTraceType instead.
*/
export interface Spec extends TurboModule {
readonly getConstants: () => {};
/**
* Start a span, and returns a unique identifier for the span.
* @param operation: The operation name of the span.
* @param context: The additional context to send.
* @param timestampMs: The timestamp when the operation started (in milliseconds). If not provided, current timestamp will be used.
*/
startSpan(
operation: string,
context: Object,
timestampMs: number
): Promise<string>;
/**
* Finish a started span.
* @param spanId: The unique identifier of the span.
* @param context: The additional context to send.
* @param timestampMs: The timestamp when the operation stopped (in milliseconds). If not provided, current timestamp will be used.
*/
finishSpan(
spanId: string,
context: Object,
timestampMs: number
): Promise<void>;
}
// eslint-disable-next-line import/no-default-export
export default TurboModuleRegistry.get<Spec>('DdTrace');