@dash0/sdk-web
Version:
Dash0's Web SDK to collect telemetry from end-users' web browsers
37 lines (36 loc) • 1.1 kB
TypeScript
import { LOG_SEVERITY_TEXT } from "../semantic-conventions";
import { AttributeValueType } from "../utils/otel";
import { TimeInput } from "../utils";
import { AnyValue } from "../types/otlp";
type EventOptions = {
/**
* Human readable title for the event.
* Should summarize the event in a single short sentence.
* Transmitted via the `dash0.web.event.title` attribute.
*/
title?: string;
/**
* The timestamp at which the event happened.
* Defaults to now
*/
timestamp?: TimeInput;
/**
* The event body
*/
data?: AttributeValueType | AnyValue;
/**
* Attributes to include with the event
*/
attributes?: Record<string, AttributeValueType | AnyValue>;
/**
* The events log severity
*/
severity?: LOG_SEVERITY_TEXT;
};
/**
* Sends a custom event.
* @param name The event name. Can not be any of the internal event names. See: EVENT_NAMES in src/semantic-conventions.
* @param opts Additional event details.
*/
export declare function sendEvent(name: string, opts?: EventOptions): void;
export {};