@rtkelly-labs/design-system 0.16.0 → 0.18.0
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/CHANGELOG.md +28 -0
- package/dist/components/AlertList.js +246 -0
- package/dist/components/AlertList.js.map +1 -0
- package/dist/components/FilterBar.js +215 -0
- package/dist/components/FilterBar.js.map +1 -0
- package/dist/components/FreshnessIndicator.js +50 -0
- package/dist/components/FreshnessIndicator.js.map +1 -0
- package/dist/components/IdChip.js +58 -0
- package/dist/components/IdChip.js.map +1 -0
- package/dist/components/IncidentTimeline.js +122 -0
- package/dist/components/IncidentTimeline.js.map +1 -0
- package/dist/components/LatencyHeatmap.js +382 -0
- package/dist/components/LatencyHeatmap.js.map +1 -0
- package/dist/components/LatencyHistogram.js +282 -0
- package/dist/components/LatencyHistogram.js.map +1 -0
- package/dist/components/LogViewer.js +393 -0
- package/dist/components/LogViewer.js.map +1 -0
- package/dist/components/ServiceMap.js +404 -0
- package/dist/components/ServiceMap.js.map +1 -0
- package/dist/components/SeverityBadge.js +15 -0
- package/dist/components/SeverityBadge.js.map +1 -0
- package/dist/components/TimeRange.js +89 -0
- package/dist/components/TimeRange.js.map +1 -0
- package/dist/components/TimeSeriesChart.js +507 -0
- package/dist/components/TimeSeriesChart.js.map +1 -0
- package/dist/components/TraceViewer.js +159 -0
- package/dist/components/TraceViewer.js.map +1 -0
- package/dist/components/TraceWaterfall.js +226 -0
- package/dist/components/TraceWaterfall.js.map +1 -0
- package/dist/components/docs/figures/ChangeSummary.js +5 -5
- package/dist/components/docs/figures/ChangeSummary.js.map +1 -1
- package/dist/components/docs/figures/FileChangeTree.js +4 -4
- package/dist/components/docs/figures/FileChangeTree.js.map +1 -1
- package/dist/components/saas/ObservabilityConsole.js +220 -0
- package/dist/components/saas/ObservabilityConsole.js.map +1 -0
- package/dist/components/saas/observabilityData.js +250 -0
- package/dist/components/saas/observabilityData.js.map +1 -0
- package/dist/hooks/useMeasuredWidth.js +22 -0
- package/dist/hooks/useMeasuredWidth.js.map +1 -0
- package/dist/hooks/useTraceClock.js +17 -0
- package/dist/hooks/useTraceClock.js.map +1 -0
- package/dist/hooks/useTraceReplay.js +75 -0
- package/dist/hooks/useTraceReplay.js.map +1 -0
- package/dist/index.d.ts +1596 -3
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/filters.js +130 -0
- package/dist/lib/filters.js.map +1 -0
- package/dist/lib/ids.js +9 -0
- package/dist/lib/ids.js.map +1 -0
- package/dist/lib/latency.js +228 -0
- package/dist/lib/latency.js.map +1 -0
- package/dist/lib/logs.js +78 -0
- package/dist/lib/logs.js.map +1 -0
- package/dist/lib/serviceGraph.js +243 -0
- package/dist/lib/serviceGraph.js.map +1 -0
- package/dist/lib/severity.js +23 -0
- package/dist/lib/severity.js.map +1 -0
- package/dist/lib/theme.js +12 -0
- package/dist/lib/theme.js.map +1 -1
- package/dist/lib/timeRange.js +94 -0
- package/dist/lib/timeRange.js.map +1 -0
- package/dist/lib/timeSeries.js +285 -0
- package/dist/lib/timeSeries.js.map +1 -0
- package/dist/lib/trace.js +251 -0
- package/dist/lib/trace.js.map +1 -0
- package/dist/theme/contrast.js +15 -0
- package/dist/theme/contrast.js.map +1 -1
- package/dist/theme/levels.js +31 -0
- package/dist/theme/levels.js.map +1 -1
- package/dist/theme.css +30 -0
- package/package.json +1 -1
- package/tokens/palette.midnight.tokens.json +50 -0
- package/tokens/palette.sketch.tokens.json +50 -0
package/dist/index.d.ts
CHANGED
|
@@ -30,6 +30,14 @@ type Emphasis = 'primary' | 'secondary' | 'tertiary' | 'quiet';
|
|
|
30
30
|
* when their hues are not.
|
|
31
31
|
*/
|
|
32
32
|
type Intent = 'info' | 'success' | 'warning' | 'danger';
|
|
33
|
+
/**
|
|
34
|
+
* Change, as a comparison reports it. Use for diff signs, change counts and
|
|
35
|
+
* change bars — never for whether the change is acceptable, which is an
|
|
36
|
+
* {@link Intent}. Red text on a removed line says *removed*, not *wrong*.
|
|
37
|
+
*/
|
|
38
|
+
type Delta = 'added' | 'removed' | 'moved';
|
|
39
|
+
/** The grounds a diff paints behind its rows. `hunk` sits behind a hunk header. */
|
|
40
|
+
type DeltaGround = 'added' | 'removed' | 'hunk';
|
|
33
41
|
/**
|
|
34
42
|
* Background elevation. `base` is the page, `raised` sits above it (cards,
|
|
35
43
|
* header, drawers), `sunken` is inset (code wells), `overlay` is modal.
|
|
@@ -108,6 +116,8 @@ declare const HEADING_EMPHASIS: Record<1 | 2 | 3 | 4 | 5 | 6, Emphasis>;
|
|
|
108
116
|
declare const semanticTokens: {
|
|
109
117
|
readonly accent: Record<Emphasis, string>;
|
|
110
118
|
readonly intent: Record<Intent, string>;
|
|
119
|
+
readonly delta: Record<Delta, string>;
|
|
120
|
+
readonly deltaGround: Record<DeltaGround, string>;
|
|
111
121
|
readonly surface: Record<Surface, string>;
|
|
112
122
|
readonly text: Record<TextTone, string>;
|
|
113
123
|
readonly border: Record<BorderTone, string>;
|
|
@@ -160,7 +170,7 @@ declare const semanticTokens: {
|
|
|
160
170
|
* hold at the light end — `border-subtle` at 28% is a visible hairline on
|
|
161
171
|
* black and invisible on paper. Literals also make the ladder *checkable*:
|
|
162
172
|
* `pnpm check:contrast` can compute every text-on-surface ratio without a
|
|
163
|
-
* browser —
|
|
173
|
+
* browser — 296 pairs, 148 per Level, including every Hue against every
|
|
164
174
|
* ground, which is what makes hand-tuned literals sustainable rather than
|
|
165
175
|
* twenty times the manual review. Stated per Level deliberately: 440 was
|
|
166
176
|
* written here in the commit that collapsed four Levels to two, so the total
|
|
@@ -230,6 +240,23 @@ interface LevelDefinition {
|
|
|
230
240
|
readonly border: Readonly<Record<BorderTone, string>>;
|
|
231
241
|
readonly accent: Readonly<Record<Emphasis, string>>;
|
|
232
242
|
readonly intent: Readonly<Record<Intent, string>>;
|
|
243
|
+
/**
|
|
244
|
+
* Change, as a comparison reports it: a line or record added, removed, or
|
|
245
|
+
* moved. Separate from `intent` on purpose. An added line is not a success
|
|
246
|
+
* and a removed one is not a danger; whether a change is acceptable is a
|
|
247
|
+
* policy's call, and a renderer that paints it green or red has made that
|
|
248
|
+
* call for the reader. The two groups may share a Hue, as `added` and
|
|
249
|
+
* `intent.success` do, and still diverge where the meanings would clash:
|
|
250
|
+
* `midnight`'s `removed` is red while its `danger` is pink.
|
|
251
|
+
*/
|
|
252
|
+
readonly delta: Readonly<Record<Delta, string>>;
|
|
253
|
+
/**
|
|
254
|
+
* The grounds a diff paints behind changed rows, and behind a hunk header.
|
|
255
|
+
* Literal tints rather than `color-mix()` for the reason given in the
|
|
256
|
+
* module header. `text.primary` and the matching `delta` role must both
|
|
257
|
+
* clear the text floor on each, which `check:contrast` asserts.
|
|
258
|
+
*/
|
|
259
|
+
readonly deltaGround: Readonly<Record<DeltaGround, string>>;
|
|
233
260
|
/**
|
|
234
261
|
* The Hue vocabulary — appearance, not job. Declared *below* the Roles above
|
|
235
262
|
* and referenced by them, never derived from them. Only a Target with no
|
|
@@ -258,6 +285,8 @@ interface LevelDefinition {
|
|
|
258
285
|
readonly accentHue: Readonly<Record<Emphasis, HueRef>>;
|
|
259
286
|
/** As `accentHue`, for the meaning Roles. */
|
|
260
287
|
readonly intentHue: Readonly<Record<Intent, HueRef>>;
|
|
288
|
+
/** As `accentHue`, for the change Roles. */
|
|
289
|
+
readonly deltaHue: Readonly<Record<Delta, HueRef>>;
|
|
261
290
|
/** Colour of the hard offset shadows. Normally tracks `border.strong`. */
|
|
262
291
|
readonly shadow: string;
|
|
263
292
|
}
|
|
@@ -969,6 +998,57 @@ interface UseActiveHeadingOptions {
|
|
|
969
998
|
*/
|
|
970
999
|
declare function useActiveHeading(ids: readonly string[], { offset, enabled }?: UseActiveHeadingOptions): string | null;
|
|
971
1000
|
|
|
1001
|
+
interface UseTraceClockOptions {
|
|
1002
|
+
/** Tick while true. Default true — pass `model.inFlightCount > 0` to stop once a trace settles. */
|
|
1003
|
+
running?: boolean;
|
|
1004
|
+
/** Milliseconds between ticks. Default 100. */
|
|
1005
|
+
interval?: number;
|
|
1006
|
+
/** The clock, for tests and replays. Default `Date.now`. */
|
|
1007
|
+
read?: () => number;
|
|
1008
|
+
}
|
|
1009
|
+
/**
|
|
1010
|
+
* The `now` a live `TraceWaterfall` or `TraceViewer` draws in-flight spans to.
|
|
1011
|
+
*
|
|
1012
|
+
* The components never read the clock themselves, so a render is deterministic;
|
|
1013
|
+
* this hook is the one place a live trace gets its time. It stops ticking when
|
|
1014
|
+
* `running` turns false, and returns the last value it read.
|
|
1015
|
+
*/
|
|
1016
|
+
declare function useTraceClock({ running, interval, read }?: UseTraceClockOptions): number;
|
|
1017
|
+
|
|
1018
|
+
interface UseTraceReplayOptions {
|
|
1019
|
+
/** Start playing on mount. Default false. */
|
|
1020
|
+
autoPlay?: boolean;
|
|
1021
|
+
/** Restart from zero on reaching the end. Default false. */
|
|
1022
|
+
loop?: boolean;
|
|
1023
|
+
/** Playback rate: 1 is real time. Default 1. */
|
|
1024
|
+
speed?: number;
|
|
1025
|
+
/** Pause held at the end before a loop restarts, in real milliseconds. Default 800. */
|
|
1026
|
+
loopDelay?: number;
|
|
1027
|
+
}
|
|
1028
|
+
interface TraceReplay {
|
|
1029
|
+
/** Trace time reached, in milliseconds from its start. */
|
|
1030
|
+
elapsed: number;
|
|
1031
|
+
playing: boolean;
|
|
1032
|
+
speed: number;
|
|
1033
|
+
play: () => void;
|
|
1034
|
+
pause: () => void;
|
|
1035
|
+
toggle: () => void;
|
|
1036
|
+
/** Back to zero, playing. */
|
|
1037
|
+
restart: () => void;
|
|
1038
|
+
/** Jump to a trace time. Keeps playing if it was. */
|
|
1039
|
+
seek: (elapsed: number) => void;
|
|
1040
|
+
setSpeed: (speed: number) => void;
|
|
1041
|
+
}
|
|
1042
|
+
/**
|
|
1043
|
+
* Plays a finished trace back in real time: `elapsed` advances from 0 to
|
|
1044
|
+
* `duration` on animation frames, scaled by `speed`. Hand it to `replayTrace`
|
|
1045
|
+
* and the waterfall draws each span as it starts and grows it until it ends.
|
|
1046
|
+
*
|
|
1047
|
+
* The clock is the only impure thing in the trace components, and it lives
|
|
1048
|
+
* here: paused, nothing re-renders.
|
|
1049
|
+
*/
|
|
1050
|
+
declare function useTraceReplay(duration: number, { autoPlay, loop, speed: initialSpeed, loopDelay }?: UseTraceReplayOptions): TraceReplay;
|
|
1051
|
+
|
|
972
1052
|
interface ButtonOwnProps {
|
|
973
1053
|
/**
|
|
974
1054
|
* The label. Written in caps at the call site rather than upper-cased in
|
|
@@ -4840,6 +4920,1494 @@ interface BulletChartProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'
|
|
|
4840
4920
|
*/
|
|
4841
4921
|
declare const BulletChart: react.ForwardRefExoticComponent<BulletChartProps & react.RefAttributes<HTMLDivElement>>;
|
|
4842
4922
|
|
|
4923
|
+
/**
|
|
4924
|
+
* The trace model: spans in, a laid-out waterfall out.
|
|
4925
|
+
*
|
|
4926
|
+
* One module answers "where does this span sit, and why is it slow?" for
|
|
4927
|
+
* `TraceWaterfall` and `TraceViewer`. Pure data, no React, so a consumer can
|
|
4928
|
+
* build, filter or inspect a trace without rendering one.
|
|
4929
|
+
*
|
|
4930
|
+
* ## Time
|
|
4931
|
+
*
|
|
4932
|
+
* Every time here is **milliseconds**, as numbers. OTLP's nanosecond strings
|
|
4933
|
+
* are converted at the parse boundary (`parseOtlpTrace`) and nowhere else.
|
|
4934
|
+
*
|
|
4935
|
+
* ## Dynamic traces
|
|
4936
|
+
*
|
|
4937
|
+
* A span with no `end` and no `duration` is **in flight**. It is drawn to
|
|
4938
|
+
* `now`, which the caller supplies — the model never reads the clock, so a
|
|
4939
|
+
* render is a pure function of its inputs and a story or a snapshot is
|
|
4940
|
+
* deterministic. Feed a growing span list and an advancing `now` and the
|
|
4941
|
+
* waterfall grows live; see `useTraceClock`.
|
|
4942
|
+
*/
|
|
4943
|
+
/** A span attribute value, as OTLP's `AnyValue` flattens to. */
|
|
4944
|
+
type TraceAttributeValue = string | number | boolean;
|
|
4945
|
+
/** Outcome of a span. `unset` is OTLP's default: nothing was recorded. */
|
|
4946
|
+
type TraceSpanStatus = 'ok' | 'error' | 'unset';
|
|
4947
|
+
/** One span as a caller hands it over. */
|
|
4948
|
+
interface TraceSpanInput {
|
|
4949
|
+
/** Unique within the trace. */
|
|
4950
|
+
id: string;
|
|
4951
|
+
/** The enclosing span. Missing, or naming a span not in the trace, makes this a root. */
|
|
4952
|
+
parentId?: string | null;
|
|
4953
|
+
/** Operation name — `GET /checkout`, `db.query`. */
|
|
4954
|
+
name: string;
|
|
4955
|
+
/** The service (OTLP `service.name`) that emitted the span. */
|
|
4956
|
+
service?: string;
|
|
4957
|
+
/** Start time in milliseconds, on any epoch shared by the whole trace. */
|
|
4958
|
+
start: number;
|
|
4959
|
+
/** End time in milliseconds. Omit with `duration` for an in-flight span. */
|
|
4960
|
+
end?: number;
|
|
4961
|
+
/** Duration in milliseconds. Used when `end` is absent. */
|
|
4962
|
+
duration?: number;
|
|
4963
|
+
/** Defaults to `unset`. */
|
|
4964
|
+
status?: TraceSpanStatus;
|
|
4965
|
+
/** OTLP span kind — `server`, `client`, `internal`, `producer`, `consumer`. */
|
|
4966
|
+
kind?: string;
|
|
4967
|
+
/** Flat key/value attributes, shown in the span details. */
|
|
4968
|
+
attributes?: Record<string, TraceAttributeValue>;
|
|
4969
|
+
}
|
|
4970
|
+
/** A span after layout. Offsets are relative to the trace start. */
|
|
4971
|
+
interface TraceSpan {
|
|
4972
|
+
id: string;
|
|
4973
|
+
parentId: string | null;
|
|
4974
|
+
name: string;
|
|
4975
|
+
service: string;
|
|
4976
|
+
status: TraceSpanStatus;
|
|
4977
|
+
kind?: string;
|
|
4978
|
+
attributes: Record<string, TraceAttributeValue>;
|
|
4979
|
+
/** Nesting depth; roots are 0. */
|
|
4980
|
+
depth: number;
|
|
4981
|
+
/** Child span ids, in start order. */
|
|
4982
|
+
children: string[];
|
|
4983
|
+
/** Milliseconds from the trace start. */
|
|
4984
|
+
offset: number;
|
|
4985
|
+
/** Milliseconds. For an in-flight span, up to `now`. */
|
|
4986
|
+
duration: number;
|
|
4987
|
+
/** Duration not covered by any child. */
|
|
4988
|
+
selfTime: number;
|
|
4989
|
+
/** Had no end: drawn to `now`. */
|
|
4990
|
+
inFlight: boolean;
|
|
4991
|
+
/** On the chain of spans that determined the trace's end. */
|
|
4992
|
+
critical: boolean;
|
|
4993
|
+
}
|
|
4994
|
+
/** A trace laid out for drawing. */
|
|
4995
|
+
interface TraceModel {
|
|
4996
|
+
/** Every span, depth-first in start order — the waterfall's row order. */
|
|
4997
|
+
spans: TraceSpan[];
|
|
4998
|
+
byId: ReadonlyMap<string, TraceSpan>;
|
|
4999
|
+
/** Absolute start of the earliest span, in the input's epoch. */
|
|
5000
|
+
start: number;
|
|
5001
|
+
/** Milliseconds from the first start to the last end. */
|
|
5002
|
+
duration: number;
|
|
5003
|
+
/** Distinct services, in order of first appearance. */
|
|
5004
|
+
services: string[];
|
|
5005
|
+
errorCount: number;
|
|
5006
|
+
inFlightCount: number;
|
|
5007
|
+
/** Ids on the critical path, root first. */
|
|
5008
|
+
criticalPath: string[];
|
|
5009
|
+
}
|
|
5010
|
+
interface BuildTraceOptions {
|
|
5011
|
+
/**
|
|
5012
|
+
* Where an in-flight span ends, in the input's epoch. Defaults to the latest
|
|
5013
|
+
* known end or start, so an in-flight span without a clock is drawn to the
|
|
5014
|
+
* trace's edge rather than to nothing.
|
|
5015
|
+
*/
|
|
5016
|
+
now?: number;
|
|
5017
|
+
}
|
|
5018
|
+
/**
|
|
5019
|
+
* Lay out a trace. Spans with a non-finite start are dropped; duplicate ids
|
|
5020
|
+
* keep the first; a parent cycle is broken by treating the span that closes it
|
|
5021
|
+
* as a root.
|
|
5022
|
+
*/
|
|
5023
|
+
declare function buildTrace(input: readonly TraceSpanInput[] | TraceModel, options?: BuildTraceOptions): TraceModel;
|
|
5024
|
+
/**
|
|
5025
|
+
* The rows to draw when the spans in `collapsed` hide their descendants, and —
|
|
5026
|
+
* when `filter` is given — only spans that match it, together with the
|
|
5027
|
+
* ancestors that place them.
|
|
5028
|
+
*/
|
|
5029
|
+
declare function visibleTraceSpans(model: TraceModel, collapsed?: ReadonlySet<string>, filter?: (span: TraceSpan) => boolean): TraceSpan[];
|
|
5030
|
+
/** A case-insensitive match on name, service and attribute values. */
|
|
5031
|
+
declare function matchTraceSpan(span: TraceSpan, query: string): boolean;
|
|
5032
|
+
/** `0.42ms`, `12ms`, `1.24s`, `2m 05s`. */
|
|
5033
|
+
declare function formatTraceDuration(ms: number): string;
|
|
5034
|
+
/**
|
|
5035
|
+
* Read OTLP/JSON (`{ resourceSpans: [...] }`, as an OpenTelemetry collector's
|
|
5036
|
+
* file exporter or `/v1/traces` writes it) into span inputs. `service.name`
|
|
5037
|
+
* comes from each resource. Ids are taken as written (hex or base64).
|
|
5038
|
+
*/
|
|
5039
|
+
declare function parseOtlpTrace(document: unknown): TraceSpanInput[];
|
|
5040
|
+
/**
|
|
5041
|
+
* Accept any of the shapes a trace arrives in: OTLP/JSON, a bare span array,
|
|
5042
|
+
* `{ spans: [...] }`, or newline-delimited JSON where each line is one of
|
|
5043
|
+
* those. Unparseable lines are skipped, so a partially written stream reads.
|
|
5044
|
+
*/
|
|
5045
|
+
declare function parseTraceDocument(input: unknown): TraceSpanInput[];
|
|
5046
|
+
/**
|
|
5047
|
+
* The trace as it stood `elapsed` milliseconds after it began: spans that had
|
|
5048
|
+
* not started are absent, and spans still running are open — no end, and no
|
|
5049
|
+
* status, because a status is only known once a span finishes. Feed it a
|
|
5050
|
+
* clock and a finished trace plays back as it was recorded.
|
|
5051
|
+
*/
|
|
5052
|
+
declare function replayTrace(input: readonly TraceSpanInput[] | TraceModel, elapsed: number): TraceSpanInput[];
|
|
5053
|
+
|
|
5054
|
+
/** What a screen reader hears for one row — the bar's geometry, said in words. */
|
|
5055
|
+
declare function describeTraceSpan(span: TraceSpan): string;
|
|
5056
|
+
interface TraceWaterfallProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
|
5057
|
+
/** The spans, or a model already built with `buildTrace`. */
|
|
5058
|
+
spans: readonly TraceSpanInput[] | TraceModel;
|
|
5059
|
+
/**
|
|
5060
|
+
* Where in-flight spans end, in the spans' own epoch. Advance it — see
|
|
5061
|
+
* `useTraceClock` — and in-flight bars grow. Ignored when `spans` is a model.
|
|
5062
|
+
*/
|
|
5063
|
+
now?: number;
|
|
5064
|
+
/** The selected span id. Controlled when defined; `null` selects nothing. */
|
|
5065
|
+
selectedId?: string | null;
|
|
5066
|
+
/** The span selected on mount when uncontrolled. */
|
|
5067
|
+
defaultSelectedId?: string | null;
|
|
5068
|
+
/** Called with the id a click, Enter or Space selects. */
|
|
5069
|
+
onSelectedChange?: (id: string | null) => void;
|
|
5070
|
+
/** Ids of collapsed spans. Controlled when defined. */
|
|
5071
|
+
collapsed?: readonly string[];
|
|
5072
|
+
/** Ids collapsed on mount when uncontrolled. */
|
|
5073
|
+
defaultCollapsed?: readonly string[];
|
|
5074
|
+
/** Called with the new collapsed set when a row is expanded or collapsed. */
|
|
5075
|
+
onCollapsedChange?: (ids: string[]) => void;
|
|
5076
|
+
/** Show only spans matching this text (name, service or `key=value`), with their ancestors. */
|
|
5077
|
+
filter?: string;
|
|
5078
|
+
/** Roughly how many axis intervals to draw. Default 4. */
|
|
5079
|
+
ticks?: number;
|
|
5080
|
+
/**
|
|
5081
|
+
* Fix the axis to this many milliseconds instead of fitting the spans — so a
|
|
5082
|
+
* replay's bars grow across a still axis rather than the axis shrinking
|
|
5083
|
+
* under them. Never shorter than the spans themselves.
|
|
5084
|
+
*/
|
|
5085
|
+
range?: number;
|
|
5086
|
+
/** Draw a playhead at this offset, in milliseconds from the trace start. */
|
|
5087
|
+
playhead?: number;
|
|
5088
|
+
/** Fade rows in as they appear. For replays and streams. Default false. */
|
|
5089
|
+
animate?: boolean;
|
|
5090
|
+
/** Accessible name for the span tree. Default `Trace waterfall`. */
|
|
5091
|
+
label?: string;
|
|
5092
|
+
}
|
|
5093
|
+
/**
|
|
5094
|
+
* A distributed-trace waterfall: one row per span, nested by parent, each bar
|
|
5095
|
+
* placed on a shared time axis.
|
|
5096
|
+
*
|
|
5097
|
+
* The rows are a keyboard tree — arrows move, Left and Right collapse and
|
|
5098
|
+
* expand, Enter or Space selects — hand-rolled rather than borrowed, per the
|
|
5099
|
+
* one-interaction-library rule. Bars are SVG, so placing them takes no inline
|
|
5100
|
+
* style. In-flight spans (no end) are drawn to `now`; feed it a clock and the
|
|
5101
|
+
* waterfall is live. `◆` marks the critical path.
|
|
5102
|
+
*/
|
|
5103
|
+
declare const TraceWaterfall: react.ForwardRefExoticComponent<TraceWaterfallProps & react.RefAttributes<HTMLDivElement>>;
|
|
5104
|
+
|
|
5105
|
+
interface TraceViewerProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
|
|
5106
|
+
/** The spans, or a model built with `buildTrace`. */
|
|
5107
|
+
spans: readonly TraceSpanInput[] | TraceModel;
|
|
5108
|
+
/** Where in-flight spans end. Pair with `useTraceClock` for a live trace. */
|
|
5109
|
+
now?: number;
|
|
5110
|
+
/** Heading for the trace — an id, a route, a job name. */
|
|
5111
|
+
title?: string;
|
|
5112
|
+
/** The span whose details show on mount. Default: the first root. */
|
|
5113
|
+
defaultSelectedId?: string | null;
|
|
5114
|
+
/** Show the filter field. Default true. */
|
|
5115
|
+
searchable?: boolean;
|
|
5116
|
+
/**
|
|
5117
|
+
* Add replay controls: the trace plays back in real time, each span drawn
|
|
5118
|
+
* as it starts and grown until it ends, on an axis fixed to the full trace.
|
|
5119
|
+
*/
|
|
5120
|
+
replay?: boolean;
|
|
5121
|
+
/** With `replay`, start playing on mount. Default false. */
|
|
5122
|
+
autoPlay?: boolean;
|
|
5123
|
+
/** With `replay`, start again from zero at the end. Default false. */
|
|
5124
|
+
loop?: boolean;
|
|
5125
|
+
/** With `replay`, the initial playback rate. Default 1. */
|
|
5126
|
+
defaultSpeed?: number;
|
|
5127
|
+
}
|
|
5128
|
+
/**
|
|
5129
|
+
* A trace viewer: a summary strip, a filterable `TraceWaterfall`, and the
|
|
5130
|
+
* selected span's details — timing, self time, status and attributes.
|
|
5131
|
+
*
|
|
5132
|
+
* Live when spans are in flight and `now` advances; load OTLP/JSON with
|
|
5133
|
+
* `parseTraceDocument`. With `replay`, a finished trace plays back in real
|
|
5134
|
+
* time — play, pause, scrub, change speed — and the rows fade in as their
|
|
5135
|
+
* spans start.
|
|
5136
|
+
*/
|
|
5137
|
+
declare const TraceViewer: react.ForwardRefExoticComponent<TraceViewerProps & react.RefAttributes<HTMLElement>>;
|
|
5138
|
+
|
|
5139
|
+
/**
|
|
5140
|
+
* Time ranges for observability views: the window every chart, log list and
|
|
5141
|
+
* heatmap on a page shares, the presets a picker offers, and axis ticks that
|
|
5142
|
+
* land on round clock times.
|
|
5143
|
+
*
|
|
5144
|
+
* ## Time is epoch milliseconds, and `now` is always passed in
|
|
5145
|
+
*
|
|
5146
|
+
* Nothing here reads the clock. A page hands its `now` to `TimeRangeProvider`
|
|
5147
|
+
* — `Date.now()` in an app, a fixed epoch in a story or a static export — so a
|
|
5148
|
+
* render is a pure function of its inputs and a server render hydrates.
|
|
5149
|
+
*
|
|
5150
|
+
* ## Labels are UTC, formatted by hand
|
|
5151
|
+
*
|
|
5152
|
+
* `toLocaleString` differs between the server and the browser and between
|
|
5153
|
+
* machines, which is a hydration mismatch and an unstable screenshot. The
|
|
5154
|
+
* formatters below write UTC digits themselves.
|
|
5155
|
+
*/
|
|
5156
|
+
/** A closed window of time, in epoch milliseconds. */
|
|
5157
|
+
interface TimeRange {
|
|
5158
|
+
from: number;
|
|
5159
|
+
to: number;
|
|
5160
|
+
}
|
|
5161
|
+
/** A named relative window — "the last hour". */
|
|
5162
|
+
interface TimeRangePreset {
|
|
5163
|
+
id: string;
|
|
5164
|
+
label: string;
|
|
5165
|
+
/** Width of the window in milliseconds, ending at `now`. */
|
|
5166
|
+
duration: number;
|
|
5167
|
+
}
|
|
5168
|
+
/** The windows a picker offers by default. */
|
|
5169
|
+
declare const TIME_RANGE_PRESETS: readonly TimeRangePreset[];
|
|
5170
|
+
/** The window a preset names, ending at `now`. */
|
|
5171
|
+
declare function presetRange(preset: TimeRangePreset, now: number): TimeRange;
|
|
5172
|
+
/** A range with `from <= to`, both finite; null when that cannot be made. */
|
|
5173
|
+
declare function normaliseRange(range: TimeRange | null | undefined): TimeRange | null;
|
|
5174
|
+
/** Clamp `time` into `range`. */
|
|
5175
|
+
declare function clampToRange(time: number, range: TimeRange): number;
|
|
5176
|
+
/** `14:05`, `14:05:30` with seconds, in UTC. */
|
|
5177
|
+
declare function formatClock(time: number, seconds?: boolean): string;
|
|
5178
|
+
/** `Oct 22`, in UTC. */
|
|
5179
|
+
declare function formatDay(time: number): string;
|
|
5180
|
+
/** `Oct 22 14:05:30.120 UTC`-style stamp for a log line or a tooltip, without the zone. */
|
|
5181
|
+
declare function formatTimestamp(time: number, precision?: 'minute' | 'second' | 'millisecond'): string;
|
|
5182
|
+
/** A tick label sized to the window: seconds for short ranges, days for long ones. */
|
|
5183
|
+
declare function formatTimeTick(time: number, span: number): string;
|
|
5184
|
+
/** `15m`, `1h 30m`, `2d`: a window's width, rounded to its two largest units. */
|
|
5185
|
+
declare function formatRangeDuration(ms: number): string;
|
|
5186
|
+
/** `14:00 – 15:00`, or with days when the window crosses one. */
|
|
5187
|
+
declare function formatRange(range: TimeRange): string;
|
|
5188
|
+
/**
|
|
5189
|
+
* Ticks on round clock times inside `range` — every 5 minutes, every hour —
|
|
5190
|
+
* about `target` of them. UTC-aligned, so the same range always ticks alike.
|
|
5191
|
+
*/
|
|
5192
|
+
declare function timeTicks(range: TimeRange, target?: number): number[];
|
|
5193
|
+
/**
|
|
5194
|
+
* Group timestamps into `count` equal buckets across `range` — the shape a
|
|
5195
|
+
* histogram over time, a heatmap column or a log-volume strip needs.
|
|
5196
|
+
*/
|
|
5197
|
+
declare function bucketTimes(range: TimeRange, count: number): TimeRange[];
|
|
5198
|
+
|
|
5199
|
+
interface TimeRangeState {
|
|
5200
|
+
/** The page's clock, as the provider was given it. */
|
|
5201
|
+
now: number;
|
|
5202
|
+
/** The window every view on the page draws. */
|
|
5203
|
+
range: TimeRange;
|
|
5204
|
+
/** The preset the range came from, or null once it was zoomed or set by hand. */
|
|
5205
|
+
presetId: string | null;
|
|
5206
|
+
presets: readonly TimeRangePreset[];
|
|
5207
|
+
/** Set the window. Pass a preset id to keep it relative; omit to mark it custom. */
|
|
5208
|
+
setRange: (range: TimeRange, presetId?: string | null) => void;
|
|
5209
|
+
/** Select a preset by id. */
|
|
5210
|
+
selectPreset: (id: string) => void;
|
|
5211
|
+
}
|
|
5212
|
+
interface TimeCursorState {
|
|
5213
|
+
/** The time being hovered on any view, or null. */
|
|
5214
|
+
cursor: number | null;
|
|
5215
|
+
setCursor: (time: number | null) => void;
|
|
5216
|
+
}
|
|
5217
|
+
/**
|
|
5218
|
+
* The shared window, or null outside a `TimeRangeProvider` — every consumer
|
|
5219
|
+
* works standalone too, with its own props.
|
|
5220
|
+
*/
|
|
5221
|
+
declare function useTimeRange(): TimeRangeState | null;
|
|
5222
|
+
/**
|
|
5223
|
+
* The shared hover cursor, or null outside a provider. Its own context, so a
|
|
5224
|
+
* cursor moving across a chart re-renders the views that draw it and nothing
|
|
5225
|
+
* that only reads the range.
|
|
5226
|
+
*/
|
|
5227
|
+
declare function useTimeCursor(): TimeCursorState | null;
|
|
5228
|
+
interface TimeRangeProviderProps {
|
|
5229
|
+
/** The page's clock. Pass `Date.now()` in an app and a fixed epoch in a story. */
|
|
5230
|
+
now: number;
|
|
5231
|
+
/** The preset selected on mount when uncontrolled. Default `1h`. */
|
|
5232
|
+
defaultPresetId?: string;
|
|
5233
|
+
/** A controlled window. */
|
|
5234
|
+
range?: TimeRange;
|
|
5235
|
+
/** Called when the window changes, with the preset it came from. */
|
|
5236
|
+
onRangeChange?: (range: TimeRange, presetId: string | null) => void;
|
|
5237
|
+
/** The windows the picker offers. Default `TIME_RANGE_PRESETS`. */
|
|
5238
|
+
presets?: readonly TimeRangePreset[];
|
|
5239
|
+
children?: ReactNode;
|
|
5240
|
+
}
|
|
5241
|
+
/**
|
|
5242
|
+
* The time window and hover cursor every observability view on a page shares:
|
|
5243
|
+
* pick "last hour" once and every chart, heatmap and log list follows; hover
|
|
5244
|
+
* one chart and the others draw the same moment; drag across a chart to zoom
|
|
5245
|
+
* them all.
|
|
5246
|
+
*
|
|
5247
|
+
* Renders nothing of its own — it is context, like `ThemeProvider`.
|
|
5248
|
+
*/
|
|
5249
|
+
declare function TimeRangeProvider({ now, defaultPresetId, range: rangeProp, onRangeChange, presets, children }: TimeRangeProviderProps): react.JSX.Element;
|
|
5250
|
+
interface TimeRangePickerProps extends HTMLAttributes<HTMLDivElement> {
|
|
5251
|
+
/** Accessible name for the preset group. Default `Time range`. */
|
|
5252
|
+
label?: string;
|
|
5253
|
+
}
|
|
5254
|
+
/**
|
|
5255
|
+
* The preset strip — 15m, 1h, 6h, 24h, 7d — and the window it resolves to, in
|
|
5256
|
+
* UTC. When a chart zooms the window it shows `Zoomed` and a reset back to the
|
|
5257
|
+
* last preset. Reads and writes the nearest `TimeRangeProvider`, and renders
|
|
5258
|
+
* nothing without one.
|
|
5259
|
+
*/
|
|
5260
|
+
declare const TimeRangePicker: react.ForwardRefExoticComponent<TimeRangePickerProps & react.RefAttributes<HTMLDivElement>>;
|
|
5261
|
+
|
|
5262
|
+
/**
|
|
5263
|
+
* The observability severity vocabulary — log levels, alert states and alert
|
|
5264
|
+
* severities — and the role each is drawn in. Kept beside `SeverityBadge`'s
|
|
5265
|
+
* module rather than in it so non-React callers (a chart legend, a CSV export)
|
|
5266
|
+
* can map a word to a role without importing a component.
|
|
5267
|
+
*/
|
|
5268
|
+
|
|
5269
|
+
/** Log levels, OpenTelemetry's severity names in lower case. */
|
|
5270
|
+
type LogSeverity = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal';
|
|
5271
|
+
/** Alert lifecycle states. */
|
|
5272
|
+
type AlertState = 'firing' | 'pending' | 'resolved' | 'silenced';
|
|
5273
|
+
/** Alert or incident severity. */
|
|
5274
|
+
type AlertSeverity = 'critical' | 'warning' | 'info';
|
|
5275
|
+
/** Every word `SeverityBadge` knows. */
|
|
5276
|
+
type Severity = LogSeverity | AlertState | AlertSeverity;
|
|
5277
|
+
/**
|
|
5278
|
+
* The fixed vocabulary, mapped to roles once so every log list, alert table
|
|
5279
|
+
* and incident view on a page says "error" in the same colour.
|
|
5280
|
+
*/
|
|
5281
|
+
declare const SEVERITY_ACCENTS: Readonly<Record<Severity, AccentToken>>;
|
|
5282
|
+
/** The role a severity is drawn in. Unknown words fall back to `quiet`. */
|
|
5283
|
+
declare function severityAccent(severity: string): AccentToken;
|
|
5284
|
+
|
|
5285
|
+
interface SeverityBadgeProps extends Omit<BadgeProps, 'accent' | 'children'> {
|
|
5286
|
+
/** A log level, an alert state or an alert severity. */
|
|
5287
|
+
severity: Severity;
|
|
5288
|
+
/** Replaces the upper-cased severity as the visible text. */
|
|
5289
|
+
children?: BadgeProps['children'];
|
|
5290
|
+
}
|
|
5291
|
+
/**
|
|
5292
|
+
* A `Badge` whose colour comes from a fixed observability vocabulary — log
|
|
5293
|
+
* levels, alert states and severities — rather than from the caller, so
|
|
5294
|
+
* "error" cannot be painted as a success anywhere on a page.
|
|
5295
|
+
*/
|
|
5296
|
+
declare const SeverityBadge: react.ForwardRefExoticComponent<SeverityBadgeProps & react.RefAttributes<HTMLSpanElement>>;
|
|
5297
|
+
|
|
5298
|
+
/**
|
|
5299
|
+
* Pure geometry and arithmetic behind `TimeSeriesChart`: cleaning points,
|
|
5300
|
+
* resolving the x domain, clipping to it, finding the point nearest a cursor,
|
|
5301
|
+
* stacking, summarising and formatting values.
|
|
5302
|
+
*
|
|
5303
|
+
* Nothing here reads the clock or the DOM, so every function is a pure
|
|
5304
|
+
* function of its arguments and can be tested without a browser.
|
|
5305
|
+
*/
|
|
5306
|
+
|
|
5307
|
+
/** One sample: epoch milliseconds and a value, or `null` for a gap. */
|
|
5308
|
+
type TimeSeriesPoint = readonly [time: number, value: number | null];
|
|
5309
|
+
/** A named line on a time-series chart. */
|
|
5310
|
+
interface TimeSeries {
|
|
5311
|
+
/** Stable id — keys the legend and `hiddenSeries`. */
|
|
5312
|
+
id: string;
|
|
5313
|
+
/** What the legend and the readout call it. */
|
|
5314
|
+
label: string;
|
|
5315
|
+
/** Samples in epoch milliseconds. A `null` value is a gap: the line breaks there. */
|
|
5316
|
+
points: ReadonlyArray<TimeSeriesPoint>;
|
|
5317
|
+
/** Unit for this series' values; falls back to the chart's `unit`. */
|
|
5318
|
+
unit?: string;
|
|
5319
|
+
/**
|
|
5320
|
+
* Pin the series to a role when its colour carries a meaning — a 5xx series
|
|
5321
|
+
* is `danger`, a 4xx one `warning`. Omitted, series take the neutral cycle.
|
|
5322
|
+
*/
|
|
5323
|
+
tone?: 'primary' | 'secondary' | 'neutral' | 'info' | 'success' | 'warning' | 'danger';
|
|
5324
|
+
}
|
|
5325
|
+
/** How a line joins its samples: straight, a monotone cubic, or a mid-point step. */
|
|
5326
|
+
type TimeSeriesCurve = 'linear' | 'monotone' | 'step';
|
|
5327
|
+
|
|
5328
|
+
/** A horizontal line the values should stay under. */
|
|
5329
|
+
interface TimeSeriesThreshold {
|
|
5330
|
+
/** Where the line sits, in the chart's value units. */
|
|
5331
|
+
value: number;
|
|
5332
|
+
/** What the line is called — drawn beside it and read in the summary. */
|
|
5333
|
+
label: string;
|
|
5334
|
+
/** How bad crossing it is. A danger threshold also tints the band above it. */
|
|
5335
|
+
intent: 'warning' | 'danger';
|
|
5336
|
+
}
|
|
5337
|
+
/** A vertical marker at a moment — a deploy, an incident, a config change. */
|
|
5338
|
+
interface TimeSeriesAnnotation {
|
|
5339
|
+
/** When, in epoch milliseconds. Outside the x domain it is not drawn. */
|
|
5340
|
+
time: number;
|
|
5341
|
+
/** Short text drawn at the top of the marker and read in the summary. */
|
|
5342
|
+
label: string;
|
|
5343
|
+
/** Colour role of the marker. Default `info`. */
|
|
5344
|
+
intent?: 'info' | 'warning' | 'danger';
|
|
5345
|
+
}
|
|
5346
|
+
/**
|
|
5347
|
+
* Every allowed value of each union prop, so a story or a test can iterate
|
|
5348
|
+
* them. `yDomain` also takes an explicit `[min, max]` tuple, not listed.
|
|
5349
|
+
*/
|
|
5350
|
+
declare const TIME_SERIES_VARIANTS: {
|
|
5351
|
+
readonly variant: readonly ["line", "area", "stacked"];
|
|
5352
|
+
readonly curve: readonly ["linear", "monotone", "step"];
|
|
5353
|
+
readonly points: readonly ["none", "hover", "all"];
|
|
5354
|
+
readonly grid: readonly ["none", "horizontal", "both"];
|
|
5355
|
+
readonly yScale: readonly ["linear", "log"];
|
|
5356
|
+
readonly yDomain: readonly ["zero", "data"];
|
|
5357
|
+
readonly legend: readonly ["top", "bottom", "none", "inline"];
|
|
5358
|
+
readonly colorStrategy: readonly ["categorical", "emphasis"];
|
|
5359
|
+
readonly density: readonly ["regular", "compact"];
|
|
5360
|
+
};
|
|
5361
|
+
/** How the series are drawn. */
|
|
5362
|
+
type TimeSeriesVariant = (typeof TIME_SERIES_VARIANTS.variant)[number];
|
|
5363
|
+
/** Where point markers are drawn: never, at the cursor, or at every sample. */
|
|
5364
|
+
type TimeSeriesPointMarkers = (typeof TIME_SERIES_VARIANTS.points)[number];
|
|
5365
|
+
/** Which grid lines are drawn. */
|
|
5366
|
+
type TimeSeriesGrid = (typeof TIME_SERIES_VARIANTS.grid)[number];
|
|
5367
|
+
/** The value scale. */
|
|
5368
|
+
type TimeSeriesYScale = (typeof TIME_SERIES_VARIANTS.yScale)[number];
|
|
5369
|
+
/** The value domain: from zero, fitted to the data, or explicit. */
|
|
5370
|
+
type TimeSeriesYDomain = (typeof TIME_SERIES_VARIANTS.yDomain)[number] | readonly [min: number, max: number];
|
|
5371
|
+
/** Where the legend goes; `inline` labels each line at its end instead. */
|
|
5372
|
+
type TimeSeriesLegend = (typeof TIME_SERIES_VARIANTS.legend)[number];
|
|
5373
|
+
/** How series are coloured. */
|
|
5374
|
+
type TimeSeriesColorStrategy = (typeof TIME_SERIES_VARIANTS.colorStrategy)[number];
|
|
5375
|
+
/** Spacing and type size. */
|
|
5376
|
+
type TimeSeriesDensity = (typeof TIME_SERIES_VARIANTS.density)[number];
|
|
5377
|
+
interface TimeSeriesChartProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
5378
|
+
/** The series to draw. `null` values are gaps: lines and areas break there. */
|
|
5379
|
+
series: readonly TimeSeries[];
|
|
5380
|
+
/** `line` (default), `area` (filled to zero), or `stacked` areas. */
|
|
5381
|
+
variant?: TimeSeriesVariant;
|
|
5382
|
+
/** How a line joins its samples: `linear` (default), `monotone` cubic, or mid-point `step`. */
|
|
5383
|
+
curve?: TimeSeriesCurve;
|
|
5384
|
+
/** Line width in pixels. Default 1.5. */
|
|
5385
|
+
strokeWidth?: number;
|
|
5386
|
+
/** Point markers: `none`, `hover` (at the cursor, default) or `all` samples. */
|
|
5387
|
+
points?: TimeSeriesPointMarkers;
|
|
5388
|
+
/** Opacity of area fills, 0–1. Default 0.2 for `area`, 0.35 for `stacked`. */
|
|
5389
|
+
fillOpacity?: number;
|
|
5390
|
+
/** Grid lines: `none`, `horizontal` (default) or `both`. */
|
|
5391
|
+
grid?: TimeSeriesGrid;
|
|
5392
|
+
/**
|
|
5393
|
+
* `linear` (default) or `log`. A log scale cannot place zero or a negative
|
|
5394
|
+
* value: those samples are drawn as gaps and left out of the domain, and
|
|
5395
|
+
* stacked bands and area fills start from the bottom of the plot.
|
|
5396
|
+
*/
|
|
5397
|
+
yScale?: TimeSeriesYScale;
|
|
5398
|
+
/**
|
|
5399
|
+
* The value domain: `zero` (default) runs from zero — or from the minimum
|
|
5400
|
+
* when values go negative — and includes thresholds; `data` fits the visible
|
|
5401
|
+
* values; a `[min, max]` tuple is used as given. A log scale always fits the
|
|
5402
|
+
* positive data unless given a positive tuple.
|
|
5403
|
+
*/
|
|
5404
|
+
yDomain?: TimeSeriesYDomain;
|
|
5405
|
+
/** Legend placement: `top`, `bottom` (default), `none`, or `inline` labels at the end of each line (no toggles). */
|
|
5406
|
+
legend?: TimeSeriesLegend;
|
|
5407
|
+
/** `categorical` (default) cycles role colours; `emphasis` draws one series in the primary accent and mutes the rest. */
|
|
5408
|
+
colorStrategy?: TimeSeriesColorStrategy;
|
|
5409
|
+
/** The series `emphasis` highlights. Default: the first series. */
|
|
5410
|
+
emphasisSeriesId?: string;
|
|
5411
|
+
/** `regular` (default) or `compact` — smaller insets and type, no unit caption — for cards and small multiples. */
|
|
5412
|
+
density?: TimeSeriesDensity;
|
|
5413
|
+
/** Vertical markers at moments in time, such as deploys. */
|
|
5414
|
+
annotations?: readonly TimeSeriesAnnotation[];
|
|
5415
|
+
/** Draw the axes and their labels. Default true; false gives a sparkline-like plot. */
|
|
5416
|
+
showAxes?: boolean;
|
|
5417
|
+
/** Dashed horizontal lines with labels. A danger threshold tints the band above it. */
|
|
5418
|
+
thresholds?: readonly TimeSeriesThreshold[];
|
|
5419
|
+
/**
|
|
5420
|
+
* The x domain. Defaults to the `TimeRangeProvider`'s range, else the data's
|
|
5421
|
+
* extent. Points outside it are clipped.
|
|
5422
|
+
*/
|
|
5423
|
+
range?: TimeRange;
|
|
5424
|
+
/** Formats values on the axis, readout and summary. Default: compact, three significant digits. */
|
|
5425
|
+
formatValue?: (value: number) => string;
|
|
5426
|
+
/** Unit for values — on the axis, and for any series without its own. */
|
|
5427
|
+
unit?: string;
|
|
5428
|
+
/** Ids of hidden series. Controlled when defined. */
|
|
5429
|
+
hiddenSeries?: readonly string[];
|
|
5430
|
+
/** Ids hidden on mount when uncontrolled. */
|
|
5431
|
+
defaultHiddenSeries?: readonly string[];
|
|
5432
|
+
/** Called with the new hidden set when a legend toggle is pressed. */
|
|
5433
|
+
onHiddenSeriesChange?: (ids: string[]) => void;
|
|
5434
|
+
/**
|
|
5435
|
+
* Called with the window a drag selects. Inside a `TimeRangeProvider` the
|
|
5436
|
+
* provider's range is set as well; outside one this is the only effect.
|
|
5437
|
+
*/
|
|
5438
|
+
onRangeSelect?: (range: TimeRange) => void;
|
|
5439
|
+
/** Drag across the plot to select a window. Default true. */
|
|
5440
|
+
zoomable?: boolean;
|
|
5441
|
+
/** Height of the plot in pixels, axes included. Default 220. */
|
|
5442
|
+
height?: number;
|
|
5443
|
+
/** The chart's accessible name, and a small heading above it. */
|
|
5444
|
+
title?: string;
|
|
5445
|
+
/** Draw `title` as a visible heading. Default true; the accessible name stays either way. */
|
|
5446
|
+
showTitle?: boolean;
|
|
5447
|
+
}
|
|
5448
|
+
/**
|
|
5449
|
+
* The metrics chart of an observability dashboard: lines, areas or stacked
|
|
5450
|
+
* areas over time, with thresholds, annotations, a legend that hides series, a
|
|
5451
|
+
* crosshair readout and drag-to-zoom.
|
|
5452
|
+
*
|
|
5453
|
+
* Inside a `TimeRangeProvider` it draws the shared window, writes the shared
|
|
5454
|
+
* cursor as the pointer moves — so every chart on the page draws the same
|
|
5455
|
+
* moment — and a drag zooms them all. Outside one it works from its own
|
|
5456
|
+
* `range` and a cursor of its own.
|
|
5457
|
+
*
|
|
5458
|
+
* The plot is a single tab stop with slider semantics: Left and Right step the
|
|
5459
|
+
* cursor sample by sample, Home and End jump to the ends, Escape clears it, and
|
|
5460
|
+
* the value text reads every visible series at that moment. Min, max and
|
|
5461
|
+
* latest per series are written out for screen readers. Colours are roles,
|
|
5462
|
+
* cycling through three and then through dash patterns; `accent-tertiary` is
|
|
5463
|
+
* never used, so danger keeps its meaning. Every design choice — curve, markers, grid, scale, domain, legend,
|
|
5464
|
+
* colouring, density — is a prop; `TIME_SERIES_VARIANTS` lists their values.
|
|
5465
|
+
*/
|
|
5466
|
+
declare const TimeSeriesChart: react.ForwardRefExoticComponent<TimeSeriesChartProps & react.RefAttributes<HTMLDivElement>>;
|
|
5467
|
+
|
|
5468
|
+
/**
|
|
5469
|
+
* Latency distributions: bucket edges that suit them, histograms, percentiles,
|
|
5470
|
+
* and the time × latency grid a heatmap draws.
|
|
5471
|
+
*
|
|
5472
|
+
* ## Why log-spaced buckets
|
|
5473
|
+
*
|
|
5474
|
+
* Request latency spans orders of magnitude — a cache hit at 2ms and a cold
|
|
5475
|
+
* path at 2s on the same endpoint. Equal-width buckets put the whole fast mode
|
|
5476
|
+
* in the first bar and spend the rest on the tail; equal *ratio* buckets give
|
|
5477
|
+
* every decade the same resolution, which is what a reader comparing 20ms with
|
|
5478
|
+
* 200ms wants.
|
|
5479
|
+
*
|
|
5480
|
+
* ## Percentiles interpolate
|
|
5481
|
+
*
|
|
5482
|
+
* `percentile` is the linear-interpolation estimate (NumPy's default, R type
|
|
5483
|
+
* 7): sort, take the fractional rank `p/100 × (n − 1)`, and interpolate between
|
|
5484
|
+
* its neighbours. It never returns a value outside the samples and agrees with
|
|
5485
|
+
* nearest-rank at the ends.
|
|
5486
|
+
*
|
|
5487
|
+
* Everything here is pure: no clock, no randomness.
|
|
5488
|
+
*/
|
|
5489
|
+
|
|
5490
|
+
/** One histogram bar: samples in `[from, to)` (the last bucket also includes `to`). */
|
|
5491
|
+
interface LatencyBucket {
|
|
5492
|
+
/** Lower edge, in milliseconds. */
|
|
5493
|
+
from: number;
|
|
5494
|
+
/** Upper edge, in milliseconds. */
|
|
5495
|
+
to: number;
|
|
5496
|
+
/** Samples in the bucket. */
|
|
5497
|
+
count: number;
|
|
5498
|
+
}
|
|
5499
|
+
/** A point in a latency-over-time series. */
|
|
5500
|
+
interface LatencyPoint {
|
|
5501
|
+
/** When the request happened, epoch milliseconds. */
|
|
5502
|
+
time: number;
|
|
5503
|
+
/** How long it took, in milliseconds. */
|
|
5504
|
+
value: number;
|
|
5505
|
+
}
|
|
5506
|
+
/** One cell of a latency heatmap. */
|
|
5507
|
+
interface LatencyCell {
|
|
5508
|
+
/** Time bucket index, 0 at the left. */
|
|
5509
|
+
column: number;
|
|
5510
|
+
/** Latency bucket index, 0 at the fastest. */
|
|
5511
|
+
row: number;
|
|
5512
|
+
/** The cell's time window. */
|
|
5513
|
+
timeRange: TimeRange;
|
|
5514
|
+
/** The cell's latency window, in milliseconds. */
|
|
5515
|
+
latencyRange: {
|
|
5516
|
+
from: number;
|
|
5517
|
+
to: number;
|
|
5518
|
+
};
|
|
5519
|
+
/** Points in the cell. */
|
|
5520
|
+
count: number;
|
|
5521
|
+
}
|
|
5522
|
+
/** The cells of a heatmap, column-major (`cells[column * rows + row]`), and their totals. */
|
|
5523
|
+
interface LatencyGrid {
|
|
5524
|
+
cells: LatencyCell[];
|
|
5525
|
+
columns: number;
|
|
5526
|
+
rows: number;
|
|
5527
|
+
/** The busiest cell's count; 0 for an empty grid. */
|
|
5528
|
+
max: number;
|
|
5529
|
+
/** Points placed in the grid (inside the time buckets). */
|
|
5530
|
+
total: number;
|
|
5531
|
+
}
|
|
5532
|
+
/**
|
|
5533
|
+
* `count + 1` log-spaced bucket edges from `min` to `max`, in milliseconds.
|
|
5534
|
+
* Edges are rounded to two significant figures (so labels read `120–180ms`)
|
|
5535
|
+
* unless rounding would merge two of them. A non-positive `min` is lifted to
|
|
5536
|
+
* `max / 1000`; an empty span is widened to a decade.
|
|
5537
|
+
*/
|
|
5538
|
+
declare function latencyBuckets(min: number, max: number, count: number): number[];
|
|
5539
|
+
/** `count + 1` evenly spaced edges from `min` to `max`. */
|
|
5540
|
+
declare function linearBuckets(min: number, max: number, count: number): number[];
|
|
5541
|
+
/** The index of the bucket `value` falls in, clamped to the ends. -1 when there are no buckets. */
|
|
5542
|
+
declare function bucketIndex(value: number, edges: readonly number[]): number;
|
|
5543
|
+
/**
|
|
5544
|
+
* Count `samples` into the buckets `edges` describe. Values below the first
|
|
5545
|
+
* edge land in the first bucket and above the last in the last, so the counts
|
|
5546
|
+
* always sum to the finite samples; non-finite samples are skipped.
|
|
5547
|
+
*/
|
|
5548
|
+
declare function histogram(samples: readonly number[], edges: readonly number[]): LatencyBucket[];
|
|
5549
|
+
/**
|
|
5550
|
+
* The `p`th percentile (0–100) of `samples`, by linear interpolation between
|
|
5551
|
+
* closest ranks. Non-finite samples are ignored; `NaN` when none remain or `p`
|
|
5552
|
+
* is not a number.
|
|
5553
|
+
*/
|
|
5554
|
+
declare function percentile(samples: readonly number[], p: number): number;
|
|
5555
|
+
/** Several percentiles at once, sorting once. Same method as `percentile`. */
|
|
5556
|
+
declare function percentiles(samples: readonly number[], ps?: readonly number[]): number[];
|
|
5557
|
+
/**
|
|
5558
|
+
* The `p`th percentile estimated from pre-bucketed counts — for when only a
|
|
5559
|
+
* histogram is available. Interpolates linearly inside the bucket the rank
|
|
5560
|
+
* falls in (geometrically when both edges are positive, matching log buckets).
|
|
5561
|
+
*/
|
|
5562
|
+
declare function bucketPercentile(buckets: readonly LatencyBucket[], p: number): number;
|
|
5563
|
+
/** The share (0–1) of finite samples strictly above `threshold`; 0 when there are none. */
|
|
5564
|
+
declare function shareAbove(samples: readonly number[], threshold: number): number;
|
|
5565
|
+
/** The smallest and largest finite, positive value; null when there is none. */
|
|
5566
|
+
declare function latencyExtent(values: Iterable<number>): {
|
|
5567
|
+
min: number;
|
|
5568
|
+
max: number;
|
|
5569
|
+
} | null;
|
|
5570
|
+
/**
|
|
5571
|
+
* Ticks for a log axis: 1, 2 and 5 of each decade inside `[min, max]`, thinned
|
|
5572
|
+
* to 1 and 5, then to decades, until there are at most `target`.
|
|
5573
|
+
*/
|
|
5574
|
+
declare function logTicks(min: number, max: number, target?: number): number[];
|
|
5575
|
+
/**
|
|
5576
|
+
* Place `points` on a time × latency grid. A point outside every time bucket
|
|
5577
|
+
* is dropped (it is outside the window); one outside the latency edges is
|
|
5578
|
+
* clamped into the first or last row. Cells are dense — an empty cell is there
|
|
5579
|
+
* with `count: 0` — and column-major: `cells[column * rows + row]`.
|
|
5580
|
+
*/
|
|
5581
|
+
declare function heatmapCells(points: readonly LatencyPoint[], timeBuckets: readonly TimeRange[], latencyEdges: readonly number[]): LatencyGrid;
|
|
5582
|
+
/** How a cell's count maps to an intensity step. */
|
|
5583
|
+
type IntensityScale = 'sqrt' | 'linear' | 'log' | 'quantile';
|
|
5584
|
+
/**
|
|
5585
|
+
* The smallest count in each of `levels` intensity steps — what a legend
|
|
5586
|
+
* prints, and what `intensityLevel` reads. Ascending; two steps can share a
|
|
5587
|
+
* threshold when counts are small, and the lower one is then never used.
|
|
5588
|
+
*
|
|
5589
|
+
* - `sqrt` (the heatmap default): latency counts are skewed, and a linear
|
|
5590
|
+
* scale would leave the slow mode of a bimodal service invisible.
|
|
5591
|
+
* - `linear`: equal count ranges per step.
|
|
5592
|
+
* - `log`: equal ratios per step, on `log(1 + count)`.
|
|
5593
|
+
* - `quantile`: each step holds about the same number of non-empty cells.
|
|
5594
|
+
*/
|
|
5595
|
+
declare function intensityThresholds(counts: readonly number[], levels?: number, scale?: IntensityScale): number[];
|
|
5596
|
+
/** The intensity step (0 for empty, else 1…thresholds.length) a count falls in. */
|
|
5597
|
+
declare function intensityLevel(count: number, thresholds: readonly number[]): number;
|
|
5598
|
+
/**
|
|
5599
|
+
* Where a latency sits on log-spaced edges, as a fractional row: 0 at the
|
|
5600
|
+
* first edge, `edges.length - 1` at the last, interpolated geometrically
|
|
5601
|
+
* inside a bucket and clamped to the ends.
|
|
5602
|
+
*/
|
|
5603
|
+
declare function latencyRowPosition(value: number, edges: readonly number[]): number;
|
|
5604
|
+
/** `1,234` — grouped by hand, so a server render and a browser agree. */
|
|
5605
|
+
declare function formatCount(value: number): string;
|
|
5606
|
+
/** `3.2%`, `0.04%`, `100%` for a 0–1 share. */
|
|
5607
|
+
declare function formatShare(share: number): string;
|
|
5608
|
+
/**
|
|
5609
|
+
* `120–180ms`, `850ms–1.2s`: a latency window, with the unit said once when
|
|
5610
|
+
* both ends share it. `format` defaults to `formatTraceDuration`.
|
|
5611
|
+
*/
|
|
5612
|
+
declare function formatLatencyRange(from: number, to: number, format?: (ms: number) => string): string;
|
|
5613
|
+
/** `1 request`, `342 requests`. */
|
|
5614
|
+
declare function formatRequests(count: number): string;
|
|
5615
|
+
|
|
5616
|
+
/** Every value each enumerable prop accepts, first the default — for stories and evaluation grids to iterate. */
|
|
5617
|
+
declare const LATENCY_HISTOGRAM_VARIANTS: {
|
|
5618
|
+
readonly scale: readonly ["log", "linear"];
|
|
5619
|
+
readonly binning: readonly ["log", "linear"];
|
|
5620
|
+
readonly bar: readonly ["bars", "steps", "outline"];
|
|
5621
|
+
readonly markers: readonly ["lines", "labels", "none"];
|
|
5622
|
+
readonly density: readonly ["regular", "compact"];
|
|
5623
|
+
readonly cumulative: readonly [false, true];
|
|
5624
|
+
};
|
|
5625
|
+
/** A service-level objective line. */
|
|
5626
|
+
interface LatencySlo {
|
|
5627
|
+
/** The threshold, in milliseconds. */
|
|
5628
|
+
value: number;
|
|
5629
|
+
/** The line's label. Default `SLO <value>`. */
|
|
5630
|
+
label?: string;
|
|
5631
|
+
}
|
|
5632
|
+
interface LatencyHistogramProps extends HTMLAttributes<HTMLDivElement> {
|
|
5633
|
+
/** Raw latencies, in milliseconds. Bucketed here; ignored when `buckets` is given. */
|
|
5634
|
+
samples?: readonly number[];
|
|
5635
|
+
/** Pre-bucketed counts, for when only a histogram is stored. Percentiles are then estimated. */
|
|
5636
|
+
buckets?: readonly LatencyBucket[];
|
|
5637
|
+
/** Percentiles drawn as labelled markers. Default `[50, 90, 99]`; `[]` draws none. */
|
|
5638
|
+
percentiles?: readonly number[];
|
|
5639
|
+
/** A latency objective: a dashed danger line, and the bars wholly past it tinted danger. */
|
|
5640
|
+
slo?: LatencySlo;
|
|
5641
|
+
/** The x axis. Default `log` — latency spans orders of magnitude. Falls back to linear for buckets that start at 0. */
|
|
5642
|
+
scale?: 'log' | 'linear';
|
|
5643
|
+
/** How `samples` are cut into buckets: equal ratios (`log`) or equal widths (`linear`). Default follows `scale`. */
|
|
5644
|
+
binning?: 'log' | 'linear';
|
|
5645
|
+
/** How many buckets to cut `samples` into. Default 40. */
|
|
5646
|
+
bins?: number;
|
|
5647
|
+
/** Lower latency bound for the buckets, in milliseconds. Default the fastest sample. */
|
|
5648
|
+
min?: number;
|
|
5649
|
+
/** Upper latency bound for the buckets, in milliseconds. Default the slowest sample. */
|
|
5650
|
+
max?: number;
|
|
5651
|
+
/** Height of the chart in pixels. Default 180. */
|
|
5652
|
+
height?: number;
|
|
5653
|
+
/** The chart's accessible name, also shown above it. Default `Latency distribution` (not shown). */
|
|
5654
|
+
title?: string;
|
|
5655
|
+
/** Format a latency for labels. Default `formatTraceDuration` (`412ms`, `1.24s`). */
|
|
5656
|
+
formatValue?: (ms: number) => string;
|
|
5657
|
+
/** How buckets are drawn: filled `bars` (default), a `steps` outline along their tops, or `outline` boxes with a faint fill. */
|
|
5658
|
+
bar?: 'bars' | 'steps' | 'outline';
|
|
5659
|
+
/** Overlay the cumulative share (a CDF, 0–100% on the right). Default false. */
|
|
5660
|
+
cumulative?: boolean;
|
|
5661
|
+
/** Percentile markers: full-height `lines` with labels (default), `labels` with a short tick only, or `none`. The summary still says them. */
|
|
5662
|
+
markers?: 'lines' | 'labels' | 'none';
|
|
5663
|
+
/** `compact` tightens margins and type and lowers the default height to 120. Default `regular`. */
|
|
5664
|
+
density?: 'regular' | 'compact';
|
|
5665
|
+
}
|
|
5666
|
+
/**
|
|
5667
|
+
* A latency histogram: how many requests took how long, on a log axis by
|
|
5668
|
+
* default, with p50 / p90 / p99 markers and an optional SLO line past which the
|
|
5669
|
+
* bars turn to the danger role.
|
|
5670
|
+
*
|
|
5671
|
+
* The bars are one tab stop — a one-row grid whose active cell Left and Right
|
|
5672
|
+
* move (Home and End jump to the ends) — and hovering a bar reads it out:
|
|
5673
|
+
* `120–180ms · 342 requests`. A screen reader gets the count, the percentiles
|
|
5674
|
+
* and the share over the SLO as a summary. Geometry is SVG attributes only.
|
|
5675
|
+
*/
|
|
5676
|
+
declare const LatencyHistogram: react.ForwardRefExoticComponent<LatencyHistogramProps & react.RefAttributes<HTMLDivElement>>;
|
|
5677
|
+
|
|
5678
|
+
/** Every value each enumerable prop accepts, first the default — for stories and evaluation grids to iterate. */
|
|
5679
|
+
declare const LATENCY_HEATMAP_VARIANTS: {
|
|
5680
|
+
readonly colorScale: readonly ["sqrt", "linear", "log", "quantile"];
|
|
5681
|
+
readonly colorSteps: readonly [6, 3, 4, 5, 7, 8, 9];
|
|
5682
|
+
readonly density: readonly ["regular", "compact"];
|
|
5683
|
+
readonly showLegend: readonly [true, false];
|
|
5684
|
+
readonly zoomable: readonly [true, false];
|
|
5685
|
+
readonly cellGap: readonly [1, 0, 2, 4];
|
|
5686
|
+
readonly percentileOverlay: readonly [readonly [], readonly [50], readonly [50, 99]];
|
|
5687
|
+
};
|
|
5688
|
+
interface LatencyHeatmapProps extends HTMLAttributes<HTMLDivElement> {
|
|
5689
|
+
/** Requests as `{ time, value }`: epoch milliseconds and latency in milliseconds. */
|
|
5690
|
+
points: readonly LatencyPoint[];
|
|
5691
|
+
/** The time window. Default the nearest `TimeRangeProvider`'s range, else the data's extent. */
|
|
5692
|
+
range?: TimeRange;
|
|
5693
|
+
/** Time buckets across the window. Default 60. */
|
|
5694
|
+
columns?: number;
|
|
5695
|
+
/** Log-spaced latency buckets. Default 16. */
|
|
5696
|
+
rows?: number;
|
|
5697
|
+
/** Lower latency bound, in milliseconds. Default the fastest point in the window. */
|
|
5698
|
+
min?: number;
|
|
5699
|
+
/** Upper latency bound, in milliseconds. Default the slowest point in the window. */
|
|
5700
|
+
max?: number;
|
|
5701
|
+
/** Height of the chart in pixels. Default 240. */
|
|
5702
|
+
height?: number;
|
|
5703
|
+
/** The chart's accessible name, also shown above it. Default `Latency heatmap` (not shown). */
|
|
5704
|
+
title?: string;
|
|
5705
|
+
/** Called with the cell a click, Enter or Space selects — "show traces in this bucket". Selection is outlined only when this is given. */
|
|
5706
|
+
onCellSelect?: (cell: LatencyCell) => void;
|
|
5707
|
+
/** Called with the window dragged across. Inside a provider the provider's range is zoomed as well. */
|
|
5708
|
+
onRangeSelect?: (range: TimeRange) => void;
|
|
5709
|
+
/** Whether dragging across columns zooms. Default true. */
|
|
5710
|
+
zoomable?: boolean;
|
|
5711
|
+
/** Format a latency for labels. Default `formatTraceDuration` (`412ms`, `1.24s`). */
|
|
5712
|
+
formatValue?: (ms: number) => string;
|
|
5713
|
+
/** How many opacity steps the count scale has, 3–9. Default 6. */
|
|
5714
|
+
colorSteps?: number;
|
|
5715
|
+
/** How a count maps to a step: `sqrt` (default), `linear`, `log`, or `quantile` (equal cells per step). */
|
|
5716
|
+
colorScale?: IntensityScale;
|
|
5717
|
+
/** Pixels between cells. Default 1; never more than half a cell. */
|
|
5718
|
+
cellGap?: number;
|
|
5719
|
+
/** Show the count-scale legend under the chart. Default true. */
|
|
5720
|
+
showLegend?: boolean;
|
|
5721
|
+
/** `compact` tightens margins and type and lowers the default height to 160. Default `regular`. */
|
|
5722
|
+
density?: 'regular' | 'compact';
|
|
5723
|
+
/** Percentiles drawn as lines through each column's own percentile, e.g. `[50, 99]`. Default none. */
|
|
5724
|
+
percentileOverlay?: readonly number[];
|
|
5725
|
+
}
|
|
5726
|
+
/**
|
|
5727
|
+
* A latency heatmap: time across, log-spaced latency up, and each cell shaded
|
|
5728
|
+
* by how many requests landed in it — one role, six stepped opacities on a
|
|
5729
|
+
* square-root scale, so a faint slow mode still shows beside a busy fast one.
|
|
5730
|
+
*
|
|
5731
|
+
* It follows the nearest `TimeRangeProvider`: the window comes from it,
|
|
5732
|
+
* hovering sets the shared cursor to the column's centre and draws wherever
|
|
5733
|
+
* the cursor is set from, and dragging across columns zooms every view on the
|
|
5734
|
+
* page. Standalone it takes `range` and reports drags through `onRangeSelect`.
|
|
5735
|
+
*
|
|
5736
|
+
* The grid is one tab stop. Arrow keys move a focus cell (Up is slower), Home
|
|
5737
|
+
* and End jump along the row, and Enter or Space selects it.
|
|
5738
|
+
*/
|
|
5739
|
+
declare const LatencyHeatmap: react.ForwardRefExoticComponent<LatencyHeatmapProps & react.RefAttributes<HTMLDivElement>>;
|
|
5740
|
+
|
|
5741
|
+
/**
|
|
5742
|
+
* The log model: entries in, the lines a viewer draws out.
|
|
5743
|
+
*
|
|
5744
|
+
* Pure data, no React, so a caller can filter, order or search a log stream
|
|
5745
|
+
* without rendering one — `LogViewer` highlights a query but never filters by
|
|
5746
|
+
* it, and this is what the caller filters with.
|
|
5747
|
+
*
|
|
5748
|
+
* Time is epoch milliseconds, and nothing here reads the clock.
|
|
5749
|
+
*/
|
|
5750
|
+
|
|
5751
|
+
/** A log field value, flattened the way OTLP attributes are. */
|
|
5752
|
+
type LogFieldValue = string | number | boolean;
|
|
5753
|
+
/** One log line. */
|
|
5754
|
+
interface LogEntry {
|
|
5755
|
+
/** Unique within the stream; rows are keyed by it. */
|
|
5756
|
+
id: string;
|
|
5757
|
+
/** When the line was emitted, in epoch milliseconds. */
|
|
5758
|
+
time: number;
|
|
5759
|
+
/** OpenTelemetry's severity name, lower case. */
|
|
5760
|
+
severity: LogSeverity;
|
|
5761
|
+
/** The log body. One line in the list; in full when the row is expanded. */
|
|
5762
|
+
message: string;
|
|
5763
|
+
/** The emitting service (OTLP `service.name`). */
|
|
5764
|
+
service?: string;
|
|
5765
|
+
/** The trace this line was written inside, when it was. */
|
|
5766
|
+
traceId?: string;
|
|
5767
|
+
/** The span this line was written inside, when it was. */
|
|
5768
|
+
spanId?: string;
|
|
5769
|
+
/** Structured attributes, shown as a key/value list when expanded. */
|
|
5770
|
+
fields?: Record<string, LogFieldValue>;
|
|
5771
|
+
}
|
|
5772
|
+
/** Severities from least to most severe. */
|
|
5773
|
+
declare const LOG_SEVERITIES: readonly LogSeverity[];
|
|
5774
|
+
/** What `filterLogEntries` keeps. Every criterion is optional and they combine with AND. */
|
|
5775
|
+
interface LogFilter {
|
|
5776
|
+
/** Case-insensitive text matched against the message, service, ids and field values. */
|
|
5777
|
+
query?: string;
|
|
5778
|
+
/** Keep only these severities. An empty list keeps nothing. */
|
|
5779
|
+
severities?: readonly LogSeverity[];
|
|
5780
|
+
/** Keep only entries inside this closed window. */
|
|
5781
|
+
range?: TimeRange | null;
|
|
5782
|
+
}
|
|
5783
|
+
/** Whether `entry` contains `query` (already lower-cased) anywhere a reader would look. */
|
|
5784
|
+
declare function matchLogEntry(entry: LogEntry, query: string): boolean;
|
|
5785
|
+
/** Whether `time` lies inside `range`, both ends included. */
|
|
5786
|
+
declare function inLogRange(time: number, range: TimeRange): boolean;
|
|
5787
|
+
/**
|
|
5788
|
+
* The entries a filter keeps, in their original order. A pure helper: the
|
|
5789
|
+
* caller filters, the viewer only highlights.
|
|
5790
|
+
*/
|
|
5791
|
+
declare function filterLogEntries(entries: readonly LogEntry[], filter?: LogFilter): LogEntry[];
|
|
5792
|
+
/**
|
|
5793
|
+
* Entries in time order, oldest first (`asc`) or newest first (`desc`).
|
|
5794
|
+
* Stable: lines with the same timestamp keep the order they arrived in.
|
|
5795
|
+
*/
|
|
5796
|
+
declare function sortLogEntries(entries: readonly LogEntry[], order?: 'asc' | 'desc'): LogEntry[];
|
|
5797
|
+
/** One run of text, and whether it matched the query. */
|
|
5798
|
+
interface LogHighlightPart {
|
|
5799
|
+
text: string;
|
|
5800
|
+
match: boolean;
|
|
5801
|
+
}
|
|
5802
|
+
/**
|
|
5803
|
+
* Split `text` into runs around every case-insensitive occurrence of `query`.
|
|
5804
|
+
* An empty query is one unmatched run.
|
|
5805
|
+
*/
|
|
5806
|
+
declare function highlightLogText(text: string, query: string | undefined): LogHighlightPart[];
|
|
5807
|
+
/**
|
|
5808
|
+
* The index of the entry whose time is nearest `time`, in a list already in
|
|
5809
|
+
* time order (either direction). Null when the list is empty or `time` lies
|
|
5810
|
+
* outside the span the list covers — a cursor past the last line marks none.
|
|
5811
|
+
*/
|
|
5812
|
+
declare function nearestLogIndex(entries: readonly LogEntry[], time: number | null | undefined): number | null;
|
|
5813
|
+
/** What a screen reader hears for one line: time, severity, service, message. */
|
|
5814
|
+
declare function describeLogEntry(entry: LogEntry): string;
|
|
5815
|
+
|
|
5816
|
+
interface LogViewerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
5817
|
+
/** The log lines, in any order; they are drawn in time order. */
|
|
5818
|
+
entries: readonly LogEntry[];
|
|
5819
|
+
/** `asc` (default) puts the newest line at the bottom, like a terminal tail; `desc` puts it at the top. */
|
|
5820
|
+
order?: 'asc' | 'desc';
|
|
5821
|
+
/** Highlight case-insensitive matches of this text in each message. Highlights only — filter with `filterLogEntries`. */
|
|
5822
|
+
query?: string;
|
|
5823
|
+
/** Show only these severities. Omit to show every line. */
|
|
5824
|
+
severities?: readonly LogSeverity[];
|
|
5825
|
+
/** Show only lines inside this window. Overrides the shared range. */
|
|
5826
|
+
range?: TimeRange;
|
|
5827
|
+
/** Inside a `TimeRangeProvider`, show only lines inside the shared window. Default true. */
|
|
5828
|
+
followRange?: boolean;
|
|
5829
|
+
/**
|
|
5830
|
+
* Tail mode. While the reader is at the latest line, new lines keep it
|
|
5831
|
+
* there; once they scroll away, a "Jump to latest" button counts what
|
|
5832
|
+
* arrived since. Default false.
|
|
5833
|
+
*/
|
|
5834
|
+
follow?: boolean;
|
|
5835
|
+
/** Called with the trace id when a line's "View trace" button is pressed. The button only renders when this is given. */
|
|
5836
|
+
onTraceSelect?: (traceId: string, entry: LogEntry) => void;
|
|
5837
|
+
/** Height of the scroll box, in px. Default 360. */
|
|
5838
|
+
height?: number;
|
|
5839
|
+
/** Window the list to the visible rows. Default: only above 200 lines. */
|
|
5840
|
+
virtualize?: boolean;
|
|
5841
|
+
/** Draw the column labels above the lines. Default true. */
|
|
5842
|
+
showHeader?: boolean;
|
|
5843
|
+
/** Announce new lines politely to screen readers. Off by default: a flood announced line by line is hostile. */
|
|
5844
|
+
announce?: boolean;
|
|
5845
|
+
/** Ids of the lines expanded on mount. */
|
|
5846
|
+
defaultExpanded?: readonly string[];
|
|
5847
|
+
/** Replaces the empty-state text. */
|
|
5848
|
+
emptyText?: ReactNode;
|
|
5849
|
+
/** Accessible name for the list. Default `Log lines`. */
|
|
5850
|
+
label?: string;
|
|
5851
|
+
}
|
|
5852
|
+
/**
|
|
5853
|
+
* A log tail: one monospace line per entry — timestamp, severity, service,
|
|
5854
|
+
* message — in time order, each expanding to its fields and trace ids.
|
|
5855
|
+
*
|
|
5856
|
+
* It follows the page's `TimeRangeProvider` when there is one — only lines in
|
|
5857
|
+
* the shared window are shown, hovering a line moves the shared cursor to it,
|
|
5858
|
+
* and the line nearest a cursor set elsewhere is marked. Large streams are
|
|
5859
|
+
* windowed with `@tanstack/react-virtual` at a fixed row height.
|
|
5860
|
+
*
|
|
5861
|
+
* The list is one tab stop. Up/Down, Home/End and PageUp/PageDown move
|
|
5862
|
+
* through the lines, Enter or Space toggles one, Right expands and Left
|
|
5863
|
+
* collapses — hand-rolled, per the one-interaction-library rule.
|
|
5864
|
+
*/
|
|
5865
|
+
declare const LogViewer: react.ForwardRefExoticComponent<LogViewerProps & react.RefAttributes<HTMLDivElement>>;
|
|
5866
|
+
|
|
5867
|
+
/**
|
|
5868
|
+
* Filter expressions for log, span and event lists — `service=checkout`,
|
|
5869
|
+
* `status != 500`, `msg~timeout` — parsed, formatted and matched as data.
|
|
5870
|
+
*
|
|
5871
|
+
* Pure: no React, no clock. `FilterBar` is the editor; this module is what a
|
|
5872
|
+
* page uses to apply the result to its records.
|
|
5873
|
+
*/
|
|
5874
|
+
/** `=` equals, `!=` does not equal, `~` contains, `!~` does not contain. */
|
|
5875
|
+
type FilterOperator = '=' | '!=' | '~' | '!~';
|
|
5876
|
+
/**
|
|
5877
|
+
* One condition. Free text — a search across every value — is
|
|
5878
|
+
* `{ key: '*', operator: '~', value }`.
|
|
5879
|
+
*/
|
|
5880
|
+
interface Filter {
|
|
5881
|
+
/** The field name; dots address nested values. `*` means any field. */
|
|
5882
|
+
key: string;
|
|
5883
|
+
operator: FilterOperator;
|
|
5884
|
+
value: string;
|
|
5885
|
+
}
|
|
5886
|
+
/** The key a free-text filter carries. */
|
|
5887
|
+
declare const FREE_TEXT_KEY = "*";
|
|
5888
|
+
/** What `tryParseFilter` returns for non-empty text: a filter, or why there is none. */
|
|
5889
|
+
type FilterParseResult = {
|
|
5890
|
+
ok: true;
|
|
5891
|
+
filter: Filter;
|
|
5892
|
+
} | {
|
|
5893
|
+
ok: false;
|
|
5894
|
+
error: string;
|
|
5895
|
+
};
|
|
5896
|
+
/** Every operator, longest first so `!=` is never read as `!` then `=`. */
|
|
5897
|
+
declare const FILTER_OPERATORS: readonly FilterOperator[];
|
|
5898
|
+
/** A word for each operator, for an accessible name or a hint. */
|
|
5899
|
+
declare const FILTER_OPERATOR_LABELS: Record<FilterOperator, string>;
|
|
5900
|
+
/**
|
|
5901
|
+
* Parse one expression, saying why when it cannot be one. Returns null for
|
|
5902
|
+
* empty or whitespace-only text.
|
|
5903
|
+
*
|
|
5904
|
+
* - `key op value`, whitespace around the operator ignored: `status != 500`.
|
|
5905
|
+
* - A value in double quotes keeps its spaces and may hold `"` as `\"`:
|
|
5906
|
+
* `route="/v1/orders"`.
|
|
5907
|
+
* - Text with no operator, or text wholly in quotes, is free text.
|
|
5908
|
+
* - An operator with nothing before it, or nothing after it, is an error.
|
|
5909
|
+
*/
|
|
5910
|
+
declare function tryParseFilter(text: string): FilterParseResult | null;
|
|
5911
|
+
/**
|
|
5912
|
+
* Parse one expression into a filter: `service=checkout`, `status != 500`,
|
|
5913
|
+
* `msg~timeout`, `route="/v1/orders"`; plain text becomes free text. Null for
|
|
5914
|
+
* empty text and for text that is not a valid expression — `tryParseFilter`
|
|
5915
|
+
* says why.
|
|
5916
|
+
*/
|
|
5917
|
+
declare function parseFilter(text: string): Filter | null;
|
|
5918
|
+
/**
|
|
5919
|
+
* The expression a filter was written as — `service=checkout`, or the bare
|
|
5920
|
+
* text for free text. `parseFilter(formatFilter(f))` gives `f` back.
|
|
5921
|
+
*/
|
|
5922
|
+
declare function formatFilter(filter: Filter): string;
|
|
5923
|
+
/**
|
|
5924
|
+
* A filter as a reader sees it: `service = checkout`, or `“timeout”` for
|
|
5925
|
+
* free text. Used for chip text and accessible names.
|
|
5926
|
+
*/
|
|
5927
|
+
declare function describeFilter(filter: Filter): string;
|
|
5928
|
+
/** Whether two filters say the same thing. */
|
|
5929
|
+
declare function sameFilter(a: Filter, b: Filter): boolean;
|
|
5930
|
+
/**
|
|
5931
|
+
* The value at `key`: the flat key first (`record['attributes.http.route']`),
|
|
5932
|
+
* then the dotted path (`record.attributes.http.route`). A segment may itself
|
|
5933
|
+
* contain dots, so each remainder is tried flat before descending.
|
|
5934
|
+
*/
|
|
5935
|
+
declare function lookupField(record: Record<string, unknown>, key: string): unknown;
|
|
5936
|
+
/**
|
|
5937
|
+
* Whether a record satisfies every filter (AND; no filters matches all).
|
|
5938
|
+
*
|
|
5939
|
+
* - `=` and `!=` compare exactly; `~` and `!~` are case-insensitive substring tests.
|
|
5940
|
+
* - Numbers and booleans compare by their string form, so `status=500` works.
|
|
5941
|
+
* - An array matches `=`/`~` when any element does; `!=`/`!~` when none does.
|
|
5942
|
+
* - A missing field never equals or contains anything, so it passes `!=` and `!~`.
|
|
5943
|
+
* - Key `*` searches every string, number and boolean in the record, nested included.
|
|
5944
|
+
*/
|
|
5945
|
+
declare function matchFilters(record: Record<string, unknown>, filters: readonly Filter[]): boolean;
|
|
5946
|
+
|
|
5947
|
+
/** A field `FilterBar` suggests while typing. */
|
|
5948
|
+
interface FilterBarField {
|
|
5949
|
+
/** The key as it is written in an expression: `service`, `http.status`. */
|
|
5950
|
+
key: string;
|
|
5951
|
+
/** A human name for the field, shown beside the `key=` suggestion where the browser shows labels. */
|
|
5952
|
+
label?: string;
|
|
5953
|
+
/** Known values, each suggested as `key=value`. */
|
|
5954
|
+
values?: readonly string[];
|
|
5955
|
+
}
|
|
5956
|
+
interface FilterBarProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
5957
|
+
/** The filters, controlled. Pair with `onFiltersChange`. */
|
|
5958
|
+
filters?: readonly Filter[];
|
|
5959
|
+
/** The filters on first render, uncontrolled. */
|
|
5960
|
+
defaultFilters?: readonly Filter[];
|
|
5961
|
+
/** Called with the whole next list whenever a chip is added, edited, removed or cleared. */
|
|
5962
|
+
onFiltersChange?: (filters: Filter[]) => void;
|
|
5963
|
+
/** Fields and values offered as suggestions, through a native `<datalist>`. */
|
|
5964
|
+
fields?: readonly FilterBarField[];
|
|
5965
|
+
/** The input's accessible name. Default `Filter`. */
|
|
5966
|
+
label?: string;
|
|
5967
|
+
/** Keep the label for assistive technology only. Default `false`: it leads the bar. */
|
|
5968
|
+
hideLabel?: boolean;
|
|
5969
|
+
/** Placeholder text in the empty input. */
|
|
5970
|
+
placeholder?: string;
|
|
5971
|
+
/** Right-aligned summary — a count such as `42 of 1,204 spans`. */
|
|
5972
|
+
summary?: ReactNode;
|
|
5973
|
+
/** The label of the button that removes every filter. Default `Clear all`. */
|
|
5974
|
+
clearLabel?: string;
|
|
5975
|
+
}
|
|
5976
|
+
/**
|
|
5977
|
+
* A query bar for log, span and event lists: each condition is a chip —
|
|
5978
|
+
* `service = checkout`, `status != 500`, `msg ~ timeout` — and one text input
|
|
5979
|
+
* adds more.
|
|
5980
|
+
*
|
|
5981
|
+
* Type `key=value` (or `!=`, `~`, `!~`, or plain text to search everything) and
|
|
5982
|
+
* press Enter to add a chip. Backspace in the empty input removes the last
|
|
5983
|
+
* chip; Escape clears the input. Pressing a chip's text puts it back in the
|
|
5984
|
+
* input for editing — Enter replaces it in place, Escape abandons the edit.
|
|
5985
|
+
*
|
|
5986
|
+
* Suggestions come from `fields` through a native `<datalist>`, so the browser
|
|
5987
|
+
* owns the list, its keyboard and its announcements; there is no popup or
|
|
5988
|
+
* focus model here. Expressions are parsed by `parseFilter` from
|
|
5989
|
+
* `lib/filters`, and `matchFilters` applies the result to records.
|
|
5990
|
+
*
|
|
5991
|
+
* An expression that cannot be parsed — `=value` with no field — stays in the
|
|
5992
|
+
* input with a message joined to its `aria-describedby`. The label, the
|
|
5993
|
+
* message and their wiring are Base UI's `Field`, as on every control here.
|
|
5994
|
+
*/
|
|
5995
|
+
declare const FilterBar: react.ForwardRefExoticComponent<FilterBarProps & react.RefAttributes<HTMLDivElement>>;
|
|
5996
|
+
|
|
5997
|
+
/**
|
|
5998
|
+
* The service graph: spans in, services and the calls between them out.
|
|
5999
|
+
*
|
|
6000
|
+
* Where `trace.ts` answers "what happened in this request?", this module
|
|
6001
|
+
* answers "which services talk to which, how often, and how badly?". It folds
|
|
6002
|
+
* any number of spans — one trace or a thousand — into one node per service
|
|
6003
|
+
* and one edge per caller → callee pair, then lays that graph out in layers.
|
|
6004
|
+
*
|
|
6005
|
+
* Pure data, no React, no clock: the same spans always produce the same graph
|
|
6006
|
+
* and the same coordinates, so a story or a snapshot is deterministic.
|
|
6007
|
+
*
|
|
6008
|
+
* Every duration is milliseconds, as in `trace.ts`.
|
|
6009
|
+
*/
|
|
6010
|
+
|
|
6011
|
+
/** What a service is, as far as its spans say. */
|
|
6012
|
+
type ServiceNodeKind = 'service' | 'database' | 'queue' | 'external';
|
|
6013
|
+
/** One service, with the traffic that entered it. */
|
|
6014
|
+
interface ServiceNode {
|
|
6015
|
+
/** The service name (OTLP `service.name`). */
|
|
6016
|
+
id: string;
|
|
6017
|
+
/** Spans that entered this service: roots, or spans whose parent is in another service. */
|
|
6018
|
+
requests: number;
|
|
6019
|
+
/** Of those requests, how many ended in error. */
|
|
6020
|
+
errors: number;
|
|
6021
|
+
/** Mean duration of the requests, in milliseconds. `0` when none had an end. */
|
|
6022
|
+
avgDuration: number;
|
|
6023
|
+
/** 95th-percentile (nearest rank) duration of the requests, in milliseconds. */
|
|
6024
|
+
p95Duration?: number;
|
|
6025
|
+
/** Inferred from span kind and attributes. */
|
|
6026
|
+
kind?: ServiceNodeKind;
|
|
6027
|
+
}
|
|
6028
|
+
/** Calls from one service into another. */
|
|
6029
|
+
interface ServiceEdge {
|
|
6030
|
+
/** The calling service. */
|
|
6031
|
+
from: string;
|
|
6032
|
+
/** The called service. */
|
|
6033
|
+
to: string;
|
|
6034
|
+
/** How many spans crossed from `from` into `to`. */
|
|
6035
|
+
calls: number;
|
|
6036
|
+
/** Of those, how many ended in error. */
|
|
6037
|
+
errors: number;
|
|
6038
|
+
/** Mean duration of the called spans, in milliseconds. */
|
|
6039
|
+
avgDuration: number;
|
|
6040
|
+
}
|
|
6041
|
+
/** Services and the calls between them. */
|
|
6042
|
+
interface ServiceGraph {
|
|
6043
|
+
/** Sorted by id. */
|
|
6044
|
+
nodes: ServiceNode[];
|
|
6045
|
+
/** Sorted by `from`, then `to`. */
|
|
6046
|
+
edges: ServiceEdge[];
|
|
6047
|
+
}
|
|
6048
|
+
/**
|
|
6049
|
+
* Fold spans into a service graph.
|
|
6050
|
+
*
|
|
6051
|
+
* Pass one flat list (spans from one or many traces, ids unique across them),
|
|
6052
|
+
* or a list of traces — each resolved on its own, so span ids may repeat from
|
|
6053
|
+
* one trace to the next.
|
|
6054
|
+
*
|
|
6055
|
+
* - A **node** per service. Its requests are the spans that *entered* it: a
|
|
6056
|
+
* root, or a span whose parent belongs to another service.
|
|
6057
|
+
* - An **edge** per parent service → child service crossing, counting the
|
|
6058
|
+
* child spans.
|
|
6059
|
+
* - **Kind**: a span carrying `db.system` makes its service a database; one
|
|
6060
|
+
* carrying `messaging.system`, or of kind `producer`/`consumer`, a queue.
|
|
6061
|
+
* A `client` span naming a `peer.service` that emitted no spans of its own
|
|
6062
|
+
* adds an `external` node, with an edge into it.
|
|
6063
|
+
*/
|
|
6064
|
+
declare function serviceGraph(input: readonly TraceSpanInput[] | readonly (readonly TraceSpanInput[])[]): ServiceGraph;
|
|
6065
|
+
/** A point in the layout's coordinate space. */
|
|
6066
|
+
interface ServiceGraphPoint {
|
|
6067
|
+
x: number;
|
|
6068
|
+
y: number;
|
|
6069
|
+
}
|
|
6070
|
+
/** A node placed by `layoutServiceGraph`. `x`, `y` is its top-left corner. */
|
|
6071
|
+
interface ServiceGraphLayoutNode {
|
|
6072
|
+
id: string;
|
|
6073
|
+
x: number;
|
|
6074
|
+
y: number;
|
|
6075
|
+
/** Column, counted from the roots. */
|
|
6076
|
+
layer: number;
|
|
6077
|
+
/** Row within the layer, top first. */
|
|
6078
|
+
index: number;
|
|
6079
|
+
}
|
|
6080
|
+
/** An edge placed by `layoutServiceGraph`. */
|
|
6081
|
+
interface ServiceGraphLayoutEdge {
|
|
6082
|
+
from: string;
|
|
6083
|
+
to: string;
|
|
6084
|
+
/** Where the edge leaves its source. */
|
|
6085
|
+
source: ServiceGraphPoint;
|
|
6086
|
+
/** Where the edge meets its target (the arrow's tip). */
|
|
6087
|
+
target: ServiceGraphPoint;
|
|
6088
|
+
/**
|
|
6089
|
+
* The edge does not run left to right — it closes a cycle, or joins two
|
|
6090
|
+
* nodes in the same layer — so it leaves and enters from below.
|
|
6091
|
+
*/
|
|
6092
|
+
back: boolean;
|
|
6093
|
+
/** For a back edge, the depth its loop's control points sit at — below every node. */
|
|
6094
|
+
dip?: number;
|
|
6095
|
+
}
|
|
6096
|
+
/** A laid-out service graph. */
|
|
6097
|
+
interface ServiceGraphLayout {
|
|
6098
|
+
/** In layer order, then top to bottom. */
|
|
6099
|
+
nodes: ServiceGraphLayoutNode[];
|
|
6100
|
+
/** In the graph's edge order; self-calls are dropped. */
|
|
6101
|
+
edges: ServiceGraphLayoutEdge[];
|
|
6102
|
+
/** Extent of the nodes, from 0, 0. Back-edge loops dip up to `rowGap` below it. */
|
|
6103
|
+
width: number;
|
|
6104
|
+
height: number;
|
|
6105
|
+
/** Node size used, so a renderer can draw what was placed. */
|
|
6106
|
+
nodeWidth: number;
|
|
6107
|
+
nodeHeight: number;
|
|
6108
|
+
/** How many layers. */
|
|
6109
|
+
layers: number;
|
|
6110
|
+
}
|
|
6111
|
+
/** Spacing for `layoutServiceGraph`, in layout units. */
|
|
6112
|
+
interface ServiceGraphLayoutOptions {
|
|
6113
|
+
/** Horizontal space between layers. Default 72. */
|
|
6114
|
+
columnGap?: number;
|
|
6115
|
+
/** Vertical space between nodes in a layer. Default 24. */
|
|
6116
|
+
rowGap?: number;
|
|
6117
|
+
/** Default 168. */
|
|
6118
|
+
nodeWidth?: number;
|
|
6119
|
+
/** Default 64. */
|
|
6120
|
+
nodeHeight?: number;
|
|
6121
|
+
}
|
|
6122
|
+
/**
|
|
6123
|
+
* Place a service graph in left-to-right layers.
|
|
6124
|
+
*
|
|
6125
|
+
* 1. Cycles are broken by removing the back edges a depth-first search finds
|
|
6126
|
+
* (roots first, then by name), so every edge left points forward.
|
|
6127
|
+
* 2. A node's layer is its longest path from a root.
|
|
6128
|
+
* 3. Within a layer, nodes start in name order and are reordered by two
|
|
6129
|
+
* down-and-up sweeps of barycentres (the mean row of their neighbours in
|
|
6130
|
+
* the layer before, then after), ties kept by current row and then name.
|
|
6131
|
+
*
|
|
6132
|
+
* Deterministic: the same graph always lands on the same coordinates. Edges
|
|
6133
|
+
* naming an unknown node are ignored.
|
|
6134
|
+
*/
|
|
6135
|
+
declare function layoutServiceGraph(graph: ServiceGraph, options?: ServiceGraphLayoutOptions): ServiceGraphLayout;
|
|
6136
|
+
/**
|
|
6137
|
+
* An SVG path for a laid-out edge: a horizontal S-curve for a forward edge,
|
|
6138
|
+
* a loop under the nodes for a back edge.
|
|
6139
|
+
*/
|
|
6140
|
+
declare function serviceEdgePath(edge: ServiceGraphLayoutEdge): string;
|
|
6141
|
+
/** The middle of the curve `serviceEdgePath` draws — where its label sits. */
|
|
6142
|
+
declare function serviceEdgeMidpoint(edge: ServiceGraphLayoutEdge): ServiceGraphPoint;
|
|
6143
|
+
/** `950`, `1.2k`, `34k`, `1.5M`. */
|
|
6144
|
+
declare function formatServiceCount(value: number): string;
|
|
6145
|
+
/** An error rate as a percentage: `0%`, `0.4%`, `2%`, `100%`. */
|
|
6146
|
+
declare function formatServiceErrorRate(errors: number, total: number): string;
|
|
6147
|
+
|
|
6148
|
+
interface ServiceMapProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
6149
|
+
/** The graph to draw. Takes precedence over `spans`. */
|
|
6150
|
+
graph?: ServiceGraph;
|
|
6151
|
+
/**
|
|
6152
|
+
* Spans folded into a graph with `serviceGraph`: one flat list (ids unique
|
|
6153
|
+
* across it), or a list of traces whose ids may repeat. Ignored when `graph`
|
|
6154
|
+
* is given.
|
|
6155
|
+
*/
|
|
6156
|
+
spans?: readonly TraceSpanInput[] | readonly (readonly TraceSpanInput[])[];
|
|
6157
|
+
/** The selected service id. Controlled when defined; `null` selects nothing. */
|
|
6158
|
+
selectedId?: string | null;
|
|
6159
|
+
/** The service selected on mount when uncontrolled. */
|
|
6160
|
+
defaultSelectedId?: string | null;
|
|
6161
|
+
/** Called with the id a click, Enter or Space selects, or `null` when Escape clears it. */
|
|
6162
|
+
onSelectedChange?: (id: string | null) => void;
|
|
6163
|
+
/**
|
|
6164
|
+
* Error rate (0–1) above which a service is flagged: outlined in the danger
|
|
6165
|
+
* role and badged. Default `0.05`.
|
|
6166
|
+
*/
|
|
6167
|
+
errorThreshold?: number;
|
|
6168
|
+
/** Accessible name for the map. Default `Service map`. */
|
|
6169
|
+
title?: string;
|
|
6170
|
+
/**
|
|
6171
|
+
* Height of the drawing, as an SVG length (`320`, `"20rem"`). The graph is
|
|
6172
|
+
* fitted inside it without stretching. Default: as tall as its width implies.
|
|
6173
|
+
*/
|
|
6174
|
+
height?: number | string;
|
|
6175
|
+
/**
|
|
6176
|
+
* When edge labels (`1.2k calls · 2% err`) show. `auto` (default) shows every
|
|
6177
|
+
* label that fits without overlapping a node or another label, and the rest
|
|
6178
|
+
* on hover or when an end is focused or selected; `interactive` shows them
|
|
6179
|
+
* only then; `always` shows all of them.
|
|
6180
|
+
*/
|
|
6181
|
+
edgeLabels?: 'auto' | 'always' | 'interactive';
|
|
6182
|
+
}
|
|
6183
|
+
/**
|
|
6184
|
+
* A service dependency map: one box per service, one arrow per caller →
|
|
6185
|
+
* callee pair, laid out in layers from the services nothing calls.
|
|
6186
|
+
*
|
|
6187
|
+
* Feed it a `graph`, or `spans` from any number of traces and it folds them
|
|
6188
|
+
* with `serviceGraph`. Boxes carry request count and error rate; a service
|
|
6189
|
+
* over `errorThreshold` is outlined and badged in the danger role, and an
|
|
6190
|
+
* edge that carried errors is drawn in it. Selecting a service dims all but
|
|
6191
|
+
* its neighbourhood and opens a details panel whose inbound and outbound
|
|
6192
|
+
* calls are buttons to the neighbour.
|
|
6193
|
+
*
|
|
6194
|
+
* The boxes are a roving tab stop in layer order — Left and Right cross
|
|
6195
|
+
* layers, Up and Down move within one, Enter or Space selects, Escape clears —
|
|
6196
|
+
* hand-rolled per the one-interaction-library rule. Everything is placed with
|
|
6197
|
+
* SVG attributes, so no inline style.
|
|
6198
|
+
*/
|
|
6199
|
+
declare const ServiceMap: react.ForwardRefExoticComponent<ServiceMapProps & react.RefAttributes<HTMLDivElement>>;
|
|
6200
|
+
|
|
6201
|
+
/** One alert as an alerting backend reports it. */
|
|
6202
|
+
interface Alert {
|
|
6203
|
+
/** Stable identity, used for selection and React keys. */
|
|
6204
|
+
id: string;
|
|
6205
|
+
/** The rule's name — `HighErrorRate`, `DiskAlmostFull`. */
|
|
6206
|
+
name: string;
|
|
6207
|
+
/** Where the alert is in its lifecycle. */
|
|
6208
|
+
state: AlertState;
|
|
6209
|
+
/** How bad it is. */
|
|
6210
|
+
severity: AlertSeverity;
|
|
6211
|
+
/** When the alert entered its current state, in epoch milliseconds. */
|
|
6212
|
+
since: number;
|
|
6213
|
+
/** The service or target the alert is about. */
|
|
6214
|
+
service?: string;
|
|
6215
|
+
/** One sentence on what is wrong. */
|
|
6216
|
+
summary?: string;
|
|
6217
|
+
/** The observed value, already formatted — `4.2%`. */
|
|
6218
|
+
value?: string;
|
|
6219
|
+
/** The threshold it is compared against, already formatted — `1%`. */
|
|
6220
|
+
threshold?: string;
|
|
6221
|
+
/** Recent samples of the alerting metric, oldest first, drawn as a sparkline. */
|
|
6222
|
+
trend?: readonly number[];
|
|
6223
|
+
}
|
|
6224
|
+
/** The order states are listed in, most urgent first. */
|
|
6225
|
+
declare const ALERT_STATE_ORDER: readonly AlertState[];
|
|
6226
|
+
/**
|
|
6227
|
+
* Alerts in reading order: by state (firing, pending, silenced, resolved), then
|
|
6228
|
+
* by severity (critical first), then by `since` — the longest-running first
|
|
6229
|
+
* for an active alert, the most recently resolved first for a resolved one.
|
|
6230
|
+
* Ties fall back to the name, so the order is total and stable.
|
|
6231
|
+
*/
|
|
6232
|
+
declare function sortAlerts(alerts: readonly Alert[]): Alert[];
|
|
6233
|
+
/** `firing for 12m`, `resolved 3h ago`: how long an alert has been in its state at `now`. */
|
|
6234
|
+
declare function formatAlertDuration(alert: Pick<Alert, 'state' | 'since'>, now: number): string;
|
|
6235
|
+
interface AlertListProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
|
6236
|
+
/** The alerts, in any order; the list sorts them by state, severity and age. */
|
|
6237
|
+
alerts: readonly Alert[];
|
|
6238
|
+
/** The time durations are measured to, in epoch milliseconds. Passed in, never read from the clock. */
|
|
6239
|
+
now: number;
|
|
6240
|
+
/**
|
|
6241
|
+
* States shown. Controlled when defined. An empty list shows every state —
|
|
6242
|
+
* the header's toggles narrow from "all" rather than starting with all pressed.
|
|
6243
|
+
*/
|
|
6244
|
+
stateFilter?: readonly AlertState[];
|
|
6245
|
+
/** States shown on mount when uncontrolled. Default `[]`, every state. */
|
|
6246
|
+
defaultStateFilter?: readonly AlertState[];
|
|
6247
|
+
/** Called with the new set of shown states when a header toggle is pressed. */
|
|
6248
|
+
onStateFilterChange?: (states: AlertState[]) => void;
|
|
6249
|
+
/**
|
|
6250
|
+
* The selected alert id. Controlled when defined; `null` selects nothing.
|
|
6251
|
+
* Rows become buttons only when one of `selectedId`, `defaultSelectedId` or
|
|
6252
|
+
* `onSelectedChange` is given.
|
|
6253
|
+
*/
|
|
6254
|
+
selectedId?: string | null;
|
|
6255
|
+
/** The alert selected on mount when uncontrolled. */
|
|
6256
|
+
defaultSelectedId?: string | null;
|
|
6257
|
+
/** Called with the id a click, Enter or Space selects. */
|
|
6258
|
+
onSelectedChange?: (id: string | null) => void;
|
|
6259
|
+
/**
|
|
6260
|
+
* Per-row actions — Acknowledge, Silence. Rendered beside the row's select
|
|
6261
|
+
* target, never inside it, so no interactive element nests in another.
|
|
6262
|
+
*/
|
|
6263
|
+
renderActions?: (alert: Alert) => ReactNode;
|
|
6264
|
+
/** The header's title. Default `Alerts`. */
|
|
6265
|
+
heading?: ReactNode;
|
|
6266
|
+
/** Shown when no alert matches the filter. Default `No alerts firing.` */
|
|
6267
|
+
emptyMessage?: ReactNode;
|
|
6268
|
+
/** Accessible name for the list of alerts. Default `Alerts`. */
|
|
6269
|
+
label?: string;
|
|
6270
|
+
}
|
|
6271
|
+
/**
|
|
6272
|
+
* An alert inbox: every alert in one list, the most urgent first, with a
|
|
6273
|
+
* header of per-state counts that double as filter toggles.
|
|
6274
|
+
*
|
|
6275
|
+
* Each row carries the state badge, severity, rule name, service, summary,
|
|
6276
|
+
* value against threshold, an optional trend and how long the alert has been
|
|
6277
|
+
* in its state at `now`. Selectable rows are buttons with a roving tab stop —
|
|
6278
|
+
* Up/Down/Home/End move, Enter or Space selects — and `renderActions` puts
|
|
6279
|
+
* row actions beside the button rather than inside it.
|
|
6280
|
+
*/
|
|
6281
|
+
declare const AlertList: react.ForwardRefExoticComponent<AlertListProps & react.RefAttributes<HTMLDivElement>>;
|
|
6282
|
+
|
|
6283
|
+
/** What happened at one point in an incident. */
|
|
6284
|
+
type IncidentEventKind = 'detected' | 'alert' | 'acknowledged' | 'update' | 'deploy' | 'mitigated' | 'resolved';
|
|
6285
|
+
/** One entry in an incident's log. */
|
|
6286
|
+
interface IncidentEvent {
|
|
6287
|
+
/** Stable identity, used for React keys and `onEventSelect`. */
|
|
6288
|
+
id: string;
|
|
6289
|
+
/** When it happened, in epoch milliseconds. */
|
|
6290
|
+
time: number;
|
|
6291
|
+
/** What kind of event it is; decides the marker's role colour and the summary's milestones. */
|
|
6292
|
+
kind: IncidentEventKind;
|
|
6293
|
+
/** One line on what happened. */
|
|
6294
|
+
title: string;
|
|
6295
|
+
/** Longer prose under the title. */
|
|
6296
|
+
detail?: string;
|
|
6297
|
+
/** Who did it or wrote it. */
|
|
6298
|
+
author?: string;
|
|
6299
|
+
}
|
|
6300
|
+
/** The milestones of an incident, measured from its first `detected` or `alert` event. */
|
|
6301
|
+
interface IncidentSummary {
|
|
6302
|
+
/** `resolved` once any `resolved` event exists, `ongoing` otherwise. */
|
|
6303
|
+
status: 'ongoing' | 'resolved';
|
|
6304
|
+
/**
|
|
6305
|
+
* When the incident started: the first `detected` or `alert` event, or the
|
|
6306
|
+
* earliest event of any kind when there is neither. `null` with no events.
|
|
6307
|
+
*/
|
|
6308
|
+
start: number | null;
|
|
6309
|
+
/** Milliseconds from start to the first `acknowledged` event; `null` when there is none. */
|
|
6310
|
+
timeToAcknowledge: number | null;
|
|
6311
|
+
/** Milliseconds from start to the first `mitigated` event; `null` when there is none. */
|
|
6312
|
+
timeToMitigate: number | null;
|
|
6313
|
+
/** Milliseconds from start to the first `resolved` event; `null` when there is none. */
|
|
6314
|
+
timeToResolve: number | null;
|
|
6315
|
+
/**
|
|
6316
|
+
* Total length: to the resolution when resolved; to `now` when ongoing and
|
|
6317
|
+
* `now` is given; otherwise to the latest event.
|
|
6318
|
+
*/
|
|
6319
|
+
duration: number | null;
|
|
6320
|
+
}
|
|
6321
|
+
/** Compute an incident's status and milestones from its events. Pure; order of `events` does not matter. */
|
|
6322
|
+
declare function summariseIncident(events: readonly IncidentEvent[], now?: number): IncidentSummary;
|
|
6323
|
+
interface IncidentTimelineProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
6324
|
+
/** The incident's log, in any order. */
|
|
6325
|
+
events: readonly IncidentEvent[];
|
|
6326
|
+
/** The incident's name, shown above the summary. */
|
|
6327
|
+
title?: ReactNode;
|
|
6328
|
+
/** The incident's severity, shown as a badge beside the title. */
|
|
6329
|
+
severity?: AlertSeverity;
|
|
6330
|
+
/** The time an unresolved incident's duration runs to. Passed in, never read from the clock. */
|
|
6331
|
+
now?: number;
|
|
6332
|
+
/** `oldest-first` (default) puts the newest event last; `newest-first` reverses it. */
|
|
6333
|
+
order?: 'oldest-first' | 'newest-first';
|
|
6334
|
+
/** Makes each event's title a button, called with the event when pressed. */
|
|
6335
|
+
onEventSelect?: (event: IncidentEvent) => void;
|
|
6336
|
+
/** Accessible name for the list of events. Default `Incident timeline`. */
|
|
6337
|
+
label?: string;
|
|
6338
|
+
}
|
|
6339
|
+
/**
|
|
6340
|
+
* An incident's history on a vertical rail: one marker per event, coloured by
|
|
6341
|
+
* kind, with its timestamp, title, detail and author, and the time between
|
|
6342
|
+
* consecutive events labelled on the rail.
|
|
6343
|
+
*
|
|
6344
|
+
* A summary strip above it gives the status and the time to acknowledge,
|
|
6345
|
+
* mitigate and resolve, measured from the first `detected` or `alert` event —
|
|
6346
|
+
* see `summariseIncident`. The events are an `<ol>` with `<time dateTime>`;
|
|
6347
|
+
* nothing is interactive unless `onEventSelect` is given.
|
|
6348
|
+
*/
|
|
6349
|
+
declare const IncidentTimeline: react.ForwardRefExoticComponent<IncidentTimelineProps & react.RefAttributes<HTMLDivElement>>;
|
|
6350
|
+
|
|
6351
|
+
interface FreshnessIndicatorProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
6352
|
+
/** When the data was last refreshed, as epoch milliseconds. */
|
|
6353
|
+
updatedAt: number;
|
|
6354
|
+
/** The page's clock, as epoch milliseconds. A prop, never read here, so a story or a capture is deterministic. */
|
|
6355
|
+
now: number;
|
|
6356
|
+
/** How old the data may get, in milliseconds, before it reads as stale. Default `60_000`. */
|
|
6357
|
+
staleAfter?: number;
|
|
6358
|
+
/** The view refreshes on its own — a pulsing dot while the data is fresh. */
|
|
6359
|
+
live?: boolean;
|
|
6360
|
+
/** Refreshing is suspended: reads `Paused`, whatever the age. */
|
|
6361
|
+
paused?: boolean;
|
|
6362
|
+
}
|
|
6363
|
+
/** Which of the three states an indicator is in. */
|
|
6364
|
+
type FreshnessState = 'fresh' | 'stale' | 'paused';
|
|
6365
|
+
/** `12s`, `3m`, `2h`, `4d` — an age in its largest whole unit; `just now` under a second. */
|
|
6366
|
+
declare function formatAge(ms: number): string;
|
|
6367
|
+
/**
|
|
6368
|
+
* How old the data on screen is: `Updated 12s ago`, `Updated 3m ago`; past
|
|
6369
|
+
* `staleAfter` it turns to the warning role and reads `Stale · updated 5m ago`,
|
|
6370
|
+
* and `paused` reads `Paused`.
|
|
6371
|
+
*
|
|
6372
|
+
* `now` is a prop: the indicator never reads the clock, so it re-renders when
|
|
6373
|
+
* the page's clock ticks and renders identically in a story. The age sits in
|
|
6374
|
+
* a `<time>` whose `dateTime` is the update's ISO instant.
|
|
6375
|
+
*
|
|
6376
|
+
* `live` adds a dot that pulses while the data is fresh, holds still in the
|
|
6377
|
+
* warning role once stale, and greys out when paused. The pulse stops under
|
|
6378
|
+
* `prefers-reduced-motion`. It is decoration; the words carry the state.
|
|
6379
|
+
*/
|
|
6380
|
+
declare const FreshnessIndicator: react.ForwardRefExoticComponent<FreshnessIndicatorProps & react.RefAttributes<HTMLSpanElement>>;
|
|
6381
|
+
|
|
6382
|
+
/** The visible part of an id: its first `count` characters and `…`, or all of it. */
|
|
6383
|
+
declare function truncateId(value: string, count?: number): string;
|
|
6384
|
+
|
|
6385
|
+
interface IdChipProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children' | 'onCopy'> {
|
|
6386
|
+
/** The identifier — a trace id, span id or request id. Copied, linked and announced in full. */
|
|
6387
|
+
value: string;
|
|
6388
|
+
/** What kind of id it is, shown before it in small caps: `trace`, `span`, `req`. */
|
|
6389
|
+
label?: string;
|
|
6390
|
+
/** How many leading characters to show before `…`. Default `8`; `0` shows the whole id. */
|
|
6391
|
+
truncate?: number;
|
|
6392
|
+
/** Makes the id a link — to the trace page, say. The copy button stays separate. */
|
|
6393
|
+
href?: string;
|
|
6394
|
+
/** Show the copy button. Default `true`. */
|
|
6395
|
+
copyable?: boolean;
|
|
6396
|
+
/** Called after a copy attempt, with whether it succeeded. */
|
|
6397
|
+
onCopy?: (value: string, ok: boolean) => void;
|
|
6398
|
+
}
|
|
6399
|
+
/**
|
|
6400
|
+
* A compact, monospace identifier — trace, span or request id — sized for a
|
|
6401
|
+
* table cell or a log row: the first eight characters and `…`, with the full
|
|
6402
|
+
* value in the accessible name and a tooltip, and a button that copies it.
|
|
6403
|
+
*
|
|
6404
|
+
* With `href` the id is a link (through `LinkProvider`, so an app's router
|
|
6405
|
+
* handles it); the copy button stays a separate control beside it, so copying
|
|
6406
|
+
* never navigates. After a copy the button reads `Copied` for two seconds,
|
|
6407
|
+
* announced as a status.
|
|
6408
|
+
*/
|
|
6409
|
+
declare const IdChip: react.ForwardRefExoticComponent<IdChipProps & react.RefAttributes<HTMLSpanElement>>;
|
|
6410
|
+
|
|
4843
6411
|
interface SlideProps {
|
|
4844
6412
|
title?: string;
|
|
4845
6413
|
subtitle?: string;
|
|
@@ -5268,6 +6836,28 @@ interface SaasLandingPageProps {
|
|
|
5268
6836
|
*/
|
|
5269
6837
|
declare const SaasLandingPage: react__default.FC<SaasLandingPageProps>;
|
|
5270
6838
|
|
|
6839
|
+
type View = 'overview' | 'logs' | 'traces' | 'services' | 'alerts';
|
|
6840
|
+
interface ObservabilityConsoleProps extends Omit<HTMLAttributes<HTMLDivElement>, 'className'> {
|
|
6841
|
+
/** The view open on mount. Default `overview`. */
|
|
6842
|
+
defaultView?: View;
|
|
6843
|
+
}
|
|
6844
|
+
/**
|
|
6845
|
+
* An ops console for a checkout service the hour after an incident: one
|
|
6846
|
+
* shared time range across latency and throughput charts, a latency heatmap
|
|
6847
|
+
* and histogram, alerts with the incident's timeline, filterable logs whose
|
|
6848
|
+
* trace ids open a replayable trace, and a service map built from the same
|
|
6849
|
+
* spans. Every number comes from one seeded dataset, so the views agree.
|
|
6850
|
+
*
|
|
6851
|
+
* A composition of exported components and nothing else — the acceptance
|
|
6852
|
+
* test for the observability surface (#407), served at `/site/examples/observability/`.
|
|
6853
|
+
*/
|
|
6854
|
+
declare const ObservabilityConsole: react.ForwardRefExoticComponent<ObservabilityConsoleProps & react.RefAttributes<HTMLDivElement>>;
|
|
6855
|
+
/** The incident window, for callers that want to open the console zoomed onto it. */
|
|
6856
|
+
declare const OBSERVABILITY_INCIDENT_WINDOW: {
|
|
6857
|
+
from: number;
|
|
6858
|
+
to: number;
|
|
6859
|
+
};
|
|
6860
|
+
|
|
5271
6861
|
type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
5272
6862
|
interface AnchorHeadingProps extends Omit<HTMLAttributes<HTMLHeadingElement>, 'id'> {
|
|
5273
6863
|
level: HeadingLevel;
|
|
@@ -5805,7 +7395,10 @@ interface ChangeSummaryProps extends react.HTMLAttributes<HTMLDivElement> {
|
|
|
5805
7395
|
footer?: DiffRow;
|
|
5806
7396
|
/** Markdown list or `<Line>` content used to derive rows. */
|
|
5807
7397
|
children?: ReactNode;
|
|
5808
|
-
/**
|
|
7398
|
+
/**
|
|
7399
|
+
* Accepted for symmetry with the other figures and ignored: additions and removals take the
|
|
7400
|
+
* `delta` roles, so a summary reads the same in a `multi` figure as in a `mono` one.
|
|
7401
|
+
*/
|
|
5809
7402
|
palette?: FigurePalette$1;
|
|
5810
7403
|
/** Additional classes for this summary. */
|
|
5811
7404
|
className?: string;
|
|
@@ -6391,4 +7984,4 @@ declare const mdxComponents: {
|
|
|
6391
7984
|
};
|
|
6392
7985
|
type MdxComponents = typeof mdxComponents;
|
|
6393
7986
|
|
|
6394
|
-
export { ANSI_SLOTS, type AccentToken, type ActivityDay, ActivityGrid, type ActivityGridProps, AlertDialog, type AlertDialogProps, AnchorHeading, type AnchorHeadingProps, type AnsiChrome, type AnsiHue, type AnsiScheme, type AnsiSlot, AppMain, type AppMainProps, type AppNavItem, AppShell, type AppShellProps, AppSidebar, AppSidebarNav, type AppSidebarNavProps, type AppSidebarProps, AppTopbar, type AppTopbarProps, AsciiDivider, type AsciiDividerProps, AsciiGauge, type AsciiGaugeProps, type AsciiGaugeVariant, Avatar, type AvatarProps, Badge, type BadgeProps, BarChart, type BarChartDatum, type BarChartProps, BeforeAfter, type BeforeAfterProps, type BlogAuthor, BlogPost, type BlogPostProps, BlueskyIcon, type BorderTone, BracketText, type BracketTextProps, Breadcrumbs, type BreadcrumbsProps, type BrutalistTheme, BulletChart, type BulletChartProps, Button, type ButtonElementProps, type ButtonLinkProps, type ButtonProps, type ButtonVariant, CSS_MEDIUM, CTASection, type CTASectionAccent, type CTASectionProps, Card, type CardProps, type CardVariant, ChangeSummary, type ChangeSummaryProps, ChartTooltip, type ChartTooltipProps, Checkbox, type CheckboxProps, type ClassInput, CodeBlock, CodeBlockAttachment, type CodeBlockProps, CodeTab, type CodeTabProps, CodeTabs, type CodeTabsProps, type CodeTabsVariant, ColophonCard, type ColophonCardProps, type ColophonLink, type Column, type ContrastCheck, type ContrastFloor, type Crumb, DEFAULT_DEPLOY_LOG, DEFAULT_EXPERIMENTS, DEFAULT_LEVEL, DEFAULT_PRICING_TIERS, DIVIDER_PATTERNS, DataTable, type DataTableProps, type DataTableVirtualization, Decision, type DecisionOption, type DecisionProps, DesignSandbox, type DiffLineProps, type DiffRow, type DiffSign, Divider, type DividerProps, type DividerVariant, DocPager, type DocPagerProps, type DocPagerTarget, DocsHeader, type DocsHeaderProps, DocsLayout, type DocsLayoutProps, DocsLink, type DocsLinkProps, DocsLinkProvider, type DocsLinkProviderProps, type DocsNavItem, type DocsNavNode, DocsSidebar, type DocsSidebarProps, Drawer, type DrawerPlacement, type DrawerProps, DrawingSheet, type DrawingSheetProps, type Emphasis, EmptyState, type EmptyStateProps, ErrorSummary, type ErrorSummaryError, type ErrorSummaryProps, Event, type ExperimentItem, ExperimentsView, type ExperimentsViewProps, FIXED_COLOURS, Feature, FeatureGrid, type FeatureGridProps, type FeatureProps, Fieldset, type FieldsetProps, FigureFrame, type FigureFrameProps, type FileChange, type FileChangeNode, FileChangeTree, type FileChangeTreeProps, type FileChangeView, type Finding, type FixedColour, FlowDiagram, type FlowDiagramProps, type FlowNode, type FlowPathProps, type FlowRow, type FlowTone, GanttChart, type GanttChartProps, type GanttItem, GitHubIcon, Glyph, type GlyphProps, HEADING_EMPHASIS, type HeadingLevel, Hero, type HeroProps, type Hue, type HueAgreementCheck, type HueRef, INK_WEIGHT, IndexedSection, type IndexedSectionProps, Input, type InputProps, type Intent, LEVELS, Legend, type LegendProps, type LevelDefinition, Line, type LinkComponentProps, LinkProvider, type LinkProviderProps, LinkedInIcon, LoremIpsumPost, MAXIMUM_NEUTRAL_CHROMA, MEDIA, MEDIA_DEFINITIONS, MINIMUM_RATIO, MailIcon, type MdxComponents, type Medium, type MediumDefinition, Menu, MenuItem, type MenuItemProps, type MenuProps, MenuRadioGroup, type MenuRadioGroupProps, MenuRadioItem, type MenuRadioItemProps, MenuSeparator, type MenuSeparatorProps, MetadataGrid, type MetadataGridCustomItem, type MetadataGridProps, type MetadataGridSeries, type Metric, MetricStrip, type MetricStripProps, type MetricTone, MobileNav, type MobileNavProps, Modal, type ModalProps, type Motion, NERD_GLYPHS, NerdIcon, type NerdIconAccent, type NerdIconName, type NerdIconProps, Node, type NodeProps, NotFoundPage, type NotFoundPageProps, NoteBlock, type NoteBlockProps, Option, type OverlayAlign, type OverlaySide, PALETTE_HUES, PageHeader, type PageHeaderProps, PageTitle, type PageTitleProps, Pagination, type PaginationProps, Path, type Polarity, Popover, type PopoverProps, PricingGrid, type PricingGridProps, PricingTier, type PricingTierAccent, type PricingTierProps, Progress, type ProgressProps, Prose, type ProseProps, RECOMMENDED_COLOURS, RECOMMENDED_COLOUR_CLASSES, RECOMMENDED_COLOUR_NAMESPACES, RECOMMENDED_COLOUR_PROPERTIES, RECOMMENDED_COLOUR_ROLES, RECOMMENDED_COLOUR_VARS, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type RecommendedColourClass, type RecommendedColourNamespace, type RecommendedColourProperty, type RecommendedThemeColours, ReportDetails, type ReportDetailsProps, ReportDocument, type ReportDocumentProps, type ReportMetaItem, ReportSection, type ReportSectionProps, type Rgb, SLIDE_DECK_HOTKEYS, SLOTS, SYSTEM_LEVEL, SaasLandingPage, type SaasLandingPageProps, type SectionAlign, type SectionColumns, SectionContainer, type SectionContainerProps, Select, type SelectOption, type SelectProps, type SelectionDevice, type SelectionDeviceCheck, ServerErrorPage, type ServerErrorPageProps, SiteFooter, type SiteFooterProps, SiteHeader, type SiteHeaderCollapse, type SiteHeaderProps, SiteLink, type SiteLinkProps, SiteNav, type SiteNavGroupItemProps, SiteNavItem, type SiteNavItemProps, type SiteNavLinkItemProps, type SiteNavOrientation, type SiteNavProps, Skeleton, type SkeletonProps, Slide, SlideDeck, type SlideDeckHotkey, type SlideDeckProps, type SlideProps, Slope, type SlopeItem, Slugger, SocialIcon, type SocialIconName, type SocialIconProps, Sparkline, type SparklineProps, Spinner, type SpinnerProps, StatCard, type StatCardAccent, type StatCardProps, StatusPage, type StatusPageProps, Step, type StepProps, type StepState, Steps, type StepsProps, type Surface, Swatch, type SwatchColumn, SwatchCompare, type SwatchCompareProps, SwatchGroup, type SwatchGroupProps, type SwatchProps, type SwatchRow, Switch, type SwitchProps, THEME_ATTRIBUTE, THEME_LEVELS, THEME_STORAGE_KEY, TLDR, type TLDRProps, TOKEN_RULES, Table, type TableAppearance, TableBody, TableCaption, TableCell, type TableDensity, TableFooter, TableHead, TableHeader, TableOfContents, type TableOfContentsProps, TableRow, Tabs, type TabsFont, TabsList, type TabsListProps, type TabsOrientation, TabsPanel, type TabsPanelProps, type TabsProps, TabsTab, type TabsTabProps, type TabsVariant, Tag, type TagProps, TelemetryGauge, type TelemetryGaugeProps, type TelemetryMachineState, Term, TermGrid, type TermGridProps, type TermItem, Terminal, type TerminalProps, TextArea, type TextAreaProps, type TextHierarchyStep, type TextTone, type ThemeContextValue, type ThemeLevel, ThemeProvider, type ThemeProviderProps, TickerTape, type TickerTapeProps, Timeline, type TimelineEvent, type TimelineProps, type TimelineState, type ToastActionOptions, type ToastApi, type ToastIntent, type ToastOptions, ToastProvider, type ToastProviderProps, type TocEntry, type TokenRow, type TokenRule, TokenTable, type TokenTableProps, Tooltip, type TooltipProps, TrackCard, type TrackCardProps, type TrackItem, type TrackItemStatus, TreeDiagram, type TreeDiagramProps, type TreeNode, type TypeStep, type TypeStepName, type UptimeStatus, UptimeStrip, type UptimeStripProps, type UseActiveHeadingOptions, type UseCopyToClipboardResult, type VerdictTone, WEB_FLOOR, XIcon, accentVar, ansiScheme, apcaContrast, assertNever, auditContrast, auditHueAgreement, auditSelectionDevices, auditTextHierarchy, borderVar, childrenToText, cn, collectHeadings, composite, contrastRatio, createAnchorHeading, fontVar, getRecommendedColours, getThemeInitScript, isExternalHref, isMedium, isRecommendedColourClass, isThemeLevel, mdxComponents, nextLevel, parseColor, relativeLuminance, scanRules, scanTokenRules, semanticTokens, slugify, surfaceVar, textVar, useActiveHeading, useCopyToClipboard, useDocsLinkComponent, useIsCurrentHref, useLinkComponent, useOptionalTheme, useOptionalToast, useTheme, useToast };
|
|
7987
|
+
export { ALERT_STATE_ORDER, ANSI_SLOTS, type AccentToken, type ActivityDay, ActivityGrid, type ActivityGridProps, type Alert, AlertDialog, type AlertDialogProps, AlertList, type AlertListProps, type AlertSeverity, type AlertState, AnchorHeading, type AnchorHeadingProps, type AnsiChrome, type AnsiHue, type AnsiScheme, type AnsiSlot, AppMain, type AppMainProps, type AppNavItem, AppShell, type AppShellProps, AppSidebar, AppSidebarNav, type AppSidebarNavProps, type AppSidebarProps, AppTopbar, type AppTopbarProps, AsciiDivider, type AsciiDividerProps, AsciiGauge, type AsciiGaugeProps, type AsciiGaugeVariant, Avatar, type AvatarProps, Badge, type BadgeProps, BarChart, type BarChartDatum, type BarChartProps, BeforeAfter, type BeforeAfterProps, type BlogAuthor, BlogPost, type BlogPostProps, BlueskyIcon, type BorderTone, BracketText, type BracketTextProps, Breadcrumbs, type BreadcrumbsProps, type BrutalistTheme, type BuildTraceOptions, BulletChart, type BulletChartProps, Button, type ButtonElementProps, type ButtonLinkProps, type ButtonProps, type ButtonVariant, CSS_MEDIUM, CTASection, type CTASectionAccent, type CTASectionProps, Card, type CardProps, type CardVariant, ChangeSummary, type ChangeSummaryProps, ChartTooltip, type ChartTooltipProps, Checkbox, type CheckboxProps, type ClassInput, CodeBlock, CodeBlockAttachment, type CodeBlockProps, CodeTab, type CodeTabProps, CodeTabs, type CodeTabsProps, type CodeTabsVariant, ColophonCard, type ColophonCardProps, type ColophonLink, type Column, type ContrastCheck, type ContrastFloor, type Crumb, DEFAULT_DEPLOY_LOG, DEFAULT_EXPERIMENTS, DEFAULT_LEVEL, DEFAULT_PRICING_TIERS, DIVIDER_PATTERNS, DataTable, type DataTableProps, type DataTableVirtualization, Decision, type DecisionOption, type DecisionProps, type Delta, type DeltaGround, DesignSandbox, type DiffLineProps, type DiffRow, type DiffSign, Divider, type DividerProps, type DividerVariant, DocPager, type DocPagerProps, type DocPagerTarget, DocsHeader, type DocsHeaderProps, DocsLayout, type DocsLayoutProps, DocsLink, type DocsLinkProps, DocsLinkProvider, type DocsLinkProviderProps, type DocsNavItem, type DocsNavNode, DocsSidebar, type DocsSidebarProps, Drawer, type DrawerPlacement, type DrawerProps, DrawingSheet, type DrawingSheetProps, type Emphasis, EmptyState, type EmptyStateProps, ErrorSummary, type ErrorSummaryError, type ErrorSummaryProps, Event, type ExperimentItem, ExperimentsView, type ExperimentsViewProps, FILTER_OPERATORS, FILTER_OPERATOR_LABELS, FIXED_COLOURS, FREE_TEXT_KEY, Feature, FeatureGrid, type FeatureGridProps, type FeatureProps, Fieldset, type FieldsetProps, FigureFrame, type FigureFrameProps, type FileChange, type FileChangeNode, FileChangeTree, type FileChangeTreeProps, type FileChangeView, type Filter, FilterBar, type FilterBarField, type FilterBarProps, type FilterOperator, type FilterParseResult, type Finding, type FixedColour, FlowDiagram, type FlowDiagramProps, type FlowNode, type FlowPathProps, type FlowRow, type FlowTone, FreshnessIndicator, type FreshnessIndicatorProps, type FreshnessState, GanttChart, type GanttChartProps, type GanttItem, GitHubIcon, Glyph, type GlyphProps, HEADING_EMPHASIS, type HeadingLevel, Hero, type HeroProps, type Hue, type HueAgreementCheck, type HueRef, INK_WEIGHT, IdChip, type IdChipProps, type IncidentEvent, type IncidentEventKind, type IncidentSummary, IncidentTimeline, type IncidentTimelineProps, IndexedSection, type IndexedSectionProps, Input, type InputProps, type IntensityScale, type Intent, LATENCY_HEATMAP_VARIANTS, LATENCY_HISTOGRAM_VARIANTS, LEVELS, LOG_SEVERITIES, type LatencyBucket, type LatencyCell, type LatencyGrid, LatencyHeatmap, type LatencyHeatmapProps, LatencyHistogram, type LatencyHistogramProps, type LatencyPoint, type LatencySlo, Legend, type LegendProps, type LevelDefinition, Line, type LinkComponentProps, LinkProvider, type LinkProviderProps, LinkedInIcon, type LogEntry, type LogFieldValue, type LogFilter, type LogHighlightPart, type LogSeverity, LogViewer, type LogViewerProps, LoremIpsumPost, MAXIMUM_NEUTRAL_CHROMA, MEDIA, MEDIA_DEFINITIONS, MINIMUM_RATIO, MailIcon, type MdxComponents, type Medium, type MediumDefinition, Menu, MenuItem, type MenuItemProps, type MenuProps, MenuRadioGroup, type MenuRadioGroupProps, MenuRadioItem, type MenuRadioItemProps, MenuSeparator, type MenuSeparatorProps, MetadataGrid, type MetadataGridCustomItem, type MetadataGridProps, type MetadataGridSeries, type Metric, MetricStrip, type MetricStripProps, type MetricTone, MobileNav, type MobileNavProps, Modal, type ModalProps, type Motion, NERD_GLYPHS, NerdIcon, type NerdIconAccent, type NerdIconName, type NerdIconProps, Node, type NodeProps, NotFoundPage, type NotFoundPageProps, NoteBlock, type NoteBlockProps, OBSERVABILITY_INCIDENT_WINDOW, ObservabilityConsole, type ObservabilityConsoleProps, Option, type OverlayAlign, type OverlaySide, PALETTE_HUES, PageHeader, type PageHeaderProps, PageTitle, type PageTitleProps, Pagination, type PaginationProps, Path, type Polarity, Popover, type PopoverProps, PricingGrid, type PricingGridProps, PricingTier, type PricingTierAccent, type PricingTierProps, Progress, type ProgressProps, Prose, type ProseProps, RECOMMENDED_COLOURS, RECOMMENDED_COLOUR_CLASSES, RECOMMENDED_COLOUR_NAMESPACES, RECOMMENDED_COLOUR_PROPERTIES, RECOMMENDED_COLOUR_ROLES, RECOMMENDED_COLOUR_VARS, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type RecommendedColourClass, type RecommendedColourNamespace, type RecommendedColourProperty, type RecommendedThemeColours, ReportDetails, type ReportDetailsProps, ReportDocument, type ReportDocumentProps, type ReportMetaItem, ReportSection, type ReportSectionProps, type Rgb, SEVERITY_ACCENTS, SLIDE_DECK_HOTKEYS, SLOTS, SYSTEM_LEVEL, SaasLandingPage, type SaasLandingPageProps, type SectionAlign, type SectionColumns, SectionContainer, type SectionContainerProps, Select, type SelectOption, type SelectProps, type SelectionDevice, type SelectionDeviceCheck, ServerErrorPage, type ServerErrorPageProps, type ServiceEdge, type ServiceGraph, type ServiceGraphLayout, type ServiceGraphLayoutEdge, type ServiceGraphLayoutNode, type ServiceGraphLayoutOptions, type ServiceGraphPoint, ServiceMap, type ServiceMapProps, type ServiceNode, type ServiceNodeKind, type Severity, SeverityBadge, type SeverityBadgeProps, SiteFooter, type SiteFooterProps, SiteHeader, type SiteHeaderCollapse, type SiteHeaderProps, SiteLink, type SiteLinkProps, SiteNav, type SiteNavGroupItemProps, SiteNavItem, type SiteNavItemProps, type SiteNavLinkItemProps, type SiteNavOrientation, type SiteNavProps, Skeleton, type SkeletonProps, Slide, SlideDeck, type SlideDeckHotkey, type SlideDeckProps, type SlideProps, Slope, type SlopeItem, Slugger, SocialIcon, type SocialIconName, type SocialIconProps, Sparkline, type SparklineProps, Spinner, type SpinnerProps, StatCard, type StatCardAccent, type StatCardProps, StatusPage, type StatusPageProps, Step, type StepProps, type StepState, Steps, type StepsProps, type Surface, Swatch, type SwatchColumn, SwatchCompare, type SwatchCompareProps, SwatchGroup, type SwatchGroupProps, type SwatchProps, type SwatchRow, Switch, type SwitchProps, THEME_ATTRIBUTE, THEME_LEVELS, THEME_STORAGE_KEY, TIME_RANGE_PRESETS, TIME_SERIES_VARIANTS, TLDR, type TLDRProps, TOKEN_RULES, Table, type TableAppearance, TableBody, TableCaption, TableCell, type TableDensity, TableFooter, TableHead, TableHeader, TableOfContents, type TableOfContentsProps, TableRow, Tabs, type TabsFont, TabsList, type TabsListProps, type TabsOrientation, TabsPanel, type TabsPanelProps, type TabsProps, TabsTab, type TabsTabProps, type TabsVariant, Tag, type TagProps, TelemetryGauge, type TelemetryGaugeProps, type TelemetryMachineState, Term, TermGrid, type TermGridProps, type TermItem, Terminal, type TerminalProps, TextArea, type TextAreaProps, type TextHierarchyStep, type TextTone, type ThemeContextValue, type ThemeLevel, ThemeProvider, type ThemeProviderProps, TickerTape, type TickerTapeProps, type TimeCursorState, type TimeRange, TimeRangePicker, type TimeRangePickerProps, type TimeRangePreset, TimeRangeProvider, type TimeRangeProviderProps, type TimeRangeState, type TimeSeries, type TimeSeriesAnnotation, TimeSeriesChart, type TimeSeriesChartProps, type TimeSeriesColorStrategy, type TimeSeriesCurve, type TimeSeriesDensity, type TimeSeriesGrid, type TimeSeriesLegend, type TimeSeriesPoint, type TimeSeriesPointMarkers, type TimeSeriesThreshold, type TimeSeriesVariant, type TimeSeriesYDomain, type TimeSeriesYScale, Timeline, type TimelineEvent, type TimelineProps, type TimelineState, type ToastActionOptions, type ToastApi, type ToastIntent, type ToastOptions, ToastProvider, type ToastProviderProps, type TocEntry, type TokenRow, type TokenRule, TokenTable, type TokenTableProps, Tooltip, type TooltipProps, type TraceAttributeValue, type TraceModel, type TraceReplay, type TraceSpan, type TraceSpanInput, type TraceSpanStatus, TraceViewer, type TraceViewerProps, TraceWaterfall, type TraceWaterfallProps, TrackCard, type TrackCardProps, type TrackItem, type TrackItemStatus, TreeDiagram, type TreeDiagramProps, type TreeNode, type TypeStep, type TypeStepName, type UptimeStatus, UptimeStrip, type UptimeStripProps, type UseActiveHeadingOptions, type UseCopyToClipboardResult, type UseTraceClockOptions, type UseTraceReplayOptions, type VerdictTone, WEB_FLOOR, XIcon, accentVar, ansiScheme, apcaContrast, assertNever, auditContrast, auditHueAgreement, auditSelectionDevices, auditTextHierarchy, borderVar, bucketIndex, bucketPercentile, bucketTimes, buildTrace, childrenToText, clampToRange, cn, collectHeadings, composite, contrastRatio, createAnchorHeading, describeFilter, describeLogEntry, describeTraceSpan, filterLogEntries, fontVar, formatAge, formatAlertDuration, formatClock, formatCount, formatDay, formatFilter, formatLatencyRange, formatRange, formatRangeDuration, formatRequests, formatServiceCount, formatServiceErrorRate, formatShare, formatTimeTick, formatTimestamp, formatTraceDuration, getRecommendedColours, getThemeInitScript, heatmapCells, highlightLogText, histogram, inLogRange, intensityLevel, intensityThresholds, isExternalHref, isMedium, isRecommendedColourClass, isThemeLevel, latencyBuckets, latencyExtent, latencyRowPosition, layoutServiceGraph, linearBuckets, logTicks, lookupField, matchFilters, matchLogEntry, matchTraceSpan, mdxComponents, nearestLogIndex, nextLevel, normaliseRange, parseColor, parseFilter, parseOtlpTrace, parseTraceDocument, percentile, percentiles, presetRange, relativeLuminance, replayTrace, sameFilter, scanRules, scanTokenRules, semanticTokens, serviceEdgeMidpoint, serviceEdgePath, serviceGraph, severityAccent, shareAbove, slugify, sortAlerts, sortLogEntries, summariseIncident, surfaceVar, textVar, timeTicks, truncateId, tryParseFilter, useActiveHeading, useCopyToClipboard, useDocsLinkComponent, useIsCurrentHref, useLinkComponent, useOptionalTheme, useOptionalToast, useTheme, useTimeCursor, useTimeRange, useToast, useTraceClock, useTraceReplay, visibleTraceSpans };
|