@datalayer/core 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/api/constants.d.ts +3 -0
- package/lib/api/constants.js +3 -0
- package/lib/api/index.d.ts +1 -0
- package/lib/api/index.js +1 -0
- package/lib/api/otel/index.d.ts +12 -0
- package/lib/api/otel/index.js +16 -0
- package/lib/api/otel/logs.d.ts +19 -0
- package/lib/api/otel/logs.js +43 -0
- package/lib/api/otel/metrics.d.ts +31 -0
- package/lib/api/otel/metrics.js +65 -0
- package/lib/api/otel/query.d.ts +16 -0
- package/lib/api/otel/query.js +37 -0
- package/lib/api/otel/services.d.ts +39 -0
- package/lib/api/otel/services.js +81 -0
- package/lib/api/otel/traces.d.ts +24 -0
- package/lib/api/otel/traces.js +53 -0
- package/lib/api/otel/types.d.ts +112 -0
- package/lib/api/otel/types.js +5 -0
- package/lib/config/Configuration.d.ts +4 -0
- package/lib/hooks/useCache.d.ts +14 -9
- package/lib/hooks/useCache.js +28 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +4 -0
- package/lib/otel/OtelLive.d.ts +12 -0
- package/lib/otel/OtelLive.js +354 -0
- package/lib/otel/OtelLogsList.d.ts +11 -0
- package/lib/otel/OtelLogsList.js +137 -0
- package/lib/otel/OtelMetricsChart.d.ts +22 -0
- package/lib/otel/OtelMetricsChart.js +300 -0
- package/lib/otel/OtelMetricsList.d.ts +15 -0
- package/lib/otel/OtelMetricsList.js +213 -0
- package/lib/otel/OtelSearchBar.d.ts +11 -0
- package/lib/otel/OtelSearchBar.js +22 -0
- package/lib/otel/OtelSpanDetail.d.ts +11 -0
- package/lib/otel/OtelSpanDetail.js +172 -0
- package/lib/otel/OtelSpanTree.d.ts +11 -0
- package/lib/otel/OtelSpanTree.js +176 -0
- package/lib/otel/OtelSqlView.d.ts +16 -0
- package/lib/otel/OtelSqlView.js +239 -0
- package/lib/otel/OtelSystemView.d.ts +15 -0
- package/lib/otel/OtelSystemView.js +75 -0
- package/lib/otel/OtelTimeline.d.ts +11 -0
- package/lib/otel/OtelTimeline.js +101 -0
- package/lib/otel/OtelTimelineRangeSlider.d.ts +16 -0
- package/lib/otel/OtelTimelineRangeSlider.js +338 -0
- package/lib/otel/OtelTracesList.d.ts +13 -0
- package/lib/otel/OtelTracesList.js +199 -0
- package/lib/otel/hooks.d.ts +172 -0
- package/lib/otel/hooks.js +490 -0
- package/lib/otel/index.d.ts +25 -0
- package/lib/otel/index.js +19 -0
- package/lib/otel/types.d.ts +190 -0
- package/lib/otel/types.js +5 -0
- package/lib/otel/utils.d.ts +33 -0
- package/lib/otel/utils.js +181 -0
- package/lib/state/storage/IAMStorage.d.ts +2 -1
- package/lib/state/substates/CoreState.js +1 -0
- package/lib/utils/Jwt.d.ts +42 -0
- package/lib/utils/Jwt.js +44 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -0
- package/lib/views/iam/SignInSimple.d.ts +38 -0
- package/lib/views/iam/SignInSimple.js +80 -0
- package/lib/views/iam/index.d.ts +2 -0
- package/lib/views/iam/index.js +5 -0
- package/lib/views/iam-tokens/IAMTokenEdit.js +53 -4
- package/lib/views/iam-tokens/IAMTokens.js +65 -33
- package/lib/views/iam-tokens/Tokens.js +63 -31
- package/lib/views/index.d.ts +2 -1
- package/lib/views/index.js +2 -1
- package/lib/views/profile/UserBadge.d.ts +18 -0
- package/lib/views/profile/UserBadge.js +101 -0
- package/lib/views/profile/index.d.ts +2 -0
- package/lib/views/profile/index.js +5 -0
- package/package.json +27 -3
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
4
|
+
* Distributed under the terms of the Modified BSD License.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* OtelTracesList – Tabular list of spans with Time / Message / Scope / Duration
|
|
8
|
+
* columns, using Primer React components for consistent theming.
|
|
9
|
+
*
|
|
10
|
+
* Spans that share the same trace_id are grouped into collapsible trees:
|
|
11
|
+
* only root spans are shown initially; clicking a row with children
|
|
12
|
+
* expands / collapses the nested child rows (shown indented).
|
|
13
|
+
*
|
|
14
|
+
* @module otel/OtelTracesList
|
|
15
|
+
*/
|
|
16
|
+
import { useMemo, useCallback, useState } from 'react';
|
|
17
|
+
import { Box, Text, Label, Spinner } from '@primer/react';
|
|
18
|
+
import { Blankslate } from '@primer/react/experimental';
|
|
19
|
+
import { TelescopeIcon, ChevronRightIcon, ChevronDownIcon, } from '@primer/octicons-react';
|
|
20
|
+
import { formatDuration, formatTime, buildSpanTree } from './utils';
|
|
21
|
+
const GRID_COLS = '140px 1fr 160px 90px';
|
|
22
|
+
// ── Helpers ─────────────────────────────────────────────────────────
|
|
23
|
+
/** Extract gen_ai token counts from span attributes. */
|
|
24
|
+
function getTokenUsage(span) {
|
|
25
|
+
const attrs = span.attributes;
|
|
26
|
+
if (!attrs)
|
|
27
|
+
return null;
|
|
28
|
+
const input = attrs['gen_ai.usage.input_tokens'] != null
|
|
29
|
+
? Number(attrs['gen_ai.usage.input_tokens'])
|
|
30
|
+
: undefined;
|
|
31
|
+
const output = attrs['gen_ai.usage.output_tokens'] != null
|
|
32
|
+
? Number(attrs['gen_ai.usage.output_tokens'])
|
|
33
|
+
: undefined;
|
|
34
|
+
if (input == null && output == null)
|
|
35
|
+
return null;
|
|
36
|
+
return { input, output };
|
|
37
|
+
}
|
|
38
|
+
export const OtelTracesList = ({ spans, loading, selectedSpanId, onSelectSpan, }) => {
|
|
39
|
+
// Set of expanded span_ids (show their children)
|
|
40
|
+
const [expanded, setExpanded] = useState(new Set());
|
|
41
|
+
// Build the span tree from flat input
|
|
42
|
+
const roots = useMemo(() => buildSpanTree(spans), [spans]);
|
|
43
|
+
// Flatten visible rows based on which nodes are expanded
|
|
44
|
+
const visibleRows = useMemo(() => {
|
|
45
|
+
const rows = [];
|
|
46
|
+
function walk(node, depth) {
|
|
47
|
+
const children = node.children ?? [];
|
|
48
|
+
rows.push({ span: node, depth, hasChildren: children.length > 0 });
|
|
49
|
+
if (expanded.has(node.span_id)) {
|
|
50
|
+
for (const child of children) {
|
|
51
|
+
walk(child, depth + 1);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
for (const root of roots) {
|
|
56
|
+
walk(root, 0);
|
|
57
|
+
}
|
|
58
|
+
return rows;
|
|
59
|
+
}, [roots, expanded]);
|
|
60
|
+
const toggleExpand = useCallback((spanId) => {
|
|
61
|
+
setExpanded(prev => {
|
|
62
|
+
const next = new Set(prev);
|
|
63
|
+
if (next.has(spanId)) {
|
|
64
|
+
next.delete(spanId);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
next.add(spanId);
|
|
68
|
+
}
|
|
69
|
+
return next;
|
|
70
|
+
});
|
|
71
|
+
}, []);
|
|
72
|
+
if (loading) {
|
|
73
|
+
return (_jsx(Box, { sx: { display: 'flex', justifyContent: 'center', p: 5 }, children: _jsx(Spinner, { size: "medium" }) }));
|
|
74
|
+
}
|
|
75
|
+
if (spans.length === 0) {
|
|
76
|
+
return (_jsxs(Blankslate, { children: [_jsx(Blankslate.Visual, { children: _jsx(TelescopeIcon, { size: 24 }) }), _jsx(Blankslate.Heading, { children: "No traces found" }), _jsx(Blankslate.Description, { children: "Send some telemetry data first." })] }));
|
|
77
|
+
}
|
|
78
|
+
return (_jsxs(Box, { sx: { width: '100%', flex: 1, minHeight: 0, overflow: 'auto' }, children: [_jsx(Box, { sx: {
|
|
79
|
+
display: 'grid',
|
|
80
|
+
gridTemplateColumns: GRID_COLS,
|
|
81
|
+
gap: 2,
|
|
82
|
+
px: 3,
|
|
83
|
+
position: 'sticky',
|
|
84
|
+
top: 0,
|
|
85
|
+
bg: 'canvas.subtle',
|
|
86
|
+
zIndex: 1,
|
|
87
|
+
borderBottom: '2px solid',
|
|
88
|
+
borderColor: 'border.default',
|
|
89
|
+
}, children: ['Time', 'Message', 'Scope', 'Duration'].map(h => (_jsx(Text, { sx: {
|
|
90
|
+
fontWeight: 'bold',
|
|
91
|
+
fontSize: 0,
|
|
92
|
+
color: 'fg.muted',
|
|
93
|
+
textTransform: 'uppercase',
|
|
94
|
+
letterSpacing: '0.05em',
|
|
95
|
+
py: 2,
|
|
96
|
+
...(h === 'Duration' ? { textAlign: 'right' } : {}),
|
|
97
|
+
}, children: h }, h))) }), visibleRows.map(({ span, depth, hasChildren }, idx) => {
|
|
98
|
+
const isSelected = selectedSpanId === span.span_id;
|
|
99
|
+
const isExpanded = expanded.has(span.span_id);
|
|
100
|
+
const indent = depth * 20;
|
|
101
|
+
return (_jsxs(Box, { onClick: () => {
|
|
102
|
+
if (hasChildren) {
|
|
103
|
+
toggleExpand(span.span_id);
|
|
104
|
+
}
|
|
105
|
+
onSelectSpan?.(span);
|
|
106
|
+
}, sx: {
|
|
107
|
+
display: 'grid',
|
|
108
|
+
gridTemplateColumns: GRID_COLS,
|
|
109
|
+
gap: 2,
|
|
110
|
+
px: 3,
|
|
111
|
+
py: '5px',
|
|
112
|
+
cursor: 'pointer',
|
|
113
|
+
bg: isSelected
|
|
114
|
+
? 'accent.subtle'
|
|
115
|
+
: depth > 0
|
|
116
|
+
? 'canvas.inset'
|
|
117
|
+
: 'canvas.default',
|
|
118
|
+
borderBottom: '1px solid',
|
|
119
|
+
borderColor: 'border.muted',
|
|
120
|
+
':hover': {
|
|
121
|
+
bg: isSelected ? 'accent.subtle' : 'canvas.subtle',
|
|
122
|
+
},
|
|
123
|
+
}, children: [_jsx(Text, { sx: {
|
|
124
|
+
fontSize: 1,
|
|
125
|
+
fontFamily: 'mono',
|
|
126
|
+
color: 'fg.muted',
|
|
127
|
+
whiteSpace: 'nowrap',
|
|
128
|
+
lineHeight: '22px',
|
|
129
|
+
}, children: formatTime(span.start_time) }), _jsxs(Box, { sx: {
|
|
130
|
+
display: 'flex',
|
|
131
|
+
alignItems: 'center',
|
|
132
|
+
gap: 1,
|
|
133
|
+
overflow: 'hidden',
|
|
134
|
+
lineHeight: '22px',
|
|
135
|
+
pl: `${indent}px`,
|
|
136
|
+
}, children: [hasChildren ? (_jsx(Box, { sx: {
|
|
137
|
+
flexShrink: 0,
|
|
138
|
+
color: 'fg.muted',
|
|
139
|
+
display: 'flex',
|
|
140
|
+
alignItems: 'center',
|
|
141
|
+
}, children: isExpanded ? (_jsx(ChevronDownIcon, { size: 14 })) : (_jsx(ChevronRightIcon, { size: 14 })) })) : depth > 0 ? (
|
|
142
|
+
/* Connector dash for child leaves */
|
|
143
|
+
_jsx(Box, { sx: {
|
|
144
|
+
flexShrink: 0,
|
|
145
|
+
width: '14px',
|
|
146
|
+
display: 'flex',
|
|
147
|
+
alignItems: 'center',
|
|
148
|
+
justifyContent: 'center',
|
|
149
|
+
color: 'fg.subtle',
|
|
150
|
+
fontSize: 0,
|
|
151
|
+
}, children: "\u2500" })) : null, _jsx(Text, { sx: {
|
|
152
|
+
fontSize: 1,
|
|
153
|
+
overflow: 'hidden',
|
|
154
|
+
textOverflow: 'ellipsis',
|
|
155
|
+
whiteSpace: 'nowrap',
|
|
156
|
+
}, title: span.span_name, children: span.span_name }), span.status_code === 'ERROR' && (_jsx(Label, { variant: "danger", size: "small", children: "ERROR" })), (() => {
|
|
157
|
+
const usage = getTokenUsage(span);
|
|
158
|
+
if (!usage)
|
|
159
|
+
return null;
|
|
160
|
+
return (_jsxs(Box, { sx: {
|
|
161
|
+
display: 'inline-flex',
|
|
162
|
+
alignItems: 'center',
|
|
163
|
+
gap: '2px',
|
|
164
|
+
border: '1px solid',
|
|
165
|
+
borderColor: 'border.default',
|
|
166
|
+
borderRadius: 2,
|
|
167
|
+
px: 1,
|
|
168
|
+
fontSize: '10px',
|
|
169
|
+
fontFamily: 'mono',
|
|
170
|
+
color: 'fg.muted',
|
|
171
|
+
flexShrink: 0,
|
|
172
|
+
lineHeight: '16px',
|
|
173
|
+
}, children: [usage.input != null && (_jsxs(Box, { sx: {
|
|
174
|
+
display: 'inline-flex',
|
|
175
|
+
alignItems: 'center',
|
|
176
|
+
gap: '1px',
|
|
177
|
+
}, children: [_jsx(Text, { sx: { fontSize: '9px', color: 'fg.subtle' }, children: "\u2197" }), _jsx(Text, { children: usage.input })] })), usage.output != null && (_jsxs(Box, { sx: {
|
|
178
|
+
display: 'inline-flex',
|
|
179
|
+
alignItems: 'center',
|
|
180
|
+
gap: '1px',
|
|
181
|
+
}, children: [_jsx(Text, { sx: { fontSize: '9px', color: 'fg.subtle' }, children: "\u2199" }), _jsx(Text, { children: usage.output })] }))] }));
|
|
182
|
+
})(), span.otel_scope_name && (_jsx(Label, { size: "small", variant: "secondary", sx: { flexShrink: 0, fontSize: '10px' }, children: span.otel_scope_name }))] }), _jsx(Text, { sx: {
|
|
183
|
+
fontSize: 1,
|
|
184
|
+
color: 'fg.muted',
|
|
185
|
+
overflow: 'hidden',
|
|
186
|
+
textOverflow: 'ellipsis',
|
|
187
|
+
whiteSpace: 'nowrap',
|
|
188
|
+
lineHeight: '22px',
|
|
189
|
+
}, title: `${span.service_name} / ${span.otel_scope_name ?? ''}`, children: span.service_name }), _jsx(Text, { sx: {
|
|
190
|
+
fontSize: 1,
|
|
191
|
+
fontFamily: 'mono',
|
|
192
|
+
textAlign: 'right',
|
|
193
|
+
lineHeight: '22px',
|
|
194
|
+
color: span.duration_ms != null && span.duration_ms > 1000
|
|
195
|
+
? 'danger.fg'
|
|
196
|
+
: 'fg.default',
|
|
197
|
+
}, children: formatDuration(span.duration_ms) })] }, `${span.trace_id}-${span.span_id}-${idx}`));
|
|
198
|
+
})] }));
|
|
199
|
+
};
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import type { OtelSpan, OtelLog, OtelMetric, OtelQueryRow } from './types';
|
|
2
|
+
/** Fetch a list of traces / spans from the OTEL service. */
|
|
3
|
+
export declare function useOtelTraces(options: {
|
|
4
|
+
token?: string;
|
|
5
|
+
baseUrl?: string;
|
|
6
|
+
serviceName?: string;
|
|
7
|
+
limit?: number;
|
|
8
|
+
autoRefreshMs?: number;
|
|
9
|
+
}): {
|
|
10
|
+
traces: OtelSpan[];
|
|
11
|
+
loading: boolean;
|
|
12
|
+
error: string | null;
|
|
13
|
+
refetch: () => Promise<void>;
|
|
14
|
+
};
|
|
15
|
+
/** Fetch all spans for a single trace. */
|
|
16
|
+
export declare function useOtelTrace(options: {
|
|
17
|
+
traceId: string | null;
|
|
18
|
+
token?: string;
|
|
19
|
+
baseUrl?: string;
|
|
20
|
+
}): {
|
|
21
|
+
spans: OtelSpan[];
|
|
22
|
+
loading: boolean;
|
|
23
|
+
error: string | null;
|
|
24
|
+
};
|
|
25
|
+
/** Fetch log records from the OTEL service. */
|
|
26
|
+
export declare function useOtelLogs(options: {
|
|
27
|
+
token?: string;
|
|
28
|
+
baseUrl?: string;
|
|
29
|
+
serviceName?: string;
|
|
30
|
+
severity?: string;
|
|
31
|
+
traceId?: string;
|
|
32
|
+
limit?: number;
|
|
33
|
+
autoRefreshMs?: number;
|
|
34
|
+
}): {
|
|
35
|
+
logs: OtelLog[];
|
|
36
|
+
loading: boolean;
|
|
37
|
+
error: string | null;
|
|
38
|
+
refetch: () => Promise<void>;
|
|
39
|
+
};
|
|
40
|
+
/** Fetch metrics from the OTEL service. */
|
|
41
|
+
export declare function useOtelMetrics(options: {
|
|
42
|
+
token?: string;
|
|
43
|
+
baseUrl?: string;
|
|
44
|
+
serviceName?: string;
|
|
45
|
+
metricName?: string;
|
|
46
|
+
limit?: number;
|
|
47
|
+
autoRefreshMs?: number;
|
|
48
|
+
}): {
|
|
49
|
+
metrics: OtelMetric[];
|
|
50
|
+
loading: boolean;
|
|
51
|
+
error: string | null;
|
|
52
|
+
refetch: () => Promise<void>;
|
|
53
|
+
};
|
|
54
|
+
/** Fetch list of observed service names. */
|
|
55
|
+
export declare function useOtelServices(options: {
|
|
56
|
+
token?: string;
|
|
57
|
+
baseUrl?: string;
|
|
58
|
+
}): {
|
|
59
|
+
services: string[];
|
|
60
|
+
loading: boolean;
|
|
61
|
+
};
|
|
62
|
+
/** Fetch storage stats from the OTEL service. */
|
|
63
|
+
export declare function useOtelStats(options: {
|
|
64
|
+
token?: string;
|
|
65
|
+
baseUrl?: string;
|
|
66
|
+
}): {
|
|
67
|
+
stats: Record<string, unknown>;
|
|
68
|
+
loading: boolean;
|
|
69
|
+
};
|
|
70
|
+
export interface OtelSystemProcess {
|
|
71
|
+
memory_rss_bytes: number;
|
|
72
|
+
memory_vms_bytes: number;
|
|
73
|
+
cpu_percent: number;
|
|
74
|
+
num_threads: number;
|
|
75
|
+
error?: string;
|
|
76
|
+
}
|
|
77
|
+
export interface OtelSystemDisk {
|
|
78
|
+
data_dir: string;
|
|
79
|
+
used_bytes: number;
|
|
80
|
+
free_bytes: number;
|
|
81
|
+
total_bytes: number;
|
|
82
|
+
used_percent: number;
|
|
83
|
+
error?: string;
|
|
84
|
+
}
|
|
85
|
+
export interface OtelSystemTable {
|
|
86
|
+
row_count: number;
|
|
87
|
+
distinct_users: number;
|
|
88
|
+
disk_bytes: number;
|
|
89
|
+
error?: string;
|
|
90
|
+
}
|
|
91
|
+
export interface OtelSystemData {
|
|
92
|
+
process: OtelSystemProcess;
|
|
93
|
+
disk: OtelSystemDisk;
|
|
94
|
+
tables: Record<string, OtelSystemTable>;
|
|
95
|
+
total_distinct_users: number;
|
|
96
|
+
}
|
|
97
|
+
/** Fetch system statistics from /api/otel/v1/system/ (platform_admin). */
|
|
98
|
+
export declare function useOtelSystem(options: {
|
|
99
|
+
token?: string;
|
|
100
|
+
baseUrl?: string;
|
|
101
|
+
}): {
|
|
102
|
+
data: OtelSystemData | null;
|
|
103
|
+
loading: boolean;
|
|
104
|
+
error: string | null;
|
|
105
|
+
refresh: () => void;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Execute an ad-hoc DataFusion SQL query against the OTEL service.
|
|
109
|
+
*
|
|
110
|
+
* Usage:
|
|
111
|
+
* ```tsx
|
|
112
|
+
* const { execute, rows, loading, error } = useOtelQuery({ baseUrl, token });
|
|
113
|
+
* await execute('SELECT trace_id FROM spans LIMIT 10');
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
export declare function useOtelQuery(options: {
|
|
117
|
+
token?: string;
|
|
118
|
+
baseUrl?: string;
|
|
119
|
+
}): {
|
|
120
|
+
rows: OtelQueryRow[];
|
|
121
|
+
loading: boolean;
|
|
122
|
+
error: string | null;
|
|
123
|
+
execute: (sql: string) => Promise<void>;
|
|
124
|
+
clear: () => void;
|
|
125
|
+
};
|
|
126
|
+
/** WebSocket message shape sent by the OTEL service. */
|
|
127
|
+
export interface OtelWsMessage {
|
|
128
|
+
signal: 'traces' | 'logs' | 'metrics';
|
|
129
|
+
data: Record<string, unknown>[];
|
|
130
|
+
count: number;
|
|
131
|
+
}
|
|
132
|
+
/** Callbacks for WebSocket lifecycle events. */
|
|
133
|
+
export interface OtelWsCallbacks {
|
|
134
|
+
/** Called when new traces are flushed. */
|
|
135
|
+
onTraces?: (spans: OtelSpan[]) => void;
|
|
136
|
+
/** Called when new logs are flushed. */
|
|
137
|
+
onLogs?: (logs: OtelLog[]) => void;
|
|
138
|
+
/** Called when new metrics are flushed. */
|
|
139
|
+
onMetrics?: (metrics: OtelMetric[]) => void;
|
|
140
|
+
/** Called on any message (raw). */
|
|
141
|
+
onMessage?: (msg: OtelWsMessage) => void;
|
|
142
|
+
/** Called when connection opens. */
|
|
143
|
+
onOpen?: () => void;
|
|
144
|
+
/** Called when connection closes. */
|
|
145
|
+
onClose?: (event: CloseEvent) => void;
|
|
146
|
+
/** Called on error. */
|
|
147
|
+
onError?: (event: Event) => void;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Connect to the OTEL service WebSocket for live telemetry streaming.
|
|
151
|
+
*
|
|
152
|
+
* The server pushes JSON messages whenever new data is flushed to storage.
|
|
153
|
+
* Authentication is via the `token` query parameter (JWT or API key).
|
|
154
|
+
*
|
|
155
|
+
* @returns `{ connected, error, close }` – reactive connection state.
|
|
156
|
+
*/
|
|
157
|
+
export declare function useOtelWebSocket(options: {
|
|
158
|
+
/** OTEL service base URL (e.g. `http://localhost:7800`). */
|
|
159
|
+
baseUrl?: string;
|
|
160
|
+
/** JWT token or API key for authentication. */
|
|
161
|
+
token?: string;
|
|
162
|
+
/** Whether to automatically reconnect on disconnect. Default true. */
|
|
163
|
+
autoReconnect?: boolean;
|
|
164
|
+
/** Reconnect delay in ms. Default 3000. */
|
|
165
|
+
reconnectDelayMs?: number;
|
|
166
|
+
/** Callbacks for signal events. */
|
|
167
|
+
callbacks?: OtelWsCallbacks;
|
|
168
|
+
}): {
|
|
169
|
+
connected: boolean;
|
|
170
|
+
error: string | null;
|
|
171
|
+
close: () => void;
|
|
172
|
+
};
|