From dd553f5a033a5ab6a15821b72b77e7bea136dd8a Mon Sep 17 00:00:00 2001 From: benjaminleonard Date: Fri, 21 Aug 2026 14:59:12 +0100 Subject: [PATCH 01/46] Initial UX rework --- app/components/OxqlEditor.tsx | 262 +++++++++++++ app/components/TimeSeriesChart.tsx | 2 +- app/components/form/fields/OxqlField.tsx | 30 -- app/layouts/SystemLayout.tsx | 4 +- app/pages/system/OxqlPage.tsx | 353 ++++++++++++------ app/routes.tsx | 5 +- .../__snapshots__/path-builder.spec.ts.snap | 6 +- app/util/path-builder.spec.ts | 2 +- app/util/path-builder.ts | 2 +- package-lock.json | 224 ++++++++--- package.json | 5 + test/e2e/oxql.e2e.ts | 47 ++- 12 files changed, 716 insertions(+), 226 deletions(-) create mode 100644 app/components/OxqlEditor.tsx delete mode 100644 app/components/form/fields/OxqlField.tsx diff --git a/app/components/OxqlEditor.tsx b/app/components/OxqlEditor.tsx new file mode 100644 index 000000000..388466224 --- /dev/null +++ b/app/components/OxqlEditor.tsx @@ -0,0 +1,262 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * Copyright Oxide Computer Company + */ +import { defaultKeymap, history, historyKeymap } from '@codemirror/commands' +import { bracketMatching } from '@codemirror/language' +import { Compartment, RangeSetBuilder } from '@codemirror/state' +import { + Decoration, + EditorView, + highlightActiveLine, + keymap, + ViewPlugin, + type DecorationSet, + type ViewUpdate, +} from '@codemirror/view' +import cn from 'classnames' +import { useEffect, useRef } from 'react' +import { + createHighlighterCoreSync, + type LanguageRegistration, + type ThemeRegistrationAny, +} from 'shiki/core' +import { createJavaScriptRegexEngine } from 'shiki/engine/javascript' + +// OxQL grammar copied from the design system so we can highlight queries +// without pulling in its full asciidoc bundle. One addition over the source: +// single-quoted strings, which OxQL supports and our examples use. +// https://github.com/oxidecomputer/design-system/blob/main/components/src/asciidoc/langs/oxql.tmLanguage.json +const oxqlGrammar = { + name: 'oxql', + scopeName: 'source.oxql', + repository: {}, + patterns: [ + { name: 'keyword.control.oxql', match: '\\b(get|join|align|filter|group_by)\\b' }, + { + name: 'string.quoted.double.oxql', + begin: '"', + end: '"', + patterns: [{ name: 'constant.character.escape.oxql', match: '\\\\.' }], + }, + { + name: 'string.quoted.single.oxql', + begin: "'", + end: "'", + patterns: [{ name: 'constant.character.escape.oxql', match: '\\\\.' }], + }, + { name: 'constant.numeric.oxql', match: '\\b\\d+[smhdw]\\b' }, + { + name: 'constant.numeric.datetime.oxql', + match: '@\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}', + }, + { name: 'constant.numeric.function.oxql', match: '@now\\(\\)' }, + { name: 'constant.numeric.oxql', match: '\\b\\d+\\b' }, + { name: 'comment.block.oxql', begin: '/\\*', end: '\\*/' }, + { name: 'comment.line.double-slash.oxql', match: '//.*$' }, + { name: 'keyword.operator.oxql', match: '\\|' }, + ], +} satisfies LanguageRegistration + +// Subset of the design system's Oxide syntax theme covering the scopes the +// OxQL grammar emits. The --syntax-* vars come from the design system +// stylesheets already imported in app/ui/styles/index.css, so this follows +// the current theme automatically. +// https://github.com/oxidecomputer/design-system/blob/main/components/src/asciidoc/oxide-syntax.json +const oxideTheme = { + name: 'oxide', + colors: { + 'editor.background': 'transparent', + 'editor.foreground': 'var(--syntax-fg)', + }, + tokenColors: [ + { scope: ['comment'], settings: { foreground: 'var(--syntax-comment)' } }, + { scope: ['string'], settings: { foreground: 'var(--syntax-string)' } }, + { + scope: ['constant.character.escape'], + settings: { foreground: 'var(--syntax-escape)' }, + }, + { scope: ['constant.numeric'], settings: { foreground: 'var(--syntax-number)' } }, + { scope: ['keyword'], settings: { foreground: 'var(--syntax-keyword)' } }, + { scope: ['keyword.operator'], settings: { foreground: 'var(--syntax-operator)' } }, + ], +} satisfies ThemeRegistrationAny + +const highlighter = createHighlighterCoreSync({ + langs: [oxqlGrammar], + themes: [oxideTheme], + engine: createJavaScriptRegexEngine(), +}) + +/** + * Tokenize the whole doc with shiki and turn the tokens into CodeMirror mark + * decorations. Queries are small, so retokenizing everything on each change + * is cheap. + */ +const buildDecorations = (view: EditorView): DecorationSet => { + const builder = new RangeSetBuilder() + const code = view.state.doc.toString() + let pos = 0 + for (const line of highlighter.codeToTokensBase(code, { + lang: 'oxql', + theme: 'oxide', + })) { + for (const token of line) { + const end = pos + token.content.length + // default-colored tokens don't need a decoration + if (token.color && token.color !== 'var(--syntax-fg)') { + builder.add( + pos, + end, + Decoration.mark({ attributes: { style: `color: ${token.color}` } }) + ) + } + pos = end + } + pos += 1 // newline + } + return builder.finish() +} + +const shikiPlugin = ViewPlugin.fromClass( + class { + decorations: DecorationSet + constructor(view: EditorView) { + this.decorations = buildDecorations(view) + } + update(update: ViewUpdate) { + if (update.docChanged) this.decorations = buildDecorations(update.view) + } + }, + { decorations: (v) => v.decorations } +) + +// Ported from the editor theme in mitos (app/components/code-editor.tsx), +// with its hardcoded dark-palette hexes swapped for the equivalent design +// system vars so light mode works too. Text selection is native, so the +// console's global ::selection style applies without any theming here. The +// font comes from the wrapper (text-mono-code), hence the `inherit`s. +const cmTheme = EditorView.theme({ + '&': { + backgroundColor: 'var(--syntax-bg)', + color: 'var(--syntax-fg)', + // fixed height of ~6 lines; longer queries scroll inside the editor + height: '7.5rem', + }, + '.cm-scroller': { overflow: 'auto' }, + // the wrapper carries the focus ring (focus-within), so hide CM's own outline + '&.cm-focused': { outline: 'none' }, + '.cm-content': { + fontFamily: 'inherit', + padding: '10px 0', + caretColor: 'var(--syntax-fg)', + }, + '.cm-line': { padding: '0 12px' }, + '.cm-cursor, .cm-dropCursor': { borderLeftColor: 'var(--syntax-fg)' }, + '.cm-activeLine': { backgroundColor: 'var(--surface-secondary)' }, + '.cm-matchingBracket, .cm-nonmatchingBracket': { + backgroundColor: 'var(--surface-hover)', + outline: 'none', + }, + '.cm-matchingBracket': { color: 'var(--syntax-fg)' }, + '.cm-nonmatchingBracket': { color: 'var(--content-destructive)' }, +}) + +const contentAttrs = (ariaLabel: string, error: boolean) => + EditorView.contentAttributes.of({ + 'aria-label': ariaLabel, + 'aria-invalid': error ? 'true' : 'false', + }) + +type OxqlEditorProps = { + value: string + onChange: (value: string) => void + /** Called on cmd+enter / ctrl+enter */ + onSubmit: () => void + error?: boolean + 'aria-label': string +} + +/** A CodeMirror editor for OxQL queries with shiki syntax highlighting */ +export function OxqlEditor({ + value, + onChange, + onSubmit, + error = false, + 'aria-label': ariaLabel, +}: OxqlEditorProps) { + const containerRef = useRef(null) + const viewRef = useRef(null) + const attrsCompartment = useRef(new Compartment()) + + // let the mount-once extensions see the latest props without reconfiguring + const callbacks = useRef({ onChange, onSubmit }) + useEffect(() => { + callbacks.current = { onChange, onSubmit } + }) + + useEffect(() => { + const view = new EditorView({ + // container div is always mounted when this effect runs + parent: containerRef.current!, + doc: value, + extensions: [ + history(), + keymap.of([ + { + key: 'Mod-Enter', + run: () => { + callbacks.current.onSubmit() + return true + }, + }, + ...defaultKeymap, + ...historyKeymap, + ]), + EditorView.lineWrapping, + highlightActiveLine(), + bracketMatching(), + shikiPlugin, + cmTheme, + attrsCompartment.current.of(contentAttrs(ariaLabel, error)), + EditorView.updateListener.of((update) => { + if (update.docChanged) callbacks.current.onChange(update.state.doc.toString()) + }), + ], + }) + viewRef.current = view + return () => view.destroy() + // value and the aria attrs are synced by the effects below + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []) + + // sync external value changes (e.g., clicking an example) into the editor + useEffect(() => { + const view = viewRef.current + if (view && value !== view.state.doc.toString()) { + view.dispatch({ changes: { from: 0, to: view.state.doc.length, insert: value } }) + } + }, [value]) + + useEffect(() => { + viewRef.current?.dispatch({ + effects: attrsCompartment.current.reconfigure(contentAttrs(ariaLabel, error)), + }) + }, [ariaLabel, error]) + + return ( +
+ ) +} diff --git a/app/components/TimeSeriesChart.tsx b/app/components/TimeSeriesChart.tsx index d1da5ddcb..e11a16965 100644 --- a/app/components/TimeSeriesChart.tsx +++ b/app/components/TimeSeriesChart.tsx @@ -169,7 +169,7 @@ type TimeSeriesChartProps = { } // this top margin is also in the chart, probably want a way of unifying the sizing between the two -const SkeletonMetric = ({ +export const SkeletonMetric = ({ children, shimmer = false, className, diff --git a/app/components/form/fields/OxqlField.tsx b/app/components/form/fields/OxqlField.tsx deleted file mode 100644 index d663ece6a..000000000 --- a/app/components/form/fields/OxqlField.tsx +++ /dev/null @@ -1,30 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at https://mozilla.org/MPL/2.0/. - * - * Copyright Oxide Computer Company - */ -import type { FieldPath, FieldValues } from 'react-hook-form' - -import type { TextAreaProps } from '~/ui/lib/TextInput' - -import { TextField, type TextFieldProps } from './TextField' - -export function OxqlField< - TFieldValues extends FieldValues, - TName extends FieldPath, ->( - props: Omit, 'validate'> & Omit -) { - return ( - - typeof value === 'string' && value.trim() ? undefined : 'Enter a query' - } - {...props} - /> - ) -} diff --git a/app/layouts/SystemLayout.tsx b/app/layouts/SystemLayout.tsx index 647b7a820..df572da1b 100644 --- a/app/layouts/SystemLayout.tsx +++ b/app/layouts/SystemLayout.tsx @@ -58,7 +58,7 @@ export default function SystemLayout() { { value: 'Subnet Pools', path: pb.subnetPools() }, { value: 'System Update', path: pb.systemUpdate() }, { value: 'Fleet Access', path: pb.fleetAccess() }, - { value: 'OxQL Explorer', path: pb.systemOxql() }, + { value: 'Metrics Explorer', path: pb.systemOxql() }, ] // filter out the entry for the path we're currently on .filter((i) => i.path !== pathname) @@ -110,7 +110,7 @@ export default function SystemLayout() { Fleet Access - OxQL Explorer + Metrics Explorer diff --git a/app/pages/system/OxqlPage.tsx b/app/pages/system/OxqlPage.tsx index 1d1f1426d..5ac61ba7c 100644 --- a/app/pages/system/OxqlPage.tsx +++ b/app/pages/system/OxqlPage.tsx @@ -6,8 +6,8 @@ * Copyright Oxide Computer Company */ import { useWindowVirtualizer } from '@tanstack/react-virtual' -import { useLayoutEffect, useMemo, useRef, useState } from 'react' -import { useForm } from 'react-hook-form' +import { useLayoutEffect, useMemo, useRef, useState, type ReactNode } from 'react' +import { useController, useForm } from 'react-hook-form' import { useSearchParams } from 'react-router' import * as R from 'remeda' import { match } from 'ts-pattern' @@ -18,6 +18,7 @@ import { camelToSnake, type Timeseries, type Points, + type OxqlQueryResult, type OxqlTable, type TimeseriesQuery, type Values, @@ -25,15 +26,25 @@ import { import { Monitoring16Icon, Monitoring24Icon } from '@oxide/design-system/icons/react' import { DocsPopover } from '~/components/DocsPopover' -import { OxqlField } from '~/components/form/fields/OxqlField' -import { ChartContainer, ChartHeader, TimeSeriesChart } from '~/components/TimeSeriesChart' +import { MoreActionsMenu } from '~/components/MoreActionsMenu' +import { OxqlEditor } from '~/components/OxqlEditor' +import { + ChartContainer, + ChartHeader, + SkeletonMetric, + TimeSeriesChart, +} from '~/components/TimeSeriesChart' import { useElementSize } from '~/hooks/use-element-size' +import { addToast } from '~/stores/toast' import { Button } from '~/ui/lib/Button' +import { CardBlock } from '~/ui/lib/CardBlock' import { Divider } from '~/ui/lib/Divider' -import * as DropdownMenu from '~/ui/lib/DropdownMenu' +import * as Dropdown from '~/ui/lib/DropdownMenu' import { Message } from '~/ui/lib/Message' import { PageHeader, PageTitle } from '~/ui/lib/PageHeader' +import { TextInputError } from '~/ui/lib/TextInput' import { docLinks } from '~/util/links' +import { pluralize } from '~/util/str' const exampleItems: { label: string; value: string }[] = [ { @@ -69,7 +80,7 @@ const defaultValues: TimeseriesQuery = { query: '', } -export const handle = { crumb: 'OxQL Explorer' } +export const handle = { crumb: 'Metrics Explorer' } const narrowToNumbers = (vs: Values): (number | null)[] => match(vs.values) @@ -310,28 +321,24 @@ const toDisplays = (groups: ChartGroup[]): ChartDisplay[] => const { startTime, endTime } = g return match(g) .with({ kind: 'unaligned' }, ({ charts }) => - charts.map( - (chart, i): ChartDisplay => ({ - kind: 'line', - key: `t${t}.${i}`, - showDivider: i === 0, - startTime, - endTime, - chart, - }) - ) + charts.map((chart, i): ChartDisplay => ({ + kind: 'line', + key: `t${t}.${i}`, + showDivider: i === 0, + startTime, + endTime, + chart, + })) ) .with({ kind: 'joined' }, { kind: 'aligned' }, ({ charts }) => - charts.map( - (chart, i): ChartDisplay => ({ - kind: 'multiline', - key: `t${t}.${i}`, - showDivider: i === 0, - startTime, - endTime, - chart, - }) - ) + charts.map((chart, i): ChartDisplay => ({ + kind: 'multiline', + key: `t${t}.${i}`, + showDivider: i === 0, + startTime, + endTime, + chart, + })) ) .exhaustive() }) @@ -413,14 +420,6 @@ function LineChart({ function ChartEntry({ display, trim }: { display: ChartDisplay; trim: Trim }) { return ( <> - {display.showDivider ? ( - // Use padding for spacing so the virtualizer can measure the bounding box properly -
- -
- ) : ( -
- )} {match(display) .with({ kind: 'empty' }, () =>

No results

) .with({ kind: 'multiline' }, (r) => ) @@ -430,7 +429,104 @@ function ChartEntry({ display, trim }: { display: ChartDisplay; trim: Trim }) { ) } -const getTextareaHeightForQuery = (q: string): number => Math.max(q.split('\n').length, 4) +// covers the header strings plus every member of ValueArray['values'] +type CsvValue = string | number | boolean | object | null | undefined + +const csvCell = (v: CsvValue): string => { + const s = + v === null || v === undefined + ? '' + : typeof v === 'object' + ? JSON.stringify(v) + : String(v) + return /[",\n]/.test(s) ? `"${s.replaceAll('"', '""')}"` : s +} + +const tablesToCsv = (tables: OxqlTable[]): string => { + const rows: CsvValue[][] = [['table', 'fields', 'metric', 'timestamp', 'value']] + for (const table of tables) { + // like the chart labels, joined tables get their per-line metric names + // from the comma-joined table name + const metricNames = table.name.split(',').map((s) => s.trim()) + for (const series of table.timeseries) { + const fields = getFormattedFields(series) + series.points.values.forEach((v, i) => { + const metric = metricNames[i] ?? table.name + series.points.timestamps.forEach((ts, j) => { + rows.push([ + table.name, + fields, + metric, + new Date(ts).toISOString(), + v.values.values[j], + ]) + }) + }) + } + } + return rows.map((row) => row.map(csvCell).join(',')).join('\n') +} + +function ResultsSummary({ tables }: { tables: OxqlTable[] }) { + const timeseries = tables.flatMap((t) => t.timeseries) + const nPoints = R.sumBy(timeseries, (t) => t.points.timestamps.length) + return ( +
+ {timeseries.length} timeseries /{' '} + + {nPoints.toLocaleString()} {pluralize('point', nPoints)} + +
+ ) +} + +const copyText = (text: string, toastMessage: string) => { + window.navigator.clipboard.writeText(text).then(() => addToast(toastMessage)) +} + +// wrap in single quotes, escaping any embedded ones, so the multiline query +// survives pasting into a shell +const shellQuote = (s: string) => `'${s.replaceAll("'", "'\\''")}'` + +// The CLI equivalent of this page's query endpoint. See "API and CLI access": +// https://docs.oxide.computer/guides/metrics/oxql-tutorial#_api_and_cli_access +const toCliCommand = (query: string) => + `oxide experimental system timeseries query --query ${shellQuote(query)}` + +function ResultsMenu({ data, query }: { data?: OxqlQueryResult; query?: string }) { + // the menu is always visible so the header doesn't jump around, but the + // actions only make sense once a query has succeeded + const noResults = data === undefined ? 'Run a query first' : undefined + return ( + + + data && copyText(JSON.stringify(data, null, 2), 'Results copied as JSON') + } + label="Copy as JSON" + /> + data && copyText(tablesToCsv(data.tables), 'Results copied as CSV')} + label="Copy as CSV" + /> + query && copyText(toCliCommand(query), 'CLI command copied')} + label="Copy CLI command" + /> + + ) +} + +// Rendered in every query state so the layout doesn't shift when results arrive +const ResultsSection = ({ children }: { children: ReactNode }) => ( + <> + + {children} + +) export default function OxqlPage() { const query = useApiMutation(api.systemTimeseriesQuery) @@ -439,14 +535,16 @@ export default function OxqlPage() { const defaultQuery = searchParams.get('query') ?? defaultValues.query - const [textareaRowCount, setTextareaRowCount] = useState( - getTextareaHeightForQuery(defaultQuery) - ) - const form = useForm({ defaultValues: { query: defaultQuery }, }) - const control = form.control + const { field, fieldState } = useController({ + name: 'query', + control: form.control, + rules: { + validate: (value) => (value.trim() ? undefined : 'Enter a query'), + }, + }) const [dropFirstPoint, setDropFirstPoint] = useState(true) @@ -501,7 +599,7 @@ export default function OxqlPage() { <>
- }>OxQL Explorer + }>Metrics Explorer } @@ -509,95 +607,116 @@ export default function OxqlPage() { links={[docLinks.oxql, docLinks.oxqlSchemas]} /> -
-
- - - Try an example - - } - /> - + + + +
+ {query.status === 'success' && ( + <> + + + )} + + +
+
+ +
+ form.handleSubmit(onSubmit)()} + /> + {fieldState.error?.message && ( + {fieldState.error.message} + )} +
+
+ Examples {exampleItems.map(({ label, value }) => ( - { - setTextareaRowCount(getTextareaHeightForQuery(value)) - form.setValue('query', value) - }} - /> + type="button" + className="text-mono-xs border-default text-secondary hover:bg-hover rounded border px-2 py-1" + onClick={() => form.setValue('query', value, { shouldValidate: true })} + > + {label} + ))} - - -
- - +
+ +
- {match(query) - .with( - { status: 'success' }, - () => - hasTrimmableCharts && ( -
- -
- ) - ) - .otherwise(() => '')}
{match(query) - .with({ status: 'idle' }, () => null) + .with({ status: 'idle' }, () => ( + + + {/* the loading skeleton, minus the shimmer and bouncing indicator */} + {null} + + + )) .with({ status: 'pending' }, () => ( - - - + + + + + )) .with({ status: 'error' }, (q) => ( - {q.error.message}} - /> + + {q.error.message}} + /> + )) .with({ status: 'success' }, () => ( -
- {virtualizer.getVirtualItems().map((item) => ( -
- + + {hasTrimmableCharts && ( +
+
- ))} -
+ )} +
+ {virtualizer.getVirtualItems().map((item) => ( +
+ +
+ ))} +
+ )) .exhaustive()} diff --git a/app/routes.tsx b/app/routes.tsx index 02b6e0c56..259bb55f4 100644 --- a/app/routes.tsx +++ b/app/routes.tsx @@ -176,7 +176,10 @@ export const routes = createRoutesFromElements( path="utilization" lazy={() => import('./pages/system/UtilizationPage').then(convert)} /> - import('./pages/system/OxqlPage').then(convert)} /> + import('./pages/system/OxqlPage').then(convert)} + /> import('./pages/system/inventory/InventoryPage.tsx').then(convert)} diff --git a/app/util/__snapshots__/path-builder.spec.ts.snap b/app/util/__snapshots__/path-builder.spec.ts.snap index a05832ff5..c241879a9 100644 --- a/app/util/__snapshots__/path-builder.spec.ts.snap +++ b/app/util/__snapshots__/path-builder.spec.ts.snap @@ -889,10 +889,10 @@ exports[`breadcrumbs 2`] = ` "path": "/system/networking/", }, ], - "systemOxql (/system/oxql)": [ + "systemOxql (/system/metrics-explorer)": [ { - "label": "OxQL Explorer", - "path": "/system/oxql", + "label": "Metrics Explorer", + "path": "/system/metrics-explorer", }, ], "systemUpdate (/system/update)": [ diff --git a/app/util/path-builder.spec.ts b/app/util/path-builder.spec.ts index 11ec3323f..1e04d5eb8 100644 --- a/app/util/path-builder.spec.ts +++ b/app/util/path-builder.spec.ts @@ -114,7 +114,7 @@ test('path builder', () => { "subnetPoolMemberAdd": "/system/networking/subnet-pools/sp/members-add", "subnetPools": "/system/networking/subnet-pools", "subnetPoolsNew": "/system/networking/subnet-pools-new", - "systemOxql": "/system/oxql", + "systemOxql": "/system/metrics-explorer", "systemUpdate": "/system/update", "systemUtilization": "/system/utilization", "vpc": "/projects/p/vpcs/v/firewall-rules", diff --git a/app/util/path-builder.ts b/app/util/path-builder.ts index 5de0438b4..ea2b6070b 100644 --- a/app/util/path-builder.ts +++ b/app/util/path-builder.ts @@ -115,7 +115,7 @@ export const pb = { siloImage: (params: PP.SiloImage) => `${pb.siloImages()}/${params.image}`, fleetAccess: () => '/system/access', - systemOxql: () => '/system/oxql', + systemOxql: () => '/system/metrics-explorer', systemUtilization: () => '/system/utilization', ipPools: () => '/system/networking/ip-pools', diff --git a/package-lock.json b/package-lock.json index e43489414..b673d6af6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,10 @@ "license": "MPL-2.0", "dependencies": { "@base-ui/react": "^1.1.0", + "@codemirror/commands": "^6.11.0", + "@codemirror/language": "^6.12.4", + "@codemirror/state": "^6.7.1", + "@codemirror/view": "^6.43.9", "@floating-ui/react": "^0.26.23", "@headlessui/react": "^2.2.9", "@oxide/design-system": "^6.3.0", @@ -45,6 +49,7 @@ "react-stately": "^3.32.2", "remeda": "^2.30.0", "semver": "^7.7.3", + "shiki": "^3.23.0", "simplebar-react": "^3.2.6", "ts-pattern": "^5.8.0", "tslib": "^2.7.0", @@ -381,6 +386,53 @@ "tough-cookie": "^4.1.4" } }, + "node_modules/@codemirror/commands": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.11.0.tgz", + "integrity": "sha512-/K4Rl5BN0OtTiPWmJCdqODu38XnDMsDxKY5rgrPnCkutPTJf2wVbkoixLfealF5Kwse/s8P8M5jAiURiwSwnFA==", + "license": "MIT", + "dependencies": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.7.0", + "@codemirror/view": "^6.27.0", + "@lezer/common": "^1.1.0" + } + }, + "node_modules/@codemirror/language": { + "version": "6.12.4", + "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.12.4.tgz", + "integrity": "sha512-1q4PaT+o6PbgpkJt4Q8Fv5XJxTy4FUZ4MWETtyiDw3J0Pyr9E2vqcKL+k9wcvjNTIsauxvE7OfmWj3FRPHQ76A==", + "license": "MIT", + "dependencies": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.23.0", + "@lezer/common": "^1.5.0", + "@lezer/highlight": "^1.0.0", + "@lezer/lr": "^1.0.0", + "style-mod": "^4.0.0" + } + }, + "node_modules/@codemirror/state": { + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.7.1.tgz", + "integrity": "sha512-9QzNDgE4EYDnAHfrTlR2lwiPciiOymLtwKK+8yHQzCc7GXhAP9xdEbEJFy2IWB1j9UGUl9BsgMmTo/ImA02T7A==", + "license": "MIT", + "dependencies": { + "@marijn/find-cluster-break": "^1.0.0" + } + }, + "node_modules/@codemirror/view": { + "version": "6.43.9", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.43.9.tgz", + "integrity": "sha512-sTuUzTpPMFebRhg6dawChoKKgndIwfjmJgKVxBefPElcU2NwQ6AFroupk0SFqEerQyZOGRfDNnSN8Dw/lMAsXw==", + "license": "MIT", + "dependencies": { + "@codemirror/state": "^6.7.0", + "crelt": "^1.0.6", + "style-mod": "^4.1.0", + "w3c-keyname": "^2.2.4" + } + }, "node_modules/@commander-js/extra-typings": { "version": "14.0.0", "resolved": "https://registry.npmjs.org/@commander-js/extra-typings/-/extra-typings-14.0.0.tgz", @@ -1152,6 +1204,36 @@ "dev": true, "license": "MIT" }, + "node_modules/@lezer/common": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.5.2.tgz", + "integrity": "sha512-sxQE460fPZyU3sdc8lafxiPwJHBzZRy/udNFynGQky1SePYBdhkBl1kOagA9uT3pxR8K09bOrmTUqA9wb/PjSQ==", + "license": "MIT" + }, + "node_modules/@lezer/highlight": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.2.3.tgz", + "integrity": "sha512-qXdH7UqTvGfdVBINrgKhDsVTJTxactNNxLk7+UMwZhU13lMHaOBlJe9Vqp907ya56Y3+ed2tlqzys7jDkTmW0g==", + "license": "MIT", + "dependencies": { + "@lezer/common": "^1.3.0" + } + }, + "node_modules/@lezer/lr": { + "version": "1.4.10", + "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.4.10.tgz", + "integrity": "sha512-rnCpTIBafOx4mRp43xOxDJbFipJm/c0cia/V5TiGlhmMa+wsSdoGmUN3w5Bqrks/09Q/D4tNAmWaT8p6NRi77A==", + "license": "MIT", + "dependencies": { + "@lezer/common": "^1.0.0" + } + }, + "node_modules/@marijn/find-cluster-break": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@marijn/find-cluster-break/-/find-cluster-break-1.0.4.tgz", + "integrity": "sha512-Wy0V7+SGUjnF9/TkiM1hKVDPj7jKXduPNboMVtHTA8dySMURWqfg/JZ9E2Sq8JgSJmkl7k7Qe9FLeMSrSraWmQ==", + "license": "MIT" + }, "node_modules/@mswjs/http-middleware": { "version": "0.10.3", "resolved": "https://registry.npmjs.org/@mswjs/http-middleware/-/http-middleware-0.10.3.tgz", @@ -4990,60 +5072,60 @@ "license": "MIT" }, "node_modules/@shikijs/core": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-3.13.0.tgz", - "integrity": "sha512-3P8rGsg2Eh2qIHekwuQjzWhKI4jV97PhvYjYUzGqjvJfqdQPz+nMlfWahU24GZAyW1FxFI1sYjyhfh5CoLmIUA==", + "version": "3.23.0", + "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-3.23.0.tgz", + "integrity": "sha512-NSWQz0riNb67xthdm5br6lAkvpDJRTgB36fxlo37ZzM2yq0PQFFzbd8psqC2XMPgCzo1fW6cVi18+ArJ44wqgA==", "license": "MIT", "dependencies": { - "@shikijs/types": "3.13.0", + "@shikijs/types": "3.23.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4", "hast-util-to-html": "^9.0.5" } }, "node_modules/@shikijs/engine-javascript": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-3.13.0.tgz", - "integrity": "sha512-Ty7xv32XCp8u0eQt8rItpMs6rU9Ki6LJ1dQOW3V/56PKDcpvfHPnYFbsx5FFUP2Yim34m/UkazidamMNVR4vKg==", + "version": "3.23.0", + "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-3.23.0.tgz", + "integrity": "sha512-aHt9eiGFobmWR5uqJUViySI1bHMqrAgamWE1TYSUoftkAeCCAiGawPMwM+VCadylQtF4V3VNOZ5LmfItH5f3yA==", "license": "MIT", "dependencies": { - "@shikijs/types": "3.13.0", + "@shikijs/types": "3.23.0", "@shikijs/vscode-textmate": "^10.0.2", - "oniguruma-to-es": "^4.3.3" + "oniguruma-to-es": "^4.3.4" } }, "node_modules/@shikijs/engine-oniguruma": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-3.13.0.tgz", - "integrity": "sha512-O42rBGr4UDSlhT2ZFMxqM7QzIU+IcpoTMzb3W7AlziI1ZF7R8eS2M0yt5Ry35nnnTX/LTLXFPUjRFCIW+Operg==", + "version": "3.23.0", + "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-3.23.0.tgz", + "integrity": "sha512-1nWINwKXxKKLqPibT5f4pAFLej9oZzQTsby8942OTlsJzOBZ0MWKiwzMsd+jhzu8YPCHAswGnnN1YtQfirL35g==", "license": "MIT", "dependencies": { - "@shikijs/types": "3.13.0", + "@shikijs/types": "3.23.0", "@shikijs/vscode-textmate": "^10.0.2" } }, "node_modules/@shikijs/langs": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-3.13.0.tgz", - "integrity": "sha512-672c3WAETDYHwrRP0yLy3W1QYB89Hbpj+pO4KhxK6FzIrDI2FoEXNiNCut6BQmEApYLfuYfpgOZaqbY+E9b8wQ==", + "version": "3.23.0", + "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-3.23.0.tgz", + "integrity": "sha512-2Ep4W3Re5aB1/62RSYQInK9mM3HsLeB91cHqznAJMuylqjzNVAVCMnNWRHFtcNHXsoNRayP9z1qj4Sq3nMqYXg==", "license": "MIT", "dependencies": { - "@shikijs/types": "3.13.0" + "@shikijs/types": "3.23.0" } }, "node_modules/@shikijs/themes": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-3.13.0.tgz", - "integrity": "sha512-Vxw1Nm1/Od8jyA7QuAenaV78BG2nSr3/gCGdBkLpfLscddCkzkL36Q5b67SrLLfvAJTOUzW39x4FHVCFriPVgg==", + "version": "3.23.0", + "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-3.23.0.tgz", + "integrity": "sha512-5qySYa1ZgAT18HR/ypENL9cUSGOeI2x+4IvYJu4JgVJdizn6kG4ia5Q1jDEOi7gTbN4RbuYtmHh0W3eccOrjMA==", "license": "MIT", "dependencies": { - "@shikijs/types": "3.13.0" + "@shikijs/types": "3.23.0" } }, "node_modules/@shikijs/types": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-3.13.0.tgz", - "integrity": "sha512-oM9P+NCFri/mmQ8LoFGVfVyemm5Hi27330zuOBp0annwJdKH1kOLndw3zCtAVDehPLg9fKqoEx3Ht/wNZxolfw==", + "version": "3.23.0", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-3.23.0.tgz", + "integrity": "sha512-3JZ5HXOZfYjsYSk0yPwBrkupyYSLpAE26Qc0HLghhZNGTZg/SKxXIIgoxOpmmeQP0RRSDJTk1/vPfw9tbw+jSQ==", "license": "MIT", "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", @@ -5734,9 +5816,9 @@ "license": "MIT" }, "node_modules/@types/hast": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", - "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.5.tgz", + "integrity": "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g==", "license": "MIT", "dependencies": { "@types/unist": "*" @@ -6219,9 +6301,9 @@ } }, "node_modules/@ungap/structured-clone": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", - "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.3.tgz", + "integrity": "sha512-60YRaenCQcVjYEKOcG824+DRGGIQ3VKErcBoAEDJZz5bKIs2ZG+X/H9Nk+Q6EVkwJk5QNApxbrc5QtBSwtrXAg==", "license": "ISC" }, "node_modules/@vitejs/plugin-basic-ssl": { @@ -7115,6 +7197,12 @@ "dev": true, "license": "MIT" }, + "node_modules/crelt": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.7.tgz", + "integrity": "sha512-aK6BbWfhf4U/wCcLHKPJl/xa6VkVstRaPywWtMKGwuOLc/wZTyQYuoxgvZnNsBvv7Kg3YTBQYYBCggcviQczuA==", + "license": "MIT" + }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", @@ -9626,19 +9714,19 @@ } }, "node_modules/oniguruma-parser": { - "version": "0.12.1", - "resolved": "https://registry.npmjs.org/oniguruma-parser/-/oniguruma-parser-0.12.1.tgz", - "integrity": "sha512-8Unqkvk1RYc6yq2WBYRj4hdnsAxVze8i7iPfQr8e4uSP3tRv0rpZcbGUDvxfQQcdwHt/e9PrMvGCsa8OqG9X3w==", + "version": "0.12.2", + "resolved": "https://registry.npmjs.org/oniguruma-parser/-/oniguruma-parser-0.12.2.tgz", + "integrity": "sha512-6HVa5oIrgMC6aA6WF6XyyqbhRPJrKR02L20+2+zpDtO5QAzGHAUGw5TKQvwi5vctNnRHkJYmjAhRVQF2EKdTQw==", "license": "MIT" }, "node_modules/oniguruma-to-es": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/oniguruma-to-es/-/oniguruma-to-es-4.3.3.tgz", - "integrity": "sha512-rPiZhzC3wXwE59YQMRDodUwwT9FZ9nNBwQQfsd1wfdtlKEyCdRV0avrTcSZ5xlIvGRVPd/cx6ZN45ECmS39xvg==", + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/oniguruma-to-es/-/oniguruma-to-es-4.3.6.tgz", + "integrity": "sha512-csuQ9x3Yr0cEIs/Zgx/OEt9iBw9vqIunAPQkx19R/fiMq2oGVTgcMqO/V3Ybqefr1TBvosI6jU539ksaBULJyA==", "license": "MIT", "dependencies": { - "oniguruma-parser": "^0.12.1", - "regex": "^6.0.1", + "oniguruma-parser": "^0.12.2", + "regex": "^6.1.0", "regex-recursion": "^6.0.2" } }, @@ -10351,9 +10439,9 @@ "license": "MIT" }, "node_modules/property-information": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/property-information/-/property-information-7.1.0.tgz", - "integrity": "sha512-TwEZ+X+yCJmYfL7TPUOcvBZ4QfoT5YenQiJuX//0th53DE6w0xxLEtfK3iyryQFddXuvkIk51EEgrJQ0WJkOmQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-7.2.0.tgz", + "integrity": "sha512-IAtzIB6sUiWaJYrX9smp3V46pBGbBeLFRGdh25kg1334VcBlD8HzhPeNIWQH9zhGmo2itIe25EHt9dQP7G5hmg==", "license": "MIT", "funding": { "type": "github", @@ -10691,9 +10779,9 @@ "license": "Apache-2.0" }, "node_modules/regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/regex/-/regex-6.0.1.tgz", - "integrity": "sha512-uorlqlzAKjKQZ5P+kTJr3eeJGSVroLKoHmquUj4zHWuR+hEyNqlXsSKlYYF5F4NI6nl7tWCs0apKJ0lmfsXAPA==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/regex/-/regex-6.1.0.tgz", + "integrity": "sha512-6VwtthbV4o/7+OaAF9I5L5V3llLEsoPyq9P1JVXkedTP33c7MfCG0/5NOPcSJn0TzXcG9YUrR0gQSWioew3LDg==", "license": "MIT", "dependencies": { "regex-utilities": "^2.3.0" @@ -11002,17 +11090,17 @@ } }, "node_modules/shiki": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-3.13.0.tgz", - "integrity": "sha512-aZW4l8Og16CokuCLf8CF8kq+KK2yOygapU5m3+hoGw0Mdosc6fPitjM+ujYarppj5ZIKGyPDPP1vqmQhr+5/0g==", + "version": "3.23.0", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-3.23.0.tgz", + "integrity": "sha512-55Dj73uq9ZXL5zyeRPzHQsK7Nbyt6Y10k5s7OjuFZGMhpp4r/rsLBH0o/0fstIzX1Lep9VxefWljK/SKCzygIA==", "license": "MIT", "dependencies": { - "@shikijs/core": "3.13.0", - "@shikijs/engine-javascript": "3.13.0", - "@shikijs/engine-oniguruma": "3.13.0", - "@shikijs/langs": "3.13.0", - "@shikijs/themes": "3.13.0", - "@shikijs/types": "3.13.0", + "@shikijs/core": "3.23.0", + "@shikijs/engine-javascript": "3.23.0", + "@shikijs/engine-oniguruma": "3.23.0", + "@shikijs/langs": "3.23.0", + "@shikijs/themes": "3.23.0", + "@shikijs/types": "3.23.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } @@ -11241,6 +11329,12 @@ "node": ">=8" } }, + "node_modules/style-mod": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.1.3.tgz", + "integrity": "sha512-i/n8VsZydrugj3Iuzll8+x/00GH2vnYsk1eomD8QiRrSAeW6ItbCQDtfXCeJHd0iwiNagqjQkvpvREEPtW3IoQ==", + "license": "MIT" + }, "node_modules/style-to-js": { "version": "1.1.21", "resolved": "https://registry.npmjs.org/style-to-js/-/style-to-js-1.1.21.tgz", @@ -11678,9 +11772,9 @@ "peer": true }, "node_modules/unist-util-is": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.0.tgz", - "integrity": "sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.1.tgz", + "integrity": "sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==", "license": "MIT", "dependencies": { "@types/unist": "^3.0.0" @@ -11717,9 +11811,9 @@ } }, "node_modules/unist-util-visit": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", - "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.1.0.tgz", + "integrity": "sha512-m+vIdyeCOpdr/QeQCu2EzxX/ohgS8KbnPDgFni4dQsfSCtpz8UqDyY5GjRru8PDKuYn7Fq19j1CQ+nJSsGKOzg==", "license": "MIT", "dependencies": { "@types/unist": "^3.0.0", @@ -11732,9 +11826,9 @@ } }, "node_modules/unist-util-visit-parents": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.1.tgz", - "integrity": "sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.2.tgz", + "integrity": "sha512-goh1s1TBrqSqukSc8wrjwWhL0hiJxgA8m4kFxGlQ+8FYQ3C/m11FcTs4YYem7V664AhHVvgoQLk890Ssdsr2IQ==", "license": "MIT", "dependencies": { "@types/unist": "^3.0.0", @@ -12179,6 +12273,12 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/w3c-keyname": { + "version": "2.2.8", + "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz", + "integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==", + "license": "MIT" + }, "node_modules/w3c-xmlserializer": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", diff --git a/package.json b/package.json index a1476ac82..27d1ff184 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,10 @@ "private": true, "dependencies": { "@base-ui/react": "^1.1.0", + "@codemirror/commands": "^6.11.0", + "@codemirror/language": "^6.12.4", + "@codemirror/state": "^6.7.1", + "@codemirror/view": "^6.43.9", "@floating-ui/react": "^0.26.23", "@headlessui/react": "^2.2.9", "@oxide/design-system": "^6.3.0", @@ -70,6 +74,7 @@ "react-stately": "^3.32.2", "remeda": "^2.30.0", "semver": "^7.7.3", + "shiki": "^3.23.0", "simplebar-react": "^3.2.6", "ts-pattern": "^5.8.0", "tslib": "^2.7.0", diff --git a/test/e2e/oxql.e2e.ts b/test/e2e/oxql.e2e.ts index 71fcf490a..2f3673ce2 100644 --- a/test/e2e/oxql.e2e.ts +++ b/test/e2e/oxql.e2e.ts @@ -9,6 +9,7 @@ import { expect, test, type Page, type Locator } from '@playwright/test' import { oxqlQueries } from './oxql-queries' +import { expectToast } from './utils' const runQuery = async (page: Page, query?: string) => { if (query !== undefined) await page.getByRole('textbox').fill(query) @@ -21,8 +22,8 @@ const runQuery = async (page: Page, query?: string) => { } test.beforeEach(async ({ page }) => { - await page.goto('/system/oxql') - await expect(page.getByRole('heading', { name: 'OxQL Explorer' })).toBeVisible() + await page.goto('/system/metrics-explorer') + await expect(page.getByRole('heading', { name: 'Metrics Explorer' })).toBeVisible() }) test('unaligned multi-table query renders a chart per series', async ({ page }) => { @@ -122,14 +123,39 @@ test('results list is virtualized', async ({ page }) => { }) test('picking an example populates the query and renders a chart', async ({ page }) => { - await page.getByRole('button', { name: 'Try an example' }).click() - await page.getByRole('menuitem', { name: 'Power shelf fan speeds' }).click() - await expect(page.getByRole('textbox')).toHaveValue(/get hardware_component:fan_speed/) + await page.getByRole('button', { name: 'Power shelf fan speeds' }).click() + // the editor is a contenteditable, so assert on text rather than value + await expect(page.getByRole('textbox')).toContainText('get hardware_component:fan_speed') await runQuery(page) await expect(page.getByRole('figure').first()).toBeVisible() }) +test('results can be copied as JSON or CSV', async ({ page }) => { + await runQuery(page, oxqlQueries.basicTctl) + + // result summary is visible in the query card header + await expect(page.getByText('1 timeseries', { exact: true })).toBeVisible() + + await page.getByRole('button', { name: 'Results actions' }).click() + await page.getByRole('menuitem', { name: 'Copy as JSON' }).click() + await expectToast(page, 'Results copied as JSON') + + await page.getByRole('button', { name: 'Results actions' }).click() + await page.getByRole('menuitem', { name: 'Copy as CSV' }).click() + await expectToast(page, 'Results copied as CSV') + + await page.getByRole('button', { name: 'Results actions' }).click() + await page.getByRole('menuitem', { name: 'Copy CLI command' }).click() + await expectToast(page, 'CLI command copied') +}) + +test('copy actions are disabled before a query has run', async ({ page }) => { + await page.getByRole('button', { name: 'Results actions' }).click() + await expect(page.getByRole('menuitem', { name: 'Copy as JSON' })).toBeDisabled() + await expect(page.getByRole('menuitem', { name: 'Copy CLI command' })).toBeDisabled() +}) + test('empty query is blocked by client-side validation', async ({ page }) => { const textbox = page.getByRole('textbox') await textbox.fill('') @@ -151,12 +177,17 @@ test('a query the backend rejects surfaces an error instead of a chart', async ( }) test('pages reads the initial query from the URL', async ({ page }) => { - await page.goto(`/system/oxql?query=${encodeURIComponent(oxqlQueries.basicTctl)}`) - await expect(page.getByRole('textbox')).toHaveValue(oxqlQueries.basicTctl) + await page.goto( + `/system/metrics-explorer?query=${encodeURIComponent(oxqlQueries.basicTctl)}` + ) + const textbox = page.getByRole('textbox') + // the editor is a contenteditable, so assert line by line rather than on value + await expect(textbox).toContainText('get hardware_component:amd_cpu_tctl') + await expect(textbox).toContainText('| filter timestamp > @now() - 1m') }) test('pages writes the query to the URL after a successful run', async ({ page }) => { - await page.goto('/system/oxql') + await page.goto('/system/metrics-explorer') await runQuery(page, oxqlQueries.basicTctl) await expect From 0848d7aa826bb9904004f6b4f6c949892ddbdea9 Mon Sep 17 00:00:00 2001 From: benjaminleonard Date: Fri, 21 Aug 2026 16:20:39 +0100 Subject: [PATCH 02/46] Add completions --- app/components/OxqlEditor.tsx | 51 +++++++- app/components/oxql-autocomplete.spec.ts | 131 +++++++++++++++++++ app/components/oxql-autocomplete.ts | 144 +++++++++++++++++++++ app/pages/system/OxqlPage.tsx | 93 ++++++------- mock-api/index.ts | 1 + mock-api/msw/handlers.ts | 6 +- mock-api/timeseries-schema.ts | 158 +++++++++++++++++++++++ package-lock.json | 13 ++ package.json | 1 + test/e2e/oxql.e2e.ts | 49 ++++++- 10 files changed, 591 insertions(+), 56 deletions(-) create mode 100644 app/components/oxql-autocomplete.spec.ts create mode 100644 app/components/oxql-autocomplete.ts create mode 100644 mock-api/timeseries-schema.ts diff --git a/app/components/OxqlEditor.tsx b/app/components/OxqlEditor.tsx index 388466224..d127a73d2 100644 --- a/app/components/OxqlEditor.tsx +++ b/app/components/OxqlEditor.tsx @@ -5,7 +5,7 @@ * * Copyright Oxide Computer Company */ -import { defaultKeymap, history, historyKeymap } from '@codemirror/commands' +import { defaultKeymap, history, historyKeymap, indentWithTab } from '@codemirror/commands' import { bracketMatching } from '@codemirror/language' import { Compartment, RangeSetBuilder } from '@codemirror/state' import { @@ -13,6 +13,7 @@ import { EditorView, highlightActiveLine, keymap, + placeholder, ViewPlugin, type DecorationSet, type ViewUpdate, @@ -26,6 +27,10 @@ import { } from 'shiki/core' import { createJavaScriptRegexEngine } from 'shiki/engine/javascript' +import type { TimeseriesSchema } from '@oxide/api' + +import { oxqlAutocomplete } from '~/components/oxql-autocomplete' + // OxQL grammar copied from the design system so we can highlight queries // without pulling in its full asciidoc bundle. One addition over the source: // single-quoted strings, which OxQL supports and our examples use. @@ -146,7 +151,9 @@ const cmTheme = EditorView.theme({ // fixed height of ~6 lines; longer queries scroll inside the editor height: '7.5rem', }, - '.cm-scroller': { overflow: 'auto' }, + // CM's base theme hardcodes font-family: monospace here; inherit the + // wrapper's font (text-mono-code) instead + '.cm-scroller': { overflow: 'auto', fontFamily: 'inherit' }, // the wrapper carries the focus ring (focus-within), so hide CM's own outline '&.cm-focused': { outline: 'none' }, '.cm-content': { @@ -163,6 +170,36 @@ const cmTheme = EditorView.theme({ }, '.cm-matchingBracket': { color: 'var(--syntax-fg)' }, '.cm-nonmatchingBracket': { color: 'var(--content-destructive)' }, + // completion popup. fontFamily inherits mono from the wrapper because the + // tooltip renders inside the editor element + '.cm-tooltip': { + backgroundColor: 'var(--surface-raise)', + border: '1px solid var(--stroke-secondary)', + borderRadius: '0.125rem', + overflow: 'hidden', + fontFamily: 'inherit', + }, + // the autocomplete base theme hardcodes font-family: monospace on the list + '.cm-tooltip.cm-tooltip-autocomplete > ul': { fontFamily: 'inherit' }, + '.cm-tooltip.cm-tooltip-autocomplete > ul > li': { padding: '2px 8px' }, + '.cm-tooltip.cm-tooltip-autocomplete > ul > li[aria-selected]': { + backgroundColor: 'var(--surface-hover)', + color: 'inherit', + }, + '.cm-completionMatchedText': { + textDecoration: 'none', + color: 'var(--content-accent-secondary)', + }, + '.cm-completionDetail': { + color: 'var(--content-quaternary)', + fontStyle: 'normal', + marginLeft: '1rem', + }, + '.cm-tooltip.cm-completionInfo': { padding: '4px 8px', maxWidth: '22rem' }, + // match the placeholder color of the regular text inputs + '.cm-placeholder': { color: 'var(--content-tertiary)' }, + // placeholder region of an accepted snippet, e.g. mean_within(period) + '.cm-snippetField': { backgroundColor: 'var(--surface-secondary)' }, }) const contentAttrs = (ariaLabel: string, error: boolean) => @@ -177,6 +214,8 @@ type OxqlEditorProps = { /** Called on cmd+enter / ctrl+enter */ onSubmit: () => void error?: boolean + /** Timeseries schemas backing name and field completions. May load after mount. */ + schemas?: TimeseriesSchema[] 'aria-label': string } @@ -186,6 +225,7 @@ export function OxqlEditor({ onChange, onSubmit, error = false, + schemas, 'aria-label': ariaLabel, }: OxqlEditorProps) { const containerRef = useRef(null) @@ -194,8 +234,10 @@ export function OxqlEditor({ // let the mount-once extensions see the latest props without reconfiguring const callbacks = useRef({ onChange, onSubmit }) + const schemasRef = useRef(schemas) useEffect(() => { callbacks.current = { onChange, onSubmit } + schemasRef.current = schemas }) useEffect(() => { @@ -215,10 +257,15 @@ export function OxqlEditor({ }, ...defaultKeymap, ...historyKeymap, + // tab indents instead of moving focus. the standard escape hatch + // still works: Ctrl-m (from defaultKeymap) toggles tab focus mode + indentWithTab, ]), EditorView.lineWrapping, + placeholder('get sled_data_link:bytes_sent | filter timestamp > @now() - 5m'), highlightActiveLine(), bracketMatching(), + oxqlAutocomplete(() => schemasRef.current ?? []), shikiPlugin, cmTheme, attrsCompartment.current.of(contentAttrs(ariaLabel, error)), diff --git a/app/components/oxql-autocomplete.spec.ts b/app/components/oxql-autocomplete.spec.ts new file mode 100644 index 000000000..6a7b903d7 --- /dev/null +++ b/app/components/oxql-autocomplete.spec.ts @@ -0,0 +1,131 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * Copyright Oxide Computer Company + */ +import { CompletionContext, type CompletionResult } from '@codemirror/autocomplete' +import { EditorState } from '@codemirror/state' +import { expect, it } from 'vitest' + +import type { TimeseriesSchema } from '@oxide/api' + +import { oxqlCompletionSource } from './oxql-autocomplete' + +const schemas: TimeseriesSchema[] = [ + { + authzScope: 'fleet', + created: new Date(0), + datumType: 'f32', + description: { target: 'A hardware component', metric: 'A fan speed measurement' }, + fieldSchema: [ + { + name: 'chassis_kind', + fieldType: 'string', + source: 'target', + description: 'What kind of thing the component is a part of', + }, + { + name: 'sled_id', + fieldType: 'uuid', + source: 'target', + description: 'ID of the sled', + }, + ], + timeseriesName: 'hardware_component:fan_speed', + units: 'rpm', + version: 1, + }, + { + authzScope: 'fleet', + created: new Date(0), + datumType: 'cumulative_u64', + description: { target: 'A sled data link', metric: 'Bytes sent on the link' }, + fieldSchema: [ + { + name: 'sled_id', + fieldType: 'uuid', + source: 'target', + description: 'ID of the sled', + }, + { + name: 'link_name', + fieldType: 'string', + source: 'target', + description: 'Name of the link', + }, + ], + timeseriesName: 'sled_data_link:bytes_sent', + units: 'bytes', + version: 1, + }, +] + +/** Run the completion source on `doc` with the cursor at the end */ +const complete = (doc: string): CompletionResult | null => + oxqlCompletionSource(() => schemas)( + new CompletionContext(EditorState.create({ doc }), doc.length, false) + ) + +const labels = (doc: string) => complete(doc)?.options.map((o) => o.label) + +it('completes table operations at the start of a clause', () => { + expect(labels('g')).toContain('get') + expect(labels('get hardware_component:fan_speed | f')).toContain('filter') + // after a pipe and a space, all ops are offered with an empty prefix + expect(labels('get hardware_component:fan_speed | ')).toContain('group_by') +}) + +it('completes timeseries names after get', () => { + expect(labels('get ')).toEqual([ + 'hardware_component:fan_speed', + 'sled_data_link:bytes_sent', + ]) + expect(labels('get hardware_com')).toEqual([ + 'hardware_component:fan_speed', + 'sled_data_link:bytes_sent', + ]) + // from points at the start of the name so CM's own prefix filtering applies + const result = complete('get hardware_com') + expect(result?.from).toBe('get '.length) +}) + +it('completes fields of the queried timeseries in filter', () => { + const result = labels('get hardware_component:fan_speed | filter ch') + expect(result).toContain('chassis_kind') + expect(result).toContain('sled_id') + expect(result).toContain('timestamp') + expect(result).toContain('@now()') + // fields of timeseries the query doesn't get are not offered + expect(result).not.toContain('link_name') +}) + +it('dedupes fields across multiple gets in a subquery', () => { + const doc = + '{ get hardware_component:fan_speed; get sled_data_link:bytes_sent } | filter ' + const result = labels(doc) + expect(result).toContain('link_name') + expect(result?.filter((l) => l === 'sled_id')).toHaveLength(1) +}) + +it('still completes filter fields after a logical operator', () => { + const doc = "get hardware_component:fan_speed | filter chassis_kind == 'power' || sl" + expect(labels(doc)).toContain('sled_id') +}) + +it('completes fields inside group_by brackets and reducers after them', () => { + expect(labels('get hardware_component:fan_speed | group_by [sl')).toContain('sled_id') + expect(labels('get hardware_component:fan_speed | group_by [sled_id], ')).toEqual([ + 'mean', + 'sum', + ]) +}) + +it('completes alignment functions after align', () => { + expect(labels('get hardware_component:fan_speed | align m')).toEqual(['mean_within']) +}) + +it('offers nothing after a complete get clause', () => { + expect(complete('get hardware_component:fan_speed ')).toBeNull() +}) diff --git a/app/components/oxql-autocomplete.ts b/app/components/oxql-autocomplete.ts new file mode 100644 index 000000000..72bf078b0 --- /dev/null +++ b/app/components/oxql-autocomplete.ts @@ -0,0 +1,144 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * Copyright Oxide Computer Company + */ +import { + autocompletion, + closeBrackets, + closeBracketsKeymap, + snippetCompletion, + type Completion, + type CompletionContext, + type CompletionResult, +} from '@codemirror/autocomplete' +import type { Extension } from '@codemirror/state' +import { keymap } from '@codemirror/view' + +import type { TimeseriesSchema } from '@oxide/api' + +// The OxQL language surface below comes from RFD 463 +// https://rfd.shared.oxide.computer/rfd/463 + +const tableOps: Completion[] = [ + { label: 'get', info: 'Retrieve a table by its timeseries name' }, + { label: 'filter', info: 'Filter timeseries by field values or timestamps' }, + { label: 'align', info: "Temporally align a table's samples" }, + { + label: 'group_by', + info: 'Group timeseries by the listed fields, reducing along the rest', + }, + { label: 'join', info: 'Natural inner join between two or more tables' }, + { label: 'first', info: 'Limit each timeseries to its first k samples' }, + { label: 'last', info: 'Limit each timeseries to its last k samples' }, +] + +const alignFns: Completion[] = [ + snippetCompletion('mean_within(${period})', { + label: 'mean_within', + info: 'Average samples within each period, e.g. mean_within(30s)', + }), +] + +const reducers: Completion[] = [ + { label: 'mean', info: 'Average the values in each group' }, + { label: 'sum', info: 'Sum the values in each group' }, +] + +// identifiers that are valid in filter expressions alongside field names +const filterExtras: Completion[] = [ + { label: 'timestamp', info: 'The timestamp of each sample' }, + { label: 'start_time', info: 'The start time of each cumulative sample' }, + { label: '@now()', info: 'The current time, e.g. timestamp > @now() - 1m' }, +] + +const fieldCompletions = ( + context: CompletionContext, + schemas: TimeseriesSchema[] +): Completion[] => { + // offer the fields of every timeseries the query `get`s, deduped by name + // since subquery filters can apply across tables + const doc = context.state.doc.toString() + const named = new Set(Array.from(doc.matchAll(/\bget\s+([\w:]+)/g), (m) => m[1])) + const seen = new Set() + const options: Completion[] = [] + for (const schema of schemas) { + if (!named.has(schema.timeseriesName)) continue + for (const field of schema.fieldSchema) { + if (seen.has(field.name)) continue + seen.add(field.name) + options.push({ label: field.name, detail: field.fieldType, info: field.description }) + } + } + return options +} + +const schemaCompletion = (s: TimeseriesSchema): Completion => ({ + label: s.timeseriesName, + detail: s.units === 'none' ? s.datumType : `${s.datumType}, ${s.units}`, + info: s.description.metric, +}) + +/** + * Complete based on which clause the cursor is in, determined with regexes + * rather than a real parser: OxQL clauses are short and always start with a + * table operation, so "text since the last pipe" is nearly always enough. + * + * Exported for tests; use {@link oxqlAutocomplete} in the editor. + */ +export const oxqlCompletionSource = + (getSchemas: () => TimeseriesSchema[]) => + (context: CompletionContext): CompletionResult | null => { + // the token being completed: word chars plus ':' (timeseries names) and '@' (@now()) + const word = context.matchBefore(/[@\w:]*/) + if (!word) return null + + const before = context.state + .sliceDoc(0, context.pos) + // blank out logical operators (preserving length) so `filter a == 1 || b` + // reads as one filter clause when we split on pipes below + .replaceAll('||', ' ') + // clauses are delimited by pipes and, in subqueries, braces and semicolons + const clauseStart = + Math.max(before.lastIndexOf('|'), before.lastIndexOf('{'), before.lastIndexOf(';')) + + 1 + const clause = before.slice(clauseStart) + + const result = (options: Completion[]): CompletionResult | null => + options.length > 0 ? { from: word.from, options, validFor: /^[@\w:]*$/ } : null + + // after `get`, complete timeseries names from the schema list + if (/^\s*get\s+[\w:]*$/.test(clause)) { + return result(getSchemas().map(schemaCompletion)) + } + + if (/^\s*align\s+\w*$/.test(clause)) return result(alignFns) + + // inside group_by's bracket list → fields; after the list and a comma → reducers + if (/^\s*group_by\s*\[[^\]]*$/.test(clause)) { + return result(fieldCompletions(context, getSchemas())) + } + if (/^\s*group_by\s*\[[^\]]*\]\s*,\s*\w*$/.test(clause)) return result(reducers) + + // anywhere in a filter expression, offer fields and time identifiers + if (/^\s*filter\b/.test(clause)) { + return result([...fieldCompletions(context, getSchemas()), ...filterExtras]) + } + + // otherwise, if we're at the start of a clause, offer table operations + if (/^\s*\w*$/.test(clause)) return result(tableOps) + + return null + } + +/** + * OxQL completions plus bracket/quote auto-closing. `getSchemas` is called on + * each completion request, so the schema list can arrive after editor mount. + */ +export const oxqlAutocomplete = (getSchemas: () => TimeseriesSchema[]): Extension => [ + autocompletion({ override: [oxqlCompletionSource(getSchemas)], icons: false }), + closeBrackets(), + keymap.of(closeBracketsKeymap), +] diff --git a/app/pages/system/OxqlPage.tsx b/app/pages/system/OxqlPage.tsx index 5ac61ba7c..cb6e054a9 100644 --- a/app/pages/system/OxqlPage.tsx +++ b/app/pages/system/OxqlPage.tsx @@ -5,6 +5,7 @@ * * Copyright Oxide Computer Company */ +import { useQuery } from '@tanstack/react-query' import { useWindowVirtualizer } from '@tanstack/react-virtual' import { useLayoutEffect, useMemo, useRef, useState, type ReactNode } from 'react' import { useController, useForm } from 'react-hook-form' @@ -14,6 +15,7 @@ import { match } from 'ts-pattern' import { api, + q, useApiMutation, camelToSnake, type Timeseries, @@ -43,6 +45,7 @@ import * as Dropdown from '~/ui/lib/DropdownMenu' import { Message } from '~/ui/lib/Message' import { PageHeader, PageTitle } from '~/ui/lib/PageHeader' import { TextInputError } from '~/ui/lib/TextInput' +import { ALL_ISH } from '~/util/consts' import { docLinks } from '~/util/links' import { pluralize } from '~/util/str' @@ -321,24 +324,28 @@ const toDisplays = (groups: ChartGroup[]): ChartDisplay[] => const { startTime, endTime } = g return match(g) .with({ kind: 'unaligned' }, ({ charts }) => - charts.map((chart, i): ChartDisplay => ({ - kind: 'line', - key: `t${t}.${i}`, - showDivider: i === 0, - startTime, - endTime, - chart, - })) + charts.map( + (chart, i): ChartDisplay => ({ + kind: 'line', + key: `t${t}.${i}`, + showDivider: i === 0, + startTime, + endTime, + chart, + }) + ) ) .with({ kind: 'joined' }, { kind: 'aligned' }, ({ charts }) => - charts.map((chart, i): ChartDisplay => ({ - kind: 'multiline', - key: `t${t}.${i}`, - showDivider: i === 0, - startTime, - endTime, - chart, - })) + charts.map( + (chart, i): ChartDisplay => ({ + kind: 'multiline', + key: `t${t}.${i}`, + showDivider: i === 0, + startTime, + endTime, + chart, + }) + ) ) .exhaustive() }) @@ -467,33 +474,11 @@ const tablesToCsv = (tables: OxqlTable[]): string => { return rows.map((row) => row.map(csvCell).join(',')).join('\n') } -function ResultsSummary({ tables }: { tables: OxqlTable[] }) { - const timeseries = tables.flatMap((t) => t.timeseries) - const nPoints = R.sumBy(timeseries, (t) => t.points.timestamps.length) - return ( -
- {timeseries.length} timeseries /{' '} - - {nPoints.toLocaleString()} {pluralize('point', nPoints)} - -
- ) -} - const copyText = (text: string, toastMessage: string) => { window.navigator.clipboard.writeText(text).then(() => addToast(toastMessage)) } -// wrap in single quotes, escaping any embedded ones, so the multiline query -// survives pasting into a shell -const shellQuote = (s: string) => `'${s.replaceAll("'", "'\\''")}'` - -// The CLI equivalent of this page's query endpoint. See "API and CLI access": -// https://docs.oxide.computer/guides/metrics/oxql-tutorial#_api_and_cli_access -const toCliCommand = (query: string) => - `oxide experimental system timeseries query --query ${shellQuote(query)}` - -function ResultsMenu({ data, query }: { data?: OxqlQueryResult; query?: string }) { +function ResultsMenu({ data }: { data?: OxqlQueryResult }) { // the menu is always visible so the header doesn't jump around, but the // actions only make sense once a query has succeeded const noResults = data === undefined ? 'Run a query first' : undefined @@ -511,15 +496,23 @@ function ResultsMenu({ data, query }: { data?: OxqlQueryResult; query?: string } onSelect={() => data && copyText(tablesToCsv(data.tables), 'Results copied as CSV')} label="Copy as CSV" /> - query && copyText(toCliCommand(query), 'CLI command copied')} - label="Copy CLI command" - /> ) } +function ResultsSummary({ tables }: { tables: OxqlTable[] }) { + const timeseries = tables.flatMap((t) => t.timeseries) + const nPoints = R.sumBy(timeseries, (t) => t.points.timestamps.length) + return ( +
+ {timeseries.length} timeseries /{' '} + + {nPoints.toLocaleString()} {pluralize('point', nPoints)} + +
+ ) +} + // Rendered in every query state so the layout doesn't shift when results arrive const ResultsSection = ({ children }: { children: ReactNode }) => ( <> @@ -531,6 +524,10 @@ const ResultsSection = ({ children }: { children: ReactNode }) => ( export default function OxqlPage() { const query = useApiMutation(api.systemTimeseriesQuery) + // powers editor autocomplete. no loading state needed: completions are a + // progressive enhancement and simply appear once this resolves + const schemas = useQuery(q(api.systemTimeseriesSchemaList, { query: { limit: ALL_ISH } })) + const [searchParams, setSearchParams] = useSearchParams() const defaultQuery = searchParams.get('query') ?? defaultValues.query @@ -619,7 +616,7 @@ export default function OxqlPage() { - +
@@ -630,6 +627,7 @@ export default function OxqlPage() { value={field.value} onChange={field.onChange} onSubmit={() => form.handleSubmit(onSubmit)()} + schemas={schemas.data?.items} /> {fieldState.error?.message && ( {fieldState.error.message} @@ -642,7 +640,10 @@ export default function OxqlPage() { key={label} type="button" className="text-mono-xs border-default text-secondary hover:bg-hover rounded border px-2 py-1" - onClick={() => form.setValue('query', value, { shouldValidate: true })} + onClick={() => { + form.setValue('query', value, { shouldValidate: true }) + form.handleSubmit(onSubmit)() + }} > {label} diff --git a/mock-api/index.ts b/mock-api/index.ts index 3620d30c2..3e1945b88 100644 --- a/mock-api/index.ts +++ b/mock-api/index.ts @@ -27,6 +27,7 @@ export * from './subnet-pool' export * from './sshKeys' export * from './switch' export * from './system-update' +export * from './timeseries-schema' export * from './token' export * from './user' export * from './user-group' diff --git a/mock-api/msw/handlers.ts b/mock-api/msw/handlers.ts index 29a35adbf..f0846f01b 100644 --- a/mock-api/msw/handlers.ts +++ b/mock-api/msw/handlers.ts @@ -36,6 +36,7 @@ import { commaSeries } from '~/util/str' import { GiB } from '~/util/units' import { defaultSilo, toIdp } from '../silo' +import { timeseriesSchemas } from '../timeseries-schema' import { getTimestamps } from '../util' import { defaultFirewallRules } from '../vpc' import { @@ -2095,6 +2096,10 @@ export const handlers = makeHandlers({ await delay(1000) return handleOxqlMetrics(body) }, + systemTimeseriesSchemaList({ cookies }) { + requireFleetViewer(cookies) + return { items: timeseriesSchemas } + }, siloMetric: handleMetrics, systemUpdateRepositoryList: ({ cookies }) => { requireFleetViewer(cookies) @@ -2742,7 +2747,6 @@ export const handlers = makeHandlers({ systemNetworkingSettingsUpdate: NotImplemented, systemNetworkingSettingsView: NotImplemented, systemQuotasList: NotImplemented, - systemTimeseriesSchemaList: NotImplemented, systemUpdateRecoveryFinish: NotImplemented, systemUpdateRepositoryView: NotImplemented, systemUpdateTrustRootCreate: NotImplemented, diff --git a/mock-api/timeseries-schema.ts b/mock-api/timeseries-schema.ts new file mode 100644 index 000000000..5a4a76881 --- /dev/null +++ b/mock-api/timeseries-schema.ts @@ -0,0 +1,158 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * Copyright Oxide Computer Company + */ +import type { TimeseriesSchema } from '@oxide/api' + +import type { Json } from './json-type' + +// Field sets are trimmed-down versions of the real schemas in Omicron; they +// only need to be realistic enough to exercise editor autocomplete and any +// future schema browsing UI. +// https://github.com/oxidecomputer/omicron/blob/main/oximeter/oximeter/schema/hardware-component.toml +// https://github.com/oxidecomputer/omicron/blob/main/oximeter/oximeter/schema/sled-data-link.toml + +const hardwareComponentFields: Json['field_schema'] = [ + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: 'ID of the rack containing the component', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: 'ID of the sled reporting the component', + }, + { + name: 'chassis_kind', + field_type: 'string', + source: 'target', + description: 'What kind of thing the component is a part of', + }, + { + name: 'chassis_serial', + field_type: 'string', + source: 'target', + description: 'Serial number of the chassis', + }, + { + name: 'slot', + field_type: 'u32', + source: 'target', + description: 'Slot number of the chassis', + }, + { + name: 'component_id', + field_type: 'string', + source: 'target', + description: 'ID of the component', + }, + { + name: 'sensor', + field_type: 'string', + source: 'metric', + description: 'Name of the sensor', + }, +] + +const sledDataLinkFields: Json['field_schema'] = [ + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: 'ID of the rack containing the link', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: 'ID of the sled containing the link', + }, + { + name: 'serial', + field_type: 'string', + source: 'target', + description: 'Serial number of the sled', + }, + { + name: 'kind', + field_type: 'string', + source: 'target', + description: 'Kind of the data link (physical or virtual)', + }, + { + name: 'link_name', + field_type: 'string', + source: 'target', + description: 'Name of the data link', + }, +] + +const common = { + authz_scope: 'fleet', + version: 1, + created: '2025-01-01T00:00:00Z', +} as const + +export const timeseriesSchemas: Json[] = [ + { + ...common, + timeseries_name: 'hardware_component:fan_speed', + description: { + target: 'A hardware component on a compute sled, switch, or power shelf', + metric: 'A fan speed measurement', + }, + field_schema: hardwareComponentFields, + datum_type: 'f32', + units: 'rpm', + }, + { + ...common, + timeseries_name: 'hardware_component:temperature', + description: { + target: 'A hardware component on a compute sled, switch, or power shelf', + metric: 'A temperature measurement', + }, + field_schema: hardwareComponentFields, + datum_type: 'f32', + units: 'degrees_celsius', + }, + { + ...common, + timeseries_name: 'hardware_component:amd_cpu_tctl', + description: { + target: 'A hardware component on a compute sled, switch, or power shelf', + metric: 'A CPU Tctl reading (dimensionless)', + }, + field_schema: hardwareComponentFields, + datum_type: 'f32', + units: 'none', + }, + { + ...common, + timeseries_name: 'sled_data_link:bytes_sent', + description: { + target: 'A network data link on a compute sled', + metric: 'Total number of bytes sent on the link', + }, + field_schema: sledDataLinkFields, + datum_type: 'cumulative_u64', + units: 'bytes', + }, + { + ...common, + timeseries_name: 'sled_data_link:bytes_received', + description: { + target: 'A network data link on a compute sled', + metric: 'Total number of bytes received on the link', + }, + field_schema: sledDataLinkFields, + datum_type: 'cumulative_u64', + units: 'bytes', + }, +] diff --git a/package-lock.json b/package-lock.json index b673d6af6..fd8f055bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ "license": "MPL-2.0", "dependencies": { "@base-ui/react": "^1.1.0", + "@codemirror/autocomplete": "^6.20.3", "@codemirror/commands": "^6.11.0", "@codemirror/language": "^6.12.4", "@codemirror/state": "^6.7.1", @@ -386,6 +387,18 @@ "tough-cookie": "^4.1.4" } }, + "node_modules/@codemirror/autocomplete": { + "version": "6.20.3", + "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.20.3.tgz", + "integrity": "sha512-tlosUqb+3BbxCxZdu4tKeRghPFC+QM7q4X5YhKV2eCmPG+1r2F3f4AaSz5sCrFqUtX4Jh20VFTKecl16MgiV9g==", + "license": "MIT", + "dependencies": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.17.0", + "@lezer/common": "^1.0.0" + } + }, "node_modules/@codemirror/commands": { "version": "6.11.0", "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.11.0.tgz", diff --git a/package.json b/package.json index 27d1ff184..1ef55c931 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "private": true, "dependencies": { "@base-ui/react": "^1.1.0", + "@codemirror/autocomplete": "^6.20.3", "@codemirror/commands": "^6.11.0", "@codemirror/language": "^6.12.4", "@codemirror/state": "^6.7.1", diff --git a/test/e2e/oxql.e2e.ts b/test/e2e/oxql.e2e.ts index 2f3673ce2..6fdc4db45 100644 --- a/test/e2e/oxql.e2e.ts +++ b/test/e2e/oxql.e2e.ts @@ -122,15 +122,54 @@ test('results list is virtualized', async ({ page }) => { await expect.poll(getFirstRenderedIndex).not.toBe(0) }) -test('picking an example populates the query and renders a chart', async ({ page }) => { +test('picking an example populates the query and runs it', async ({ page }) => { await page.getByRole('button', { name: 'Power shelf fan speeds' }).click() // the editor is a contenteditable, so assert on text rather than value await expect(page.getByRole('textbox')).toContainText('get hardware_component:fan_speed') - await runQuery(page) + // the query runs automatically, no need to click "Run query" + const loading = page.getByLabel('Chart loading') + await expect(loading).toBeVisible() + await expect(loading).toBeHidden() await expect(page.getByRole('figure').first()).toBeVisible() }) +test('editor autocompletes timeseries names, fields, and operations', async ({ page }) => { + const textbox = page.getByRole('textbox') + await textbox.click() + await page.keyboard.type('get hardware') + + // ctrl-space explicitly re-requests completions in case the schema list + // hadn't loaded when typing started + const options = page.getByRole('listbox').getByRole('option') + await expect(async () => { + await page.keyboard.press('Control+Space') + await expect(options.first()).toBeVisible({ timeout: 1000 }) + }).toPass() + + // accept with the keyboard rather than clicking: the info tooltip can + // overlap the option and intercept pointer events + await expect(options.getByText('hardware_component:fan_speed')).toBeVisible() + await page.keyboard.type('_component:fan') // narrow until fan_speed is the top match + await page.keyboard.press('Enter') + await expect(textbox).toContainText('get hardware_component:fan_speed') + + // table ops complete at the start of a clause. type the word out instead of + // accepting: a second Enter-accept can race the popup closing and insert a + // newline, breaking the clause for the next step + await page.keyboard.type(' | fil') + await expect(options.getByText('filter', { exact: true })).toBeVisible() + await page.keyboard.type('ter') + + // fields of the get-ed timeseries complete inside the filter + await page.keyboard.type(' chass') + await expect(options.getByText('chassis_kind')).toBeVisible() + await page.keyboard.press('Enter') + await expect(textbox).toContainText( + 'get hardware_component:fan_speed | filter chassis_kind' + ) +}) + test('results can be copied as JSON or CSV', async ({ page }) => { await runQuery(page, oxqlQueries.basicTctl) @@ -144,16 +183,12 @@ test('results can be copied as JSON or CSV', async ({ page }) => { await page.getByRole('button', { name: 'Results actions' }).click() await page.getByRole('menuitem', { name: 'Copy as CSV' }).click() await expectToast(page, 'Results copied as CSV') - - await page.getByRole('button', { name: 'Results actions' }).click() - await page.getByRole('menuitem', { name: 'Copy CLI command' }).click() - await expectToast(page, 'CLI command copied') }) test('copy actions are disabled before a query has run', async ({ page }) => { await page.getByRole('button', { name: 'Results actions' }).click() await expect(page.getByRole('menuitem', { name: 'Copy as JSON' })).toBeDisabled() - await expect(page.getByRole('menuitem', { name: 'Copy CLI command' })).toBeDisabled() + await expect(page.getByRole('menuitem', { name: 'Copy as CSV' })).toBeDisabled() }) test('empty query is blocked by client-side validation', async ({ page }) => { From e0c3c3632d03379b72e55a73556f8ea9727a7053 Mon Sep 17 00:00:00 2001 From: benjaminleonard Date: Mon, 24 Aug 2026 17:56:15 +0100 Subject: [PATCH 03/46] Metrics updates contd --- app/components/OxqlEditor.tsx | 45 ++++++++++++++++- app/components/oxql-error.spec.ts | 78 +++++++++++++++++++++++++++++ app/components/oxql-error.ts | 40 +++++++++++++++ app/pages/system/OxqlPage.tsx | 83 +++++++++++++++++++++++-------- app/ui/lib/InlineCode.tsx | 1 + app/ui/styles/index.css | 13 +++++ mock-api/msw/util.ts | 39 ++++++++++++++- package-lock.json | 12 +++++ package.json | 1 + test/e2e/oxql.e2e.ts | 34 +++++++++++-- 10 files changed, 320 insertions(+), 26 deletions(-) create mode 100644 app/components/oxql-error.spec.ts create mode 100644 app/components/oxql-error.ts diff --git a/app/components/OxqlEditor.tsx b/app/components/OxqlEditor.tsx index d127a73d2..7c0f6e1e3 100644 --- a/app/components/OxqlEditor.tsx +++ b/app/components/OxqlEditor.tsx @@ -7,7 +7,8 @@ */ import { defaultKeymap, history, historyKeymap, indentWithTab } from '@codemirror/commands' import { bracketMatching } from '@codemirror/language' -import { Compartment, RangeSetBuilder } from '@codemirror/state' +import { setDiagnostics, type Diagnostic } from '@codemirror/lint' +import { Compartment, RangeSetBuilder, type Text } from '@codemirror/state' import { Decoration, EditorView, @@ -30,6 +31,7 @@ import { createJavaScriptRegexEngine } from 'shiki/engine/javascript' import type { TimeseriesSchema } from '@oxide/api' import { oxqlAutocomplete } from '~/components/oxql-autocomplete' +import type { OxqlDiagnostic } from '~/components/oxql-error' // OxQL grammar copied from the design system so we can highlight queries // without pulling in its full asciidoc bundle. One addition over the source: @@ -196,12 +198,41 @@ const cmTheme = EditorView.theme({ marginLeft: '1rem', }, '.cm-tooltip.cm-completionInfo': { padding: '4px 8px', maxWidth: '22rem' }, + // the lint extension draws its underline as a data: URI background image, + // which our Content-Security-Policy blocks. Use a plain CSS wavy underline + '.cm-lintRange-error': { + backgroundImage: 'none', + textDecoration: 'underline wavy var(--content-destructive)', + textDecorationSkipInk: 'none', + textUnderlineOffset: '3px', + }, + // hover tooltip for the diagnostic; the border color default is a hardcoded red + '.cm-tooltip .cm-diagnostic-error': { + borderLeftColor: 'var(--content-destructive)', + }, // match the placeholder color of the regular text inputs '.cm-placeholder': { color: 'var(--content-tertiary)' }, // placeholder region of an accepted snippet, e.g. mean_within(period) '.cm-snippetField': { backgroundColor: 'var(--surface-secondary)' }, }) +// Convert a 1-based line:column server error position into a CodeMirror +// diagnostic covering the offending token. Positions are clamped so a stale +// or out-of-range position can't crash the editor. +const toCmDiagnostic = ( + doc: Text, + { line, column, message }: OxqlDiagnostic +): Diagnostic => { + const lineInfo = doc.line(Math.max(1, Math.min(line, doc.lines))) + let from = Math.min(lineInfo.from + column - 1, lineInfo.to) + // underline through the end of the token under the caret, or one char minimum + const token = /^[@\w:]+/.exec(doc.sliceString(from, lineInfo.to)) + const to = Math.min(from + (token?.[0].length || 1), lineInfo.to) + // at end of line there's nothing after the caret, so underline the char before + if (from === to) from = Math.max(lineInfo.from, to - 1) + return { from, to, severity: 'error', message } +} + const contentAttrs = (ariaLabel: string, error: boolean) => EditorView.contentAttributes.of({ 'aria-label': ariaLabel, @@ -214,6 +245,8 @@ type OxqlEditorProps = { /** Called on cmd+enter / ctrl+enter */ onSubmit: () => void error?: boolean + /** Server-reported parse error position, underlined in the editor */ + diagnostic?: OxqlDiagnostic /** Timeseries schemas backing name and field completions. May load after mount. */ schemas?: TimeseriesSchema[] 'aria-label': string @@ -225,6 +258,7 @@ export function OxqlEditor({ onChange, onSubmit, error = false, + diagnostic, schemas, 'aria-label': ariaLabel, }: OxqlEditorProps) { @@ -294,6 +328,15 @@ export function OxqlEditor({ }) }, [ariaLabel, error]) + // underline the position a server-side parse error points at. setDiagnostics + // pulls in the lint state on demand, so no linter extension is needed above + useEffect(() => { + const view = viewRef.current + if (!view) return + const diags = diagnostic ? [toCmDiagnostic(view.state.doc, diagnostic)] : [] + view.dispatch(setDiagnostics(view.state, diags)) + }, [diagnostic]) + return (
{ + it('extracts position and the expected clause', () => { + expect(parseOxqlQueryError(parseError)).toEqual({ + line: 1, + column: 1, + message: 'expected one of "get", "{"', + }) + }) + + it('handles positions past line 1', () => { + expect(parseOxqlQueryError(multilineError)).toEqual({ + line: 2, + column: 5, + message: 'expected one of "align", "filter"', + }) + }) + + it('falls back to the whole message when the Expected line is missing', () => { + const result = parseOxqlQueryError('Error at 3:7: something odd') + expect(result).toEqual({ + line: 3, + column: 7, + message: 'Error at 3:7: something odd', + }) + }) + + it('returns null for non-parse errors', () => { + expect(parseOxqlQueryError('Input tables to a `group_by` must be aligned')).toBeNull() + expect(parseOxqlQueryError('Internal Server Error')).toBeNull() + }) +}) + +describe('stripCaretLine', () => { + it('removes the caret line, leaving header and Expected intact', () => { + expect(stripCaretLine(parseError)).toEqual( + `Error at 1:1: .. junk junk junk! .. +Expected: error at 1:1: expected one of "get", "{" +` + ) + }) + + it('handles trailing spaces after the caret', () => { + expect(stripCaretLine('Error at 1:5: .. x ..\n ^ \nExpected: y\n')).toEqual( + 'Error at 1:5: .. x ..\nExpected: y\n' + ) + }) + + it('leaves messages without a caret line alone', () => { + const semantic = 'Input tables to a `group_by` must be aligned' + expect(stripCaretLine(semantic)).toEqual(semantic) + // a ^ used inside the query context is not a caret line + const withCaretChar = 'Error at 1:9: .. filter a ^ b ..\nExpected: y\n' + expect(stripCaretLine(withCaretChar)).toEqual(withCaretChar) + }) +}) diff --git a/app/components/oxql-error.ts b/app/components/oxql-error.ts new file mode 100644 index 000000000..e615f2be1 --- /dev/null +++ b/app/components/oxql-error.ts @@ -0,0 +1,40 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * Copyright Oxide Computer Company + */ +export type OxqlDiagnostic = { + /** 1-based line in the query */ + line: number + /** 1-based column in the line */ + column: number + message: string +} + +/** + * Drop the caret line (whitespace + `^`) from a parse error: its alignment + * assumes a monospace terminal, and the editor underline already points at + * the position. + */ +export const stripCaretLine = (message: string) => message.replace(/\n *\^ *(?=\n)/, '') + +/** + * Pull the position and expectation out of an OxQL parse error so it can be + * shown as a diagnostic in the editor. The message format comes from + * omicron's `fmt_parse_error`: an `Error at :` header and an + * `Expected:` line whose peg Display redundantly repeats the position. + * Returns null for errors that aren't parse errors (e.g., semantic ones). + * https://github.com/oxidecomputer/omicron/blob/6db4c7e/oximeter/db/src/oxql/mod.rs + */ +export function parseOxqlQueryError(message: string): OxqlDiagnostic | null { + const position = /^Error at (\d+):(\d+)/.exec(message) + if (!position) return null + const expected = /^Expected: (?:error at \d+:\d+: )?(.+)$/m.exec(message)?.[1] + return { + line: parseInt(position[1], 10), + column: parseInt(position[2], 10), + message: expected ? expected.trim() : message, + } +} diff --git a/app/pages/system/OxqlPage.tsx b/app/pages/system/OxqlPage.tsx index cb6e054a9..bc3f02e88 100644 --- a/app/pages/system/OxqlPage.tsx +++ b/app/pages/system/OxqlPage.tsx @@ -29,6 +29,7 @@ import { Monitoring16Icon, Monitoring24Icon } from '@oxide/design-system/icons/r import { DocsPopover } from '~/components/DocsPopover' import { MoreActionsMenu } from '~/components/MoreActionsMenu' +import { parseOxqlQueryError, stripCaretLine } from '~/components/oxql-error' import { OxqlEditor } from '~/components/OxqlEditor' import { ChartContainer, @@ -40,8 +41,10 @@ import { useElementSize } from '~/hooks/use-element-size' import { addToast } from '~/stores/toast' import { Button } from '~/ui/lib/Button' import { CardBlock } from '~/ui/lib/CardBlock' +import { Checkbox } from '~/ui/lib/Checkbox' import { Divider } from '~/ui/lib/Divider' import * as Dropdown from '~/ui/lib/DropdownMenu' +import { ErrorInlineCode } from '~/ui/lib/InlineCode' import { Message } from '~/ui/lib/Message' import { PageHeader, PageTitle } from '~/ui/lib/PageHeader' import { TextInputError } from '~/ui/lib/TextInput' @@ -513,6 +516,43 @@ function ResultsSummary({ tables }: { tables: OxqlTable[] }) { ) } +// Server-side query errors render below the editor in the same Message box we +// use for API errors elsewhere (e.g., side modal forms). role=alert announces +// the failure to screen readers on arrival; mono + pre-wrap preserve the parse +// errors' caret alignment. +// The code-ish parts of an error message get inline code styling: the query +// excerpt between fmt_parse_error's `..` markers (which stay outside the chip, +// reading as ellipses), peg's double-quoted expected tokens, and the +// backtick-quoted names in semantic errors. Split with a capture group, so +// odd indices are the code segments. +const codeSegment = /(\.\. [\s\S]*? \.\.|"[^"\n]*"|`[^`\n]*`)/ +const ErrorMessage = ({ message }: { message: string }) => ( + + {message.split(codeSegment).map((part, i) => { + if (i % 2 === 0) return part + // the chip delimits the code, so drop the markers/quotes around it + const code = part.startsWith('.. ') ? part.slice(3, -3) : part.slice(1, -1) + return ( + + {part.startsWith('.. ') && '.. '} + {code} + {part.startsWith('.. ') && ' ..'} + + ) + })} + +) + +const QueryError = ({ message }: { message: string }) => ( +
+ } + /> +
+) + // Rendered in every query state so the layout doesn't shift when results arrive const ResultsSection = ({ children }: { children: ReactNode }) => ( <> @@ -562,6 +602,13 @@ export default function OxqlPage() { ) } + // Parse errors carry a line:column position we can point at in the editor. + // Only show the diagnostic while the editor still holds the exact query that + // failed; as soon as the user edits, the position no longer applies. + const oxqlError = query.error ? parseOxqlQueryError(query.error.message) : null + const diagnostic = + oxqlError && field.value === query.variables?.body.query ? oxqlError : undefined + const chartGroups: ChartGroup[] | null = useMemo( () => (query.data ? query.data.tables.map(tableToGroup) : null), [query.data] @@ -623,15 +670,18 @@ export default function OxqlPage() {
form.handleSubmit(onSubmit)()} schemas={schemas.data?.items} /> - {fieldState.error?.message && ( + {fieldState.error?.message ? ( {fieldState.error.message} - )} + ) : query.error ? ( + + ) : null}
Examples @@ -655,7 +705,9 @@ export default function OxqlPage() {
{match(query) - .with({ status: 'idle' }, () => ( + // on error the message renders below the editor, so the results + // section just shows the same empty chart as the idle state + .with({ status: 'idle' }, { status: 'error' }, () => ( {/* the loading skeleton, minus the shimmer and bouncing indicator */} @@ -677,27 +729,16 @@ export default function OxqlPage() { )) - .with({ status: 'error' }, (q) => ( - - {q.error.message}} - /> - - )) .with({ status: 'success' }, () => ( {hasTrimmableCharts && (
- +
)}
diff --git a/app/ui/lib/InlineCode.tsx b/app/ui/lib/InlineCode.tsx index 4d6d28649..97394b314 100644 --- a/app/ui/lib/InlineCode.tsx +++ b/app/ui/lib/InlineCode.tsx @@ -9,3 +9,4 @@ import { classed } from '~/util/classed' export const InlineCode = classed.code`whitespace-nowrap rounded-sm px-[3px] py-px text-mono-sm normal-case! bg-raise border border-secondary mx-px` +export const ErrorInlineCode = classed.code`inline-code font-mono whitespace-nowrap` diff --git a/app/ui/styles/index.css b/app/ui/styles/index.css index 521e87a6c..282b13f82 100644 --- a/app/ui/styles/index.css +++ b/app/ui/styles/index.css @@ -105,6 +105,19 @@ margin-right: var(--content-gutter); } +/* Inline code chip that takes its tint from the surrounding text color, so it + works on any background (e.g., inside an error message) */ +@utility inline-code { + font-size: 0.825em; + letter-spacing: 0; + vertical-align: 1px; + margin: 0 1px; + padding: 0 0.125rem; + background-color: color-mix(in srgb, currentColor 8%, transparent); + border: 1px solid color-mix(in srgb, currentColor 10%, transparent); + border-radius: var(--radius-md); +} + @utility link-with-underline { @apply text-raise; text-decoration: underline; diff --git a/mock-api/msw/util.ts b/mock-api/msw/util.ts index 1be94c53a..51d1e475d 100644 --- a/mock-api/msw/util.ts +++ b/mock-api/msw/util.ts @@ -596,7 +596,8 @@ const getVibe = (query: string): OxqlVibe => { const [firstTable, ...moreTables] = [...query.matchAll(/get ([a-z_]+:[a-z_]+)/g)].map( (m) => m[1] as OxqlMetricName ) - if (!firstTable) throw new Error(`no "get " found in query: ${query}`) + // a query with no `get` can't parse, and the caret goes at the very start + if (!firstTable) throw fmtOxqlParseError(query, 0, 'one of "get", "{"') const alignment = query.match(/\bjoin\b/) ? 'joined' @@ -675,7 +676,43 @@ function getMultipleTables(vibe: OxqlVibe) { .exhaustive() } +/** + * Faithful port of omicron's `fmt_parse_error` so the mock's OxQL parse errors + * look exactly like real ones: an `Error at :` header with a + * context excerpt, a caret line pointing at the failure, and an `Expected:` + * line (whose peg Display repeats the position). Thrown as a string so the + * handler wrapper turns it into a 400 like Nexus's `invalid_request`. + * https://github.com/oxidecomputer/omicron/blob/6db4c7e/oximeter/db/src/oxql/mod.rs + */ +export function fmtOxqlParseError(source: string, offset: number, expected: string) { + const before = source.slice(0, offset) + const line = before.split('\n').length + const column = offset - before.lastIndexOf('\n') + let out = `Error at ${line}:${column}` + const context = 24 + const start = Math.max(0, offset - context) + const end = Math.min(source.length, offset + context) + const prefixLen = out.length + 2 + out += `: .. ${source.slice(start, end)} ..\n` + const leftPad = offset - start + 3 + prefixLen + const rightPad = end - offset + 3 + prefixLen + out += `${' '.repeat(leftPad)}^${' '.repeat(rightPad)}\n` + out += `Expected: error at ${line}:${column}: expected ${expected}\n` + return out +} + export function handleOxqlMetrics({ query }: TimeseriesQuery): Json { + // Sentinel for exercising the console's parse error handling: `oops` + // anywhere in a query fails with a realistic parse error pointing at it + const oops = query.indexOf('oops') + if (oops !== -1) { + throw fmtOxqlParseError( + query, + oops, + 'one of "align", "filter", "first", "get", "group_by", "join", "last"' + ) + } + const vibe = getVibe(query) if (vibe.moreTables.length > 0) return getMultipleTables(vibe) diff --git a/package-lock.json b/package-lock.json index fd8f055bc..2e514b1ac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "@codemirror/autocomplete": "^6.20.3", "@codemirror/commands": "^6.11.0", "@codemirror/language": "^6.12.4", + "@codemirror/lint": "^6.9.7", "@codemirror/state": "^6.7.1", "@codemirror/view": "^6.43.9", "@floating-ui/react": "^0.26.23", @@ -425,6 +426,17 @@ "style-mod": "^4.0.0" } }, + "node_modules/@codemirror/lint": { + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.9.7.tgz", + "integrity": "sha512-28/+iWLYxKxsvGYhSYL7zaCZqLz5+FFFDq9tVsvGv9kv8RY4fFAchJ5WX9M3YrrRlTIsECjsXPqeNgnSmNP2dg==", + "license": "MIT", + "dependencies": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.42.0", + "crelt": "^1.0.5" + } + }, "node_modules/@codemirror/state": { "version": "6.7.1", "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.7.1.tgz", diff --git a/package.json b/package.json index 1ef55c931..c3a97ccbb 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "@codemirror/autocomplete": "^6.20.3", "@codemirror/commands": "^6.11.0", "@codemirror/language": "^6.12.4", + "@codemirror/lint": "^6.9.7", "@codemirror/state": "^6.7.1", "@codemirror/view": "^6.43.9", "@floating-ui/react": "^0.26.23", diff --git a/test/e2e/oxql.e2e.ts b/test/e2e/oxql.e2e.ts index 6fdc4db45..799f15bcd 100644 --- a/test/e2e/oxql.e2e.ts +++ b/test/e2e/oxql.e2e.ts @@ -18,7 +18,7 @@ const runQuery = async (page: Page, query?: string) => { const loading = page.getByLabel('Chart loading') await expect(loading).toBeVisible() await expect(loading).toBeHidden() - await expect(page.getByText('Query failed')).toBeHidden() + await expect(page.getByRole('alert')).toBeHidden() } test.beforeEach(async ({ page }) => { @@ -204,13 +204,41 @@ test('empty query is blocked by client-side validation', async ({ page }) => { test('a query the backend rejects surfaces an error instead of a chart', async ({ page, }) => { - await page.getByRole('textbox').fill('junk junk junk!') + const textbox = page.getByRole('textbox') + await textbox.fill('junk junk junk!') await page.getByRole('button', { name: 'Run query' }).click() - await expect(page.getByText('Query failed')).toBeVisible() + // the server's parse error is shown below the editor, minus the caret + // line, which assumes a monospace terminal + const error = page.getByRole('alert') + await expect(error).toContainText('Error at 1:1') + await expect(error).toContainText('Expected: error at 1:1') + await expect(error).not.toContainText('^') + // and the editor border turns red + await expect(textbox).toHaveAttribute('aria-invalid', 'true') await expect(page.getByRole('figure')).toHaveCount(0) }) +test('parse errors underline the offending spot in the editor', async ({ page }) => { + const textbox = page.getByRole('textbox') + await textbox.fill('get sled_data_link:bytes_sent | oops') + await page.getByRole('button', { name: 'Run query' }).click() + + await expect(page.getByRole('alert')).toBeVisible() + + // CM lint underlines have no semantic representation, so target the class + const underlined = page.locator('.cm-lintRange-error') + await expect(underlined).toHaveText('oops') + // guard against the underline existing but not rendering: the lint default + // is a data: URI background image, which our CSP blocks, so we draw a CSS + // underline instead + await expect(underlined).toHaveCSS('text-decoration-line', 'underline') + + // editing the query invalidates the position, clearing the underline + await textbox.pressSequentially('x') + await expect(underlined).toBeHidden() +}) + test('pages reads the initial query from the URL', async ({ page }) => { await page.goto( `/system/metrics-explorer?query=${encodeURIComponent(oxqlQueries.basicTctl)}` From 5b3901feb2912c54b9cee2ca67844eb2168e15ad Mon Sep 17 00:00:00 2001 From: benjaminleonard Date: Mon, 24 Aug 2026 18:38:53 +0100 Subject: [PATCH 04/46] Cleanup --- app/components/OxqlEditor.tsx | 204 ++++++----------------- app/ui/styles/components/oxql-editor.css | 115 +++++++++++++ app/ui/styles/index.css | 3 + package-lock.json | 176 ++++++++++++++++--- package.json | 3 +- test/e2e/oxql.e2e.ts | 8 +- 6 files changed, 321 insertions(+), 188 deletions(-) create mode 100644 app/ui/styles/components/oxql-editor.css diff --git a/app/components/OxqlEditor.tsx b/app/components/OxqlEditor.tsx index 7c0f6e1e3..b058d4c61 100644 --- a/app/components/OxqlEditor.tsx +++ b/app/components/OxqlEditor.tsx @@ -7,8 +7,13 @@ */ import { defaultKeymap, history, historyKeymap, indentWithTab } from '@codemirror/commands' import { bracketMatching } from '@codemirror/language' -import { setDiagnostics, type Diagnostic } from '@codemirror/lint' -import { Compartment, RangeSetBuilder, type Text } from '@codemirror/state' +import { + Compartment, + RangeSetBuilder, + StateEffect, + StateField, + type Text, +} from '@codemirror/state' import { Decoration, EditorView, @@ -21,77 +26,17 @@ import { } from '@codemirror/view' import cn from 'classnames' import { useEffect, useRef } from 'react' -import { - createHighlighterCoreSync, - type LanguageRegistration, - type ThemeRegistrationAny, -} from 'shiki/core' +import { createHighlighterCoreSync } from 'shiki/core' import { createJavaScriptRegexEngine } from 'shiki/engine/javascript' import type { TimeseriesSchema } from '@oxide/api' +import { oxideTheme, oxqlGrammar } from '@oxide/design-system/syntax' import { oxqlAutocomplete } from '~/components/oxql-autocomplete' import type { OxqlDiagnostic } from '~/components/oxql-error' -// OxQL grammar copied from the design system so we can highlight queries -// without pulling in its full asciidoc bundle. One addition over the source: -// single-quoted strings, which OxQL supports and our examples use. -// https://github.com/oxidecomputer/design-system/blob/main/components/src/asciidoc/langs/oxql.tmLanguage.json -const oxqlGrammar = { - name: 'oxql', - scopeName: 'source.oxql', - repository: {}, - patterns: [ - { name: 'keyword.control.oxql', match: '\\b(get|join|align|filter|group_by)\\b' }, - { - name: 'string.quoted.double.oxql', - begin: '"', - end: '"', - patterns: [{ name: 'constant.character.escape.oxql', match: '\\\\.' }], - }, - { - name: 'string.quoted.single.oxql', - begin: "'", - end: "'", - patterns: [{ name: 'constant.character.escape.oxql', match: '\\\\.' }], - }, - { name: 'constant.numeric.oxql', match: '\\b\\d+[smhdw]\\b' }, - { - name: 'constant.numeric.datetime.oxql', - match: '@\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}', - }, - { name: 'constant.numeric.function.oxql', match: '@now\\(\\)' }, - { name: 'constant.numeric.oxql', match: '\\b\\d+\\b' }, - { name: 'comment.block.oxql', begin: '/\\*', end: '\\*/' }, - { name: 'comment.line.double-slash.oxql', match: '//.*$' }, - { name: 'keyword.operator.oxql', match: '\\|' }, - ], -} satisfies LanguageRegistration - -// Subset of the design system's Oxide syntax theme covering the scopes the -// OxQL grammar emits. The --syntax-* vars come from the design system -// stylesheets already imported in app/ui/styles/index.css, so this follows -// the current theme automatically. -// https://github.com/oxidecomputer/design-system/blob/main/components/src/asciidoc/oxide-syntax.json -const oxideTheme = { - name: 'oxide', - colors: { - 'editor.background': 'transparent', - 'editor.foreground': 'var(--syntax-fg)', - }, - tokenColors: [ - { scope: ['comment'], settings: { foreground: 'var(--syntax-comment)' } }, - { scope: ['string'], settings: { foreground: 'var(--syntax-string)' } }, - { - scope: ['constant.character.escape'], - settings: { foreground: 'var(--syntax-escape)' }, - }, - { scope: ['constant.numeric'], settings: { foreground: 'var(--syntax-number)' } }, - { scope: ['keyword'], settings: { foreground: 'var(--syntax-keyword)' } }, - { scope: ['keyword.operator'], settings: { foreground: 'var(--syntax-operator)' } }, - ], -} satisfies ThemeRegistrationAny - +// the --syntax-* vars in the theme come from the design system stylesheets +// already imported in app/ui/styles/index.css, so colors follow the theme const highlighter = createHighlighterCoreSync({ langs: [oxqlGrammar], themes: [oxideTheme], @@ -109,7 +54,7 @@ const buildDecorations = (view: EditorView): DecorationSet => { let pos = 0 for (const line of highlighter.codeToTokensBase(code, { lang: 'oxql', - theme: 'oxide', + theme: oxideTheme.name, })) { for (const token of line) { const end = pos + token.content.length @@ -141,88 +86,10 @@ const shikiPlugin = ViewPlugin.fromClass( { decorations: (v) => v.decorations } ) -// Ported from the editor theme in mitos (app/components/code-editor.tsx), -// with its hardcoded dark-palette hexes swapped for the equivalent design -// system vars so light mode works too. Text selection is native, so the -// console's global ::selection style applies without any theming here. The -// font comes from the wrapper (text-mono-code), hence the `inherit`s. -const cmTheme = EditorView.theme({ - '&': { - backgroundColor: 'var(--syntax-bg)', - color: 'var(--syntax-fg)', - // fixed height of ~6 lines; longer queries scroll inside the editor - height: '7.5rem', - }, - // CM's base theme hardcodes font-family: monospace here; inherit the - // wrapper's font (text-mono-code) instead - '.cm-scroller': { overflow: 'auto', fontFamily: 'inherit' }, - // the wrapper carries the focus ring (focus-within), so hide CM's own outline - '&.cm-focused': { outline: 'none' }, - '.cm-content': { - fontFamily: 'inherit', - padding: '10px 0', - caretColor: 'var(--syntax-fg)', - }, - '.cm-line': { padding: '0 12px' }, - '.cm-cursor, .cm-dropCursor': { borderLeftColor: 'var(--syntax-fg)' }, - '.cm-activeLine': { backgroundColor: 'var(--surface-secondary)' }, - '.cm-matchingBracket, .cm-nonmatchingBracket': { - backgroundColor: 'var(--surface-hover)', - outline: 'none', - }, - '.cm-matchingBracket': { color: 'var(--syntax-fg)' }, - '.cm-nonmatchingBracket': { color: 'var(--content-destructive)' }, - // completion popup. fontFamily inherits mono from the wrapper because the - // tooltip renders inside the editor element - '.cm-tooltip': { - backgroundColor: 'var(--surface-raise)', - border: '1px solid var(--stroke-secondary)', - borderRadius: '0.125rem', - overflow: 'hidden', - fontFamily: 'inherit', - }, - // the autocomplete base theme hardcodes font-family: monospace on the list - '.cm-tooltip.cm-tooltip-autocomplete > ul': { fontFamily: 'inherit' }, - '.cm-tooltip.cm-tooltip-autocomplete > ul > li': { padding: '2px 8px' }, - '.cm-tooltip.cm-tooltip-autocomplete > ul > li[aria-selected]': { - backgroundColor: 'var(--surface-hover)', - color: 'inherit', - }, - '.cm-completionMatchedText': { - textDecoration: 'none', - color: 'var(--content-accent-secondary)', - }, - '.cm-completionDetail': { - color: 'var(--content-quaternary)', - fontStyle: 'normal', - marginLeft: '1rem', - }, - '.cm-tooltip.cm-completionInfo': { padding: '4px 8px', maxWidth: '22rem' }, - // the lint extension draws its underline as a data: URI background image, - // which our Content-Security-Policy blocks. Use a plain CSS wavy underline - '.cm-lintRange-error': { - backgroundImage: 'none', - textDecoration: 'underline wavy var(--content-destructive)', - textDecorationSkipInk: 'none', - textUnderlineOffset: '3px', - }, - // hover tooltip for the diagnostic; the border color default is a hardcoded red - '.cm-tooltip .cm-diagnostic-error': { - borderLeftColor: 'var(--content-destructive)', - }, - // match the placeholder color of the regular text inputs - '.cm-placeholder': { color: 'var(--content-tertiary)' }, - // placeholder region of an accepted snippet, e.g. mean_within(period) - '.cm-snippetField': { backgroundColor: 'var(--surface-secondary)' }, -}) - -// Convert a 1-based line:column server error position into a CodeMirror -// diagnostic covering the offending token. Positions are clamped so a stale -// or out-of-range position can't crash the editor. -const toCmDiagnostic = ( - doc: Text, - { line, column, message }: OxqlDiagnostic -): Diagnostic => { +// Convert a 1-based line:column server error position into an editor range +// covering the offending token. Positions are clamped so a stale or +// out-of-range position can't crash the editor. +const toErrorRange = (doc: Text, { line, column }: OxqlDiagnostic) => { const lineInfo = doc.line(Math.max(1, Math.min(line, doc.lines))) let from = Math.min(lineInfo.from + column - 1, lineInfo.to) // underline through the end of the token under the caret, or one char minimum @@ -230,9 +97,34 @@ const toCmDiagnostic = ( const to = Math.min(from + (token?.[0].length || 1), lineInfo.to) // at end of line there's nothing after the caret, so underline the char before if (from === to) from = Math.max(lineInfo.from, to - 1) - return { from, to, severity: 'error', message } + // mark decorations may not be empty, so an empty line gets no underline + return from < to ? { from, to } : null } +const errorMark = Decoration.mark({ class: 'oxql-error-underline' }) + +const setErrorRange = StateEffect.define<{ from: number; to: number } | null>() + +// Underline the position a server-side parse error points at. The error +// message itself is shown below the editor, so no lint tooltip is needed. +// A StateField (rather than a plain decoration facet) so the range remaps +// when the user edits elsewhere in the doc. +const errorRangeField = StateField.define({ + create: () => Decoration.none, + update(deco, tr) { + let mapped = deco.map(tr.changes) + for (const effect of tr.effects) { + if (effect.is(setErrorRange)) { + mapped = effect.value + ? Decoration.set([errorMark.range(effect.value.from, effect.value.to)]) + : Decoration.none + } + } + return mapped + }, + provide: (f) => EditorView.decorations.from(f), +}) + const contentAttrs = (ariaLabel: string, error: boolean) => EditorView.contentAttributes.of({ 'aria-label': ariaLabel, @@ -301,7 +193,7 @@ export function OxqlEditor({ bracketMatching(), oxqlAutocomplete(() => schemasRef.current ?? []), shikiPlugin, - cmTheme, + errorRangeField, attrsCompartment.current.of(contentAttrs(ariaLabel, error)), EditorView.updateListener.of((update) => { if (update.docChanged) callbacks.current.onChange(update.state.doc.toString()) @@ -328,21 +220,19 @@ export function OxqlEditor({ }) }, [ariaLabel, error]) - // underline the position a server-side parse error points at. setDiagnostics - // pulls in the lint state on demand, so no linter extension is needed above useEffect(() => { const view = viewRef.current if (!view) return - const diags = diagnostic ? [toCmDiagnostic(view.state.doc, diagnostic)] : [] - view.dispatch(setDiagnostics(view.state, diags)) + const range = diagnostic ? toErrorRange(view.state.doc, diagnostic) : null + view.dispatch({ effects: setErrorRange.of(range) }) }, [diagnostic]) return (
tags at mount time. The doubled .cm-editor + * keeps every rule here above that. + */ + +.oxql-editor .cm-editor.cm-editor { + background-color: var(--syntax-bg); + color: var(--syntax-fg); + height: 7.5rem; + + &.cm-focused { + outline: none; + } + + .cm-scroller { + overflow: auto; + font-family: inherit; + } + + .cm-content { + font-family: inherit; + padding: 10px 0; + caret-color: var(--syntax-fg); + } + + .cm-line { + padding: 0 12px; + } + + .cm-cursor, + .cm-dropCursor { + border-left-color: var(--syntax-fg); + } + + .cm-activeLine { + background-color: var(--surface-secondary); + } + + .cm-matchingBracket, + .cm-nonmatchingBracket { + background-color: var(--surface-hover); + outline: none; + } + + .cm-matchingBracket { + color: var(--syntax-fg); + } + + .cm-nonmatchingBracket { + color: var(--content-destructive); + } + + .cm-tooltip { + background-color: var(--surface-raise); + border: 1px solid var(--stroke-secondary); + border-radius: 0.125rem; + overflow: hidden; + font-family: inherit; + } + + .cm-tooltip.cm-tooltip-autocomplete > ul { + font-family: inherit; + } + + .cm-tooltip.cm-tooltip-autocomplete > ul > li { + padding: 2px 8px; + } + + .cm-tooltip.cm-tooltip-autocomplete > ul > li[aria-selected] { + background-color: var(--surface-hover); + color: inherit; + } + + .cm-completionMatchedText { + text-decoration: none; + color: var(--content-accent-secondary); + } + + .cm-completionDetail { + color: var(--content-quaternary); + font-style: normal; + margin-left: 1rem; + } + + .cm-tooltip.cm-completionInfo { + padding: 4px 8px; + max-width: 22rem; + } + + /* wavy underline under the token a server-side parse error points at */ + .oxql-error-underline { + text-decoration: underline wavy var(--content-destructive); + text-decoration-skip-ink: none; + text-underline-offset: 3px; + } + + /* match the placeholder color of the regular text inputs */ + .cm-placeholder { + color: var(--content-tertiary); + } + + /* placeholder region of an accepted snippet, e.g. mean_within(period) */ + .cm-snippetField { + background-color: var(--surface-secondary); + } +} diff --git a/app/ui/styles/index.css b/app/ui/styles/index.css index 282b13f82..26f652468 100644 --- a/app/ui/styles/index.css +++ b/app/ui/styles/index.css @@ -52,6 +52,9 @@ /* layer(components) on this one results in visual changes, holding off for now */ @import './components/table.css'; +/* deliberately unlayered: must beat CodeMirror's injected unlayered styles */ +@import './components/oxql-editor.css'; + @import '@xterm/xterm/css/xterm.css' layer(components); @source '../../../node_modules/@oxide/design-system/dist'; @custom-variant light (&:where([data-theme=light], [data-theme=light] *)); diff --git a/package-lock.json b/package-lock.json index 2e514b1ac..66afddd3f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,12 +14,11 @@ "@codemirror/autocomplete": "^6.20.3", "@codemirror/commands": "^6.11.0", "@codemirror/language": "^6.12.4", - "@codemirror/lint": "^6.9.7", "@codemirror/state": "^6.7.1", "@codemirror/view": "^6.43.9", "@floating-ui/react": "^0.26.23", "@headlessui/react": "^2.2.9", - "@oxide/design-system": "^6.3.0", + "@oxide/design-system": "^6.5.4-canary.fb43c60", "@peculiar/x509": "^1.12.3", "@react-aria/live-announcer": "^3.3.4", "@tailwindcss/container-queries": "^0.1.1", @@ -426,17 +425,6 @@ "style-mod": "^4.0.0" } }, - "node_modules/@codemirror/lint": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.9.7.tgz", - "integrity": "sha512-28/+iWLYxKxsvGYhSYL7zaCZqLz5+FFFDq9tVsvGv9kv8RY4fFAchJ5WX9M3YrrRlTIsECjsXPqeNgnSmNP2dg==", - "license": "MIT", - "dependencies": { - "@codemirror/state": "^6.0.0", - "@codemirror/view": "^6.42.0", - "crelt": "^1.0.5" - } - }, "node_modules/@codemirror/state": { "version": "6.7.1", "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.7.1.tgz", @@ -1670,9 +1658,9 @@ } }, "node_modules/@oxide/design-system": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/@oxide/design-system/-/design-system-6.3.0.tgz", - "integrity": "sha512-AX3zviv4RuH6AKZkETGMqLnqVucNRSPaAw4zVMqYzJdhDfQUqJUljJsQA7jqWnSWn7BK9T0gvEKrrL7+jrtX4w==", + "version": "6.5.4-canary.fb43c60", + "resolved": "https://registry.npmjs.org/@oxide/design-system/-/design-system-6.5.4-canary.fb43c60.tgz", + "integrity": "sha512-EnvsgFfoooyULVJBptdHb4nt3MEXcvJPZuTgycZlzclHi0aUP7X10/eyjMyF5aFaZazxztKilwY8Y2FZuuX7xw==", "license": "MPL 2.0", "dependencies": { "@floating-ui/react": "^0.27.16", @@ -1681,11 +1669,11 @@ "@radix-ui/react-tabs": "^1.1.13", "classnames": "^2.5.1", "prettier-plugin-tailwindcss": "^0.6.14", - "shiki": "^3.13.0" + "shiki": "^4.4.3" }, "peerDependencies": { "@asciidoctor/core": "^3.0.0", - "@oxide/react-asciidoc": "^1.3.0", + "@oxide/react-asciidoc": "^2.1.1", "react": ">=18.0.0", "react-dom": ">=18.0.0" } @@ -1705,6 +1693,105 @@ "react-dom": ">=17.0.0" } }, + "node_modules/@oxide/design-system/node_modules/@shikijs/core": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-4.4.3.tgz", + "integrity": "sha512-QCR4q2ZO/ILJEuwiBMel4wdcTDb1JGwfjKTxPDF6x8ixOaluPrVqIn06C99AcRPhmYlBR56d/Fb+GN58GzExpg==", + "license": "MIT", + "dependencies": { + "@shikijs/primitive": "4.4.3", + "@shikijs/types": "4.4.3", + "@shikijs/vscode-textmate": "^10.0.2", + "@types/hast": "^3.0.5", + "hast-util-to-html": "^9.0.5" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@oxide/design-system/node_modules/@shikijs/engine-javascript": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-4.4.3.tgz", + "integrity": "sha512-FbOjFJp9VLdo1Wevs10BBtVxiTWwNLqZh5Gkhjgda/ioL15YOgeSl9n+6XMa3qRlPQzfhFNe641SrynFHYG0nQ==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "4.4.3", + "@shikijs/vscode-textmate": "^10.0.2", + "oniguruma-to-es": "^4.3.6" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@oxide/design-system/node_modules/@shikijs/engine-oniguruma": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-4.4.3.tgz", + "integrity": "sha512-EcOQkxdxGQrc1Row/cC2c96/v1dbZqGnEVu1qTuT/MJmp6+cXCvQussowVmCv5Tqr3KuY3c7IbM6HTW3LJ1k9w==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "4.4.3", + "@shikijs/vscode-textmate": "^10.0.2" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@oxide/design-system/node_modules/@shikijs/langs": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-4.4.3.tgz", + "integrity": "sha512-ePic0yfAJGOF83D5wBHK/00EjK65oahBYxFk5epgq33WRv7X9UuxLEV8PtR0szC0z8dl7INIpIodB99JRFlR+A==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "4.4.3" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@oxide/design-system/node_modules/@shikijs/themes": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-4.4.3.tgz", + "integrity": "sha512-w8UHjeUnIR965KMWJHUPXOc2mNJUnK3vpVLYLvw5IYU2mnTTJ89E24OrJDBNiJDQ0qzb0tc4l7mrIXx5cFeIyw==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "4.4.3" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@oxide/design-system/node_modules/@shikijs/types": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-4.4.3.tgz", + "integrity": "sha512-UEJxmRR++MAGR6hugn0vgVS2W/6lWAts84FFSrnlH9sP0LNol7E5+NQ792pH8liWUhyMyjhTgSUH3k7iD7tc5g==", + "license": "MIT", + "dependencies": { + "@shikijs/vscode-textmate": "^10.0.2", + "@types/hast": "^3.0.5" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@oxide/design-system/node_modules/shiki": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-4.4.3.tgz", + "integrity": "sha512-Mb/GvXPHBAXdgGIcnfU5L3ldpn1XcxrGkPHwqgRx17/I2XRfqlFKk2vGkHWINn1kdXvzJZeuO3is6I9KLPFm0g==", + "license": "MIT", + "dependencies": { + "@shikijs/core": "4.4.3", + "@shikijs/engine-javascript": "4.4.3", + "@shikijs/engine-oniguruma": "4.4.3", + "@shikijs/langs": "4.4.3", + "@shikijs/themes": "4.4.3", + "@shikijs/types": "4.4.3", + "@shikijs/vscode-textmate": "^10.0.2", + "@types/hast": "^3.0.5" + }, + "engines": { + "node": ">=20" + } + }, "node_modules/@oxide/openapi-gen-ts": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/@oxide/openapi-gen-ts/-/openapi-gen-ts-0.14.0.tgz", @@ -1741,12 +1828,13 @@ } }, "node_modules/@oxide/react-asciidoc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@oxide/react-asciidoc/-/react-asciidoc-1.3.0.tgz", - "integrity": "sha512-0QNKE03z3nh82AjmJD7Gx7uxpEa0Io4bb/3Zlqh7b87c6iyQ99nV1bdiIel/Ja7FfSdC/qqIfmcedxutvKuD7Q==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@oxide/react-asciidoc/-/react-asciidoc-2.2.1.tgz", + "integrity": "sha512-X8DDHIxY/13GlxaoVxXg/hypzd3vT8IcU6MohPKA1hw7Dxyx0WdeFVlKLtDqWGNI8ld+wyaJpWscIx7chELQzQ==", "license": "MPL 2.0", "peer": true, "dependencies": { + "entities": "^6.0.1", "html-react-parser": "^5.2.6" }, "peerDependencies": { @@ -5138,6 +5226,33 @@ "@shikijs/types": "3.23.0" } }, + "node_modules/@shikijs/primitive": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/@shikijs/primitive/-/primitive-4.4.3.tgz", + "integrity": "sha512-m0wBeLDQDeIxRdUmrCPdQqfuUamDwRL5isCfYbguKD6NiaKpVbsv+3J81DyIKgNW5h4WAIIr8T4EkgQrBBxvaQ==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "4.4.3", + "@shikijs/vscode-textmate": "^10.0.2", + "@types/hast": "^3.0.5" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@shikijs/primitive/node_modules/@shikijs/types": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-4.4.3.tgz", + "integrity": "sha512-UEJxmRR++MAGR6hugn0vgVS2W/6lWAts84FFSrnlH9sP0LNol7E5+NQ792pH8liWUhyMyjhTgSUH3k7iD7tc5g==", + "license": "MIT", + "dependencies": { + "@shikijs/vscode-textmate": "^10.0.2", + "@types/hast": "^3.0.5" + }, + "engines": { + "node": ">=20" + } + }, "node_modules/@shikijs/themes": { "version": "3.23.0", "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-3.23.0.tgz", @@ -7429,6 +7544,19 @@ "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" } }, + "node_modules/dom-serializer/node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "license": "BSD-2-Clause", + "peer": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/domelementtype": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", @@ -7526,9 +7654,9 @@ } }, "node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", + "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", "license": "BSD-2-Clause", "peer": true, "engines": { diff --git a/package.json b/package.json index c3a97ccbb..5801cc708 100644 --- a/package.json +++ b/package.json @@ -39,12 +39,11 @@ "@codemirror/autocomplete": "^6.20.3", "@codemirror/commands": "^6.11.0", "@codemirror/language": "^6.12.4", - "@codemirror/lint": "^6.9.7", "@codemirror/state": "^6.7.1", "@codemirror/view": "^6.43.9", "@floating-ui/react": "^0.26.23", "@headlessui/react": "^2.2.9", - "@oxide/design-system": "^6.3.0", + "@oxide/design-system": "^6.5.4-canary.fb43c60", "@peculiar/x509": "^1.12.3", "@react-aria/live-announcer": "^3.3.4", "@tailwindcss/container-queries": "^0.1.1", diff --git a/test/e2e/oxql.e2e.ts b/test/e2e/oxql.e2e.ts index 799f15bcd..d78f28d24 100644 --- a/test/e2e/oxql.e2e.ts +++ b/test/e2e/oxql.e2e.ts @@ -226,12 +226,10 @@ test('parse errors underline the offending spot in the editor', async ({ page }) await expect(page.getByRole('alert')).toBeVisible() - // CM lint underlines have no semantic representation, so target the class - const underlined = page.locator('.cm-lintRange-error') + // the error underline has no semantic representation, so target the class + const underlined = page.locator('.oxql-error-underline') await expect(underlined).toHaveText('oops') - // guard against the underline existing but not rendering: the lint default - // is a data: URI background image, which our CSP blocks, so we draw a CSS - // underline instead + // guard against the mark existing but the CSS not applying await expect(underlined).toHaveCSS('text-decoration-line', 'underline') // editing the query invalidates the position, clearing the underline From 587341f3ca068d204b41691e199830c71417d566 Mon Sep 17 00:00:00 2001 From: benjaminleonard Date: Mon, 24 Aug 2026 22:14:38 +0100 Subject: [PATCH 05/46] Trimming and tweaking --- app/components/TimeSeriesChart.tsx | 12 +-- app/components/oxql-error.spec.ts | 65 +++++++++++++- app/components/oxql-error.ts | 18 +++- app/pages/system/OxqlPage.tsx | 109 ++++++++++++++++++++--- app/ui/styles/components/oxql-editor.css | 3 + test/e2e/oxql.e2e.ts | 57 +++--------- test/visual/regression.e2e.ts | 18 ++-- 7 files changed, 206 insertions(+), 76 deletions(-) diff --git a/app/components/TimeSeriesChart.tsx b/app/components/TimeSeriesChart.tsx index e11a16965..661163eb5 100644 --- a/app/components/TimeSeriesChart.tsx +++ b/app/components/TimeSeriesChart.tsx @@ -186,7 +186,7 @@ export const SkeletonMetric = ({ className )} > -
+
{[...Array(4)].map((_e, i) => (
))} @@ -197,7 +197,7 @@ export const SkeletonMetric = ({ ))}
-
+
{children}
@@ -576,7 +576,7 @@ export const ChartContainer = classed.div`flex w-full grow flex-col rounded-lg b type ChartHeaderProps = { title: string label: string - description?: string + description?: ReactNode children?: ReactNode } @@ -585,7 +585,7 @@ export function ChartHeader({ title, label, description, children }: ChartHeader

-
{title}
+
{title}
{label}

{description}
@@ -613,9 +613,9 @@ function ChartLegend({ theme: ChartTheme }) { return ( -
    +
      {Array.from({ length: count }, (_, i) => ( -
    • +
    • { + expect(stripCaretLine('Error at 1:5: .. x ..\n ^')).toEqual('Error at 1:5: .. x ..') + }) +}) + +describe('codeSegment', () => { + // odd indices are the code segments + const split = (message: string) => message.split(codeSegment) + + it('splits out excerpt markers, quoted tokens, and backticked names', () => { + expect(split('Error at 1:1: .. junk junk! ..\nExpected: one of "get", "{"')).toEqual([ + 'Error at 1:1: ', + '.. junk junk! ..', + '\nExpected: one of ', + '"get"', + ', ', + '"{"', + '', + ]) + expect(split('Input tables to a `group_by` must be aligned')).toEqual([ + 'Input tables to a ', + '`group_by`', + ' must be aligned', + ]) + }) + + it('keeps a filter expression with nested quotes in one segment', () => { + // omicron interpolates the raw expression, so quotes inside it are unescaped + expect(split('The filter expression "kind == "power"" is not valid, because')).toEqual([ + 'The filter expression ', + '"kind == "power""', + ' is not valid, because', + ]) + // nested quotes mid-expression, where the inner closing quote is followed + // by a delimiter and could be mistaken for the end of the segment + expect( + split('The filter expression "kind == "power" && sled == 1" is not valid, because') + ).toEqual([ + 'The filter expression ', + '"kind == "power" && sled == 1"', + ' is not valid, because', + ]) + }) + + it('splits identifier lists into one segment per name', () => { + expect( + split('Invalid identifiers: ["chassis_kind"], valid: ["datum", "peer"]') + ).toEqual([ + 'Invalid identifiers: [', + '"chassis_kind"', + '], valid: [', + '"datum"', + ', ', + '"peer"', + ']', + ]) + }) + + it('leaves unbalanced quotes alone', () => { + const message = 'something with a stray " quote' + expect(split(message)).toEqual([message]) + }) }) diff --git a/app/components/oxql-error.ts b/app/components/oxql-error.ts index e615f2be1..dd812a2c9 100644 --- a/app/components/oxql-error.ts +++ b/app/components/oxql-error.ts @@ -18,7 +18,23 @@ export type OxqlDiagnostic = { * assumes a monospace terminal, and the editor underline already points at * the position. */ -export const stripCaretLine = (message: string) => message.replace(/\n *\^ *(?=\n)/, '') +export const stripCaretLine = (message: string) => message.replace(/\n *\^ *(?=\n|$)/, '') + +/** + * Split pattern for the code-ish parts of an error message: the query excerpt + * between fmt_parse_error's `..` markers, peg's double-quoted expected tokens, + * and the backtick- or double-quoted names in semantic errors. Used with + * `String.split`, so the capture group puts code segments at odd indices. + * + * Quoted filter expressions can contain unescaped nested quotes (omicron + * interpolates the raw expression, e.g. `The filter expression "kind == + * "power"" is not valid`), so that known frame gets a greedy context-anchored + * alternative, and elsewhere a quote only closes a segment when followed by a + * delimiter rather than a word char or another quote. + * https://github.com/oxidecomputer/omicron/blob/6db4c7e/oximeter/db/src/oxql/plan/filter.rs + */ +export const codeSegment = + /(\.\. [\s\S]*? \.\.|(?<=The filter expression )"[^\n]*"(?= is not valid)|(? = { name: string - description?: string + description?: ReactNode timestamps: number[] data: Data } @@ -185,9 +189,68 @@ type ChartGroup = const getFormattedFields = (t: Timeseries): string => Object.entries(t.fields) - // hello my evil friend. .map(([fieldName, x]) => `${camelToSnake(fieldName)}: ${x.value}`) - .join(' \u2022 ') + .join(' / ') + +const FIELDS_SHOWN = 5 +// long enough for names/serials; a UUID (36 chars) gets middle-truncated +const FIELD_VALUE_MAX_LEN = 24 + +const FieldBadge = ({ fieldName, value }: { fieldName: string; value: string }) => { + const truncated = value.length > FIELD_VALUE_MAX_LEN + const badge = ( + + {camelToSnake(fieldName)} + + {truncated ? truncate(value, FIELD_VALUE_MAX_LEN, 'middle') : value} + + + ) + if (!truncated) return badge + return ( + + {/* Badge doesn't take a ref, so the tooltip needs a host element target */} + {badge} + + ) +} + +// JSX version of getFormattedFields for chart descriptions: each field is a +// badge, capped at FIELDS_SHOWN with a +N tooltip listing the rest +const FieldsList = ({ timeseries }: { timeseries: Timeseries }) => { + const fields = Object.entries(timeseries.fields) + const overflow = fields.slice(FIELDS_SHOWN) + return ( +
      + {fields.slice(0, FIELDS_SHOWN).map(([fieldName, x]) => ( + + ))} + {overflow.length > 0 && ( + + {overflow.map(([fieldName, x]) => ( + + + {camelToSnake(fieldName)} + + + + ))} +
      + } + > +
      +{overflow.length}
      + + )} +
+ ) +} const tableToGroup = (table: OxqlTable): ChartGroup => { const { name, timeseries } = table @@ -222,7 +285,7 @@ const tableToGroup = (table: OxqlTable): ChartGroup => { // no further charts: timeseries.map((series) => ({ name, - description: getFormattedFields(series), + description: , timestamps: toPosix(series.points.timestamps), data: series.points.values.map((v, i) => ({ label: @@ -255,7 +318,7 @@ const tableToGroup = (table: OxqlTable): ChartGroup => { .filter((s) => s.points.values.length > 0) .map((series) => ({ name, - description: getFormattedFields(series), + description: , timestamps: toPosix(series.points.timestamps), data: series.points.values[0], })), @@ -431,7 +494,26 @@ function ChartEntry({ display, trim }: { display: ChartDisplay; trim: Trim }) { return ( <> {match(display) - .with({ kind: 'empty' }, () =>

No results

) + .with({ kind: 'empty' }, () => ( + + + {/* gradient uses the surface-default token so it works in both themes */} +
+
+ +
+ + + )) .with({ kind: 'multiline' }, (r) => ) .with({ kind: 'line' }, (r) => ) .exhaustive()} @@ -520,18 +602,17 @@ function ResultsSummary({ tables }: { tables: OxqlTable[] }) { // use for API errors elsewhere (e.g., side modal forms). role=alert announces // the failure to screen readers on arrival; mono + pre-wrap preserve the parse // errors' caret alignment. -// The code-ish parts of an error message get inline code styling: the query -// excerpt between fmt_parse_error's `..` markers (which stay outside the chip, -// reading as ellipses), peg's double-quoted expected tokens, and the -// backtick-quoted names in semantic errors. Split with a capture group, so -// odd indices are the code segments. -const codeSegment = /(\.\. [\s\S]*? \.\.|"[^"\n]*"|`[^`\n]*`)/ +// The code-ish parts of an error message get inline code styling via +// codeSegment (see oxql-error.ts). The `..` excerpt markers stay outside the +// chip, reading as ellipses. const ErrorMessage = ({ message }: { message: string }) => ( {message.split(codeSegment).map((part, i) => { if (i % 2 === 0) return part // the chip delimits the code, so drop the markers/quotes around it const code = part.startsWith('.. ') ? part.slice(3, -3) : part.slice(1, -1) + // an empty chip is just visual noise; show the raw text instead + if (!code) return part return ( {part.startsWith('.. ') && '.. '} diff --git a/app/ui/styles/components/oxql-editor.css b/app/ui/styles/components/oxql-editor.css index 660632088..0f38f8cc4 100644 --- a/app/ui/styles/components/oxql-editor.css +++ b/app/ui/styles/components/oxql-editor.css @@ -34,6 +34,9 @@ .cm-line { padding: 0 12px; + text-transform: none !important; + letter-spacing: 0 !important; + @apply text-mono-sm; } .cm-cursor, diff --git a/test/e2e/oxql.e2e.ts b/test/e2e/oxql.e2e.ts index d78f28d24..a1f2e92f5 100644 --- a/test/e2e/oxql.e2e.ts +++ b/test/e2e/oxql.e2e.ts @@ -134,7 +134,9 @@ test('picking an example populates the query and runs it', async ({ page }) => { await expect(page.getByRole('figure').first()).toBeVisible() }) -test('editor autocompletes timeseries names, fields, and operations', async ({ page }) => { +test('editor completions are wired to live timeseries schemas', async ({ page }) => { + // the completion logic itself is unit-tested in oxql-autocomplete.spec.ts; + // here we only check the editor is hooked up to the schema list from the API const textbox = page.getByRole('textbox') await textbox.click() await page.keyboard.type('get hardware') @@ -153,21 +155,6 @@ test('editor autocompletes timeseries names, fields, and operations', async ({ p await page.keyboard.type('_component:fan') // narrow until fan_speed is the top match await page.keyboard.press('Enter') await expect(textbox).toContainText('get hardware_component:fan_speed') - - // table ops complete at the start of a clause. type the word out instead of - // accepting: a second Enter-accept can race the popup closing and insert a - // newline, breaking the clause for the next step - await page.keyboard.type(' | fil') - await expect(options.getByText('filter', { exact: true })).toBeVisible() - await page.keyboard.type('ter') - - // fields of the get-ed timeseries complete inside the filter - await page.keyboard.type(' chass') - await expect(options.getByText('chassis_kind')).toBeVisible() - await page.keyboard.press('Enter') - await expect(textbox).toContainText( - 'get hardware_component:fan_speed | filter chassis_kind' - ) }) test('results can be copied as JSON or CSV', async ({ page }) => { @@ -185,22 +172,6 @@ test('results can be copied as JSON or CSV', async ({ page }) => { await expectToast(page, 'Results copied as CSV') }) -test('copy actions are disabled before a query has run', async ({ page }) => { - await page.getByRole('button', { name: 'Results actions' }).click() - await expect(page.getByRole('menuitem', { name: 'Copy as JSON' })).toBeDisabled() - await expect(page.getByRole('menuitem', { name: 'Copy as CSV' })).toBeDisabled() -}) - -test('empty query is blocked by client-side validation', async ({ page }) => { - const textbox = page.getByRole('textbox') - await textbox.fill('') - await page.getByRole('button', { name: 'Run query' }).click() - - await expect(textbox).toHaveAttribute('aria-invalid', 'true') - await expect(page.getByText('Enter a query').first()).toBeVisible() - await expect(page.getByRole('figure')).toHaveCount(0) -}) - test('a query the backend rejects surfaces an error instead of a chart', async ({ page, }) => { @@ -237,21 +208,17 @@ test('parse errors underline the offending spot in the editor', async ({ page }) await expect(underlined).toBeHidden() }) -test('pages reads the initial query from the URL', async ({ page }) => { - await page.goto( - `/system/metrics-explorer?query=${encodeURIComponent(oxqlQueries.basicTctl)}` - ) - const textbox = page.getByRole('textbox') - // the editor is a contenteditable, so assert line by line rather than on value - await expect(textbox).toContainText('get hardware_component:amd_cpu_tctl') - await expect(textbox).toContainText('| filter timestamp > @now() - 1m') -}) - -test('pages writes the query to the URL after a successful run', async ({ page }) => { - await page.goto('/system/metrics-explorer') +test('query round-trips through the URL', async ({ page }) => { + // a successful run writes the query to the URL await runQuery(page, oxqlQueries.basicTctl) - await expect .poll(() => new URL(page.url()).searchParams.get('query')) .toBe(oxqlQueries.basicTctl) + + // and a fresh load of that URL populates the editor from the query param. + // the editor is a contenteditable, so assert line by line rather than on value + await page.goto(page.url()) + const textbox = page.getByRole('textbox') + await expect(textbox).toContainText('get hardware_component:amd_cpu_tctl') + await expect(textbox).toContainText('| filter timestamp > @now() - 1m') }) diff --git a/test/visual/regression.e2e.ts b/test/visual/regression.e2e.ts index 7b0ed7c8d..026998591 100644 --- a/test/visual/regression.e2e.ts +++ b/test/visual/regression.e2e.ts @@ -258,13 +258,13 @@ test.describe('Visual Regression', { tag: '@visual' }, () => { }) }) - for (const [name, query] of Object.entries(oxqlQueries)) { - test(`oxql ${name}`, async ({ page }) => { - await page.goto('/system/oxql', { waitUntil: 'networkidle' }) - await page.getByRole('textbox').fill(query) - await page.getByRole('button', { name: 'Run query' }).click() - await expect(page.locator('figure').first()).toBeVisible() - await expect(page).toHaveScreenshot(`oxql-${name}.png`, fullPage) - }) - } + // one representative query is enough for styling coverage: the joined query + // exercises multiple charts, legends, and the results list in one screenshot + test('oxql metrics explorer', async ({ page }) => { + await page.goto('/system/metrics-explorer', { waitUntil: 'networkidle' }) + await page.getByRole('textbox').fill(oxqlQueries.multiJoinedTables) + await page.getByRole('button', { name: 'Run query' }).click() + await expect(page.locator('figure').first()).toBeVisible() + await expect(page).toHaveScreenshot('oxql-metrics-explorer.png', fullPage) + }) }) From a2a496724b67bee71b8d6fca2555faf8e6150ec9 Mon Sep 17 00:00:00 2001 From: benjaminleonard Date: Mon, 24 Aug 2026 22:36:18 +0100 Subject: [PATCH 06/46] Memo trim --- app/pages/system/OxqlPage.tsx | 127 +++++++++++++--------------------- 1 file changed, 49 insertions(+), 78 deletions(-) diff --git a/app/pages/system/OxqlPage.tsx b/app/pages/system/OxqlPage.tsx index 4ea1f8529..1acfe8cf9 100644 --- a/app/pages/system/OxqlPage.tsx +++ b/app/pages/system/OxqlPage.tsx @@ -106,8 +106,8 @@ const narrowToNumbers = (vs: Values): (number | null)[] => ) ) .with({ type: 'string' }, () => []) // these don't exist in practice - .with({ type: 'integer_distribution' }, () => []) // by only calling this on aligned/joined tables, we know this is unreachable - .with({ type: 'double_distribution' }, () => []) // these don't exist in practice, and are also unreachable per above + .with({ type: 'integer_distribution' }, () => []) // heatmaps! + .with({ type: 'double_distribution' }, () => []) // these don't exist in practice .exhaustive() const leftPad = (items: T[], length: number): (T | null)[] => @@ -375,15 +375,25 @@ const groupHasPointWorthDropping = (g: ChartGroup): boolean => ) .exhaustive() -// A simplified representation of a single chart. +// A render-ready representation of a single chart. Keep the data arrays memoized: uplot-react +// deep-compares the whole dataset whenever their identity changes (see TimeSeriesChart.spec.tsx) type ChartDisplay = { key: string; showDivider: boolean } & ( | { kind: 'empty' } - | { kind: 'multiline'; startTime: Date; endTime: Date; chart: Multiline } - | { kind: 'line'; startTime: Date; endTime: Date; chart: Chart } + | { + kind: 'chart' + startTime: Date + endTime: Date + name: string + description?: ReactNode + timestamps: number[] + data: (number | null)[][] + /** only set for multi-series charts, where it enables the legend */ + seriesLabels?: string[] + } ) // Virtualization relies on a list of near-same-size items, so we flatten out all the groups -const toDisplays = (groups: ChartGroup[]): ChartDisplay[] => +const toDisplays = (groups: ChartGroup[], trim: Trim): ChartDisplay[] => groups.flatMap((g, t): ChartDisplay[] => { if (g === 'empty-timeseries') return [{ kind: 'empty', key: `t${t}`, showDivider: true }] @@ -392,96 +402,53 @@ const toDisplays = (groups: ChartGroup[]): ChartDisplay[] => .with({ kind: 'unaligned' }, ({ charts }) => charts.map( (chart, i): ChartDisplay => ({ - kind: 'line', + kind: 'chart', key: `t${t}.${i}`, showDivider: i === 0, startTime, endTime, - chart, + name: chart.name, + description: chart.description, + ...trim({ + timestamps: chart.timestamps, + data: [narrowToNumbers(chart.data)], + }), }) ) ) .with({ kind: 'joined' }, { kind: 'aligned' }, ({ charts }) => charts.map( (chart, i): ChartDisplay => ({ - kind: 'multiline', + kind: 'chart', key: `t${t}.${i}`, showDivider: i === 0, startTime, endTime, - chart, + name: chart.name, + description: chart.description, + seriesLabels: chart.data.map((l) => l.label), + ...trim({ + timestamps: chart.timestamps, + data: chart.data.map((d) => d.values), + }), }) ) ) .exhaustive() }) -function MultilineChart({ - display, - trim, -}: { - display: Extract - trim: Trim -}) { - const { chart, startTime, endTime } = display - const trimmed = trim({ - timestamps: chart.timestamps, - data: chart.data.map((d) => d.values), - }) - const seriesLabels = chart.data.map((l) => l.label) - return ( - - - - - ) -} - -function LineChart({ - display, - trim, -}: { - display: Extract - trim: Trim -}) { - const { chart, startTime, endTime } = display - const data = match(chart.data.values) - .with({ type: 'integer' }, ({ values }) => values) - .with({ type: 'double' }, ({ values }) => values) - .with({ type: 'boolean' }, ({ values }) => - values.map((b) => - match(b) - .with(true, () => 1) - .with(false, () => 0) - .with(null, () => null) - .exhaustive() - ) - ) - .with({ type: 'string' }, () => []) // these don't exist in practice - .with({ type: 'integer_distribution' }, { type: 'double_distribution' }, () => []) // heatmaps! - .exhaustive() - const trimmed = trim({ data: [data], timestamps: chart.timestamps }) +function ChartCard({ display }: { display: Extract }) { return ( - + {match(display) @@ -514,8 +481,7 @@ function ChartEntry({ display, trim }: { display: ChartDisplay; trim: Trim }) { )) - .with({ kind: 'multiline' }, (r) => ) - .with({ kind: 'line' }, (r) => ) + .with({ kind: 'chart' }, (r) => ) .exhaustive()} ) @@ -696,9 +662,14 @@ export default function OxqlPage() { ) const hasTrimmableCharts = chartGroups?.some(groupHasPointWorthDropping) ?? false - const trim = firstPointDropper(dropFirstPoint && hasTrimmableCharts) - const charts = useMemo(() => (chartGroups ? toDisplays(chartGroups) : []), [chartGroups]) + const charts = useMemo( + () => + chartGroups + ? toDisplays(chartGroups, firstPointDropper(dropFirstPoint && hasTrimmableCharts)) + : [], + [chartGroups, dropFirstPoint, hasTrimmableCharts] + ) // Since the whole window is the scroll container, the virtualizer needs to // know the offset from the top. By reacting to height changes in everything @@ -835,7 +806,7 @@ export default function OxqlPage() { className="absolute top-0 left-0 w-full pb-4" style={{ transform: `translateY(${item.start - scrollMargin}px)` }} > - +
))}
From b077b8a89ddaba408f4d0bc5e6b8f44fd6e05fcf Mon Sep 17 00:00:00 2001 From: benjaminleonard Date: Mon, 24 Aug 2026 22:36:22 +0100 Subject: [PATCH 07/46] Fix link --- app/util/links.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/util/links.ts b/app/util/links.ts index 78e021f7c..18d7c8e6b 100644 --- a/app/util/links.ts +++ b/app/util/links.ts @@ -91,7 +91,7 @@ export const docLinks = { linkText: 'Instance Actions', }, oxql: { - href: 'https://docs.oxide.computer/guides/metrics/oxql-tutorial#_oxql_quickstart', + href: 'https://docs.oxide.computer/guides/metrics/oxql-tutorial#_oxql_quick_start', linkText: 'OxQL', }, oxqlSchemas: { From c5a8543bb60d8274f20098caca89987c1524c859 Mon Sep 17 00:00:00 2001 From: benjaminleonard Date: Tue, 25 Aug 2026 11:45:55 +0100 Subject: [PATCH 08/46] Upgrade dep --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 66afddd3f..a9f9140bf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "@codemirror/view": "^6.43.9", "@floating-ui/react": "^0.26.23", "@headlessui/react": "^2.2.9", - "@oxide/design-system": "^6.5.4-canary.fb43c60", + "@oxide/design-system": "^6.6.0", "@peculiar/x509": "^1.12.3", "@react-aria/live-announcer": "^3.3.4", "@tailwindcss/container-queries": "^0.1.1", @@ -1658,9 +1658,9 @@ } }, "node_modules/@oxide/design-system": { - "version": "6.5.4-canary.fb43c60", - "resolved": "https://registry.npmjs.org/@oxide/design-system/-/design-system-6.5.4-canary.fb43c60.tgz", - "integrity": "sha512-EnvsgFfoooyULVJBptdHb4nt3MEXcvJPZuTgycZlzclHi0aUP7X10/eyjMyF5aFaZazxztKilwY8Y2FZuuX7xw==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/@oxide/design-system/-/design-system-6.6.0.tgz", + "integrity": "sha512-NhrovzCCzwUuk/gvz4w9tZEwta0/LpFjelb0xSnMd0K6c2Z103zlAL6h+poFIQ0HVbSZnpDFOnYb4o6U2WnenA==", "license": "MPL 2.0", "dependencies": { "@floating-ui/react": "^0.27.16", diff --git a/package.json b/package.json index 5801cc708..ced1d75cd 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "@codemirror/view": "^6.43.9", "@floating-ui/react": "^0.26.23", "@headlessui/react": "^2.2.9", - "@oxide/design-system": "^6.5.4-canary.fb43c60", + "@oxide/design-system": "^6.6.0", "@peculiar/x509": "^1.12.3", "@react-aria/live-announcer": "^3.3.4", "@tailwindcss/container-queries": "^0.1.1", From 683bdfdf9b4b39c26b0fc48d245f27478d0f8d7f Mon Sep 17 00:00:00 2001 From: David Crespo Date: Tue, 25 Aug 2026 15:58:59 -0500 Subject: [PATCH 09/46] Draw the OxQL editor cursor with CodeMirror instead of the native caret --- app/components/OxqlEditor.tsx | 5 +++++ app/ui/styles/components/oxql-editor.css | 10 +++++++++- test/e2e/oxql.e2e.ts | 13 +++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/app/components/OxqlEditor.tsx b/app/components/OxqlEditor.tsx index b058d4c61..26f0b739e 100644 --- a/app/components/OxqlEditor.tsx +++ b/app/components/OxqlEditor.tsx @@ -16,6 +16,7 @@ import { } from '@codemirror/state' import { Decoration, + drawSelection, EditorView, highlightActiveLine, keymap, @@ -189,6 +190,10 @@ export function OxqlEditor({ ]), EditorView.lineWrapping, placeholder('get sled_data_link:bytes_sent | filter timestamp > @now() - 5m'), + // draw the cursor and selection ourselves. Firefox puts the native + // caret in the wrong spot when the doc is empty and the line contains + // only the placeholder widget + drawSelection(), highlightActiveLine(), bracketMatching(), oxqlAutocomplete(() => schemasRef.current ?? []), diff --git a/app/ui/styles/components/oxql-editor.css b/app/ui/styles/components/oxql-editor.css index 0f38f8cc4..8011f231c 100644 --- a/app/ui/styles/components/oxql-editor.css +++ b/app/ui/styles/components/oxql-editor.css @@ -29,7 +29,6 @@ .cm-content { font-family: inherit; padding: 10px 0; - caret-color: var(--syntax-fg); } .cm-line { @@ -39,11 +38,20 @@ @apply text-mono-sm; } + /* drawSelection() hides the native caret and selection and draws its own */ .cm-cursor, .cm-dropCursor { border-left-color: var(--syntax-fg); } + /* + * Matches the global ::selection color in index.css. CodeMirror's own + * focused-selection rule is unusually specific, hence the repeated class. + */ + .cm-scroller .cm-selectionLayer .cm-selectionBackground.cm-selectionBackground { + @apply bg-accent-inverse/30; + } + .cm-activeLine { background-color: var(--surface-secondary); } diff --git a/test/e2e/oxql.e2e.ts b/test/e2e/oxql.e2e.ts index a1f2e92f5..db06e1a38 100644 --- a/test/e2e/oxql.e2e.ts +++ b/test/e2e/oxql.e2e.ts @@ -222,3 +222,16 @@ test('query round-trips through the URL', async ({ page }) => { await expect(textbox).toContainText('get hardware_component:amd_cpu_tctl') await expect(textbox).toContainText('| filter timestamp > @now() - 1m') }) + +test('cursor sits at the start of the line when the query is empty', async ({ page }) => { + // CodeMirror draws its own cursor because Firefox puts the native caret in + // the wrong spot when the line contains nothing but the placeholder widget. + // The cursor has no semantic representation, so target the class. + await page.getByRole('textbox').click() + const cursor = await page.locator('.cm-cursor').boundingBox() + const placeholder = await page.locator('.cm-placeholder').boundingBox() + + // the cursor sits where the placeholder text starts, give or take its own width + expect(Math.abs(cursor!.x - placeholder!.x)).toBeLessThan(2) + expect(cursor!.y).toEqual(placeholder!.y) +}) From df221bbb2272108ec43c1b8b56abfc0f628474fd Mon Sep 17 00:00:00 2001 From: David Crespo Date: Tue, 25 Aug 2026 17:21:15 -0500 Subject: [PATCH 10/46] Improve regex completer: string-aware clauses, literal positions, subquery scope, datum --- app/components/oxql-autocomplete.spec.ts | 84 ++++++++++++++- app/components/oxql-autocomplete.ts | 128 +++++++++++++++++++---- 2 files changed, 189 insertions(+), 23 deletions(-) diff --git a/app/components/oxql-autocomplete.spec.ts b/app/components/oxql-autocomplete.spec.ts index 6a7b903d7..dfe64f3a8 100644 --- a/app/components/oxql-autocomplete.spec.ts +++ b/app/components/oxql-autocomplete.spec.ts @@ -96,7 +96,8 @@ it('completes fields of the queried timeseries in filter', () => { expect(result).toContain('chassis_kind') expect(result).toContain('sled_id') expect(result).toContain('timestamp') - expect(result).toContain('@now()') + // @now() is a literal, not an identifier, so it's not offered here + expect(result).not.toContain('@now()') // fields of timeseries the query doesn't get are not offered expect(result).not.toContain('link_name') }) @@ -122,6 +123,87 @@ it('completes fields inside group_by brackets and reducers after them', () => { ]) }) +it('offers only literals at literal positions, not fields', () => { + const literals = ['@now()', 'true', 'false'] + expect(labels('get hardware_component:fan_speed | filter chassis_kind == ')).toEqual( + literals + ) + expect(labels('get hardware_component:fan_speed | filter timestamp > @no')).toEqual( + literals + ) +}) + +it('offers only get at the start of a query branch', () => { + expect(labels('')).toEqual(['get']) + expect(labels('g')).toEqual(['get']) + expect(labels('{ get hardware_component:fan_speed; ')).toEqual(['get']) +}) + +it('does not offer get after a pipe', () => { + const result = labels('get hardware_component:fan_speed | ') + expect(result).not.toContain('get') + expect(result).toContain('filter') +}) + +it('offers nothing at positions expecting an operator', () => { + const filter = 'get hardware_component:fan_speed | filter ' + // after a complete literal of any kind, quoted or not, spaced or not + expect(complete(`${filter}timestamp > @now()`)).toBeNull() + expect(complete(`${filter}chassis_kind == 'power' `)).toBeNull() + expect(complete(`${filter}sled_id == 5 `)).toBeNull() + // duration arithmetic after @now() + expect(complete(`${filter}timestamp > @now() - `)).toBeNull() + // after an identifier, where a comparison operator is expected + expect(complete(`${filter}sled_id `)).toBeNull() + // after a closing paren + expect(complete(`${filter}(sled_id == 5) `)).toBeNull() +}) + +it('offers fields at the start of each boolean operand', () => { + const filter = 'get hardware_component:fan_speed | filter ' + expect(labels(`${filter}chassis_kind == 'power' && `)).toContain('sled_id') + expect(labels(`${filter}chassis_kind == 'power' ^ `)).toContain('sled_id') + expect(labels(`${filter}(`)).toContain('sled_id') + expect(labels(`${filter}!`)).toContain('sled_id') +}) + +it('ignores a get inside a string literal', () => { + const doc = + "get hardware_component:fan_speed | filter chassis_kind == 'get sled_data_link:bytes_sent' && " + const result = labels(doc) + expect(result).toContain('chassis_kind') + expect(result).not.toContain('link_name') +}) + +it('offers nothing after a complete quoted literal', () => { + expect( + complete("get hardware_component:fan_speed | filter chassis_kind == 'power'") + ).toBeNull() +}) + +it('offers nothing inside a string literal', () => { + expect( + complete("get hardware_component:fan_speed | filter chassis_kind == 'pow") + ).toBeNull() +}) + +it('ignores pipes and semicolons inside strings when finding the clause', () => { + const doc = "get hardware_component:fan_speed | filter chassis_kind == 'a | b; c' || sl" + expect(labels(doc)).toContain('sled_id') +}) + +it('scopes fields to the innermost subquery branch', () => { + const doc = + '{ get hardware_component:fan_speed; get sled_data_link:bytes_sent | filter li' + const result = labels(doc) + expect(result).toContain('link_name') + expect(result).not.toContain('chassis_kind') +}) + +it('offers datum alongside fields in filter', () => { + expect(labels('get hardware_component:fan_speed | filter ')).toContain('datum') +}) + it('completes alignment functions after align', () => { expect(labels('get hardware_component:fan_speed | align m')).toEqual(['mean_within']) }) diff --git a/app/components/oxql-autocomplete.ts b/app/components/oxql-autocomplete.ts index 72bf078b0..15bc39b20 100644 --- a/app/components/oxql-autocomplete.ts +++ b/app/components/oxql-autocomplete.ts @@ -22,8 +22,11 @@ import type { TimeseriesSchema } from '@oxide/api' // The OxQL language surface below comes from RFD 463 // https://rfd.shared.oxide.computer/rfd/463 -const tableOps: Completion[] = [ - { label: 'get', info: 'Retrieve a table by its timeseries name' }, +// every query/subquery starts with `get`, and `get` cannot appear again after +// a pipe, so it is offered separately from the other table operations +const getOp: Completion = { label: 'get', info: 'Retrieve a table by its timeseries name' } + +const pipeOps: Completion[] = [ { label: 'filter', info: 'Filter timeseries by field values or timestamps' }, { label: 'align', info: "Temporally align a table's samples" }, { @@ -47,21 +50,86 @@ const reducers: Completion[] = [ { label: 'sum', info: 'Sum the values in each group' }, ] +const atNow: Completion = { + label: '@now()', + info: 'The current time, e.g. timestamp > @now() - 1m', +} + +// completable literals for the right-hand side of a filter comparison +const literals: Completion[] = [atNow, { label: 'true' }, { label: 'false' }] + // identifiers that are valid in filter expressions alongside field names const filterExtras: Completion[] = [ { label: 'timestamp', info: 'The timestamp of each sample' }, { label: 'start_time', info: 'The start time of each cumulative sample' }, - { label: '@now()', info: 'The current time, e.g. timestamp > @now() - 1m' }, + { label: 'datum', info: 'The value of each sample' }, ] +/** + * Walk the document up to `pos`, skipping string literals, to find (1) whether + * the cursor is inside an unterminated string, (2) where the current clause + * starts (last `|`/`{`/`;`/`}` outside strings, with `||` ignored), and + * (3) where the innermost query branch containing the cursor starts: a `{` + * opens a subquery, `;` starts a sibling branch, and `}` returns to the + * enclosing query's scope. + */ +const scanQuery = (doc: string, pos: number) => { + let quote: string | null = null + let escaped = false + let clauseStart = 0 + let scopeStart = 0 + const enclosingScopes: number[] = [] + for (let i = 0; i < pos; i++) { + const c = doc[i] + if (escaped) { + escaped = false + continue + } + if (quote) { + if (c === '\\') escaped = true + else if (c === quote) quote = null + continue + } + switch (c) { + case "'": + case '"': + quote = c + break + case '|': + // logical || is not a clause boundary + if (doc[i + 1] === '|') i++ + else clauseStart = i + 1 + break + case '{': + enclosingScopes.push(scopeStart) + scopeStart = i + 1 + clauseStart = i + 1 + break + case ';': + scopeStart = i + 1 + clauseStart = i + 1 + break + case '}': + scopeStart = enclosingScopes.pop() ?? 0 + clauseStart = i + 1 + break + } + } + return { inString: quote !== null, clauseStart, scopeStart } +} + const fieldCompletions = ( context: CompletionContext, + scopeStart: number, schemas: TimeseriesSchema[] ): Completion[] => { - // offer the fields of every timeseries the query `get`s, deduped by name - // since subquery filters can apply across tables - const doc = context.state.doc.toString() - const named = new Set(Array.from(doc.matchAll(/\bget\s+([\w:]+)/g), (m) => m[1])) + // offer the fields of every timeseries the innermost query branch `get`s, + // deduped by name since subquery filters can apply across tables. Blank out + // string literals so quoted text can't contribute a phantom `get` + const scope = context.state + .sliceDoc(scopeStart, context.pos) + .replace(/'[^']*'|"[^"]*"/g, '') + const named = new Set(Array.from(scope.matchAll(/\bget\s+([\w:]+)/g), (m) => m[1])) const seen = new Set() const options: Completion[] = [] for (const schema of schemas) { @@ -95,16 +163,13 @@ export const oxqlCompletionSource = const word = context.matchBefore(/[@\w:]*/) if (!word) return null - const before = context.state - .sliceDoc(0, context.pos) - // blank out logical operators (preserving length) so `filter a == 1 || b` - // reads as one filter clause when we split on pipes below - .replaceAll('||', ' ') - // clauses are delimited by pipes and, in subqueries, braces and semicolons - const clauseStart = - Math.max(before.lastIndexOf('|'), before.lastIndexOf('{'), before.lastIndexOf(';')) + - 1 - const clause = before.slice(clauseStart) + const doc = context.state.doc.toString() + const { inString, clauseStart, scopeStart } = scanQuery(doc, context.pos) + + // no completions inside a string literal + if (inString) return null + + const clause = doc.slice(clauseStart, context.pos) const result = (options: Completion[]): CompletionResult | null => options.length > 0 ? { from: word.from, options, validFor: /^[@\w:]*$/ } : null @@ -118,17 +183,36 @@ export const oxqlCompletionSource = // inside group_by's bracket list → fields; after the list and a comma → reducers if (/^\s*group_by\s*\[[^\]]*$/.test(clause)) { - return result(fieldCompletions(context, getSchemas())) + return result(fieldCompletions(context, scopeStart, getSchemas())) } if (/^\s*group_by\s*\[[^\]]*\]\s*,\s*\w*$/.test(clause)) return result(reducers) - // anywhere in a filter expression, offer fields and time identifiers if (/^\s*filter\b/.test(clause)) { - return result([...fieldCompletions(context, getSchemas()), ...filterExtras]) + // comparisons are strictly `ident op literal`, so each cursor position + // allows exactly one kind of completion. Right after a comparison + // operator, only literals are legal + if (/(?:==|!=|>=|<=|<|>|~=)\s*[@\w:]*$/.test(clause)) return result(literals) + // identifiers are legal only at the start of a boolean operand: after + // `filter` itself, a logical operator, an open paren, or negation + if (/(?:\bfilter|&&|\|\||\^|\(|!)\s*[@\w:]*$/.test(clause)) { + return result([ + ...fieldCompletions(context, scopeStart, getSchemas()), + ...filterExtras, + ]) + } + // any other position (after a complete literal or identifier, closing + // paren, etc.) expects an operator, which we don't complete + return null } - // otherwise, if we're at the start of a clause, offer table operations - if (/^\s*\w*$/.test(clause)) return result(tableOps) + // otherwise, at the start of a clause, offer `get` if this is the first + // clause of a query branch and the other table operations after a pipe. + // Known quirk: right after `}` only a pipe is legal, but we offer ops + // anyway — distinguishing that case means tracking boundary kind in the + // scanner, more state than this heuristic approach warrants + if (/^\s*\w*$/.test(clause)) { + return result(clauseStart === scopeStart ? [getOp] : pipeOps) + } return null } From 4af469cc8afe791a38461e582a6a2977b76b33e9 Mon Sep 17 00:00:00 2001 From: Joe Thel Date: Wed, 9 Sep 2026 13:08:06 -0700 Subject: [PATCH 11/46] Rename OxqlPage -> MetricsExplorer No point leaving it behind. --- app/pages/system/{OxqlPage.tsx => MetricsExplorer.tsx} | 2 +- app/routes.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename app/pages/system/{OxqlPage.tsx => MetricsExplorer.tsx} (99%) diff --git a/app/pages/system/OxqlPage.tsx b/app/pages/system/MetricsExplorer.tsx similarity index 99% rename from app/pages/system/OxqlPage.tsx rename to app/pages/system/MetricsExplorer.tsx index cc0ba9f8e..bcb7af186 100644 --- a/app/pages/system/OxqlPage.tsx +++ b/app/pages/system/MetricsExplorer.tsx @@ -728,7 +728,7 @@ const ResultsSection = ({ children }: { children: ReactNode }) => ( ) -export default function OxqlPage() { +export default function MetricsExplorer() { const query = useApiMutation(api.systemTimeseriesQuery) // powers editor autocomplete. no loading state needed: completions are a diff --git a/app/routes.tsx b/app/routes.tsx index 247e80262..1dd277564 100644 --- a/app/routes.tsx +++ b/app/routes.tsx @@ -178,7 +178,7 @@ export const routes = createRoutesFromElements( /> import('./pages/system/OxqlPage').then(convert)} + lazy={() => import('./pages/system/MetricsExplorer.tsx').then(convert)} /> Date: Wed, 9 Sep 2026 13:22:52 -0700 Subject: [PATCH 12/46] Just snapshot the schemas They're stable. --- mock-api/timeseries-schema.ts | 12108 +++++++++++++++++++++++++++++++- 1 file changed, 12009 insertions(+), 99 deletions(-) diff --git a/mock-api/timeseries-schema.ts b/mock-api/timeseries-schema.ts index 5a4a76881..fcf226f10 100644 --- a/mock-api/timeseries-schema.ts +++ b/mock-api/timeseries-schema.ts @@ -9,150 +9,12060 @@ import type { TimeseriesSchema } from '@oxide/api' import type { Json } from './json-type' -// Field sets are trimmed-down versions of the real schemas in Omicron; they -// only need to be realistic enough to exercise editor autocomplete and any -// future schema browsing UI. -// https://github.com/oxidecomputer/omicron/blob/main/oximeter/oximeter/schema/hardware-component.toml -// https://github.com/oxidecomputer/omicron/blob/main/oximeter/oximeter/schema/sled-data-link.toml - -const hardwareComponentFields: Json['field_schema'] = [ +// snapshot from dogfood. schemas are pretty darn stable +export const timeseriesSchemas: Json[] = [ + { + timeseries_name: 'bgp_session:active_connections_accepted', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'local_asn', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'peer', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.382654900Z', + }, + { + timeseries_name: 'bgp_session:connection_retries', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'local_asn', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'peer', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.391077498Z', + }, + { + timeseries_name: 'bgp_session:hold_timer_expirations', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'local_asn', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'peer', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.373240625Z', + }, + { + timeseries_name: 'bgp_session:idle_hold_timer_expirations', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'local_asn', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'peer', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.368709833Z', + }, + { + timeseries_name: 'bgp_session:keepalive_send_failures', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'local_asn', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'peer', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.452187576Z', + }, + { + timeseries_name: 'bgp_session:keepalives_received', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'local_asn', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'peer', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.286539687Z', + }, + { + timeseries_name: 'bgp_session:keepalives_sent', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'local_asn', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'peer', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.163117810Z', + }, + { + timeseries_name: 'bgp_session:notification_send_failures', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'local_asn', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'peer', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.446026555Z', + }, + { + timeseries_name: 'bgp_session:open_handle_failures', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'local_asn', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'peer', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.395049178Z', + }, + { + timeseries_name: 'bgp_session:open_send_failures', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'local_asn', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'peer', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.456331671Z', + }, + { + timeseries_name: 'bgp_session:opens_received', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'local_asn', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'peer', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.340922385Z', + }, + { + timeseries_name: 'bgp_session:opens_sent', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'local_asn', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'peer', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.295987414Z', + }, + { + timeseries_name: 'bgp_session:passive_connections_accepted', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'local_asn', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'peer', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.386239723Z', + }, + { + timeseries_name: 'bgp_session:prefixes_advertised', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'local_asn', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'peer', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.359643912Z', + }, + { + timeseries_name: 'bgp_session:prefixes_imported', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'local_asn', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'peer', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.363537040Z', + }, + { + timeseries_name: 'bgp_session:transition_to_active', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'local_asn', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'peer', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.410603402Z', + }, + { + timeseries_name: 'bgp_session:transition_to_connect', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'local_asn', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'peer', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.405590536Z', + }, + { + timeseries_name: 'bgp_session:transition_to_established', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'local_asn', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'peer', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.429033616Z', + }, + { + timeseries_name: 'bgp_session:transition_to_idle', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'local_asn', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'peer', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.401648462Z', + }, + { + timeseries_name: 'bgp_session:transition_to_open_confirm', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'local_asn', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'peer', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.419127285Z', + }, + { + timeseries_name: 'bgp_session:transition_to_open_sent', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'local_asn', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'peer', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.414230998Z', + }, + { + timeseries_name: 'bgp_session:transition_to_session_setup', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'local_asn', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'peer', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.424845645Z', + }, + { + timeseries_name: 'bgp_session:unexpected_keepalive_messages', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'local_asn', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'peer', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.437750383Z', + }, + { + timeseries_name: 'bgp_session:unexpected_open_messages', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'local_asn', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'peer', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.442273160Z', + }, + { + timeseries_name: 'bgp_session:unexpected_update_messages', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'local_asn', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'peer', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.434115093Z', + }, + { + timeseries_name: 'bgp_session:update_nexthop_missing', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'local_asn', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'peer', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.377469644Z', + }, + { + timeseries_name: 'bgp_session:update_send_failures', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'local_asn', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'peer', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.461585929Z', + }, + { + timeseries_name: 'bgp_session:updates_received', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'local_asn', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'peer', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.354008910Z', + }, + { + timeseries_name: 'bgp_session:updates_sent', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'local_asn', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'peer', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.349052439Z', + }, + { + timeseries_name: 'collection_target:cpus_provisioned', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'i64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2023-10-25T23:05:04.909050887Z', + }, + { + timeseries_name: 'collection_target:ram_provisioned', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'i64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2023-10-25T23:05:04.915652918Z', + }, + { + timeseries_name: 'collection_target:virtual_disk_space_provisioned', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'i64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2023-10-25T23:13:04.927950665Z', + }, + { + timeseries_name: 'crucible_upstairs:activated', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'upstairs_uuid', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_i64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2023-10-25T23:04:34.899663499Z', + }, + { + timeseries_name: 'crucible_upstairs:extent_no_op', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'upstairs_uuid', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_i64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2023-10-25T23:04:34.930943640Z', + }, + { + timeseries_name: 'crucible_upstairs:extent_reopen', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'upstairs_uuid', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_i64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2023-10-25T23:04:34.934827868Z', + }, + { + timeseries_name: 'crucible_upstairs:extent_repair', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'upstairs_uuid', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_i64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2023-10-25T23:04:34.927207024Z', + }, + { + timeseries_name: 'crucible_upstairs:flush', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'upstairs_uuid', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_i64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2023-10-25T23:04:34.903985541Z', + }, + { + timeseries_name: 'crucible_upstairs:flush_close', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'upstairs_uuid', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_i64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2023-10-25T23:04:34.923454748Z', + }, + { + timeseries_name: 'crucible_upstairs:read', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'upstairs_uuid', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_i64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2023-10-25T23:04:34.915831652Z', + }, + { + timeseries_name: 'crucible_upstairs:read_bytes', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'upstairs_uuid', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_i64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2023-10-25T23:04:34.919609014Z', + }, + { + timeseries_name: 'crucible_upstairs:write', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'upstairs_uuid', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_i64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2023-10-25T23:04:34.908085310Z', + }, + { + timeseries_name: 'crucible_upstairs:write_bytes', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'upstairs_uuid', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_i64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2023-10-25T23:04:34.911931515Z', + }, + { + timeseries_name: 'database_transaction:retry_data', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'attempt', + field_type: 'u32', + source: 'metric', + description: '', + }, + { + name: 'name', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'f64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2023-12-09T05:05:12.777325080Z', + }, + { + timeseries_name: 'ddm_router:originated_tunnel_endpoints', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-22T06:41:04.468869678Z', + }, + { + timeseries_name: 'ddm_router:originated_underlay_prefixes', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-22T06:41:04.458812191Z', + }, + { + timeseries_name: 'ddm_session:advertisements_received', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'interface', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-22T06:41:04.490830594Z', + }, + { + timeseries_name: 'ddm_session:advertisements_sent', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'interface', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-22T06:41:04.485165121Z', + }, + { + timeseries_name: 'ddm_session:imported_tunnel_endpoints', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'interface', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-22T06:41:04.532085293Z', + }, + { + timeseries_name: 'ddm_session:imported_underlay_prefixes', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'interface', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-22T06:41:04.526955683Z', + }, + { + timeseries_name: 'ddm_session:peer_address_changes', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'interface', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-22T06:41:04.501513674Z', + }, + { + timeseries_name: 'ddm_session:peer_expirations', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'interface', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-22T06:41:04.496421046Z', + }, + { + timeseries_name: 'ddm_session:peer_sessions_established', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'interface', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-22T06:41:04.506910539Z', + }, + { + timeseries_name: 'ddm_session:solicitations_received', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'interface', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-22T06:41:04.479772914Z', + }, + { + timeseries_name: 'ddm_session:solicitations_sent', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'interface', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-22T06:41:04.473936670Z', + }, + { + timeseries_name: 'ddm_session:update_send_fail', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'interface', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-22T06:41:04.522046049Z', + }, + { + timeseries_name: 'ddm_session:updates_received', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'interface', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-22T06:41:04.516919585Z', + }, + { + timeseries_name: 'ddm_session:updates_sent', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'interface', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-22T06:41:04.511944819Z', + }, + { + timeseries_name: 'dendrite:sample_collection_duration', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'metric', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'metric', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'metric', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'metric', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'metric', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'metric', + description: '', + }, + ], + datum_type: 'f64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:40.028670944Z', + }, + { + timeseries_name: 'hardware_component:amd_cpu_tctl', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'chassis_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'chassis_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'chassis_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'chassis_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'component_id', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'component_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'description', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'gateway_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'hubris_archive_id', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sensor', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'slot', + field_type: 'u32', + source: 'target', + description: '', + }, + ], + datum_type: 'f32', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-09-26T20:54:40.780650780Z', + }, + { + timeseries_name: 'hardware_component:current', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'chassis_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'chassis_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'chassis_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'chassis_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'component_id', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'component_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'description', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'gateway_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'hubris_archive_id', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sensor', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'slot', + field_type: 'u32', + source: 'target', + description: '', + }, + ], + datum_type: 'f32', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-08-27T02:18:06.049588403Z', + }, + { + timeseries_name: 'hardware_component:fan_speed', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'chassis_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'chassis_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'chassis_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'chassis_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'component_id', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'component_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'description', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'gateway_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'hubris_archive_id', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sensor', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'slot', + field_type: 'u32', + source: 'target', + description: '', + }, + ], + datum_type: 'f32', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-08-27T02:18:06.071093138Z', + }, + { + timeseries_name: 'hardware_component:input_current', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'chassis_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'chassis_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'chassis_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'chassis_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'component_id', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'component_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'description', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'gateway_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'hubris_archive_id', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sensor', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'slot', + field_type: 'u32', + source: 'target', + description: '', + }, + ], + datum_type: 'f32', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-08-27T02:18:06.060593618Z', + }, + { + timeseries_name: 'hardware_component:input_voltage', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'chassis_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'chassis_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'chassis_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'chassis_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'component_id', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'component_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'description', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'gateway_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'hubris_archive_id', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sensor', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'slot', + field_type: 'u32', + source: 'target', + description: '', + }, + ], + datum_type: 'f32', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-08-27T02:18:06.065753331Z', + }, + { + timeseries_name: 'hardware_component:poll_error_count', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'chassis_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'chassis_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'chassis_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'chassis_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'component_id', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'component_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'description', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'error', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'gateway_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'hubris_archive_id', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'slot', + field_type: 'u32', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-10-15T00:13:59.310580937Z', + }, + { + timeseries_name: 'hardware_component:power', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'chassis_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'chassis_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'chassis_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'chassis_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'component_id', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'component_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'description', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'gateway_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'hubris_archive_id', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sensor', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'slot', + field_type: 'u32', + source: 'target', + description: '', + }, + ], + datum_type: 'f32', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-08-27T02:18:06.084199090Z', + }, + { + timeseries_name: 'hardware_component:sensor_error_count', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'chassis_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'chassis_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'chassis_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'chassis_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'component_id', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'component_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'description', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'error', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'gateway_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'hubris_archive_id', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sensor', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'sensor_kind', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'slot', + field_type: 'u32', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-08-27T02:18:06.038148045Z', + }, + { + timeseries_name: 'hardware_component:temperature', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'chassis_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'chassis_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'chassis_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'chassis_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'component_id', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'component_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'description', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'gateway_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'hubris_archive_id', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sensor', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'slot', + field_type: 'u32', + source: 'target', + description: '', + }, + ], + datum_type: 'f32', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-08-27T02:18:06.044202257Z', + }, + { + timeseries_name: 'hardware_component:voltage', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'chassis_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'chassis_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'chassis_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'chassis_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'component_id', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'component_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'description', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'gateway_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'hubris_archive_id', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sensor', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'slot', + field_type: 'u32', + source: 'target', + description: '', + }, + ], + datum_type: 'f32', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-08-27T02:18:06.055480125Z', + }, + { + timeseries_name: 'http_service:request_latency_histogram', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'operation_id', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'status_code', + field_type: 'u16', + source: 'metric', + description: '', + }, + ], + datum_type: 'histogram_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-09-12T18:06:16.899666089Z', + }, + { + timeseries_name: 'instance_network_interface:bytes_received', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'instance_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'interface_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'project_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'silo_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-09-12T18:07:20.691164152Z', + }, + { + timeseries_name: 'instance_network_interface:bytes_sent', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'instance_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'interface_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'project_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'silo_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-09-12T18:07:20.709144483Z', + }, + { + timeseries_name: 'instance_network_interface:errors_received', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'instance_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'interface_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'project_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'silo_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-09-12T18:07:20.695807570Z', + }, + { + timeseries_name: 'instance_network_interface:errors_sent', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'instance_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'interface_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'project_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'silo_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-09-12T18:07:20.713747565Z', + }, + { + timeseries_name: 'instance_network_interface:packets_dropped', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'instance_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'interface_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'project_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'silo_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-09-12T18:07:20.700227615Z', + }, + { + timeseries_name: 'instance_network_interface:packets_received', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'instance_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'interface_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'project_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'silo_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-09-12T18:07:20.685683981Z', + }, + { + timeseries_name: 'instance_network_interface:packets_sent', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'instance_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'interface_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'project_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'silo_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-09-12T18:07:20.704117609Z', + }, + { + timeseries_name: 'kstat_sampler:expired_targets', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-09-18T23:28:55.312503012Z', + }, + { + timeseries_name: 'kstat_sampler:samples_dropped', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'target_id', + field_type: 'u64', + source: 'metric', + description: '', + }, + { + name: 'target_name', + field_type: 'string', + source: 'metric', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2023-11-17T02:53:34.642824724Z', + }, + { + timeseries_name: 'management_network_data_link:bytes_received', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-13T07:32:13.160257732Z', + }, + { + timeseries_name: 'management_network_data_link:bytes_sent', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-13T07:32:12.656694601Z', + }, + { + timeseries_name: 'management_network_data_link:errors_received', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-13T07:32:12.801529140Z', + }, + { + timeseries_name: 'management_network_data_link:errors_sent', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-13T07:32:12.904711448Z', + }, + { + timeseries_name: 'management_network_data_link:packets_received', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-13T07:32:13.197085086Z', + }, + { + timeseries_name: 'management_network_data_link:packets_sent', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-13T07:32:12.751660813Z', + }, + { + timeseries_name: 'mg_lower:routes_blocked_by_link_state', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.479959512Z', + }, + { + timeseries_name: 'opte_port:in_uft_evictions', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'interface_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'interface_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'parent_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'port_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'zone_name', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2026-08-10T22:26:03.789533870Z', + }, + { + timeseries_name: 'opte_port:in_uft_flows', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'interface_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'interface_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'parent_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'port_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'zone_name', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2026-08-10T22:26:03.789530543Z', + }, + { + timeseries_name: 'opte_port:in_uft_hits', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'interface_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'interface_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'parent_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'port_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'zone_name', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2026-08-10T22:26:03.789523680Z', + }, + { + timeseries_name: 'opte_port:in_uft_misses', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'interface_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'interface_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'parent_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'port_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'zone_name', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2026-08-10T22:26:03.789527427Z', + }, + { + timeseries_name: 'opte_port:out_uft_evictions', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'interface_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'interface_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'parent_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'port_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'zone_name', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2026-08-10T22:26:03.789547245Z', + }, + { + timeseries_name: 'opte_port:out_uft_flows', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'interface_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'interface_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'parent_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'port_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'zone_name', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2026-08-10T22:26:03.789543909Z', + }, + { + timeseries_name: 'opte_port:out_uft_hits', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'interface_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'interface_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'parent_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'port_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'zone_name', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2026-08-10T22:26:03.789537547Z', + }, + { + timeseries_name: 'opte_port:out_uft_misses', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'interface_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'interface_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'parent_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'port_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'zone_name', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2026-08-10T22:26:03.789540753Z', + }, + { + timeseries_name: 'opte_port:route_cache_hits', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'interface_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'interface_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'parent_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'port_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'zone_name', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2026-08-10T22:26:03.789554018Z', + }, + { + timeseries_name: 'opte_port:route_cache_misses', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'interface_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'interface_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'parent_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'port_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'zone_name', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2026-08-10T22:26:03.789558386Z', + }, + { + timeseries_name: 'opte_port:route_cache_occupancy', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'interface_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'interface_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'parent_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'port_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'zone_name', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2026-08-10T22:26:03.789550782Z', + }, + { + timeseries_name: 'opte_port:route_cache_table_full', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'interface_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'interface_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'parent_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'port_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'zone_name', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2026-08-10T22:26:03.789561822Z', + }, + { + timeseries_name: 'oximeter_collector:collections', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'base_route', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'collector_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'collector_ip', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'collector_port', + field_type: 'u16', + source: 'target', + description: '', + }, + { + name: 'producer_id', + field_type: 'uuid', + source: 'metric', + description: '', + }, + { + name: 'producer_ip', + field_type: 'ip_addr', + source: 'metric', + description: '', + }, + { + name: 'producer_port', + field_type: 'u16', + source: 'metric', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2023-11-17T02:53:57.255983666Z', + }, + { + timeseries_name: 'oximeter_collector:database_queue_depth', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'collector_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'collector_ip', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'collector_port', + field_type: 'u16', + source: 'target', + description: '', + }, + { + name: 'collector_sink', + field_type: 'string', + source: 'metric', + description: '', + }, + ], + datum_type: 'histogram_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2026-07-09T14:03:34.016056546Z', + }, + { + timeseries_name: 'oximeter_collector:database_samples_dropped', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'collector_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'collector_ip', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'collector_port', + field_type: 'u16', + source: 'target', + description: '', + }, + { + name: 'collector_sink', + field_type: 'string', + source: 'metric', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2026-07-09T14:03:34.016052395Z', + }, + { + timeseries_name: 'oximeter_collector:failed_collections', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'base_route', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'collector_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'collector_ip', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'collector_port', + field_type: 'u16', + source: 'target', + description: '', + }, + { + name: 'producer_id', + field_type: 'uuid', + source: 'metric', + description: '', + }, + { + name: 'producer_ip', + field_type: 'ip_addr', + source: 'metric', + description: '', + }, + { + name: 'producer_port', + field_type: 'u16', + source: 'metric', + description: '', + }, + { + name: 'reason', + field_type: 'string', + source: 'metric', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2023-11-17T02:56:39.525743256Z', + }, + { + timeseries_name: 'oximeter_collector:samples_collected', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'base_route', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'collector_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'collector_ip', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'collector_port', + field_type: 'u16', + source: 'target', + description: '', + }, + { + name: 'producer_id', + field_type: 'uuid', + source: 'metric', + description: '', + }, + { + name: 'producer_ip', + field_type: 'ip_addr', + source: 'metric', + description: '', + }, + { + name: 'producer_port', + field_type: 'u16', + source: 'metric', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2026-07-09T14:04:14.539773793Z', + }, + { + timeseries_name: 'physical_data_link:bytes_received', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-08-21T22:24:04.500160033Z', + }, + { + timeseries_name: 'physical_data_link:bytes_sent', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-08-21T22:24:04.507782173Z', + }, + { + timeseries_name: 'physical_data_link:errors_received', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-08-21T22:24:04.491505511Z', + }, + { + timeseries_name: 'physical_data_link:errors_sent', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-08-21T22:24:04.496304619Z', + }, + { + timeseries_name: 'physical_data_link:packets_received', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-08-21T22:24:04.504092176Z', + }, + { + timeseries_name: 'physical_data_link:packets_sent', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-08-21T22:24:04.511712158Z', + }, + { + timeseries_name: 'sled_cpu:cpu_nsec', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'cpu_id', + field_type: 'u32', + source: 'metric', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'state', + field_type: 'string', + source: 'metric', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2026-03-03T00:01:22.032950719Z', + }, + { + timeseries_name: 'sled_data_link:bytes_received', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'zone_name', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-08-14T03:24:34.149372848Z', + }, + { + timeseries_name: 'sled_data_link:bytes_sent', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'zone_name', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-08-14T03:24:34.232414065Z', + }, + { + timeseries_name: 'sled_data_link:errors_received', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'zone_name', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-08-14T03:24:34.050086881Z', + }, + { + timeseries_name: 'sled_data_link:errors_sent', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'zone_name', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-08-14T03:24:34.092318117Z', + }, + { + timeseries_name: 'sled_data_link:packets_received', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'zone_name', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-08-14T03:24:34.193000416Z', + }, + { + timeseries_name: 'sled_data_link:packets_sent', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'zone_name', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-08-14T03:24:34.270285239Z', + }, + { + timeseries_name: 'static_routing_config:static_nexthops', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.470632635Z', + }, + { + timeseries_name: 'static_routing_config:static_routes', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.465433112Z', + }, + { + timeseries_name: 'switch_data_link:bytes_received', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_id', + field_type: 'u8', + source: 'metric', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'port_id', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:39.678212511Z', + }, + { + timeseries_name: 'switch_data_link:bytes_sent', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_id', + field_type: 'u8', + source: 'metric', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'port_id', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:39.707787542Z', + }, + { + timeseries_name: 'switch_data_link:errors_received', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_id', + field_type: 'u8', + source: 'metric', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'port_id', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:39.695740167Z', + }, + { + timeseries_name: 'switch_data_link:errors_sent', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_id', + field_type: 'u8', + source: 'metric', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'port_id', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:39.714194722Z', + }, + { + timeseries_name: 'switch_data_link:fec_corrected_blocks', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_id', + field_type: 'u8', + source: 'metric', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'port_id', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:39.732581990Z', + }, + { + timeseries_name: 'switch_data_link:fec_high_symbol_errors', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_id', + field_type: 'u8', + source: 'metric', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'port_id', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'bool', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:39.720562272Z', + }, + { + timeseries_name: 'switch_data_link:fec_symbol_errors', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'lane', + field_type: 'u8', + source: 'metric', + description: '', + }, + { + name: 'link_id', + field_type: 'u8', + source: 'metric', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'port_id', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:39.744428376Z', + }, + { + timeseries_name: 'switch_data_link:fec_sync_aligned', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_id', + field_type: 'u8', + source: 'metric', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'port_id', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'bool', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:39.726717613Z', + }, + { + timeseries_name: 'switch_data_link:fec_uncorrected_blocks', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_id', + field_type: 'u8', + source: 'metric', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'port_id', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:39.738632766Z', + }, + { + timeseries_name: 'switch_data_link:link_enabled', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_id', + field_type: 'u8', + source: 'metric', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'port_id', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'bool', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:39.654131442Z', + }, + { + timeseries_name: 'switch_data_link:link_fsm', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_id', + field_type: 'u8', + source: 'metric', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'port_id', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'state', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:39.751036026Z', + }, + { + timeseries_name: 'switch_data_link:link_up', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_id', + field_type: 'u8', + source: 'metric', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'port_id', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'bool', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:39.664448579Z', + }, + { + timeseries_name: 'switch_data_link:packets_received', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_id', + field_type: 'u8', + source: 'metric', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'port_id', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:39.672147342Z', + }, + { + timeseries_name: 'switch_data_link:packets_sent', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_id', + field_type: 'u8', + source: 'metric', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'port_id', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:39.702278594Z', + }, { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: 'ID of the rack containing the component', + timeseries_name: 'switch_data_link:pcs_bad_sync_headers', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_id', + field_type: 'u8', + source: 'metric', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'port_id', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:39.758203239Z', }, { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: 'ID of the sled reporting the component', + timeseries_name: 'switch_data_link:pcs_block_lock_loss', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_id', + field_type: 'u8', + source: 'metric', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'port_id', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:39.770730009Z', }, { - name: 'chassis_kind', - field_type: 'string', - source: 'target', - description: 'What kind of thing the component is a part of', + timeseries_name: 'switch_data_link:pcs_errored_blocks', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_id', + field_type: 'u8', + source: 'metric', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'port_id', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:39.777603911Z', }, { - name: 'chassis_serial', - field_type: 'string', - source: 'target', - description: 'Serial number of the chassis', + timeseries_name: 'switch_data_link:pcs_high_ber', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_id', + field_type: 'u8', + source: 'metric', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'port_id', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:39.784408692Z', }, { - name: 'slot', - field_type: 'u32', - source: 'target', - description: 'Slot number of the chassis', + timeseries_name: 'switch_data_link:pcs_invalid_errors', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_id', + field_type: 'u8', + source: 'metric', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'port_id', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:39.790948389Z', }, { - name: 'component_id', - field_type: 'string', - source: 'target', - description: 'ID of the component', + timeseries_name: 'switch_data_link:pcs_sync_loss', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_id', + field_type: 'u8', + source: 'metric', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'port_id', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:39.764811478Z', }, { - name: 'sensor', - field_type: 'string', - source: 'metric', - description: 'Name of the sensor', + timeseries_name: 'switch_data_link:pcs_unknown_errors', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_id', + field_type: 'u8', + source: 'metric', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'port_id', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:39.799540984Z', }, -] - -const sledDataLinkFields: Json['field_schema'] = [ { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: 'ID of the rack containing the link', + timeseries_name: 'switch_data_link:pcs_valid_errors', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_id', + field_type: 'u8', + source: 'metric', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'port_id', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:39.805847762Z', }, { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: 'ID of the sled containing the link', + timeseries_name: 'switch_data_link:receive_buffer_full_drops', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_id', + field_type: 'u8', + source: 'metric', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'port_id', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:39.690159917Z', }, { - name: 'serial', - field_type: 'string', - source: 'target', - description: 'Serial number of the sled', + timeseries_name: 'switch_data_link:receive_crc_error_drops', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_id', + field_type: 'u8', + source: 'metric', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'port_id', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:39.684158156Z', }, { - name: 'kind', - field_type: 'string', - source: 'target', - description: 'Kind of the data link (physical or virtual)', + timeseries_name: 'switch_port_control_data_link:bytes_received', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-13T07:32:13.638699340Z', }, { - name: 'link_name', - field_type: 'string', - source: 'target', - description: 'Name of the data link', + timeseries_name: 'switch_port_control_data_link:bytes_sent', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-13T07:32:13.364408444Z', }, -] - -const common = { - authz_scope: 'fleet', - version: 1, - created: '2025-01-01T00:00:00Z', -} as const - -export const timeseriesSchemas: Json[] = [ { - ...common, - timeseries_name: 'hardware_component:fan_speed', + timeseries_name: 'switch_port_control_data_link:errors_received', description: { - target: 'A hardware component on a compute sled, switch, or power shelf', - metric: 'A fan speed measurement', + target: '', + metric: '', }, - field_schema: hardwareComponentFields, - datum_type: 'f32', - units: 'rpm', + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-13T07:32:13.505589080Z', }, { - ...common, - timeseries_name: 'hardware_component:temperature', + timeseries_name: 'switch_port_control_data_link:errors_sent', description: { - target: 'A hardware component on a compute sled, switch, or power shelf', - metric: 'A temperature measurement', + target: '', + metric: '', }, - field_schema: hardwareComponentFields, - datum_type: 'f32', - units: 'degrees_celsius', + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-13T07:32:13.589540327Z', }, { - ...common, - timeseries_name: 'hardware_component:amd_cpu_tctl', + timeseries_name: 'switch_port_control_data_link:packets_received', description: { - target: 'A hardware component on a compute sled, switch, or power shelf', - metric: 'A CPU Tctl reading (dimensionless)', + target: '', + metric: '', }, - field_schema: hardwareComponentFields, - datum_type: 'f32', + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', units: 'none', + created: '2025-02-13T07:32:13.799182096Z', }, { - ...common, - timeseries_name: 'sled_data_link:bytes_sent', + timeseries_name: 'switch_port_control_data_link:packets_sent', description: { - target: 'A network data link on a compute sled', - metric: 'Total number of bytes sent on the link', + target: '', + metric: '', }, - field_schema: sledDataLinkFields, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'link_name', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'network', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + ], datum_type: 'cumulative_u64', - units: 'bytes', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-13T07:32:13.421921557Z', }, { - ...common, - timeseries_name: 'sled_data_link:bytes_received', + timeseries_name: 'switch_rib:active_routes', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'hostname', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-03-27T21:18:27.475028506Z', + }, + { + timeseries_name: 'switch_table:capacity', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + { + name: 'table', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:39.955432618Z', + }, + { + timeseries_name: 'switch_table:collisions', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + { + name: 'table', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:39.993290403Z', + }, + { + timeseries_name: 'switch_table:delete_misses', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + { + name: 'table', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:40.006538271Z', + }, + { + timeseries_name: 'switch_table:deletes', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + { + name: 'table', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:39.977541324Z', + }, + { + timeseries_name: 'switch_table:exhaustion', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + { + name: 'table', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:40.013588153Z', + }, + { + timeseries_name: 'switch_table:inserts', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + { + name: 'table', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:39.970311290Z', + }, + { + timeseries_name: 'switch_table:occupancy', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + { + name: 'table', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:39.962671108Z', + }, + { + timeseries_name: 'switch_table:update_misses', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + { + name: 'table', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:39.999692262Z', + }, + { + timeseries_name: 'switch_table:updates', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'asic_fab', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_lot', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'asic_wafer', + field_type: 'u8', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_x', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'asic_wafer_loc_y', + field_type: 'i16', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'switch_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'switch_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'switch_slot', + field_type: 'u16', + source: 'target', + description: '', + }, + { + name: 'table', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2025-02-14T22:29:39.985250897Z', + }, + { + timeseries_name: 'virtual_disk:bytes_discarded', description: { - target: 'A network data link on a compute sled', - metric: 'Total number of bytes received on the link', + target: '', + metric: '', }, - field_schema: sledDataLinkFields, + field_schema: [ + { + name: 'attached_instance_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'block_size', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'disk_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'project_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'silo_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], datum_type: 'cumulative_u64', - units: 'bytes', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2026-06-30T18:33:29.089497759Z', + }, + { + timeseries_name: 'virtual_disk:bytes_read', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'attached_instance_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'block_size', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'disk_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'project_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'silo_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-09-12T18:07:20.725376238Z', + }, + { + timeseries_name: 'virtual_disk:bytes_written', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'attached_instance_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'block_size', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'disk_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'project_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'silo_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-09-12T18:07:20.737369060Z', + }, + { + timeseries_name: 'virtual_disk:discards', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'attached_instance_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'block_size', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'disk_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'project_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'silo_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2026-06-30T18:33:29.089363383Z', + }, + { + timeseries_name: 'virtual_disk:failed_discards', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'attached_instance_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'block_size', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'disk_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'failure_reason', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'project_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'silo_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2026-06-30T18:33:29.089649599Z', + }, + { + timeseries_name: 'virtual_disk:failed_flushes', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'attached_instance_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'block_size', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'disk_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'failure_reason', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'project_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'silo_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-09-12T18:07:20.749378966Z', + }, + { + timeseries_name: 'virtual_disk:failed_reads', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'attached_instance_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'block_size', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'disk_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'failure_reason', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'project_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'silo_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-09-12T18:07:20.729368797Z', + }, + { + timeseries_name: 'virtual_disk:failed_writes', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'attached_instance_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'block_size', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'disk_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'failure_reason', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'project_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'silo_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-09-12T18:07:20.741157142Z', + }, + { + timeseries_name: 'virtual_disk:flushes', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'attached_instance_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'block_size', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'disk_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'project_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'silo_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-09-12T18:07:20.745168876Z', + }, + { + timeseries_name: 'virtual_disk:io_latency', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'attached_instance_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'block_size', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'disk_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'io_kind', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'project_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'silo_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'histogram_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-09-12T18:07:20.754569807Z', + }, + { + timeseries_name: 'virtual_disk:io_size', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'attached_instance_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'block_size', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'disk_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'io_kind', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'project_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'silo_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'histogram_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-09-12T18:07:20.759303246Z', + }, + { + timeseries_name: 'virtual_disk:reads', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'attached_instance_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'block_size', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'disk_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'project_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'silo_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-09-12T18:07:20.721185245Z', + }, + { + timeseries_name: 'virtual_disk:writes', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'attached_instance_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'block_size', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'disk_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'project_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'silo_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-09-12T18:07:20.733402020Z', + }, + { + timeseries_name: 'virtual_machine:check', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'instance_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'nexus_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'project_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'reason', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'silo_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_agent_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_agent_ip', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'sled_agent_port', + field_type: 'u16', + source: 'target', + description: '', + }, + { + name: 'state', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'vmm_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-05-19T00:07:04.930606011Z', + }, + { + timeseries_name: 'virtual_machine:incomplete_check', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'instance_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'nexus_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'project_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'reason', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'silo_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_agent_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_agent_ip', + field_type: 'ip_addr', + source: 'target', + description: '', + }, + { + name: 'sled_agent_port', + field_type: 'u16', + source: 'target', + description: '', + }, + { + name: 'vmm_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-06-20T17:45:08.409040686Z', + }, + { + timeseries_name: 'virtual_machine:pv_panic_guest_handled', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'instance_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'project_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'silo_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-08-01T21:43:51.299251810Z', + }, + { + timeseries_name: 'virtual_machine:pv_panic_host_handled', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'instance_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'project_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'silo_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-08-01T21:43:51.305010310Z', + }, + { + timeseries_name: 'virtual_machine:reset', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'instance_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'project_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'silo_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-08-01T21:43:51.309966069Z', + }, + { + timeseries_name: 'virtual_machine:vcpu_usage', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'instance_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'project_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'silo_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'state', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'vcpu_id', + field_type: 'u32', + source: 'metric', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2024-08-01T21:43:51.313851227Z', + }, + { + timeseries_name: 'zfs_dataset:bytes_used', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'dataset_id', + field_type: 'uuid', + source: 'metric', + description: '', + }, + { + name: 'dataset_kind', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'dataset_name', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'pool_id', + field_type: 'uuid', + source: 'metric', + description: '', + }, + { + name: 'pool_kind', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'zone_name', + field_type: 'string', + source: 'metric', + description: '', + }, + ], + datum_type: 'u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2026-05-27T02:53:06.414720080Z', + }, + { + timeseries_name: 'zfs_pool:bytes_allocated', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'pool_id', + field_type: 'uuid', + source: 'metric', + description: '', + }, + { + name: 'pool_kind', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'pool_name', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2026-05-27T02:53:06.413670104Z', + }, + { + timeseries_name: 'zfs_pool:bytes_total', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'pool_id', + field_type: 'uuid', + source: 'metric', + description: '', + }, + { + name: 'pool_kind', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'pool_name', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + ], + datum_type: 'u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2026-05-27T02:53:06.413805258Z', + }, + { + timeseries_name: 'zone:cpu_nsec', + description: { + target: '', + metric: '', + }, + field_schema: [ + { + name: 'rack_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_id', + field_type: 'uuid', + source: 'target', + description: '', + }, + { + name: 'sled_model', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'sled_revision', + field_type: 'u32', + source: 'target', + description: '', + }, + { + name: 'sled_serial', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'state', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'zone_id', + field_type: 'uuid', + source: 'metric', + description: '', + }, + { + name: 'zone_name', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'zone_type', + field_type: 'string', + source: 'metric', + description: '', + }, + ], + datum_type: 'cumulative_u64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2026-03-30T23:58:07.024767757Z', }, ] From dda0945d73301c2d6b853bfdd3de40d4aec15b44 Mon Sep 17 00:00:00 2001 From: Joe Thel Date: Wed, 9 Sep 2026 13:51:05 -0700 Subject: [PATCH 13/46] Revert the Claude lie There is no such thing as "one representative query". There are three distinct kinds of charts, to say nothing of layout! --- test/visual/regression.e2e.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/visual/regression.e2e.ts b/test/visual/regression.e2e.ts index 026998591..1b6d1e848 100644 --- a/test/visual/regression.e2e.ts +++ b/test/visual/regression.e2e.ts @@ -258,13 +258,13 @@ test.describe('Visual Regression', { tag: '@visual' }, () => { }) }) - // one representative query is enough for styling coverage: the joined query - // exercises multiple charts, legends, and the results list in one screenshot - test('oxql metrics explorer', async ({ page }) => { - await page.goto('/system/metrics-explorer', { waitUntil: 'networkidle' }) - await page.getByRole('textbox').fill(oxqlQueries.multiJoinedTables) - await page.getByRole('button', { name: 'Run query' }).click() - await expect(page.locator('figure').first()).toBeVisible() - await expect(page).toHaveScreenshot('oxql-metrics-explorer.png', fullPage) - }) + for (const [name, query] of Object.entries(oxqlQueries)) { + test(`oxql ${name}`, async ({ page }) => { + await page.goto('/system/metrics-explorer', { waitUntil: 'networkidle' }) + await page.getByRole('textbox').fill(query) + await page.getByRole('button', { name: 'Run query' }).click() + await expect(page.locator('figure').first()).toBeVisible() + await expect(page).toHaveScreenshot(`metrics-explorer-${name}.png`, fullPage) + }) + } }) From 7083b49ba03046b47860cde06ed60813eeb54c72 Mon Sep 17 00:00:00 2001 From: Joe Thel Date: Thu, 10 Sep 2026 17:14:43 -0700 Subject: [PATCH 14/46] Remove active line highlight when not focused --- app/ui/styles/components/oxql-editor.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/ui/styles/components/oxql-editor.css b/app/ui/styles/components/oxql-editor.css index 8011f231c..30750fb30 100644 --- a/app/ui/styles/components/oxql-editor.css +++ b/app/ui/styles/components/oxql-editor.css @@ -53,6 +53,10 @@ } .cm-activeLine { + background-color: transparent; + } + + &.cm-focused .cm-activeLine { background-color: var(--surface-secondary); } From e716e3be3d898b9329225281704362f6807ac145 Mon Sep 17 00:00:00 2001 From: Joe Thel Date: Fri, 11 Sep 2026 12:17:52 -0700 Subject: [PATCH 15/46] fix highlighting Codemirror was putting it behind the active line, making it challenging to see what text you selected (and impossible to tell what whitespace you selected). --- app/ui/styles/components/oxql-editor.css | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/ui/styles/components/oxql-editor.css b/app/ui/styles/components/oxql-editor.css index 30750fb30..8b7b3eaf0 100644 --- a/app/ui/styles/components/oxql-editor.css +++ b/app/ui/styles/components/oxql-editor.css @@ -52,6 +52,15 @@ @apply bg-accent-inverse/30; } + /* + * drawSelection sets z-index: -2 on the selection layer as an inline style, + * rendering it invisible. But we actually want to see it! + */ + .cm-selectionLayer { + z-index: unset !important; + pointer-events: none; /* without making it interactive, that is */ + } + .cm-activeLine { background-color: transparent; } From 71c0998f01059611af7a7a6abd37ba2c97a30116 Mon Sep 17 00:00:00 2001 From: Joe Thel Date: Fri, 11 Sep 2026 12:25:54 -0700 Subject: [PATCH 16/46] Add autocompletion with tab --- app/components/OxqlEditor.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/components/OxqlEditor.tsx b/app/components/OxqlEditor.tsx index 26f0b739e..e0c59014d 100644 --- a/app/components/OxqlEditor.tsx +++ b/app/components/OxqlEditor.tsx @@ -1,3 +1,4 @@ +import { acceptCompletion } from '@codemirror/autocomplete' /* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -184,8 +185,10 @@ export function OxqlEditor({ }, ...defaultKeymap, ...historyKeymap, - // tab indents instead of moving focus. the standard escape hatch - // still works: Ctrl-m (from defaultKeymap) toggles tab focus mode + // tab accepts/indents instead of moving focus. the standard escape + // hatch still works: Ctrl-m (from defaultKeymap) toggles tab focus + // mode + { key: 'Tab', run: acceptCompletion }, indentWithTab, ]), EditorView.lineWrapping, From 062ee79aeaea4df26388e23060b0b6bb3dd1b069 Mon Sep 17 00:00:00 2001 From: Joe Thel Date: Mon, 14 Sep 2026 11:01:01 -0700 Subject: [PATCH 17/46] refactor: abstract the code snippet detection a bit This page is already tipped pretty far into "knowing everything about backend implementation details", so I'm just grabbing an easy win here. --- app/components/oxql-error.spec.ts | 81 ++++++++++++++++------------ app/components/oxql-error.ts | 27 +++++++++- app/pages/system/MetricsExplorer.tsx | 36 +++++++------ 3 files changed, 95 insertions(+), 49 deletions(-) diff --git a/app/components/oxql-error.spec.ts b/app/components/oxql-error.spec.ts index ff212484e..086f9681b 100644 --- a/app/components/oxql-error.spec.ts +++ b/app/components/oxql-error.spec.ts @@ -7,7 +7,7 @@ */ import { describe, expect, it } from 'vitest' -import { codeSegment, parseOxqlQueryError, stripCaretLine } from './oxql-error' +import { errorMessageToSegments, parseOxqlQueryError, stripCaretLine } from './oxql-error' // realistic examples of omicron's fmt_parse_error output const parseError = `Error at 1:1: .. junk junk junk! .. @@ -81,61 +81,76 @@ Expected: error at 1:1: expected one of "get", "{" }) }) -describe('codeSegment', () => { - // odd indices are the code segments - const split = (message: string) => message.split(codeSegment) +describe('errorMessageToSegments', () => { + const t = (text: string) => ({ type: 'text', text }) + const c = (raw: string, code: string, isTruncated = false) => ({ + type: 'code', + isTruncated, + code, + raw, + }) it('splits out excerpt markers, quoted tokens, and backticked names', () => { - expect(split('Error at 1:1: .. junk junk! ..\nExpected: one of "get", "{"')).toEqual([ - 'Error at 1:1: ', - '.. junk junk! ..', - '\nExpected: one of ', - '"get"', - ', ', - '"{"', - '', + expect( + errorMessageToSegments('Error at 1:1: .. junk junk! ..\nExpected: one of "get", "{"') + ).toEqual([ + t('Error at 1:1: '), + c('.. junk junk! ..', 'junk junk!', true), + t('\nExpected: one of '), + c('"get"', 'get'), + t(', '), + c('"{"', '{'), + t(''), ]) - expect(split('Input tables to a `group_by` must be aligned')).toEqual([ - 'Input tables to a ', - '`group_by`', - ' must be aligned', + expect(errorMessageToSegments('Input tables to a `group_by` must be aligned')).toEqual([ + t('Input tables to a '), + c('`group_by`', 'group_by'), + t(' must be aligned'), ]) }) it('keeps a filter expression with nested quotes in one segment', () => { // omicron interpolates the raw expression, so quotes inside it are unescaped - expect(split('The filter expression "kind == "power"" is not valid, because')).toEqual([ - 'The filter expression ', - '"kind == "power""', - ' is not valid, because', + expect( + errorMessageToSegments( + 'The filter expression "kind == "power"" is not valid, because' + ) + ).toEqual([ + t('The filter expression '), + c('"kind == "power""', 'kind == "power"'), + t(' is not valid, because'), ]) // nested quotes mid-expression, where the inner closing quote is followed // by a delimiter and could be mistaken for the end of the segment expect( - split('The filter expression "kind == "power" && sled == 1" is not valid, because') + errorMessageToSegments( + 'The filter expression "kind == "power" && sled == 1" is not valid, because' + ) ).toEqual([ - 'The filter expression ', - '"kind == "power" && sled == 1"', - ' is not valid, because', + t('The filter expression '), + c('"kind == "power" && sled == 1"', 'kind == "power" && sled == 1'), + t(' is not valid, because'), ]) }) it('splits identifier lists into one segment per name', () => { expect( - split('Invalid identifiers: ["chassis_kind"], valid: ["datum", "peer"]') + errorMessageToSegments( + 'Invalid identifiers: ["chassis_kind"], valid: ["datum", "peer"]' + ) ).toEqual([ - 'Invalid identifiers: [', - '"chassis_kind"', - '], valid: [', - '"datum"', - ', ', - '"peer"', - ']', + t('Invalid identifiers: ['), + c('"chassis_kind"', 'chassis_kind'), + t('], valid: ['), + c('"datum"', 'datum'), + t(', '), + c('"peer"', 'peer'), + t(']'), ]) }) it('leaves unbalanced quotes alone', () => { const message = 'something with a stray " quote' - expect(split(message)).toEqual([message]) + expect(errorMessageToSegments(message)).toEqual([t(message)]) }) }) diff --git a/app/components/oxql-error.ts b/app/components/oxql-error.ts index dd812a2c9..022c05423 100644 --- a/app/components/oxql-error.ts +++ b/app/components/oxql-error.ts @@ -13,6 +13,15 @@ export type OxqlDiagnostic = { message: string } +export type Segment = + | { + type: 'code' + isTruncated: boolean + code: string + raw: string + } + | { type: 'text'; text: string } + /** * Drop the caret line (whitespace + `^`) from a parse error: its alignment * assumes a monospace terminal, and the editor underline already points at @@ -33,9 +42,25 @@ export const stripCaretLine = (message: string) => message.replace(/\n *\^ *(?=\ * delimiter rather than a word char or another quote. * https://github.com/oxidecomputer/omicron/blob/6db4c7e/oximeter/db/src/oxql/plan/filter.rs */ -export const codeSegment = +const codeSegment = /(\.\. [\s\S]*? \.\.|(?<=The filter expression )"[^\n]*"(?= is not valid)|(? { + if (i % 2 === 0) return { type: 'text', text: part } + + // code snippets are always wrapped in quotes, backticks, or `.. ..` + const isTruncated = part.startsWith('.. ') + const wrapperLength = isTruncated ? 3 : 1 + return { + type: 'code', + isTruncated, + code: part.slice(wrapperLength, -wrapperLength), + raw: part, + } + }) +} + /** * Pull the position and expectation out of an OxQL parse error so it can be * shown as a diagnostic in the editor. The message format comes from diff --git a/app/pages/system/MetricsExplorer.tsx b/app/pages/system/MetricsExplorer.tsx index bcb7af186..bcad11067 100644 --- a/app/pages/system/MetricsExplorer.tsx +++ b/app/pages/system/MetricsExplorer.tsx @@ -33,7 +33,11 @@ import { Badge } from '@oxide/design-system/ui' import { DocsPopover } from '~/components/DocsPopover' import { Heatmap } from '~/components/Heatmap' import { MoreActionsMenu } from '~/components/MoreActionsMenu' -import { codeSegment, parseOxqlQueryError, stripCaretLine } from '~/components/oxql-error' +import { + errorMessageToSegments, + parseOxqlQueryError, + stripCaretLine, +} from '~/components/oxql-error' import { OxqlEditor } from '~/components/OxqlEditor' import { ChartContainer, @@ -693,20 +697,22 @@ function ResultsSummary({ tables }: { tables: OxqlTable[] }) { // chip, reading as ellipses. const ErrorMessage = ({ message }: { message: string }) => ( - {message.split(codeSegment).map((part, i) => { - if (i % 2 === 0) return part - // the chip delimits the code, so drop the markers/quotes around it - const code = part.startsWith('.. ') ? part.slice(3, -3) : part.slice(1, -1) - // an empty chip is just visual noise; show the raw text instead - if (!code) return part - return ( - - {part.startsWith('.. ') && '.. '} - {code} - {part.startsWith('.. ') && ' ..'} - - ) - })} + {errorMessageToSegments(message).map((segment, i) => + match(segment) + .with({ type: 'text' }, ({ text }) => text) + .with({ type: 'code' }, ({ isTruncated, code, raw }) => { + // an empty chip is just visual noise; show the raw text instead + if (!code) return raw + return ( + + {isTruncated && '.. '} + {code} + {isTruncated && ' ..'} + + ) + }) + .exhaustive() + )} ) From 6328c4be8ae716d73359b44fade7f00fe69a15ab Mon Sep 17 00:00:00 2001 From: Joe Thel Date: Mon, 14 Sep 2026 11:15:55 -0700 Subject: [PATCH 18/46] fix broken safari oxql test, minor refactors to others Safari has subpixel precision on bounding boxes, so we need slightly more tolerance than exact matching for cursor<->placeholder comparisons. "Within a pixel" seems fair enough to me. --- test/e2e/oxql.e2e.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/e2e/oxql.e2e.ts b/test/e2e/oxql.e2e.ts index db06e1a38..f3fbd7a77 100644 --- a/test/e2e/oxql.e2e.ts +++ b/test/e2e/oxql.e2e.ts @@ -135,16 +135,15 @@ test('picking an example populates the query and runs it', async ({ page }) => { }) test('editor completions are wired to live timeseries schemas', async ({ page }) => { - // the completion logic itself is unit-tested in oxql-autocomplete.spec.ts; // here we only check the editor is hooked up to the schema list from the API const textbox = page.getByRole('textbox') await textbox.click() await page.keyboard.type('get hardware') - // ctrl-space explicitly re-requests completions in case the schema list - // hadn't loaded when typing started const options = page.getByRole('listbox').getByRole('option') await expect(async () => { + // ctrl-space explicitly re-requests completions in case the schema list + // hadn't loaded when typing started await page.keyboard.press('Control+Space') await expect(options.first()).toBeVisible({ timeout: 1000 }) }).toPass() @@ -160,7 +159,7 @@ test('editor completions are wired to live timeseries schemas', async ({ page }) test('results can be copied as JSON or CSV', async ({ page }) => { await runQuery(page, oxqlQueries.basicTctl) - // result summary is visible in the query card header + // result summary is visible await expect(page.getByText('1 timeseries', { exact: true })).toBeVisible() await page.getByRole('button', { name: 'Results actions' }).click() @@ -208,16 +207,17 @@ test('parse errors underline the offending spot in the editor', async ({ page }) await expect(underlined).toBeHidden() }) -test('query round-trips through the URL', async ({ page }) => { +test('pages writes the query to the URL after a successful run', async ({ page }) => { // a successful run writes the query to the URL await runQuery(page, oxqlQueries.basicTctl) await expect .poll(() => new URL(page.url()).searchParams.get('query')) .toBe(oxqlQueries.basicTctl) +}) - // and a fresh load of that URL populates the editor from the query param. +test('page loads queries from the URL when set', async ({ page }) => { + await page.goto(`${page.url()}?query=${encodeURIComponent(oxqlQueries.basicTctl)}`) // the editor is a contenteditable, so assert line by line rather than on value - await page.goto(page.url()) const textbox = page.getByRole('textbox') await expect(textbox).toContainText('get hardware_component:amd_cpu_tctl') await expect(textbox).toContainText('| filter timestamp > @now() - 1m') @@ -233,5 +233,5 @@ test('cursor sits at the start of the line when the query is empty', async ({ pa // the cursor sits where the placeholder text starts, give or take its own width expect(Math.abs(cursor!.x - placeholder!.x)).toBeLessThan(2) - expect(cursor!.y).toEqual(placeholder!.y) + expect(Math.abs(cursor!.y - placeholder!.y)).toBeLessThan(1) }) From 5365c13f4b6312f36fbcd455c2d3b7af88202f43 Mon Sep 17 00:00:00 2001 From: Joe Thel Date: Mon, 14 Sep 2026 11:44:53 -0700 Subject: [PATCH 19/46] tiny refactors, add some TODOs for metrics page --- app/pages/system/MetricsExplorer.tsx | 37 ++++++++++++++-------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/app/pages/system/MetricsExplorer.tsx b/app/pages/system/MetricsExplorer.tsx index bcad11067..60af925c4 100644 --- a/app/pages/system/MetricsExplorer.tsx +++ b/app/pages/system/MetricsExplorer.tsx @@ -240,15 +240,13 @@ const FieldBadge = ({ fieldName, value }: { fieldName: string; value: string }) const badge = ( {camelToSnake(fieldName)} - - {truncated ? truncate(value, FIELD_VALUE_MAX_LEN, 'middle') : value} - + {truncate(value, FIELD_VALUE_MAX_LEN, 'middle')} ) if (!truncated) return badge return ( - {/* Badge doesn't take a ref, so the tooltip needs a host element target */} + {/* Tooltip applies a ref to its child, but Badge doesn't forward refs */} {badge} ) @@ -256,6 +254,8 @@ const FieldBadge = ({ fieldName, value }: { fieldName: string; value: string }) // JSX version of getFormattedFields for chart descriptions: each field is a // badge, capped at FIELDS_SHOWN with a +N tooltip listing the rest +// TODO: make overflow a toggle instead of a hover +// TODO: make values copyable const FieldsList = ({ timeseries }: { timeseries: Timeseries }) => { const fields = Object.entries(timeseries.fields) const overflow = fields.slice(FIELDS_SHOWN) @@ -448,6 +448,8 @@ const trimHeatmap = ( // The first aligned point of a cumulative counter is diffed against the counter's start_time, // collapsing all pre-window history into one giant bucket. It's not "erroneous" but it's usually // not useful, and you'd want to hide it to get a more useful y-axis for the rest of your data. +// TODO: now that we know the schema, we can instead look at a successful query and check whether +// one of its tables has a cumulative type const groupHasPointWorthDropping = (g: ChartGroup): boolean => match(g) .with('empty-timeseries', () => false) @@ -459,8 +461,7 @@ const groupHasPointWorthDropping = (g: ChartGroup): boolean => ) .exhaustive() -// A render-ready representation of a single chart. Keep the data arrays memoized: uplot-react -// deep-compares the whole dataset whenever their identity changes (see TimeSeriesChart.spec.tsx) +// TODO: showDivider is a dead field type ChartDisplay = { key: string; showDivider: boolean } & ( | { kind: 'empty' } | { @@ -471,7 +472,6 @@ type ChartDisplay = { key: string; showDivider: boolean } & ( description?: ReactNode timestamps: number[] data: (number | null)[][] - /** only set for multi-series charts, where it enables the legend */ seriesLabels?: string[] } | { @@ -587,7 +587,6 @@ function ChartEntry({ display }: { display: ChartDisplay }) { .with({ kind: 'empty' }, () => ( - {/* gradient uses the surface-default token so it works in both themes */}
charts[i].key, }) + const errorMessage = fieldState.error?.message ? ( + {fieldState.error.message} + ) : query.error ? ( + + ) : null + return ( <>
@@ -832,9 +837,7 @@ export default function MetricsExplorer() {
{query.status === 'success' && ( - <> - - + )} )}
) @@ -324,7 +314,7 @@ const tableToGroup = (table: OxqlTable): ChartGroup => { // no further charts: timeseries.map((series) => ({ name, - description: , + description: , timestamps: toPosix(series.points.timestamps), data: series.points.values.map((v, i) => ({ label: @@ -369,7 +359,7 @@ const tableToGroup = (table: OxqlTable): ChartGroup => { const timestamps = toPosix(series.points.timestamps) return { name, - description: , + description: , timestamps, metricType: series.points.values[0].metricType, startTimes: @@ -383,7 +373,7 @@ const tableToGroup = (table: OxqlTable): ChartGroup => { charts: seriesList.map( (series): LineChartData => ({ name, - description: , + description: , timestamps: toPosix(series.points.timestamps), metricType: series.points.values[0].metricType, data: narrowToNumbers(series.points.values[0].values), From dad5354c5c77c4ca162e8be9a77a23f8d7cc77a9 Mon Sep 17 00:00:00 2001 From: Joe Thel Date: Mon, 14 Sep 2026 13:48:23 -0700 Subject: [PATCH 21/46] Improve "drop first point" detection and give an explainer Not sure it needs its own doc link, but the docs do give a _little_ context. --- app/pages/system/MetricsExplorer.tsx | 82 ++++++++++++++++++++++++---- test/e2e/oxql.e2e.ts | 2 +- 2 files changed, 71 insertions(+), 13 deletions(-) diff --git a/app/pages/system/MetricsExplorer.tsx b/app/pages/system/MetricsExplorer.tsx index 0743acddc..355ef3b7b 100644 --- a/app/pages/system/MetricsExplorer.tsx +++ b/app/pages/system/MetricsExplorer.tsx @@ -27,6 +27,7 @@ import { type TimeseriesQuery, type ValueArray, type FieldValue, + type TimeseriesSchema, } from '@oxide/api' import { Monitoring16Icon, Monitoring24Icon } from '@oxide/design-system/icons/react' import { Badge } from '@oxide/design-system/ui' @@ -59,6 +60,7 @@ import { ErrorInlineCode } from '~/ui/lib/InlineCode' import { Message } from '~/ui/lib/Message' import { PageHeader, PageTitle } from '~/ui/lib/PageHeader' import { TextInputError } from '~/ui/lib/TextInput' +import { TipIcon } from '~/ui/lib/TipIcon' import { Tooltip } from '~/ui/lib/Tooltip' import { truncate } from '~/ui/lib/Truncate' import { ALL_ISH } from '~/util/consts' @@ -281,6 +283,11 @@ const FieldsList = ({ fields }: { fields: Record }) => { ) } +// In a joined table, the table name is component metric names, comma-joined. +// e.g. bfd_session:timeout_expired,hardware_component:current +const retrieveMetricNames = (tableName: string): string[] => + tableName.split(',').map((s) => s.trim()) + const tableToGroup = (table: OxqlTable): ChartGroup => { const { name, timeseries } = table if (timeseries.length === 0) return 'empty-timeseries' @@ -301,11 +308,7 @@ const tableToGroup = (table: OxqlTable): ChartGroup => { const chart = match(kind) .with('joined', (kind) => { - // In a joined table, each Values item is a distinct metric:target and the - // table name is those metric names comma-joined, index-aligned to the Values. - // So the line labels come from the table name, not the (identical-per-line) - // joined field. - const metricNames = name.split(',').map((s) => s.trim()) + const metricNames = retrieveMetricNames(name) return { kind, @@ -438,8 +441,56 @@ const trimHeatmap = ( // The first aligned point of a cumulative counter is diffed against the counter's start_time, // collapsing all pre-window history into one giant bucket. It's not "erroneous" but it's usually // not useful, and you'd want to hide it to get a more useful y-axis for the rest of your data. -// TODO: now that we know the schema, we can instead look at a successful query and check whether -// one of its tables has a cumulative type +const queryHasCumulativeData = ( + queryResult: OxqlQueryResult, + schemas: TimeseriesSchema[] +): boolean => { + const metricNames = new Set( + queryResult.tables.flatMap((t) => retrieveMetricNames(t.name)) + ) + return schemas.some( + (schema) => + metricNames.has(schema.timeseriesName) && + match(schema.datumType) + .with( + 'bool', + 'i8', + 'u8', + 'i16', + 'u16', + 'i32', + 'u32', + 'i64', + 'u64', + 'f32', + 'f64', + 'string', + 'bytes', + () => false + ) + .with( + 'cumulative_i64', + 'cumulative_u64', + 'cumulative_f32', + 'cumulative_f64', + // histogram data is cumulative by definition + 'histogram_i8', + 'histogram_u8', + 'histogram_i16', + 'histogram_u16', + 'histogram_i32', + 'histogram_u32', + 'histogram_i64', + 'histogram_u64', + 'histogram_f32', + 'histogram_f64', + () => true + ) + .exhaustive() + ) +} + +// If the schemas haven't loaded, this is a decent heuristic const groupHasPointWorthDropping = (g: ChartGroup): boolean => match(g) .with('empty-timeseries', () => false) @@ -618,7 +669,7 @@ const tablesToCsv = (tables: OxqlTable[]): string => { for (const table of tables) { // like the chart labels, joined tables get their per-line metric names // from the comma-joined table name - const metricNames = table.name.split(',').map((s) => s.trim()) + const metricNames = retrieveMetricNames(table.name) for (const series of table.timeseries) { const fields = getFormattedFields(series) series.points.values.forEach((v, i) => { @@ -776,7 +827,10 @@ export default function MetricsExplorer() { [query.data] ) - const hasTrimmableCharts = chartGroups?.some(groupHasPointWorthDropping) ?? false + const hasTrimmableCharts = + schemas.data && query.data + ? queryHasCumulativeData(query.data, schemas.data.items) + : (chartGroups?.some(groupHasPointWorthDropping) ?? false) const trim = dropFirstPoint && hasTrimmableCharts const charts = useMemo( @@ -893,17 +947,21 @@ export default function MetricsExplorer() { )) - // TODO: explainer for the drop first point thing .with({ status: 'success' }, () => ( {hasTrimmableCharts && ( -
+
setDropFirstPoint(e.target.checked)} > - Drop first point + Drop first data point + + With deltas and cumulative counters, the initial point is a delta from the + earliest observed value. It's therefore typically much larger, and not + worth comparing to the rest of your data. +
)}
{ - const dropFirst = page.getByLabel('Drop first point') + const dropFirst = page.getByLabel('Drop first data point') // a plain gauge is never cumulative, so there's no giant first point to drop await runQuery(page, oxqlQueries.basicTctl) From 045e83d2f4870285f29282f3534d2d11beb5001b Mon Sep 17 00:00:00 2001 From: Joe Thel Date: Mon, 14 Sep 2026 13:55:15 -0700 Subject: [PATCH 22/46] Remove dead showDivider field --- app/pages/system/MetricsExplorer.tsx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/app/pages/system/MetricsExplorer.tsx b/app/pages/system/MetricsExplorer.tsx index 355ef3b7b..51e9b1008 100644 --- a/app/pages/system/MetricsExplorer.tsx +++ b/app/pages/system/MetricsExplorer.tsx @@ -502,8 +502,7 @@ const groupHasPointWorthDropping = (g: ChartGroup): boolean => ) .exhaustive() -// TODO: showDivider is a dead field -type ChartDisplay = { key: string; showDivider: boolean } & ( +type ChartDisplay = { key: string } & ( | { kind: 'empty' } | { kind: 'chart' @@ -528,8 +527,7 @@ type ChartDisplay = { key: string; showDivider: boolean } & ( // Virtualization relies on a list of near-same-size items, so we flatten out all the groups const toDisplays = (groups: ChartGroup[], trim: boolean): ChartDisplay[] => groups.flatMap((g, t): ChartDisplay[] => { - if (g === 'empty-timeseries') - return [{ kind: 'empty', key: `t${t}`, showDivider: true }] + if (g === 'empty-timeseries') return [{ kind: 'empty', key: `t${t}` }] const { startTime, endTime } = g return match(g) .with({ kind: 'distributions' }, ({ charts }) => @@ -537,7 +535,6 @@ const toDisplays = (groups: ChartGroup[], trim: boolean): ChartDisplay[] => (chart, i): ChartDisplay => ({ kind: 'heatmap', key: `t${t}.${i}`, - showDivider: i === 0, name: chart.name, description: chart.description, ...trimHeatmap(trim, { @@ -553,7 +550,6 @@ const toDisplays = (groups: ChartGroup[], trim: boolean): ChartDisplay[] => (chart, i): ChartDisplay => ({ kind: 'chart', key: `t${t}.${i}`, - showDivider: i === 0, startTime, endTime, name: chart.name, @@ -570,7 +566,6 @@ const toDisplays = (groups: ChartGroup[], trim: boolean): ChartDisplay[] => (chart, i): ChartDisplay => ({ kind: 'chart', key: `t${t}.${i}`, - showDivider: i === 0, startTime, endTime, name: chart.name, From d991f9d46c50bbdea780d5b3beace68fedca561b Mon Sep 17 00:00:00 2001 From: Joe Thel Date: Thu, 17 Sep 2026 13:28:06 -0700 Subject: [PATCH 23/46] drop the convert-to-CSV path --- app/pages/system/MetricsExplorer.tsx | 43 ---------------------------- test/e2e/oxql.e2e.ts | 6 +--- 2 files changed, 1 insertion(+), 48 deletions(-) diff --git a/app/pages/system/MetricsExplorer.tsx b/app/pages/system/MetricsExplorer.tsx index 51e9b1008..9fd54103a 100644 --- a/app/pages/system/MetricsExplorer.tsx +++ b/app/pages/system/MetricsExplorer.tsx @@ -646,44 +646,6 @@ function ChartEntry({ display }: { display: ChartDisplay }) { ) } -// covers the header strings plus every member of ValueArray['values'] -type CsvValue = string | number | boolean | object | null | undefined - -const csvCell = (v: CsvValue): string => { - const s = - v === null || v === undefined - ? '' - : typeof v === 'object' - ? JSON.stringify(v) - : String(v) - return /[",\n]/.test(s) ? `"${s.replaceAll('"', '""')}"` : s -} - -const tablesToCsv = (tables: OxqlTable[]): string => { - const rows: CsvValue[][] = [['table', 'fields', 'metric', 'timestamp', 'value']] - for (const table of tables) { - // like the chart labels, joined tables get their per-line metric names - // from the comma-joined table name - const metricNames = retrieveMetricNames(table.name) - for (const series of table.timeseries) { - const fields = getFormattedFields(series) - series.points.values.forEach((v, i) => { - const metric = metricNames[i] ?? table.name - series.points.timestamps.forEach((ts, j) => { - rows.push([ - table.name, - fields, - metric, - new Date(ts).toISOString(), - v.values.values[j], - ]) - }) - }) - } - } - return rows.map((row) => row.map(csvCell).join(',')).join('\n') -} - const copyText = (text: string, toastMessage: string) => { window.navigator.clipboard.writeText(text).then(() => addToast(toastMessage)) } @@ -701,11 +663,6 @@ function ResultsMenu({ data }: { data?: OxqlQueryResult }) { } label="Copy as JSON" /> - data && copyText(tablesToCsv(data.tables), 'Results copied as CSV')} - label="Copy as CSV" - /> ) } diff --git a/test/e2e/oxql.e2e.ts b/test/e2e/oxql.e2e.ts index 59368326d..3b1bb6f1a 100644 --- a/test/e2e/oxql.e2e.ts +++ b/test/e2e/oxql.e2e.ts @@ -156,7 +156,7 @@ test('editor completions are wired to live timeseries schemas', async ({ page }) await expect(textbox).toContainText('get hardware_component:fan_speed') }) -test('results can be copied as JSON or CSV', async ({ page }) => { +test('results can be copied as JSON', async ({ page }) => { await runQuery(page, oxqlQueries.basicTctl) // result summary is visible @@ -165,10 +165,6 @@ test('results can be copied as JSON or CSV', async ({ page }) => { await page.getByRole('button', { name: 'Results actions' }).click() await page.getByRole('menuitem', { name: 'Copy as JSON' }).click() await expectToast(page, 'Results copied as JSON') - - await page.getByRole('button', { name: 'Results actions' }).click() - await page.getByRole('menuitem', { name: 'Copy as CSV' }).click() - await expectToast(page, 'Results copied as CSV') }) test('a query the backend rejects surfaces an error instead of a chart', async ({ From 773d7227d4aadda3930d2163d08696069b6c0aef Mon Sep 17 00:00:00 2001 From: Joe Thel Date: Thu, 17 Sep 2026 13:50:42 -0700 Subject: [PATCH 24/46] fix copied JSON It was camel case!! --- app/pages/system/MetricsExplorer.tsx | 4 +++- mock-api/oxql-metrics.ts | 2 +- test/e2e/oxql.e2e.ts | 21 ++++++++++++++++++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/app/pages/system/MetricsExplorer.tsx b/app/pages/system/MetricsExplorer.tsx index 9fd54103a..4108c703c 100644 --- a/app/pages/system/MetricsExplorer.tsx +++ b/app/pages/system/MetricsExplorer.tsx @@ -18,6 +18,7 @@ import { q, useApiMutation, camelToSnake, + snakeify, type Distributiondouble, type MetricType, type OxqlQueryResult, @@ -659,7 +660,8 @@ function ResultsMenu({ data }: { data?: OxqlQueryResult }) { - data && copyText(JSON.stringify(data, null, 2), 'Results copied as JSON') + data && + copyText(JSON.stringify(snakeify(data), null, 2), 'Results copied as JSON') } label="Copy as JSON" /> diff --git a/mock-api/oxql-metrics.ts b/mock-api/oxql-metrics.ts index 73b6666f3..224b1f07b 100644 --- a/mock-api/oxql-metrics.ts +++ b/mock-api/oxql-metrics.ts @@ -66,7 +66,7 @@ export const pointsFrom = ( export const timeseriesFrom = (id: string, points: Json): Json => ({ fields: { - instanceId: { + instance_id: { type: 'uuid', value: id, }, diff --git a/test/e2e/oxql.e2e.ts b/test/e2e/oxql.e2e.ts index 3b1bb6f1a..d53a9bd57 100644 --- a/test/e2e/oxql.e2e.ts +++ b/test/e2e/oxql.e2e.ts @@ -9,7 +9,7 @@ import { expect, test, type Page, type Locator } from '@playwright/test' import { oxqlQueries } from './oxql-queries' -import { expectToast } from './utils' +import { clipboardText, expectToast } from './utils' const runQuery = async (page: Page, query?: string) => { if (query !== undefined) await page.getByRole('textbox').fill(query) @@ -167,6 +167,25 @@ test('results can be copied as JSON', async ({ page }) => { await expectToast(page, 'Results copied as JSON') }) +test('copied JSON actually matches the response body', async ({ page, browserName }) => { + // eslint-disable-next-line playwright/no-skipped-test + test.skip( + browserName === 'webkit', + 'navigator.clipboard.readText() works locally in Safari but not in CI.' + ) + + const response = page.waitForResponse('**/v1/system/timeseries/query') + // the most likely error here is a failure to restore snake case, so + // histograms are a decent test (they always include start_times) + await runQuery(page, oxqlQueries.bytesSentAndReceived) + const raw = await response.then((r) => r.json()) + + await page.getByRole('button', { name: 'Results actions' }).click() + await page.getByRole('menuitem', { name: 'Copy as JSON' }).click() + + expect(JSON.stringify(JSON.parse(await clipboardText(page)))).toBe(JSON.stringify(raw)) +}) + test('a query the backend rejects surfaces an error instead of a chart', async ({ page, }) => { From 83fd258539e9af82756e51041719f9938ff8d6dd Mon Sep 17 00:00:00 2001 From: Joe Thel Date: Thu, 17 Sep 2026 14:18:41 -0700 Subject: [PATCH 25/46] update clipboard comment/skip explanations --- test/e2e/images.e2e.ts | 2 +- test/e2e/oxql.e2e.ts | 2 +- test/e2e/utilization.e2e.ts | 2 +- test/e2e/utils.ts | 3 +-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/test/e2e/images.e2e.ts b/test/e2e/images.e2e.ts index a8f269c86..c60eada6e 100644 --- a/test/e2e/images.e2e.ts +++ b/test/e2e/images.e2e.ts @@ -125,7 +125,7 @@ test('can copy an image ID to clipboard', async ({ page, browserName }) => { // eslint-disable-next-line playwright/no-skipped-test test.skip( browserName === 'webkit', - 'navigator.clipboard.readText() works locally in Safari but not in CI.' + 'navigator.clipboard.readText() is forbidden in Safari.' ) await page.goto('/images') diff --git a/test/e2e/oxql.e2e.ts b/test/e2e/oxql.e2e.ts index d53a9bd57..bade398ff 100644 --- a/test/e2e/oxql.e2e.ts +++ b/test/e2e/oxql.e2e.ts @@ -171,7 +171,7 @@ test('copied JSON actually matches the response body', async ({ page, browserNam // eslint-disable-next-line playwright/no-skipped-test test.skip( browserName === 'webkit', - 'navigator.clipboard.readText() works locally in Safari but not in CI.' + 'navigator.clipboard.readText() is forbidden in Safari.' ) const response = page.waitForResponse('**/v1/system/timeseries/query') diff --git a/test/e2e/utilization.e2e.ts b/test/e2e/utilization.e2e.ts index b3cbd56f6..10dc62d68 100644 --- a/test/e2e/utilization.e2e.ts +++ b/test/e2e/utilization.e2e.ts @@ -49,7 +49,7 @@ test.describe('System utilization', () => { // eslint-disable-next-line playwright/no-skipped-test test.skip( browserName === 'webkit', - 'navigator.clipboard.readText() works locally in Safari but not in CI.' + 'navigator.clipboard.readText() is forbidden in Safari.' ) await page.goto('/system/utilization') await clickRowAction(page, 'maze-war', 'Copy silo ID') diff --git a/test/e2e/utils.ts b/test/e2e/utils.ts index f1bfc3ee3..c0f32ed3a 100644 --- a/test/e2e/utils.ts +++ b/test/e2e/utils.ts @@ -208,8 +208,7 @@ export async function closeToast(page: Page) { } /** - * This will not work in Firefox, which only supports reading from the clipboard in extensions. - * See [MDN: readText](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/readText#browser_compatibility). + * This will not work in Safari, which forbids clipboard reading without a user interaction. */ export const clipboardText = async (page: Page) => page.evaluate(() => navigator.clipboard.readText()) From 9117a1b064e7c8c4237c88ccea04ec9efc717bef Mon Sep 17 00:00:00 2001 From: David Crespo Date: Mon, 5 Oct 2026 16:47:10 -0500 Subject: [PATCH 26/46] Bump shiki to 4 to match design system --- package-lock.json | 250 ++++++++++++++++++++++++---------------------- package.json | 2 +- 2 files changed, 131 insertions(+), 121 deletions(-) diff --git a/package-lock.json b/package-lock.json index 663df0841..682695af8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,7 +50,7 @@ "react-stately": "^3.32.2", "remeda": "^2.30.0", "semver": "^7.7.3", - "shiki": "^3.23.0", + "shiki": "^4.5.0", "simplebar-react": "^3.2.6", "ts-pattern": "^5.8.0", "tslib": "^2.7.0", @@ -1299,91 +1299,6 @@ "react-dom": ">=17.0.0" } }, - "node_modules/@oxide/design-system/node_modules/@shikijs/core": { - "version": "4.4.3", - "license": "MIT", - "dependencies": { - "@shikijs/primitive": "4.4.3", - "@shikijs/types": "4.4.3", - "@shikijs/vscode-textmate": "^10.0.2", - "@types/hast": "^3.0.5", - "hast-util-to-html": "^9.0.5" - }, - "engines": { - "node": ">=20" - } - }, - "node_modules/@oxide/design-system/node_modules/@shikijs/engine-javascript": { - "version": "4.4.3", - "license": "MIT", - "dependencies": { - "@shikijs/types": "4.4.3", - "@shikijs/vscode-textmate": "^10.0.2", - "oniguruma-to-es": "^4.3.6" - }, - "engines": { - "node": ">=20" - } - }, - "node_modules/@oxide/design-system/node_modules/@shikijs/engine-oniguruma": { - "version": "4.4.3", - "license": "MIT", - "dependencies": { - "@shikijs/types": "4.4.3", - "@shikijs/vscode-textmate": "^10.0.2" - }, - "engines": { - "node": ">=20" - } - }, - "node_modules/@oxide/design-system/node_modules/@shikijs/langs": { - "version": "4.4.3", - "license": "MIT", - "dependencies": { - "@shikijs/types": "4.4.3" - }, - "engines": { - "node": ">=20" - } - }, - "node_modules/@oxide/design-system/node_modules/@shikijs/themes": { - "version": "4.4.3", - "license": "MIT", - "dependencies": { - "@shikijs/types": "4.4.3" - }, - "engines": { - "node": ">=20" - } - }, - "node_modules/@oxide/design-system/node_modules/@shikijs/types": { - "version": "4.4.3", - "license": "MIT", - "dependencies": { - "@shikijs/vscode-textmate": "^10.0.2", - "@types/hast": "^3.0.5" - }, - "engines": { - "node": ">=20" - } - }, - "node_modules/@oxide/design-system/node_modules/shiki": { - "version": "4.4.3", - "license": "MIT", - "dependencies": { - "@shikijs/core": "4.4.3", - "@shikijs/engine-javascript": "4.4.3", - "@shikijs/engine-oniguruma": "4.4.3", - "@shikijs/langs": "4.4.3", - "@shikijs/themes": "4.4.3", - "@shikijs/types": "4.4.3", - "@shikijs/vscode-textmate": "^10.0.2", - "@types/hast": "^3.0.5" - }, - "engines": { - "node": ">=20" - } - }, "node_modules/@oxide/openapi-gen-ts": { "version": "0.14.0", "dev": true, @@ -4479,55 +4394,67 @@ "license": "MIT" }, "node_modules/@shikijs/core": { - "version": "3.23.0", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-4.5.0.tgz", + "integrity": "sha512-6CIgwq+bt2JZ3OSjb/nBkkwEf/CfpHcbam+Mg5Pllco7HAGRQ2/EFhZrrJtbyNTgKwknfVS+llsXGygiDGwJWw==", "license": "MIT", "dependencies": { - "@shikijs/types": "3.23.0", + "@shikijs/primitive": "4.5.0", + "@shikijs/types": "4.5.0", "@shikijs/vscode-textmate": "^10.0.2", - "@types/hast": "^3.0.4", + "@types/hast": "^3.0.5", "hast-util-to-html": "^9.0.5" + }, + "engines": { + "node": ">=20" } }, "node_modules/@shikijs/engine-javascript": { - "version": "3.23.0", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-4.5.0.tgz", + "integrity": "sha512-Ed6UdEj84LyYkwnxM5CvSMWAD+id9ExTYri0/+x41U9zrgNifPSS9lZm0JqBP0VfYI8yr8tY5nbNq9+p9R0kFA==", "license": "MIT", "dependencies": { - "@shikijs/types": "3.23.0", + "@shikijs/types": "4.5.0", "@shikijs/vscode-textmate": "^10.0.2", - "oniguruma-to-es": "^4.3.4" + "oniguruma-to-es": "^4.3.6" + }, + "engines": { + "node": ">=20" } }, "node_modules/@shikijs/engine-oniguruma": { - "version": "3.23.0", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-4.5.0.tgz", + "integrity": "sha512-dKVmbJecVdB9recl8a/CU4jdpNXyjJQrIcesIkpS70s5HS02ohpnCSpMUbotPnEUzbAcLQ+S4hwZYbkBBiTcJw==", "license": "MIT", "dependencies": { - "@shikijs/types": "3.23.0", + "@shikijs/types": "4.5.0", "@shikijs/vscode-textmate": "^10.0.2" + }, + "engines": { + "node": ">=20" } }, "node_modules/@shikijs/langs": { - "version": "3.23.0", - "license": "MIT", - "dependencies": { - "@shikijs/types": "3.23.0" - } - }, - "node_modules/@shikijs/primitive": { - "version": "4.4.3", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-4.5.0.tgz", + "integrity": "sha512-wwBTqwduXSz0X4v9Qa2EWeFaYJEw1clCncWjoRNQRbVDu3SPRTRWucnouYapKj3b8Q+sk/41Vbc4B5c8nuYzLA==", "license": "MIT", "dependencies": { - "@shikijs/types": "4.4.3", - "@shikijs/vscode-textmate": "^10.0.2", - "@types/hast": "^3.0.5" + "@shikijs/types": "4.5.0" }, "engines": { "node": ">=20" } }, - "node_modules/@shikijs/primitive/node_modules/@shikijs/types": { - "version": "4.4.3", + "node_modules/@shikijs/primitive": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/@shikijs/primitive/-/primitive-4.5.0.tgz", + "integrity": "sha512-UM7ShlA8oz0OWxLLO8BmO9Ip6fVqdkt8yF0EH7nOCqHfrx1eEAzF0ZUVK7L+I8NEgeu1PEWSRlxaiPPeCb4iDg==", "license": "MIT", "dependencies": { + "@shikijs/types": "4.5.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.5" }, @@ -4536,18 +4463,28 @@ } }, "node_modules/@shikijs/themes": { - "version": "3.23.0", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-4.5.0.tgz", + "integrity": "sha512-zGb87H3UBbpuI4yoh5UguB1XbU+2BDU3kflM7UfZ+Cy2hWo9lBtqjSVK20gmLY6ukYl040hAypGXMgud9vul8Q==", "license": "MIT", "dependencies": { - "@shikijs/types": "3.23.0" + "@shikijs/types": "4.5.0" + }, + "engines": { + "node": ">=20" } }, "node_modules/@shikijs/types": { - "version": "3.23.0", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-4.5.0.tgz", + "integrity": "sha512-drtPrtD8N0DENyD2cyt6Ajy+IWsiCLgMxODwLTpvH1UsN6a9jf90tNTPjqwHvA+0Lzu9e0txk8DjfqH1p9UJRw==", "license": "MIT", "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", - "@types/hast": "^3.0.4" + "@types/hast": "^3.0.5" + }, + "engines": { + "node": ">=20" } }, "node_modules/@shikijs/vscode-textmate": { @@ -5004,6 +4941,8 @@ }, "node_modules/@types/mdast": { "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", + "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", "license": "MIT", "dependencies": { "@types/unist": "*" @@ -5415,6 +5354,8 @@ }, "node_modules/@ungap/structured-clone": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.4.0.tgz", + "integrity": "sha512-1mEZtMKPM09vDmQt5y7YvmN2+DFTP7Tg0EWXdic8/C6VRnpb33e4ghisCIE3WZjsE2N8mf+QV1Zqh7ZFYLWInQ==", "license": "ISC" }, "node_modules/@vitejs/plugin-basic-ssl": { @@ -5869,6 +5810,8 @@ }, "node_modules/ccount": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", + "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", "license": "MIT", "funding": { "type": "github", @@ -5885,6 +5828,8 @@ }, "node_modules/character-entities-html4": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz", + "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", "license": "MIT", "funding": { "type": "github", @@ -5893,6 +5838,8 @@ }, "node_modules/character-entities-legacy": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", + "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", "license": "MIT", "funding": { "type": "github", @@ -6026,6 +5973,8 @@ }, "node_modules/comma-separated-tokens": { "version": "2.0.3", + "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", + "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==", "license": "MIT", "funding": { "type": "github", @@ -6172,6 +6121,8 @@ }, "node_modules/dequal": { "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", "license": "MIT", "engines": { "node": ">=6" @@ -6195,6 +6146,8 @@ }, "node_modules/devlop": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", + "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", "license": "MIT", "dependencies": { "dequal": "^2.0.0" @@ -6995,6 +6948,8 @@ }, "node_modules/hast-util-to-html": { "version": "9.0.5", + "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.5.tgz", + "integrity": "sha512-OguPdidb+fbHQSU4Q4ZiLKnzWo8Wwsf5bZfbvu7//a9oTYoqD/fWpe96NuHkoS9h0ccGOTe0C4NGXdtS0iObOw==", "license": "MIT", "dependencies": { "@types/hast": "^3.0.0", @@ -7016,6 +6971,8 @@ }, "node_modules/hast-util-whitespace": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz", + "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==", "license": "MIT", "dependencies": { "@types/hast": "^3.0.0" @@ -7077,6 +7034,8 @@ }, "node_modules/html-void-elements": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-3.0.0.tgz", + "integrity": "sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==", "license": "MIT", "funding": { "type": "github", @@ -7707,6 +7666,8 @@ }, "node_modules/mdast-util-to-hast": { "version": "13.2.1", + "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.1.tgz", + "integrity": "sha512-cctsq2wp5vTsLIcaymblUriiTcZd0CwWtCbLvrOzYCDZoWyMNV8sZ7krj09FSnsiJi3WVsHLM4k6Dq/yaPyCXA==", "license": "MIT", "dependencies": { "@types/hast": "^3.0.0", @@ -7750,6 +7711,8 @@ }, "node_modules/micromark-util-character": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz", + "integrity": "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==", "funding": [ { "type": "GitHub Sponsors", @@ -7768,6 +7731,8 @@ }, "node_modules/micromark-util-encode": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz", + "integrity": "sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==", "funding": [ { "type": "GitHub Sponsors", @@ -7782,6 +7747,8 @@ }, "node_modules/micromark-util-sanitize-uri": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.1.tgz", + "integrity": "sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==", "funding": [ { "type": "GitHub Sponsors", @@ -7801,6 +7768,8 @@ }, "node_modules/micromark-util-symbol": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz", + "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==", "funding": [ { "type": "GitHub Sponsors", @@ -7814,7 +7783,9 @@ "license": "MIT" }, "node_modules/micromark-util-types": { - "version": "2.0.2", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.3.tgz", + "integrity": "sha512-oxB2Ik03hI0gv+VNn9tnh1t1YEe9MDPptViAEgfdf3YQHsn0pzGTgCdlSCJXcwhqm8phaEuM7zeEu3QQzVBrPg==", "funding": [ { "type": "GitHub Sponsors", @@ -8093,10 +8064,14 @@ }, "node_modules/oniguruma-parser": { "version": "0.12.2", + "resolved": "https://registry.npmjs.org/oniguruma-parser/-/oniguruma-parser-0.12.2.tgz", + "integrity": "sha512-6HVa5oIrgMC6aA6WF6XyyqbhRPJrKR02L20+2+zpDtO5QAzGHAUGw5TKQvwi5vctNnRHkJYmjAhRVQF2EKdTQw==", "license": "MIT" }, "node_modules/oniguruma-to-es": { "version": "4.3.6", + "resolved": "https://registry.npmjs.org/oniguruma-to-es/-/oniguruma-to-es-4.3.6.tgz", + "integrity": "sha512-csuQ9x3Yr0cEIs/Zgx/OEt9iBw9vqIunAPQkx19R/fiMq2oGVTgcMqO/V3Ybqefr1TBvosI6jU539ksaBULJyA==", "license": "MIT", "dependencies": { "oniguruma-parser": "^0.12.2", @@ -8661,6 +8636,8 @@ }, "node_modules/property-information": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-7.2.0.tgz", + "integrity": "sha512-IAtzIB6sUiWaJYrX9smp3V46pBGbBeLFRGdh25kg1334VcBlD8HzhPeNIWQH9zhGmo2itIe25EHt9dQP7G5hmg==", "license": "MIT", "funding": { "type": "github", @@ -8941,6 +8918,8 @@ }, "node_modules/regex": { "version": "6.1.0", + "resolved": "https://registry.npmjs.org/regex/-/regex-6.1.0.tgz", + "integrity": "sha512-6VwtthbV4o/7+OaAF9I5L5V3llLEsoPyq9P1JVXkedTP33c7MfCG0/5NOPcSJn0TzXcG9YUrR0gQSWioew3LDg==", "license": "MIT", "dependencies": { "regex-utilities": "^2.3.0" @@ -8948,6 +8927,8 @@ }, "node_modules/regex-recursion": { "version": "6.0.2", + "resolved": "https://registry.npmjs.org/regex-recursion/-/regex-recursion-6.0.2.tgz", + "integrity": "sha512-0YCaSCq2VRIebiaUviZNs0cBz1kg5kVS2UKUfNIx8YVs1cN3AV7NTctO5FOKBA+UT2BPJIWZauYHPqJODG50cg==", "license": "MIT", "dependencies": { "regex-utilities": "^2.3.0" @@ -8955,6 +8936,8 @@ }, "node_modules/regex-utilities": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/regex-utilities/-/regex-utilities-2.3.0.tgz", + "integrity": "sha512-8VhliFJAWRaUiVvREIiW2NXXTmHs4vMNnSzuJVhscgmGav3g9VDxLrQndI3dZZVVdp0ZO/5v0xmX516/7M9cng==", "license": "MIT" }, "node_modules/remeda": { @@ -9178,17 +9161,22 @@ } }, "node_modules/shiki": { - "version": "3.23.0", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-4.5.0.tgz", + "integrity": "sha512-OcRW72ngQvc+MSVWBRIovC/BTW589iUE/Vxav7VeM4RcY9MUjqB+IR6ILG1k9nuW6LiG/nct9uma4/MBtnZbmQ==", "license": "MIT", "dependencies": { - "@shikijs/core": "3.23.0", - "@shikijs/engine-javascript": "3.23.0", - "@shikijs/engine-oniguruma": "3.23.0", - "@shikijs/langs": "3.23.0", - "@shikijs/themes": "3.23.0", - "@shikijs/types": "3.23.0", + "@shikijs/core": "4.5.0", + "@shikijs/engine-javascript": "4.5.0", + "@shikijs/engine-oniguruma": "4.5.0", + "@shikijs/langs": "4.5.0", + "@shikijs/themes": "4.5.0", + "@shikijs/types": "4.5.0", "@shikijs/vscode-textmate": "^10.0.2", - "@types/hast": "^3.0.4" + "@types/hast": "^3.0.5" + }, + "engines": { + "node": ">=20" } }, "node_modules/side-channel": { @@ -9316,6 +9304,8 @@ }, "node_modules/space-separated-tokens": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz", + "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==", "license": "MIT", "funding": { "type": "github", @@ -9347,6 +9337,8 @@ }, "node_modules/stringify-entities": { "version": "4.0.4", + "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz", + "integrity": "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==", "license": "MIT", "dependencies": { "character-entities-html4": "^2.0.0", @@ -9559,6 +9551,8 @@ }, "node_modules/trim-lines": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", + "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==", "license": "MIT", "funding": { "type": "github", @@ -9699,6 +9693,8 @@ }, "node_modules/unist-util-is": { "version": "6.0.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.1.tgz", + "integrity": "sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==", "license": "MIT", "dependencies": { "@types/unist": "^3.0.0" @@ -9710,6 +9706,8 @@ }, "node_modules/unist-util-position": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", "license": "MIT", "dependencies": { "@types/unist": "^3.0.0" @@ -9721,6 +9719,8 @@ }, "node_modules/unist-util-stringify-position": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "license": "MIT", "dependencies": { "@types/unist": "^3.0.0" @@ -9732,6 +9732,8 @@ }, "node_modules/unist-util-visit": { "version": "5.1.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.1.0.tgz", + "integrity": "sha512-m+vIdyeCOpdr/QeQCu2EzxX/ohgS8KbnPDgFni4dQsfSCtpz8UqDyY5GjRru8PDKuYn7Fq19j1CQ+nJSsGKOzg==", "license": "MIT", "dependencies": { "@types/unist": "^3.0.0", @@ -9745,6 +9747,8 @@ }, "node_modules/unist-util-visit-parents": { "version": "6.0.2", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.2.tgz", + "integrity": "sha512-goh1s1TBrqSqukSc8wrjwWhL0hiJxgA8m4kFxGlQ+8FYQ3C/m11FcTs4YYem7V664AhHVvgoQLk890Ssdsr2IQ==", "license": "MIT", "dependencies": { "@types/unist": "^3.0.0", @@ -9866,6 +9870,8 @@ }, "node_modules/vfile": { "version": "6.0.3", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz", + "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==", "license": "MIT", "dependencies": { "@types/unist": "^3.0.0", @@ -9878,6 +9884,8 @@ }, "node_modules/vfile-message": { "version": "4.0.3", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.3.tgz", + "integrity": "sha512-QTHzsGd1EhbZs4AsQ20JX1rC3cOlt/IWJruk893DfLRr57lcnOeMaWG4K0JrRta4mIJZKth2Au3mM3u03/JWKw==", "license": "MIT", "dependencies": { "@types/unist": "^3.0.0", @@ -10358,6 +10366,8 @@ }, "node_modules/zwitch": { "version": "2.0.4", + "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", + "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==", "license": "MIT", "funding": { "type": "github", diff --git a/package.json b/package.json index 95fdca086..82e7f4924 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,7 @@ "react-stately": "^3.32.2", "remeda": "^2.30.0", "semver": "^7.7.3", - "shiki": "^3.23.0", + "shiki": "^4.5.0", "simplebar-react": "^3.2.6", "ts-pattern": "^5.8.0", "tslib": "^2.7.0", From 4e7e3b4dea9bffbdaf1b209b46a24a7ee14e782b Mon Sep 17 00:00:00 2001 From: Joe Thel Date: Mon, 5 Oct 2026 17:50:41 -0700 Subject: [PATCH 27/46] add two-step autocomplete for oxql target:metric pairs --- app/components/oxql-autocomplete.spec.ts | 62 +++++++++++++++++++----- app/components/oxql-autocomplete.ts | 60 +++++++++++++++++++---- test/e2e/oxql.e2e.ts | 27 +++++++++-- 3 files changed, 122 insertions(+), 27 deletions(-) diff --git a/app/components/oxql-autocomplete.spec.ts b/app/components/oxql-autocomplete.spec.ts index dfe64f3a8..00774e0d3 100644 --- a/app/components/oxql-autocomplete.spec.ts +++ b/app/components/oxql-autocomplete.spec.ts @@ -60,9 +60,25 @@ const schemas: TimeseriesSchema[] = [ units: 'bytes', version: 1, }, + { + authzScope: 'fleet', + created: new Date(0), + datumType: 'f32', + description: { target: 'A hardware component', metric: 'Current draw' }, + fieldSchema: [ + { + name: 'chassis_kind', + fieldType: 'string', + source: 'target', + description: '', + }, + ], + timeseriesName: 'hardware_component:current', + units: 'none', + version: 1, + }, ] -/** Run the completion source on `doc` with the cursor at the end */ const complete = (doc: string): CompletionResult | null => oxqlCompletionSource(() => schemas)( new CompletionContext(EditorState.create({ doc }), doc.length, false) @@ -70,6 +86,15 @@ const complete = (doc: string): CompletionResult | null => const labels = (doc: string) => complete(doc)?.options.map((o) => o.label) +/** Run the completion source with the cursor where the first `|` is */ +const completeAt = (docWithCursor: string): CompletionResult | null => { + const pos = docWithCursor.indexOf('|') + const doc = docWithCursor.replace('|', '') + return oxqlCompletionSource(() => schemas)( + new CompletionContext(EditorState.create({ doc }), pos, false) + ) +} + it('completes table operations at the start of a clause', () => { expect(labels('g')).toContain('get') expect(labels('get hardware_component:fan_speed | f')).toContain('filter') @@ -77,18 +102,29 @@ it('completes table operations at the start of a clause', () => { expect(labels('get hardware_component:fan_speed | ')).toContain('group_by') }) -it('completes timeseries names after get', () => { - expect(labels('get ')).toEqual([ - 'hardware_component:fan_speed', - 'sled_data_link:bytes_sent', - ]) - expect(labels('get hardware_com')).toEqual([ - 'hardware_component:fan_speed', - 'sled_data_link:bytes_sent', - ]) - // from points at the start of the name so CM's own prefix filtering applies - const result = complete('get hardware_com') - expect(result?.from).toBe('get '.length) +it('completes all available targets after get', () => { + expect(labels('get ')).toEqual(['hardware_component', 'sled_data_link']) + expect(labels('get hardware_com')).toEqual(['hardware_component', 'sled_data_link']) +}) + +it('completes metrics of the chosen target after the colon', () => { + expect(labels('get hardware_component:')).toEqual(['fan_speed', 'current']) + expect(labels('get hardware_component:fan')).toEqual(['fan_speed', 'current']) + // from starts after the colon so the metric half filters against its own text + expect(complete('get hardware_component:fan')?.from).toBe( + 'get hardware_component:'.length + ) + expect(complete('get nonsense:')).toBeNull() +}) + +it('offers no name completions with the cursor mid-metric/target', () => { + expect(completeAt('get |hardware_component:fan_speed')).toBeNull() + expect(completeAt('get hardware_com|ponent:fan_speed')).toBeNull() + expect(completeAt('get hardware_component|:fan_speed')).toBeNull() + expect(completeAt('get hardware_component:|fan_speed')).toBeNull() + expect(completeAt('get hardware_component:fan|_speed')).toBeNull() + + expect(completeAt('get hardware_com| |')).not.toBeNull() }) it('completes fields of the queried timeseries in filter', () => { diff --git a/app/components/oxql-autocomplete.ts b/app/components/oxql-autocomplete.ts index 15bc39b20..d852a646f 100644 --- a/app/components/oxql-autocomplete.ts +++ b/app/components/oxql-autocomplete.ts @@ -9,16 +9,20 @@ import { autocompletion, closeBrackets, closeBracketsKeymap, + insertCompletionText, snippetCompletion, + startCompletion, type Completion, type CompletionContext, type CompletionResult, } from '@codemirror/autocomplete' import type { Extension } from '@codemirror/state' -import { keymap } from '@codemirror/view' +import { keymap, type EditorView } from '@codemirror/view' import type { TimeseriesSchema } from '@oxide/api' +import { pluralize } from '~/util/str' + // The OxQL language surface below comes from RFD 463 // https://rfd.shared.oxide.computer/rfd/463 @@ -143,11 +147,36 @@ const fieldCompletions = ( return options } -const schemaCompletion = (s: TimeseriesSchema): Completion => ({ - label: s.timeseriesName, - detail: s.units === 'none' ? s.datumType : `${s.datumType}, ${s.units}`, - info: s.description.metric, -}) +const targetOf = (timeseriesName: string) => + timeseriesName.slice(0, timeseriesName.indexOf(':')) + +const targetCompletions = (schemas: TimeseriesSchema[]): Completion[] => { + const targets = new Map() + for (const schema of schemas) { + const target = targetOf(schema.timeseriesName) + targets.set(target, (targets.get(target) || 0) + 1) + } + + return Array.from(targets, ([label, count]) => ({ + label: label, + detail: `${count} ${pluralize('metric', count)}`, + apply: (view: EditorView, c: Completion, from: number, to: number) => { + view.dispatch(insertCompletionText(view.state, `${c.label}:`, from, to)) + startCompletion(view) + }, + })) +} + +const metricCompletions = (schemas: TimeseriesSchema[], target: string): Completion[] => { + const prefix = `${target}:` + return schemas + .filter((s) => s.timeseriesName.startsWith(prefix)) + .map((s) => ({ + label: s.timeseriesName.slice(prefix.length), + detail: s.units === 'none' ? s.datumType : `${s.datumType}, ${s.units}`, + info: s.description.metric, + })) +} /** * Complete based on which clause the cursor is in, determined with regexes @@ -174,9 +203,22 @@ export const oxqlCompletionSource = const result = (options: Completion[]): CompletionResult | null => options.length > 0 ? { from: word.from, options, validFor: /^[@\w:]*$/ } : null - // after `get`, complete timeseries names from the schema list - if (/^\s*get\s+[\w:]*$/.test(clause)) { - return result(getSchemas().map(schemaCompletion)) + const getTable = /^\s*get\s+(\w*)(:?)(\w*)$/.exec(clause) + if (getTable) { + // if we're in the middle of a target:metric, don't make a completion + if (/[\w:]/.test(doc[context.pos] ?? '')) return null + + const [, target, colon, metric] = getTable + const inMetric = colon === ':' + const options = inMetric + ? metricCompletions(getSchemas(), target) + : targetCompletions(getSchemas()) + if (options.length === 0) return null + return { + from: context.pos - (inMetric ? metric.length : target.length), + options, + validFor: /^\w*$/, + } } if (/^\s*align\s+\w*$/.test(clause)) return result(alignFns) diff --git a/test/e2e/oxql.e2e.ts b/test/e2e/oxql.e2e.ts index bade398ff..e3cfea077 100644 --- a/test/e2e/oxql.e2e.ts +++ b/test/e2e/oxql.e2e.ts @@ -21,6 +21,16 @@ const runQuery = async (page: Page, query?: string) => { await expect(page.getByRole('alert')).toBeHidden() } +/** + * CodeMirror ignores Enter for `interactionDelay` (75ms) after the completion + * list opens, so a keypress the user made before seeing the tooltip can't + * accept an option. + */ +const acceptCompletion = async (page: Page) => { + await page.waitForTimeout(150) + await page.keyboard.press('Enter') +} + test.beforeEach(async ({ page }) => { await page.goto('/system/metrics-explorer') await expect(page.getByRole('heading', { name: 'Metrics Explorer' })).toBeVisible() @@ -134,8 +144,7 @@ test('picking an example populates the query and runs it', async ({ page }) => { await expect(page.getByRole('figure').first()).toBeVisible() }) -test('editor completions are wired to live timeseries schemas', async ({ page }) => { - // here we only check the editor is hooked up to the schema list from the API +test('editor completions walk from target to metric', async ({ page }) => { const textbox = page.getByRole('textbox') await textbox.click() await page.keyboard.type('get hardware') @@ -148,11 +157,19 @@ test('editor completions are wired to live timeseries schemas', async ({ page }) await expect(options.first()).toBeVisible({ timeout: 1000 }) }).toPass() + // the first half of a name completes on its own, so this is the target, not + // hardware_component:fan_speed + await expect(options).toHaveText(['hardware_component10 metrics']) + // accept with the keyboard rather than clicking: the info tooltip can // overlap the option and intercept pointer events - await expect(options.getByText('hardware_component:fan_speed')).toBeVisible() - await page.keyboard.type('_component:fan') // narrow until fan_speed is the top match - await page.keyboard.press('Enter') + await acceptCompletion(page) + await expect(textbox).toContainText('get hardware_component:') + + // accepting a target reopens the list on that target's metrics + await expect(options.getByText('fan_speed', { exact: true })).toBeVisible() + await page.keyboard.type('fan') // narrow until fan_speed is the top match + await acceptCompletion(page) await expect(textbox).toContainText('get hardware_component:fan_speed') }) From c3eabbc6f37c70aaf3f45f6e12f0ef6735643fa4 Mon Sep 17 00:00:00 2001 From: Joe Thel Date: Mon, 5 Oct 2026 18:31:16 -0700 Subject: [PATCH 28/46] shrink the timeseries snapshot for the mock api I had my fun. --- mock-api/timeseries-schema.ts | 11669 +------------------------------- test/e2e/oxql.e2e.ts | 2 +- 2 files changed, 253 insertions(+), 11418 deletions(-) diff --git a/mock-api/timeseries-schema.ts b/mock-api/timeseries-schema.ts index fcf226f10..8fa8b1934 100644 --- a/mock-api/timeseries-schema.ts +++ b/mock-api/timeseries-schema.ts @@ -9,98 +9,79 @@ import type { TimeseriesSchema } from '@oxide/api' import type { Json } from './json-type' -// snapshot from dogfood. schemas are pretty darn stable +/** + * Snapshot from dogfood, as schemas are pretty darn stable. Trimmed down to a + * smaller set to represent the variety of datum_type. + */ export const timeseriesSchemas: Json[] = [ { - timeseries_name: 'bgp_session:active_connections_accepted', + timeseries_name: 'collection_target:cpus_provisioned', description: { target: '', metric: '', }, field_schema: [ { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'local_asn', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'peer', - field_type: 'ip_addr', - source: 'target', - description: '', - }, - { - name: 'rack_id', + name: 'id', field_type: 'uuid', source: 'target', description: '', }, + ], + datum_type: 'i64', + version: 1, + authz_scope: 'fleet', + units: 'none', + created: '2023-10-25T23:05:04.909050887Z', + }, + { + timeseries_name: 'crucible_upstairs:activated', + description: { + target: '', + metric: '', + }, + field_schema: [ { - name: 'sled_id', + name: 'upstairs_uuid', field_type: 'uuid', source: 'target', description: '', }, ], - datum_type: 'cumulative_u64', + datum_type: 'cumulative_i64', version: 1, authz_scope: 'fleet', units: 'none', - created: '2024-03-27T21:18:27.382654900Z', + created: '2023-10-25T23:04:34.899663499Z', }, { - timeseries_name: 'bgp_session:connection_retries', + timeseries_name: 'database_transaction:retry_data', description: { target: '', metric: '', }, field_schema: [ { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'local_asn', + name: 'attempt', field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'peer', - field_type: 'ip_addr', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', + source: 'metric', description: '', }, { - name: 'sled_id', - field_type: 'uuid', + name: 'name', + field_type: 'string', source: 'target', description: '', }, ], - datum_type: 'cumulative_u64', + datum_type: 'f64', version: 1, authz_scope: 'fleet', units: 'none', - created: '2024-03-27T21:18:27.391077498Z', + created: '2023-12-09T05:05:12.777325080Z', }, { - timeseries_name: 'bgp_session:hold_timer_expirations', + timeseries_name: 'ddm_router:originated_tunnel_endpoints', description: { target: '', metric: '', @@ -112,18 +93,6 @@ export const timeseriesSchemas: Json[] = [ source: 'target', description: '', }, - { - name: 'local_asn', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'peer', - field_type: 'ip_addr', - source: 'target', - description: '', - }, { name: 'rack_id', field_type: 'uuid', @@ -137,78 +106,70 @@ export const timeseriesSchemas: Json[] = [ description: '', }, ], - datum_type: 'cumulative_u64', + datum_type: 'u64', version: 1, authz_scope: 'fleet', units: 'none', - created: '2024-03-27T21:18:27.373240625Z', + created: '2024-03-22T06:41:04.468869678Z', }, { - timeseries_name: 'bgp_session:idle_hold_timer_expirations', + timeseries_name: 'hardware_component:amd_cpu_tctl', description: { target: '', metric: '', }, field_schema: [ { - name: 'hostname', + name: 'chassis_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'chassis_model', field_type: 'string', source: 'target', description: '', }, { - name: 'local_asn', + name: 'chassis_revision', field_type: 'u32', source: 'target', description: '', }, { - name: 'peer', - field_type: 'ip_addr', + name: 'chassis_serial', + field_type: 'string', source: 'target', description: '', }, { - name: 'rack_id', - field_type: 'uuid', + name: 'component_id', + field_type: 'string', source: 'target', description: '', }, { - name: 'sled_id', - field_type: 'uuid', + name: 'component_kind', + field_type: 'string', source: 'target', description: '', }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-27T21:18:27.368709833Z', - }, - { - timeseries_name: 'bgp_session:keepalive_send_failures', - description: { - target: '', - metric: '', - }, - field_schema: [ { - name: 'hostname', + name: 'description', field_type: 'string', source: 'target', description: '', }, { - name: 'local_asn', - field_type: 'u32', + name: 'gateway_id', + field_type: 'uuid', source: 'target', description: '', }, { - name: 'peer', - field_type: 'ip_addr', + name: 'hubris_archive_id', + field_type: 'string', source: 'target', description: '', }, @@ -219,84 +180,82 @@ export const timeseriesSchemas: Json[] = [ description: '', }, { - name: 'sled_id', - field_type: 'uuid', + name: 'sensor', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'slot', + field_type: 'u32', source: 'target', description: '', }, ], - datum_type: 'cumulative_u64', + datum_type: 'f32', version: 1, authz_scope: 'fleet', units: 'none', - created: '2024-03-27T21:18:27.452187576Z', + created: '2024-09-26T20:54:40.780650780Z', }, { - timeseries_name: 'bgp_session:keepalives_received', + timeseries_name: 'hardware_component:fan_speed', description: { target: '', metric: '', }, field_schema: [ { - name: 'hostname', + name: 'chassis_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'chassis_model', field_type: 'string', source: 'target', description: '', }, { - name: 'local_asn', + name: 'chassis_revision', field_type: 'u32', source: 'target', description: '', }, { - name: 'peer', - field_type: 'ip_addr', + name: 'chassis_serial', + field_type: 'string', source: 'target', description: '', }, { - name: 'rack_id', - field_type: 'uuid', + name: 'component_id', + field_type: 'string', source: 'target', description: '', }, { - name: 'sled_id', - field_type: 'uuid', + name: 'component_kind', + field_type: 'string', source: 'target', description: '', }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-27T21:18:27.286539687Z', - }, - { - timeseries_name: 'bgp_session:keepalives_sent', - description: { - target: '', - metric: '', - }, - field_schema: [ { - name: 'hostname', + name: 'description', field_type: 'string', source: 'target', description: '', }, { - name: 'local_asn', - field_type: 'u32', + name: 'gateway_id', + field_type: 'uuid', source: 'target', description: '', }, { - name: 'peer', - field_type: 'ip_addr', + name: 'hubris_archive_id', + field_type: 'string', source: 'target', description: '', }, @@ -307,84 +266,88 @@ export const timeseriesSchemas: Json[] = [ description: '', }, { - name: 'sled_id', - field_type: 'uuid', + name: 'sensor', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'slot', + field_type: 'u32', source: 'target', description: '', }, ], - datum_type: 'cumulative_u64', + datum_type: 'f32', version: 1, authz_scope: 'fleet', units: 'none', - created: '2024-03-27T21:18:27.163117810Z', + created: '2024-08-27T02:18:06.071093138Z', }, { - timeseries_name: 'bgp_session:notification_send_failures', + timeseries_name: 'hardware_component:sensor_error_count', description: { target: '', metric: '', }, field_schema: [ { - name: 'hostname', + name: 'chassis_kind', + field_type: 'string', + source: 'target', + description: '', + }, + { + name: 'chassis_model', field_type: 'string', source: 'target', description: '', }, { - name: 'local_asn', + name: 'chassis_revision', field_type: 'u32', source: 'target', description: '', }, { - name: 'peer', - field_type: 'ip_addr', + name: 'chassis_serial', + field_type: 'string', source: 'target', description: '', }, { - name: 'rack_id', - field_type: 'uuid', + name: 'component_id', + field_type: 'string', source: 'target', description: '', }, { - name: 'sled_id', - field_type: 'uuid', + name: 'component_kind', + field_type: 'string', source: 'target', description: '', }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-27T21:18:27.446026555Z', - }, - { - timeseries_name: 'bgp_session:open_handle_failures', - description: { - target: '', - metric: '', - }, - field_schema: [ { - name: 'hostname', + name: 'description', field_type: 'string', source: 'target', description: '', }, { - name: 'local_asn', - field_type: 'u32', + name: 'error', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'gateway_id', + field_type: 'uuid', source: 'target', description: '', }, { - name: 'peer', - field_type: 'ip_addr', + name: 'hubris_archive_id', + field_type: 'string', source: 'target', description: '', }, @@ -395,8 +358,20 @@ export const timeseriesSchemas: Json[] = [ description: '', }, { - name: 'sled_id', - field_type: 'uuid', + name: 'sensor', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'sensor_kind', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'slot', + field_type: 'u32', source: 'target', description: '', }, @@ -405,11179 +380,115 @@ export const timeseriesSchemas: Json[] = [ version: 1, authz_scope: 'fleet', units: 'none', - created: '2024-03-27T21:18:27.395049178Z', + created: '2024-08-27T02:18:06.038148045Z', }, { - timeseries_name: 'bgp_session:open_send_failures', + timeseries_name: 'hardware_component:temperature', description: { target: '', metric: '', }, field_schema: [ { - name: 'hostname', + name: 'chassis_kind', field_type: 'string', source: 'target', description: '', }, { - name: 'local_asn', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'peer', - field_type: 'ip_addr', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-27T21:18:27.456331671Z', - }, - { - timeseries_name: 'bgp_session:opens_received', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'local_asn', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'peer', - field_type: 'ip_addr', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-27T21:18:27.340922385Z', - }, - { - timeseries_name: 'bgp_session:opens_sent', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'local_asn', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'peer', - field_type: 'ip_addr', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-27T21:18:27.295987414Z', - }, - { - timeseries_name: 'bgp_session:passive_connections_accepted', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'local_asn', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'peer', - field_type: 'ip_addr', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-27T21:18:27.386239723Z', - }, - { - timeseries_name: 'bgp_session:prefixes_advertised', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'local_asn', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'peer', - field_type: 'ip_addr', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-27T21:18:27.359643912Z', - }, - { - timeseries_name: 'bgp_session:prefixes_imported', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'local_asn', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'peer', - field_type: 'ip_addr', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-27T21:18:27.363537040Z', - }, - { - timeseries_name: 'bgp_session:transition_to_active', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'local_asn', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'peer', - field_type: 'ip_addr', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-27T21:18:27.410603402Z', - }, - { - timeseries_name: 'bgp_session:transition_to_connect', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'local_asn', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'peer', - field_type: 'ip_addr', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-27T21:18:27.405590536Z', - }, - { - timeseries_name: 'bgp_session:transition_to_established', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'local_asn', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'peer', - field_type: 'ip_addr', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-27T21:18:27.429033616Z', - }, - { - timeseries_name: 'bgp_session:transition_to_idle', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'local_asn', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'peer', - field_type: 'ip_addr', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-27T21:18:27.401648462Z', - }, - { - timeseries_name: 'bgp_session:transition_to_open_confirm', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'local_asn', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'peer', - field_type: 'ip_addr', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-27T21:18:27.419127285Z', - }, - { - timeseries_name: 'bgp_session:transition_to_open_sent', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'local_asn', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'peer', - field_type: 'ip_addr', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-27T21:18:27.414230998Z', - }, - { - timeseries_name: 'bgp_session:transition_to_session_setup', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'local_asn', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'peer', - field_type: 'ip_addr', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-27T21:18:27.424845645Z', - }, - { - timeseries_name: 'bgp_session:unexpected_keepalive_messages', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'local_asn', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'peer', - field_type: 'ip_addr', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-27T21:18:27.437750383Z', - }, - { - timeseries_name: 'bgp_session:unexpected_open_messages', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'local_asn', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'peer', - field_type: 'ip_addr', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-27T21:18:27.442273160Z', - }, - { - timeseries_name: 'bgp_session:unexpected_update_messages', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'local_asn', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'peer', - field_type: 'ip_addr', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-27T21:18:27.434115093Z', - }, - { - timeseries_name: 'bgp_session:update_nexthop_missing', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'local_asn', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'peer', - field_type: 'ip_addr', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-27T21:18:27.377469644Z', - }, - { - timeseries_name: 'bgp_session:update_send_failures', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'local_asn', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'peer', - field_type: 'ip_addr', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-27T21:18:27.461585929Z', - }, - { - timeseries_name: 'bgp_session:updates_received', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'local_asn', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'peer', - field_type: 'ip_addr', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-27T21:18:27.354008910Z', - }, - { - timeseries_name: 'bgp_session:updates_sent', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'local_asn', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'peer', - field_type: 'ip_addr', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-27T21:18:27.349052439Z', - }, - { - timeseries_name: 'collection_target:cpus_provisioned', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'i64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2023-10-25T23:05:04.909050887Z', - }, - { - timeseries_name: 'collection_target:ram_provisioned', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'i64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2023-10-25T23:05:04.915652918Z', - }, - { - timeseries_name: 'collection_target:virtual_disk_space_provisioned', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'i64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2023-10-25T23:13:04.927950665Z', - }, - { - timeseries_name: 'crucible_upstairs:activated', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'upstairs_uuid', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_i64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2023-10-25T23:04:34.899663499Z', - }, - { - timeseries_name: 'crucible_upstairs:extent_no_op', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'upstairs_uuid', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_i64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2023-10-25T23:04:34.930943640Z', - }, - { - timeseries_name: 'crucible_upstairs:extent_reopen', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'upstairs_uuid', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_i64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2023-10-25T23:04:34.934827868Z', - }, - { - timeseries_name: 'crucible_upstairs:extent_repair', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'upstairs_uuid', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_i64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2023-10-25T23:04:34.927207024Z', - }, - { - timeseries_name: 'crucible_upstairs:flush', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'upstairs_uuid', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_i64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2023-10-25T23:04:34.903985541Z', - }, - { - timeseries_name: 'crucible_upstairs:flush_close', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'upstairs_uuid', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_i64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2023-10-25T23:04:34.923454748Z', - }, - { - timeseries_name: 'crucible_upstairs:read', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'upstairs_uuid', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_i64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2023-10-25T23:04:34.915831652Z', - }, - { - timeseries_name: 'crucible_upstairs:read_bytes', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'upstairs_uuid', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_i64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2023-10-25T23:04:34.919609014Z', - }, - { - timeseries_name: 'crucible_upstairs:write', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'upstairs_uuid', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_i64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2023-10-25T23:04:34.908085310Z', - }, - { - timeseries_name: 'crucible_upstairs:write_bytes', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'upstairs_uuid', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_i64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2023-10-25T23:04:34.911931515Z', - }, - { - timeseries_name: 'database_transaction:retry_data', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'attempt', - field_type: 'u32', - source: 'metric', - description: '', - }, - { - name: 'name', - field_type: 'string', - source: 'target', - description: '', - }, - ], - datum_type: 'f64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2023-12-09T05:05:12.777325080Z', - }, - { - timeseries_name: 'ddm_router:originated_tunnel_endpoints', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-22T06:41:04.468869678Z', - }, - { - timeseries_name: 'ddm_router:originated_underlay_prefixes', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-22T06:41:04.458812191Z', - }, - { - timeseries_name: 'ddm_session:advertisements_received', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'interface', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-22T06:41:04.490830594Z', - }, - { - timeseries_name: 'ddm_session:advertisements_sent', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'interface', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-22T06:41:04.485165121Z', - }, - { - timeseries_name: 'ddm_session:imported_tunnel_endpoints', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'interface', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-22T06:41:04.532085293Z', - }, - { - timeseries_name: 'ddm_session:imported_underlay_prefixes', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'interface', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-22T06:41:04.526955683Z', - }, - { - timeseries_name: 'ddm_session:peer_address_changes', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'interface', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-22T06:41:04.501513674Z', - }, - { - timeseries_name: 'ddm_session:peer_expirations', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'interface', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-22T06:41:04.496421046Z', - }, - { - timeseries_name: 'ddm_session:peer_sessions_established', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'interface', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-22T06:41:04.506910539Z', - }, - { - timeseries_name: 'ddm_session:solicitations_received', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'interface', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-22T06:41:04.479772914Z', - }, - { - timeseries_name: 'ddm_session:solicitations_sent', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'interface', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-22T06:41:04.473936670Z', - }, - { - timeseries_name: 'ddm_session:update_send_fail', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'interface', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-22T06:41:04.522046049Z', - }, - { - timeseries_name: 'ddm_session:updates_received', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'interface', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-22T06:41:04.516919585Z', - }, - { - timeseries_name: 'ddm_session:updates_sent', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'interface', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-22T06:41:04.511944819Z', - }, - { - timeseries_name: 'dendrite:sample_collection_duration', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'metric', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'metric', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'metric', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'metric', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'metric', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'metric', - description: '', - }, - ], - datum_type: 'f64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:40.028670944Z', - }, - { - timeseries_name: 'hardware_component:amd_cpu_tctl', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'chassis_kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'chassis_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'chassis_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'chassis_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'component_id', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'component_kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'description', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'gateway_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'hubris_archive_id', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sensor', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'slot', - field_type: 'u32', - source: 'target', - description: '', - }, - ], - datum_type: 'f32', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-09-26T20:54:40.780650780Z', - }, - { - timeseries_name: 'hardware_component:current', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'chassis_kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'chassis_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'chassis_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'chassis_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'component_id', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'component_kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'description', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'gateway_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'hubris_archive_id', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sensor', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'slot', - field_type: 'u32', - source: 'target', - description: '', - }, - ], - datum_type: 'f32', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-08-27T02:18:06.049588403Z', - }, - { - timeseries_name: 'hardware_component:fan_speed', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'chassis_kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'chassis_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'chassis_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'chassis_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'component_id', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'component_kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'description', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'gateway_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'hubris_archive_id', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sensor', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'slot', - field_type: 'u32', - source: 'target', - description: '', - }, - ], - datum_type: 'f32', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-08-27T02:18:06.071093138Z', - }, - { - timeseries_name: 'hardware_component:input_current', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'chassis_kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'chassis_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'chassis_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'chassis_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'component_id', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'component_kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'description', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'gateway_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'hubris_archive_id', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sensor', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'slot', - field_type: 'u32', - source: 'target', - description: '', - }, - ], - datum_type: 'f32', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-08-27T02:18:06.060593618Z', - }, - { - timeseries_name: 'hardware_component:input_voltage', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'chassis_kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'chassis_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'chassis_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'chassis_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'component_id', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'component_kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'description', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'gateway_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'hubris_archive_id', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sensor', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'slot', - field_type: 'u32', - source: 'target', - description: '', - }, - ], - datum_type: 'f32', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-08-27T02:18:06.065753331Z', - }, - { - timeseries_name: 'hardware_component:poll_error_count', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'chassis_kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'chassis_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'chassis_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'chassis_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'component_id', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'component_kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'description', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'error', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'gateway_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'hubris_archive_id', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'slot', - field_type: 'u32', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-10-15T00:13:59.310580937Z', - }, - { - timeseries_name: 'hardware_component:power', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'chassis_kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'chassis_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'chassis_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'chassis_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'component_id', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'component_kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'description', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'gateway_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'hubris_archive_id', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sensor', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'slot', - field_type: 'u32', - source: 'target', - description: '', - }, - ], - datum_type: 'f32', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-08-27T02:18:06.084199090Z', - }, - { - timeseries_name: 'hardware_component:sensor_error_count', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'chassis_kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'chassis_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'chassis_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'chassis_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'component_id', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'component_kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'description', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'error', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'gateway_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'hubris_archive_id', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sensor', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'sensor_kind', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'slot', - field_type: 'u32', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-08-27T02:18:06.038148045Z', - }, - { - timeseries_name: 'hardware_component:temperature', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'chassis_kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'chassis_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'chassis_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'chassis_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'component_id', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'component_kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'description', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'gateway_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'hubris_archive_id', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sensor', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'slot', - field_type: 'u32', - source: 'target', - description: '', - }, - ], - datum_type: 'f32', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-08-27T02:18:06.044202257Z', - }, - { - timeseries_name: 'hardware_component:voltage', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'chassis_kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'chassis_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'chassis_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'chassis_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'component_id', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'component_kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'description', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'gateway_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'hubris_archive_id', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sensor', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'slot', - field_type: 'u32', - source: 'target', - description: '', - }, - ], - datum_type: 'f32', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-08-27T02:18:06.055480125Z', - }, - { - timeseries_name: 'http_service:request_latency_histogram', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'operation_id', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'status_code', - field_type: 'u16', - source: 'metric', - description: '', - }, - ], - datum_type: 'histogram_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-09-12T18:06:16.899666089Z', - }, - { - timeseries_name: 'instance_network_interface:bytes_received', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'instance_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'interface_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'project_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'silo_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-09-12T18:07:20.691164152Z', - }, - { - timeseries_name: 'instance_network_interface:bytes_sent', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'instance_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'interface_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'project_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'silo_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-09-12T18:07:20.709144483Z', - }, - { - timeseries_name: 'instance_network_interface:errors_received', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'instance_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'interface_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'project_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'silo_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-09-12T18:07:20.695807570Z', - }, - { - timeseries_name: 'instance_network_interface:errors_sent', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'instance_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'interface_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'project_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'silo_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-09-12T18:07:20.713747565Z', - }, - { - timeseries_name: 'instance_network_interface:packets_dropped', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'instance_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'interface_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'project_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'silo_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-09-12T18:07:20.700227615Z', - }, - { - timeseries_name: 'instance_network_interface:packets_received', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'instance_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'interface_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'project_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'silo_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-09-12T18:07:20.685683981Z', - }, - { - timeseries_name: 'instance_network_interface:packets_sent', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'instance_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'interface_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'project_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'silo_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-09-12T18:07:20.704117609Z', - }, - { - timeseries_name: 'kstat_sampler:expired_targets', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-09-18T23:28:55.312503012Z', - }, - { - timeseries_name: 'kstat_sampler:samples_dropped', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'target_id', - field_type: 'u64', - source: 'metric', - description: '', - }, - { - name: 'target_name', - field_type: 'string', - source: 'metric', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2023-11-17T02:53:34.642824724Z', - }, - { - timeseries_name: 'management_network_data_link:bytes_received', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-13T07:32:13.160257732Z', - }, - { - timeseries_name: 'management_network_data_link:bytes_sent', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-13T07:32:12.656694601Z', - }, - { - timeseries_name: 'management_network_data_link:errors_received', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-13T07:32:12.801529140Z', - }, - { - timeseries_name: 'management_network_data_link:errors_sent', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-13T07:32:12.904711448Z', - }, - { - timeseries_name: 'management_network_data_link:packets_received', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-13T07:32:13.197085086Z', - }, - { - timeseries_name: 'management_network_data_link:packets_sent', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-13T07:32:12.751660813Z', - }, - { - timeseries_name: 'mg_lower:routes_blocked_by_link_state', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-27T21:18:27.479959512Z', - }, - { - timeseries_name: 'opte_port:in_uft_evictions', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'interface_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'interface_kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'parent_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'port_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'zone_name', - field_type: 'string', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2026-08-10T22:26:03.789533870Z', - }, - { - timeseries_name: 'opte_port:in_uft_flows', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'interface_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'interface_kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'parent_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'port_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'zone_name', - field_type: 'string', - source: 'target', - description: '', - }, - ], - datum_type: 'u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2026-08-10T22:26:03.789530543Z', - }, - { - timeseries_name: 'opte_port:in_uft_hits', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'interface_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'interface_kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'parent_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'port_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'zone_name', - field_type: 'string', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2026-08-10T22:26:03.789523680Z', - }, - { - timeseries_name: 'opte_port:in_uft_misses', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'interface_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'interface_kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'parent_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'port_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'zone_name', - field_type: 'string', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2026-08-10T22:26:03.789527427Z', - }, - { - timeseries_name: 'opte_port:out_uft_evictions', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'interface_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'interface_kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'parent_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'port_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'zone_name', - field_type: 'string', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2026-08-10T22:26:03.789547245Z', - }, - { - timeseries_name: 'opte_port:out_uft_flows', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'interface_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'interface_kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'parent_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'port_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'zone_name', - field_type: 'string', - source: 'target', - description: '', - }, - ], - datum_type: 'u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2026-08-10T22:26:03.789543909Z', - }, - { - timeseries_name: 'opte_port:out_uft_hits', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'interface_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'interface_kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'parent_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'port_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'zone_name', - field_type: 'string', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2026-08-10T22:26:03.789537547Z', - }, - { - timeseries_name: 'opte_port:out_uft_misses', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'interface_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'interface_kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'parent_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'port_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'zone_name', - field_type: 'string', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2026-08-10T22:26:03.789540753Z', - }, - { - timeseries_name: 'opte_port:route_cache_hits', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'interface_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'interface_kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'parent_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'port_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'zone_name', - field_type: 'string', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2026-08-10T22:26:03.789554018Z', - }, - { - timeseries_name: 'opte_port:route_cache_misses', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'interface_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'interface_kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'parent_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'port_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'zone_name', - field_type: 'string', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2026-08-10T22:26:03.789558386Z', - }, - { - timeseries_name: 'opte_port:route_cache_occupancy', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'interface_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'interface_kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'parent_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'port_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'zone_name', - field_type: 'string', - source: 'target', - description: '', - }, - ], - datum_type: 'u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2026-08-10T22:26:03.789550782Z', - }, - { - timeseries_name: 'opte_port:route_cache_table_full', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'interface_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'interface_kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'parent_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'port_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'zone_name', - field_type: 'string', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2026-08-10T22:26:03.789561822Z', - }, - { - timeseries_name: 'oximeter_collector:collections', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'base_route', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'collector_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'collector_ip', - field_type: 'ip_addr', - source: 'target', - description: '', - }, - { - name: 'collector_port', - field_type: 'u16', - source: 'target', - description: '', - }, - { - name: 'producer_id', - field_type: 'uuid', - source: 'metric', - description: '', - }, - { - name: 'producer_ip', - field_type: 'ip_addr', - source: 'metric', - description: '', - }, - { - name: 'producer_port', - field_type: 'u16', - source: 'metric', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2023-11-17T02:53:57.255983666Z', - }, - { - timeseries_name: 'oximeter_collector:database_queue_depth', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'collector_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'collector_ip', - field_type: 'ip_addr', - source: 'target', - description: '', - }, - { - name: 'collector_port', - field_type: 'u16', - source: 'target', - description: '', - }, - { - name: 'collector_sink', - field_type: 'string', - source: 'metric', - description: '', - }, - ], - datum_type: 'histogram_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2026-07-09T14:03:34.016056546Z', - }, - { - timeseries_name: 'oximeter_collector:database_samples_dropped', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'collector_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'collector_ip', - field_type: 'ip_addr', - source: 'target', - description: '', - }, - { - name: 'collector_port', - field_type: 'u16', - source: 'target', - description: '', - }, - { - name: 'collector_sink', - field_type: 'string', - source: 'metric', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2026-07-09T14:03:34.016052395Z', - }, - { - timeseries_name: 'oximeter_collector:failed_collections', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'base_route', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'collector_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'collector_ip', - field_type: 'ip_addr', - source: 'target', - description: '', - }, - { - name: 'collector_port', - field_type: 'u16', - source: 'target', - description: '', - }, - { - name: 'producer_id', - field_type: 'uuid', - source: 'metric', - description: '', - }, - { - name: 'producer_ip', - field_type: 'ip_addr', - source: 'metric', - description: '', - }, - { - name: 'producer_port', - field_type: 'u16', - source: 'metric', - description: '', - }, - { - name: 'reason', - field_type: 'string', - source: 'metric', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2023-11-17T02:56:39.525743256Z', - }, - { - timeseries_name: 'oximeter_collector:samples_collected', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'base_route', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'collector_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'collector_ip', - field_type: 'ip_addr', - source: 'target', - description: '', - }, - { - name: 'collector_port', - field_type: 'u16', - source: 'target', - description: '', - }, - { - name: 'producer_id', - field_type: 'uuid', - source: 'metric', - description: '', - }, - { - name: 'producer_ip', - field_type: 'ip_addr', - source: 'metric', - description: '', - }, - { - name: 'producer_port', - field_type: 'u16', - source: 'metric', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2026-07-09T14:04:14.539773793Z', - }, - { - timeseries_name: 'physical_data_link:bytes_received', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-08-21T22:24:04.500160033Z', - }, - { - timeseries_name: 'physical_data_link:bytes_sent', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-08-21T22:24:04.507782173Z', - }, - { - timeseries_name: 'physical_data_link:errors_received', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-08-21T22:24:04.491505511Z', - }, - { - timeseries_name: 'physical_data_link:errors_sent', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-08-21T22:24:04.496304619Z', - }, - { - timeseries_name: 'physical_data_link:packets_received', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-08-21T22:24:04.504092176Z', - }, - { - timeseries_name: 'physical_data_link:packets_sent', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-08-21T22:24:04.511712158Z', - }, - { - timeseries_name: 'sled_cpu:cpu_nsec', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'cpu_id', - field_type: 'u32', - source: 'metric', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'state', - field_type: 'string', - source: 'metric', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2026-03-03T00:01:22.032950719Z', - }, - { - timeseries_name: 'sled_data_link:bytes_received', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'zone_name', - field_type: 'string', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-08-14T03:24:34.149372848Z', - }, - { - timeseries_name: 'sled_data_link:bytes_sent', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'zone_name', - field_type: 'string', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-08-14T03:24:34.232414065Z', - }, - { - timeseries_name: 'sled_data_link:errors_received', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'zone_name', - field_type: 'string', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-08-14T03:24:34.050086881Z', - }, - { - timeseries_name: 'sled_data_link:errors_sent', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'zone_name', - field_type: 'string', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-08-14T03:24:34.092318117Z', - }, - { - timeseries_name: 'sled_data_link:packets_received', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'zone_name', - field_type: 'string', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-08-14T03:24:34.193000416Z', - }, - { - timeseries_name: 'sled_data_link:packets_sent', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'zone_name', - field_type: 'string', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-08-14T03:24:34.270285239Z', - }, - { - timeseries_name: 'static_routing_config:static_nexthops', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-27T21:18:27.470632635Z', - }, - { - timeseries_name: 'static_routing_config:static_routes', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-27T21:18:27.465433112Z', - }, - { - timeseries_name: 'switch_data_link:bytes_received', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_id', - field_type: 'u8', - source: 'metric', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'port_id', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:39.678212511Z', - }, - { - timeseries_name: 'switch_data_link:bytes_sent', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_id', - field_type: 'u8', - source: 'metric', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'port_id', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:39.707787542Z', - }, - { - timeseries_name: 'switch_data_link:errors_received', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_id', - field_type: 'u8', - source: 'metric', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'port_id', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:39.695740167Z', - }, - { - timeseries_name: 'switch_data_link:errors_sent', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_id', - field_type: 'u8', - source: 'metric', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'port_id', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:39.714194722Z', - }, - { - timeseries_name: 'switch_data_link:fec_corrected_blocks', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_id', - field_type: 'u8', - source: 'metric', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'port_id', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:39.732581990Z', - }, - { - timeseries_name: 'switch_data_link:fec_high_symbol_errors', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_id', - field_type: 'u8', - source: 'metric', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'port_id', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'bool', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:39.720562272Z', - }, - { - timeseries_name: 'switch_data_link:fec_symbol_errors', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'lane', - field_type: 'u8', - source: 'metric', - description: '', - }, - { - name: 'link_id', - field_type: 'u8', - source: 'metric', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'port_id', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:39.744428376Z', - }, - { - timeseries_name: 'switch_data_link:fec_sync_aligned', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_id', - field_type: 'u8', - source: 'metric', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'port_id', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'bool', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:39.726717613Z', - }, - { - timeseries_name: 'switch_data_link:fec_uncorrected_blocks', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_id', - field_type: 'u8', - source: 'metric', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'port_id', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:39.738632766Z', - }, - { - timeseries_name: 'switch_data_link:link_enabled', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_id', - field_type: 'u8', - source: 'metric', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'port_id', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'bool', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:39.654131442Z', - }, - { - timeseries_name: 'switch_data_link:link_fsm', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_id', - field_type: 'u8', - source: 'metric', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'port_id', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'state', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:39.751036026Z', - }, - { - timeseries_name: 'switch_data_link:link_up', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_id', - field_type: 'u8', - source: 'metric', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'port_id', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'bool', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:39.664448579Z', - }, - { - timeseries_name: 'switch_data_link:packets_received', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_id', - field_type: 'u8', - source: 'metric', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'port_id', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:39.672147342Z', - }, - { - timeseries_name: 'switch_data_link:packets_sent', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_id', - field_type: 'u8', - source: 'metric', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'port_id', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:39.702278594Z', - }, - { - timeseries_name: 'switch_data_link:pcs_bad_sync_headers', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_id', - field_type: 'u8', - source: 'metric', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'port_id', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:39.758203239Z', - }, - { - timeseries_name: 'switch_data_link:pcs_block_lock_loss', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_id', - field_type: 'u8', - source: 'metric', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'port_id', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:39.770730009Z', - }, - { - timeseries_name: 'switch_data_link:pcs_errored_blocks', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_id', - field_type: 'u8', - source: 'metric', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'port_id', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:39.777603911Z', - }, - { - timeseries_name: 'switch_data_link:pcs_high_ber', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_id', - field_type: 'u8', - source: 'metric', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'port_id', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:39.784408692Z', - }, - { - timeseries_name: 'switch_data_link:pcs_invalid_errors', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_id', - field_type: 'u8', - source: 'metric', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'port_id', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:39.790948389Z', - }, - { - timeseries_name: 'switch_data_link:pcs_sync_loss', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_id', - field_type: 'u8', - source: 'metric', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'port_id', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:39.764811478Z', - }, - { - timeseries_name: 'switch_data_link:pcs_unknown_errors', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_id', - field_type: 'u8', - source: 'metric', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'port_id', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:39.799540984Z', - }, - { - timeseries_name: 'switch_data_link:pcs_valid_errors', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_id', - field_type: 'u8', - source: 'metric', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'port_id', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:39.805847762Z', - }, - { - timeseries_name: 'switch_data_link:receive_buffer_full_drops', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_id', - field_type: 'u8', - source: 'metric', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'port_id', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:39.690159917Z', - }, - { - timeseries_name: 'switch_data_link:receive_crc_error_drops', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_id', - field_type: 'u8', - source: 'metric', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'port_id', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:39.684158156Z', - }, - { - timeseries_name: 'switch_port_control_data_link:bytes_received', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-13T07:32:13.638699340Z', - }, - { - timeseries_name: 'switch_port_control_data_link:bytes_sent', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-13T07:32:13.364408444Z', - }, - { - timeseries_name: 'switch_port_control_data_link:errors_received', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-13T07:32:13.505589080Z', - }, - { - timeseries_name: 'switch_port_control_data_link:errors_sent', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-13T07:32:13.589540327Z', - }, - { - timeseries_name: 'switch_port_control_data_link:packets_received', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-13T07:32:13.799182096Z', - }, - { - timeseries_name: 'switch_port_control_data_link:packets_sent', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'kind', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'link_name', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'network', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-13T07:32:13.421921557Z', - }, - { - timeseries_name: 'switch_rib:active_routes', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'hostname', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-03-27T21:18:27.475028506Z', - }, - { - timeseries_name: 'switch_table:capacity', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - { - name: 'table', - field_type: 'string', - source: 'target', - description: '', - }, - ], - datum_type: 'u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:39.955432618Z', - }, - { - timeseries_name: 'switch_table:collisions', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - { - name: 'table', - field_type: 'string', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:39.993290403Z', - }, - { - timeseries_name: 'switch_table:delete_misses', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - { - name: 'table', - field_type: 'string', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:40.006538271Z', - }, - { - timeseries_name: 'switch_table:deletes', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - { - name: 'table', - field_type: 'string', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:39.977541324Z', - }, - { - timeseries_name: 'switch_table:exhaustion', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - { - name: 'table', - field_type: 'string', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:40.013588153Z', - }, - { - timeseries_name: 'switch_table:inserts', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - { - name: 'table', - field_type: 'string', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:39.970311290Z', - }, - { - timeseries_name: 'switch_table:occupancy', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - { - name: 'table', - field_type: 'string', - source: 'target', - description: '', - }, - ], - datum_type: 'u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:39.962671108Z', - }, - { - timeseries_name: 'switch_table:update_misses', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - { - name: 'table', - field_type: 'string', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:39.999692262Z', - }, - { - timeseries_name: 'switch_table:updates', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'asic_fab', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_lot', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'asic_wafer', - field_type: 'u8', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_x', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'asic_wafer_loc_y', - field_type: 'i16', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'switch_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'switch_serial', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'switch_slot', - field_type: 'u16', - source: 'target', - description: '', - }, - { - name: 'table', - field_type: 'string', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2025-02-14T22:29:39.985250897Z', - }, - { - timeseries_name: 'virtual_disk:bytes_discarded', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'attached_instance_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'block_size', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'disk_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'project_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'silo_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2026-06-30T18:33:29.089497759Z', - }, - { - timeseries_name: 'virtual_disk:bytes_read', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'attached_instance_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'block_size', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'disk_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'project_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'silo_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-09-12T18:07:20.725376238Z', - }, - { - timeseries_name: 'virtual_disk:bytes_written', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'attached_instance_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'block_size', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'disk_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'project_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'silo_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-09-12T18:07:20.737369060Z', - }, - { - timeseries_name: 'virtual_disk:discards', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'attached_instance_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'block_size', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'disk_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'project_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'silo_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2026-06-30T18:33:29.089363383Z', - }, - { - timeseries_name: 'virtual_disk:failed_discards', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'attached_instance_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'block_size', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'disk_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'failure_reason', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'project_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'silo_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2026-06-30T18:33:29.089649599Z', - }, - { - timeseries_name: 'virtual_disk:failed_flushes', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'attached_instance_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'block_size', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'disk_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'failure_reason', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'project_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'silo_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-09-12T18:07:20.749378966Z', - }, - { - timeseries_name: 'virtual_disk:failed_reads', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'attached_instance_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'block_size', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'disk_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'failure_reason', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'project_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'silo_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-09-12T18:07:20.729368797Z', - }, - { - timeseries_name: 'virtual_disk:failed_writes', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'attached_instance_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'block_size', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'disk_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'failure_reason', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'project_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'silo_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-09-12T18:07:20.741157142Z', - }, - { - timeseries_name: 'virtual_disk:flushes', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'attached_instance_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'block_size', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'disk_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'project_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'silo_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-09-12T18:07:20.745168876Z', - }, - { - timeseries_name: 'virtual_disk:io_latency', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'attached_instance_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'block_size', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'disk_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'io_kind', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'project_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'silo_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'histogram_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-09-12T18:07:20.754569807Z', - }, - { - timeseries_name: 'virtual_disk:io_size', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'attached_instance_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'block_size', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'disk_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'io_kind', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'project_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'silo_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'histogram_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-09-12T18:07:20.759303246Z', - }, - { - timeseries_name: 'virtual_disk:reads', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'attached_instance_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'block_size', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'disk_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'project_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'silo_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-09-12T18:07:20.721185245Z', - }, - { - timeseries_name: 'virtual_disk:writes', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'attached_instance_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'block_size', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'disk_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'project_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'silo_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-09-12T18:07:20.733402020Z', - }, - { - timeseries_name: 'virtual_machine:check', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'instance_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'nexus_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'project_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'reason', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'silo_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_agent_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_agent_ip', - field_type: 'ip_addr', - source: 'target', - description: '', - }, - { - name: 'sled_agent_port', - field_type: 'u16', - source: 'target', - description: '', - }, - { - name: 'state', + name: 'chassis_model', field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'vmm_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - ], - datum_type: 'cumulative_u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2024-05-19T00:07:04.930606011Z', - }, - { - timeseries_name: 'virtual_machine:incomplete_check', - description: { - target: '', - metric: '', - }, - field_schema: [ - { - name: 'instance_id', - field_type: 'uuid', source: 'target', description: '', }, { - name: 'nexus_id', - field_type: 'uuid', + name: 'chassis_revision', + field_type: 'u32', source: 'target', description: '', }, { - name: 'project_id', - field_type: 'uuid', + name: 'chassis_serial', + field_type: 'string', source: 'target', description: '', }, { - name: 'rack_id', - field_type: 'uuid', + name: 'component_id', + field_type: 'string', source: 'target', description: '', }, { - name: 'reason', + name: 'component_kind', field_type: 'string', - source: 'metric', + source: 'target', description: '', }, { - name: 'silo_id', - field_type: 'uuid', + name: 'description', + field_type: 'string', source: 'target', description: '', }, { - name: 'sled_agent_id', + name: 'gateway_id', field_type: 'uuid', source: 'target', description: '', }, { - name: 'sled_agent_ip', - field_type: 'ip_addr', + name: 'hubris_archive_id', + field_type: 'string', source: 'target', description: '', }, { - name: 'sled_agent_port', - field_type: 'u16', + name: 'rack_id', + field_type: 'uuid', source: 'target', description: '', }, { - name: 'vmm_id', - field_type: 'uuid', + name: 'sensor', + field_type: 'string', + source: 'metric', + description: '', + }, + { + name: 'slot', + field_type: 'u32', source: 'target', description: '', }, ], - datum_type: 'cumulative_u64', + datum_type: 'f32', version: 1, authz_scope: 'fleet', units: 'none', - created: '2024-06-20T17:45:08.409040686Z', + created: '2024-08-27T02:18:06.044202257Z', }, { - timeseries_name: 'virtual_machine:pv_panic_guest_handled', + timeseries_name: 'sled_data_link:bytes_received', description: { target: '', metric: '', }, field_schema: [ { - name: 'instance_id', - field_type: 'uuid', + name: 'kind', + field_type: 'string', source: 'target', description: '', }, { - name: 'project_id', - field_type: 'uuid', + name: 'link_name', + field_type: 'string', source: 'target', description: '', }, { - name: 'silo_id', + name: 'rack_id', field_type: 'uuid', source: 'target', description: '', @@ -11606,34 +517,40 @@ export const timeseriesSchemas: Json[] = [ source: 'target', description: '', }, + { + name: 'zone_name', + field_type: 'string', + source: 'target', + description: '', + }, ], datum_type: 'cumulative_u64', version: 1, authz_scope: 'fleet', units: 'none', - created: '2024-08-01T21:43:51.299251810Z', + created: '2024-08-14T03:24:34.149372848Z', }, { - timeseries_name: 'virtual_machine:pv_panic_host_handled', + timeseries_name: 'sled_data_link:bytes_sent', description: { target: '', metric: '', }, field_schema: [ { - name: 'instance_id', - field_type: 'uuid', + name: 'kind', + field_type: 'string', source: 'target', description: '', }, { - name: 'project_id', - field_type: 'uuid', + name: 'link_name', + field_type: 'string', source: 'target', description: '', }, { - name: 'silo_id', + name: 'rack_id', field_type: 'uuid', source: 'target', description: '', @@ -11662,34 +579,40 @@ export const timeseriesSchemas: Json[] = [ source: 'target', description: '', }, + { + name: 'zone_name', + field_type: 'string', + source: 'target', + description: '', + }, ], datum_type: 'cumulative_u64', version: 1, authz_scope: 'fleet', units: 'none', - created: '2024-08-01T21:43:51.305010310Z', + created: '2024-08-14T03:24:34.232414065Z', }, { - timeseries_name: 'virtual_machine:reset', + timeseries_name: 'sled_data_link:errors_received', description: { target: '', metric: '', }, field_schema: [ { - name: 'instance_id', - field_type: 'uuid', + name: 'kind', + field_type: 'string', source: 'target', description: '', }, { - name: 'project_id', - field_type: 'uuid', + name: 'link_name', + field_type: 'string', source: 'target', description: '', }, { - name: 'silo_id', + name: 'rack_id', field_type: 'uuid', source: 'target', description: '', @@ -11718,34 +641,40 @@ export const timeseriesSchemas: Json[] = [ source: 'target', description: '', }, + { + name: 'zone_name', + field_type: 'string', + source: 'target', + description: '', + }, ], datum_type: 'cumulative_u64', version: 1, authz_scope: 'fleet', units: 'none', - created: '2024-08-01T21:43:51.309966069Z', + created: '2024-08-14T03:24:34.050086881Z', }, { - timeseries_name: 'virtual_machine:vcpu_usage', + timeseries_name: 'sled_data_link:errors_sent', description: { target: '', metric: '', }, field_schema: [ { - name: 'instance_id', - field_type: 'uuid', + name: 'kind', + field_type: 'string', source: 'target', description: '', }, { - name: 'project_id', - field_type: 'uuid', + name: 'link_name', + field_type: 'string', source: 'target', description: '', }, { - name: 'silo_id', + name: 'rack_id', field_type: 'uuid', source: 'target', description: '', @@ -11775,15 +704,9 @@ export const timeseriesSchemas: Json[] = [ description: '', }, { - name: 'state', + name: 'zone_name', field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'vcpu_id', - field_type: 'u32', - source: 'metric', + source: 'target', description: '', }, ], @@ -11791,109 +714,71 @@ export const timeseriesSchemas: Json[] = [ version: 1, authz_scope: 'fleet', units: 'none', - created: '2024-08-01T21:43:51.313851227Z', + created: '2024-08-14T03:24:34.092318117Z', }, { - timeseries_name: 'zfs_dataset:bytes_used', + timeseries_name: 'switch_data_link:fec_high_symbol_errors', description: { target: '', metric: '', }, field_schema: [ { - name: 'dataset_id', - field_type: 'uuid', - source: 'metric', - description: '', - }, - { - name: 'dataset_kind', - field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'dataset_name', + name: 'asic_fab', field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'pool_id', - field_type: 'uuid', - source: 'metric', + source: 'target', description: '', }, { - name: 'pool_kind', + name: 'asic_lot', field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', source: 'target', description: '', }, { - name: 'sled_id', - field_type: 'uuid', + name: 'asic_wafer', + field_type: 'u8', source: 'target', description: '', }, { - name: 'sled_model', - field_type: 'string', + name: 'asic_wafer_loc_x', + field_type: 'i16', source: 'target', description: '', }, { - name: 'sled_revision', - field_type: 'u32', + name: 'asic_wafer_loc_y', + field_type: 'i16', source: 'target', description: '', }, { - name: 'sled_serial', + name: 'kind', field_type: 'string', source: 'target', description: '', }, { - name: 'zone_name', - field_type: 'string', + name: 'link_id', + field_type: 'u8', source: 'metric', description: '', }, - ], - datum_type: 'u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2026-05-27T02:53:06.414720080Z', - }, - { - timeseries_name: 'zfs_pool:bytes_allocated', - description: { - target: '', - metric: '', - }, - field_schema: [ { - name: 'pool_id', - field_type: 'uuid', - source: 'metric', + name: 'model', + field_type: 'string', + source: 'target', description: '', }, { - name: 'pool_kind', + name: 'network', field_type: 'string', - source: 'metric', + source: 'target', description: '', }, { - name: 'pool_name', + name: 'port_id', field_type: 'string', source: 'metric', description: '', @@ -11928,141 +813,91 @@ export const timeseriesSchemas: Json[] = [ source: 'target', description: '', }, - ], - datum_type: 'u64', - version: 1, - authz_scope: 'fleet', - units: 'none', - created: '2026-05-27T02:53:06.413670104Z', - }, - { - timeseries_name: 'zfs_pool:bytes_total', - description: { - target: '', - metric: '', - }, - field_schema: [ { - name: 'pool_id', + name: 'switch_id', field_type: 'uuid', - source: 'metric', - description: '', - }, - { - name: 'pool_kind', - field_type: 'string', - source: 'metric', + source: 'target', description: '', }, { - name: 'pool_name', + name: 'switch_model', field_type: 'string', - source: 'metric', - description: '', - }, - { - name: 'rack_id', - field_type: 'uuid', source: 'target', description: '', }, { - name: 'sled_id', - field_type: 'uuid', + name: 'switch_revision', + field_type: 'u32', source: 'target', description: '', }, { - name: 'sled_model', + name: 'switch_serial', field_type: 'string', source: 'target', description: '', }, { - name: 'sled_revision', - field_type: 'u32', - source: 'target', - description: '', - }, - { - name: 'sled_serial', - field_type: 'string', + name: 'switch_slot', + field_type: 'u16', source: 'target', description: '', }, ], - datum_type: 'u64', + datum_type: 'bool', version: 1, authz_scope: 'fleet', units: 'none', - created: '2026-05-27T02:53:06.413805258Z', + created: '2025-02-14T22:29:39.720562272Z', }, { - timeseries_name: 'zone:cpu_nsec', + timeseries_name: 'virtual_disk:io_latency', description: { target: '', metric: '', }, field_schema: [ { - name: 'rack_id', - field_type: 'uuid', - source: 'target', - description: '', - }, - { - name: 'sled_id', + name: 'attached_instance_id', field_type: 'uuid', source: 'target', description: '', }, { - name: 'sled_model', - field_type: 'string', - source: 'target', - description: '', - }, - { - name: 'sled_revision', + name: 'block_size', field_type: 'u32', source: 'target', description: '', }, { - name: 'sled_serial', - field_type: 'string', + name: 'disk_id', + field_type: 'uuid', source: 'target', description: '', }, { - name: 'state', + name: 'io_kind', field_type: 'string', source: 'metric', description: '', }, { - name: 'zone_id', + name: 'project_id', field_type: 'uuid', - source: 'metric', - description: '', - }, - { - name: 'zone_name', - field_type: 'string', - source: 'metric', + source: 'target', description: '', }, { - name: 'zone_type', - field_type: 'string', - source: 'metric', + name: 'silo_id', + field_type: 'uuid', + source: 'target', description: '', }, ], - datum_type: 'cumulative_u64', + datum_type: 'histogram_u64', version: 1, authz_scope: 'fleet', units: 'none', - created: '2026-03-30T23:58:07.024767757Z', + created: '2024-09-12T18:07:20.754569807Z', }, ] diff --git a/test/e2e/oxql.e2e.ts b/test/e2e/oxql.e2e.ts index e3cfea077..c65dd5ce4 100644 --- a/test/e2e/oxql.e2e.ts +++ b/test/e2e/oxql.e2e.ts @@ -159,7 +159,7 @@ test('editor completions walk from target to metric', async ({ page }) => { // the first half of a name completes on its own, so this is the target, not // hardware_component:fan_speed - await expect(options).toHaveText(['hardware_component10 metrics']) + await expect(options).toHaveText(['hardware_component4 metrics']) // accept with the keyboard rather than clicking: the info tooltip can // overlap the option and intercept pointer events From 7ccdcc992668a052f4508a0bc7373067ce8cf4a9 Mon Sep 17 00:00:00 2001 From: David Crespo Date: Tue, 6 Oct 2026 14:48:15 -0500 Subject: [PATCH 29/46] Copy full field value, not the truncated one --- app/pages/system/MetricsExplorer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/pages/system/MetricsExplorer.tsx b/app/pages/system/MetricsExplorer.tsx index 4108c703c..a53a6d55d 100644 --- a/app/pages/system/MetricsExplorer.tsx +++ b/app/pages/system/MetricsExplorer.tsx @@ -248,7 +248,7 @@ const FieldBadge = ({ fieldName, value }: { fieldName: string; value: string })
{camelToSnake(fieldName)} {text} - +
) From 2f51c48d91d912037999dc3ccbbfac7668579fca Mon Sep 17 00:00:00 2001 From: David Crespo Date: Tue, 6 Oct 2026 15:50:14 -0500 Subject: [PATCH 30/46] Raise contrast of completion detail text --- app/ui/styles/components/oxql-editor.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/ui/styles/components/oxql-editor.css b/app/ui/styles/components/oxql-editor.css index 8b7b3eaf0..c0de31497 100644 --- a/app/ui/styles/components/oxql-editor.css +++ b/app/ui/styles/components/oxql-editor.css @@ -110,7 +110,7 @@ } .cm-completionDetail { - color: var(--content-quaternary); + color: var(--content-tertiary); font-style: normal; margin-left: 1rem; } From 9b72a4e83f3adaeacc37eafbafe2dea60d484d8c Mon Sep 17 00:00:00 2001 From: David Crespo Date: Tue, 6 Oct 2026 15:54:10 -0500 Subject: [PATCH 31/46] Format metrics explorer ticks with Intl compact --- app/pages/system/MetricsExplorer.tsx | 14 +------------- app/util/math.spec.ts | 23 ++++++++++++++++++++++- app/util/math.ts | 11 +++++++++++ 3 files changed, 34 insertions(+), 14 deletions(-) diff --git a/app/pages/system/MetricsExplorer.tsx b/app/pages/system/MetricsExplorer.tsx index a53a6d55d..e428c792e 100644 --- a/app/pages/system/MetricsExplorer.tsx +++ b/app/pages/system/MetricsExplorer.tsx @@ -66,6 +66,7 @@ import { Tooltip } from '~/ui/lib/Tooltip' import { truncate } from '~/ui/lib/Truncate' import { ALL_ISH } from '~/util/consts' import { docLinks } from '~/util/links' +import { formatTick } from '~/util/math' import { pluralize } from '~/util/str' const exampleItems: { label: string; value: string }[] = [ @@ -400,19 +401,6 @@ const tableToGroup = (table: OxqlTable): ChartGroup => { } } -const TICK_UNITS = [ - // TODO: this doesn't quite match the suffixes in the oxql-metrics util, but i'm leaving it - // because i don't understand those - [1e12, 't'], - [1e9, 'b'], - [1e6, 'm'], - [1e3, 'k'], -] as const -const formatTick = (n: number): string => { - const [divisor, suffix] = TICK_UNITS.find(([min]) => Math.abs(n) >= min) ?? [1, ''] - return (n / divisor).toLocaleString() + suffix -} - // Drops (or keeps, without copying) the first sample of a series. const dropFirst = (drop: boolean) => diff --git a/app/util/math.spec.ts b/app/util/math.spec.ts index c7fdfe9b7..c34832a20 100644 --- a/app/util/math.spec.ts +++ b/app/util/math.spec.ts @@ -7,7 +7,14 @@ */ import { describe, expect, it } from 'vitest' -import { diskSizeNearest10, displayBigNum, percentage, round, splitDecimal } from './math' +import { + diskSizeNearest10, + displayBigNum, + formatTick, + percentage, + round, + splitDecimal, +} from './math' import { GiB } from './units' it('round', () => { @@ -122,6 +129,20 @@ describe('with default locale', () => { ])('displayBigNum %d -> %s', (input, output) => { expect(displayBigNum(input)).toEqual(output) }) + + it.each([ + [0, '0'], + [0.125, '0.125'], + [250, '250'], + [1250, '1.25K'], + [1750, '1.75K'], + [12500, '12.5K'], + [1_250_000, '1.25M'], + [2.5e9, '2.5B'], + [-3e6, '-3M'], + ])('formatTick %d -> %s', (input, output) => { + expect(formatTick(input)).toEqual(output) + }) }) describe('with de-DE locale', () => { diff --git a/app/util/math.ts b/app/util/math.ts index d240fa9ad..40a14f456 100644 --- a/app/util/math.ts +++ b/app/util/math.ts @@ -103,6 +103,17 @@ export function displayBigNum( return [result, abbreviated] } +/** + * Short y-axis tick labels like 1.25K. Compact notation rounds to 2 + * significant digits by default, which turns ticks like 1.25K into 1.3K. + */ +export function formatTick(num: number, locale?: string) { + return Intl.NumberFormat(locale, { + notation: 'compact', + maximumSignificantDigits: 3, + }).format(num) +} + /** * Calculate disk size based on image or snapshot size. We round up to the * nearest 10, but also cap it at the max disk size so that, for example, a 1023 From 257433bcaf68b5c2fafc34c048f328128544504b Mon Sep 17 00:00:00 2001 From: David Crespo Date: Tue, 6 Oct 2026 16:03:47 -0500 Subject: [PATCH 32/46] Show field values in their original case --- app/pages/system/MetricsExplorer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/pages/system/MetricsExplorer.tsx b/app/pages/system/MetricsExplorer.tsx index e428c792e..8509dd49c 100644 --- a/app/pages/system/MetricsExplorer.tsx +++ b/app/pages/system/MetricsExplorer.tsx @@ -248,7 +248,7 @@ const FieldBadge = ({ fieldName, value }: { fieldName: string; value: string })
{camelToSnake(fieldName)} - {text} + {text}
From d379d351281e185f4b3c69acaf37516a1c7a2b99 Mon Sep 17 00:00:00 2001 From: David Crespo Date: Tue, 6 Oct 2026 16:06:41 -0500 Subject: [PATCH 33/46] Show up to 10 fields before collapsing --- app/pages/system/MetricsExplorer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/pages/system/MetricsExplorer.tsx b/app/pages/system/MetricsExplorer.tsx index 8509dd49c..66350dd9e 100644 --- a/app/pages/system/MetricsExplorer.tsx +++ b/app/pages/system/MetricsExplorer.tsx @@ -237,7 +237,7 @@ const getFormattedFields = (t: Timeseries): string => .map(([fieldName, x]) => `${camelToSnake(fieldName)}: ${x.value}`) .join(' / ') -const DEFAULT_FIELDS_SHOWN = 5 +const DEFAULT_FIELDS_SHOWN = 10 // long enough for names/serials; a UUID (36 chars) gets middle-truncated const FIELD_VALUE_MAX_LEN = 24 From ebc3e0cfdec5b68ac1e311878931f4eff62c0bb7 Mon Sep 17 00:00:00 2001 From: David Crespo Date: Tue, 6 Oct 2026 16:35:17 -0500 Subject: [PATCH 34/46] Truncate UUID field values more aggressively --- app/pages/system/MetricsExplorer.tsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/app/pages/system/MetricsExplorer.tsx b/app/pages/system/MetricsExplorer.tsx index 66350dd9e..32a9ee783 100644 --- a/app/pages/system/MetricsExplorer.tsx +++ b/app/pages/system/MetricsExplorer.tsx @@ -238,12 +238,16 @@ const getFormattedFields = (t: Timeseries): string => .join(' / ') const DEFAULT_FIELDS_SHOWN = 10 -// long enough for names/serials; a UUID (36 chars) gets middle-truncated +// long enough for names/serials const FIELD_VALUE_MAX_LEN = 24 - -const FieldBadge = ({ fieldName, value }: { fieldName: string; value: string }) => { - const truncated = value.length > FIELD_VALUE_MAX_LEN - const text = truncate(value, FIELD_VALUE_MAX_LEN, 'middle') +// 6 chars on either side of the ellipsis is enough to tell UUIDs apart +const UUID_MAX_LEN = 14 + +const FieldBadge = ({ fieldName, field }: { fieldName: string; field: FieldValue }) => { + const value = String(field.value) + const maxLen = field.type === 'uuid' ? UUID_MAX_LEN : FIELD_VALUE_MAX_LEN + const truncated = value.length > maxLen + const text = truncate(value, maxLen, 'middle') const badge = (
@@ -270,7 +274,7 @@ const FieldsList = ({ fields }: { fields: Record }) => { return (
{toShow.map(([fieldName, x]) => ( - + ))} {!showOverflow && entries.length > DEFAULT_FIELDS_SHOWN && ( + + {showDocs && ( + setShowDocs(false)} /> + )} + + ) +} + +/** + * Like `ChartHeader`, but each timeseries in the table name (more than one for + * a joined table) gets its own heading and docs button. The buttons sit + * outside the headings so they don't end up in the headings' accessible names. + */ +function TimeseriesChartHeader({ + tableName, + description, +}: { + tableName: string + description: ReactNode +}) { + const names = retrieveMetricNames(tableName) + return ( +
+
+ {names.map((name, i) => ( + + {i > 0 && } +
+

{name}

+ +
+
+ ))} +
+
{description}
+
+ ) +} + function ChartCard({ display }: { display: Extract }) { return ( - + }) { return ( - + void isOpen: boolean children?: React.ReactNode errors?: string[] + /** + * Focus the title on open instead of the first tabbable element. For + * read-only content, where jumping to (and scrolling down to) the first link + * or button isn't useful. See the note on long content in + * https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/#keyboardinteraction + */ + focusTitle?: boolean /** * Whether the modal should animate in. It never animates out. Default `true`. * Used to prevent animation from firing when we show the modal directly on a @@ -56,7 +63,9 @@ export function SideModal({ subtitle, animate = true, errors, + focusTitle, }: SideModalProps) { + const titleRef = useRef(null) return (
- + {title} {subtitle} diff --git a/test/e2e/oxql.e2e.ts b/test/e2e/oxql.e2e.ts index c65dd5ce4..06ff47f67 100644 --- a/test/e2e/oxql.e2e.ts +++ b/test/e2e/oxql.e2e.ts @@ -144,6 +144,61 @@ test('picking an example populates the query and runs it', async ({ page }) => { await expect(page.getByRole('figure').first()).toBeVisible() }) +test('chart title opens timeseries docs', async ({ page }) => { + await page.getByRole('button', { name: 'Power shelf fan speeds' }).click() + await page + .getByRole('button', { name: 'hardware_component:fan_speed details' }) + .first() + .click() + + const modal = page.getByRole('dialog', { name: 'hardware_component:fan_speed' }) + await expect(modal).toBeVisible() + // read-only modal focuses its title instead of the docs link at the bottom + await expect( + modal.getByRole('heading', { name: 'hardware_component:fan_speed' }) + ).toBeFocused() + // descriptions come from the snapshot, not the schema endpoint + await expect( + modal.getByText('A fan speed measurement, in rotations per minute') + ).toBeVisible() + await expect(modal.getByText('f32', { exact: true })).toBeVisible() + await expect(modal.getByText('rpm', { exact: true })).toBeVisible() + await expect(modal.getByText('hubris_archive_id')).toBeVisible() + await expect(modal.getByRole('link', { name: 'Timeseries schemas' })).toHaveAttribute( + 'href', + 'https://docs.oxide.computer/guides/metrics/timeseries-schemas#_hardware_componentfan_speed' + ) +}) + +test('joined chart title has docs for each timeseries', async ({ page }) => { + await page.getByRole('button', { name: 'Bytes sent & received per sled' }).click() + await expect( + page.getByRole('heading', { name: 'sled_data_link:bytes_sent' }).first() + ).toBeVisible() + await expect( + page.getByRole('heading', { name: 'sled_data_link:bytes_received' }).first() + ).toBeVisible() + + await page + .getByRole('button', { name: 'sled_data_link:bytes_received details' }) + .first() + .click() + const received = page.getByRole('dialog', { name: 'sled_data_link:bytes_received' }) + await expect(received).toBeVisible() + await expect(received.getByText('Number of bytes received on the link')).toBeVisible() + await expect(received.getByText('Number of bytes sent on the link')).toBeHidden() + await page.keyboard.press('Escape') + await expect(received).toBeHidden() + + await page + .getByRole('button', { name: 'sled_data_link:bytes_sent details' }) + .first() + .click() + const sent = page.getByRole('dialog', { name: 'sled_data_link:bytes_sent' }) + await expect(sent).toBeVisible() + await expect(sent.getByText('Number of bytes sent on the link')).toBeVisible() +}) + test('editor completions walk from target to metric', async ({ page }) => { const textbox = page.getByRole('textbox') await textbox.click() From 26cb60a8032bd149687c26dfaab570f3c05b429e Mon Sep 17 00:00:00 2001 From: David Crespo Date: Tue, 6 Oct 2026 21:35:00 -0500 Subject: [PATCH 39/46] tiny bit of space around colon in metric names --- app/pages/system/MetricsExplorer.tsx | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/app/pages/system/MetricsExplorer.tsx b/app/pages/system/MetricsExplorer.tsx index 5d83951f7..535df907c 100644 --- a/app/pages/system/MetricsExplorer.tsx +++ b/app/pages/system/MetricsExplorer.tsx @@ -602,6 +602,24 @@ function TimeseriesDocsButton({ name }: { name: string }) { ) } +/** + * The colon's sidebearings in a proportional font are so narrow that, with + * underscores running each half together, it's the tightest spot in the name. + * Give it a little room on both sides. Margin rather than inserted spaces so + * copying and the heading's accessible name still give the real name. + */ +function TimeseriesName({ name }: { name: string }) { + const i = name.indexOf(':') + if (i === -1) return name + return ( + <> + {name.slice(0, i)} + : + {name.slice(i + 1)} + + ) +} + /** * Like `ChartHeader`, but each timeseries in the table name (more than one for * a joined table) gets its own heading and docs button. The buttons sit @@ -622,7 +640,9 @@ function TimeseriesChartHeader({ {i > 0 && }
-

{name}

+

+ +

From ca683a153c443d4712e4cf0d9e6df209f35652a2 Mon Sep 17 00:00:00 2001 From: David Crespo Date: Tue, 6 Oct 2026 22:06:55 -0500 Subject: [PATCH 40/46] Brighten chart axis text to tertiary --- app/util/charts.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/util/charts.ts b/app/util/charts.ts index 6d5f00c51..68010fbb0 100644 --- a/app/util/charts.ts +++ b/app/util/charts.ts @@ -85,7 +85,7 @@ export function getChartTheme(): ChartTheme { hoverPoint: v('--content-accent'), fill: withAlpha(v('--surface-accent-secondary'), 0.6), axisLine: v('--stroke-secondary'), - axisText: v('--content-quaternary'), + axisText: v('--content-tertiary'), lineColors: [ '--color-green-800', '--color-blue-800', From 0069da20d1e961a213d3d1ddb43c7f0dac112710 Mon Sep 17 00:00:00 2001 From: David Crespo Date: Tue, 6 Oct 2026 21:57:47 -0500 Subject: [PATCH 41/46] Label chart Y axis with timeseries unit --- app/components/Heatmap.tsx | 5 ++++ app/components/TimeSeriesChart.tsx | 6 +++- app/pages/system/MetricsExplorer.tsx | 44 +++++++++++++++++++++++++++- app/util/charts.ts | 10 ++++++- 4 files changed, 62 insertions(+), 3 deletions(-) diff --git a/app/components/Heatmap.tsx b/app/components/Heatmap.tsx index 6156200e2..ef843c564 100644 --- a/app/components/Heatmap.tsx +++ b/app/components/Heatmap.tsx @@ -91,6 +91,8 @@ type HeatmapProps = { distributions: (HeatmapDistribution | null)[] yAxisTickFormatter?: (val: number) => string unit?: string + /** Drawn rotated alongside the y-axis tick labels, e.g. a unit */ + yAxisLabel?: string } const defaultYAxisTickFormatter = (val: number) => val.toLocaleString() @@ -102,6 +104,7 @@ export function Heatmap({ distributions, yAxisTickFormatter = defaultYAxisTickFormatter, unit, + yAxisLabel, }: HeatmapProps) { const theme = useChartTheme() const [hover, setHover] = useState(null) @@ -253,6 +256,7 @@ export function Heatmap({ xTimeAxis({ theme, formatTime }), yValueAxis({ theme, + label: yAxisLabel, grid: { show: false }, values: (_u, splits) => splits.map((v) => { @@ -277,6 +281,7 @@ export function Heatmap({ drawCells, tooltipPlugin, formatterRef, + yAxisLabel, ]) const data = useMemo( diff --git a/app/components/TimeSeriesChart.tsx b/app/components/TimeSeriesChart.tsx index 7481f5e7d..7e6a200b2 100644 --- a/app/components/TimeSeriesChart.tsx +++ b/app/components/TimeSeriesChart.tsx @@ -37,6 +37,8 @@ type TimeSeriesChartProps = { startTime: Date endTime: Date unit?: string + /** Drawn rotated alongside the y-axis tick labels, e.g. a unit */ + yAxisLabel?: string yAxisTickFormatter?: (val: number) => string hasError?: boolean loading: boolean @@ -110,6 +112,7 @@ export function TimeSeriesChart({ startTime, endTime, unit, + yAxisLabel, yAxisTickFormatter = defaultYAxisTickFormatter, hasError = false, loading, @@ -213,6 +216,7 @@ export function TimeSeriesChart({ xTimeAxis({ theme, formatTime }), yValueAxis({ theme, + label: yAxisLabel, grid: { show: true, stroke: theme.axisLine, width: 1 }, values: (_u, yValues) => yValues.map((v) => (v === 0 ? '' : formatterRef.current(v))), @@ -236,7 +240,7 @@ export function TimeSeriesChart({ legend: { show: false }, plugins: [tooltipPlugin], }) satisfies UPlotOptions, - [dataLength, formatTime, tooltipPlugin, interpolation, theme, formatterRef] + [dataLength, formatTime, tooltipPlugin, interpolation, theme, formatterRef, yAxisLabel] ) const aligned = useMemo(() => { diff --git a/app/pages/system/MetricsExplorer.tsx b/app/pages/system/MetricsExplorer.tsx index 535df907c..3f812fd90 100644 --- a/app/pages/system/MetricsExplorer.tsx +++ b/app/pages/system/MetricsExplorer.tsx @@ -28,6 +28,7 @@ import { type ValueArray, type FieldValue, type TimeseriesSchema, + type Units, } from '@oxide/api' import { Info16Icon, @@ -36,6 +37,7 @@ import { } from '@oxide/design-system/icons/react' import { Badge } from '@oxide/design-system/ui' +import { timeseries as timeseriesMetadata } from '~/api/__generated__/timeseries-metadata' import { DocsPopover } from '~/components/DocsPopover' import { Heatmap } from '~/components/Heatmap' import { MoreActionsMenu } from '~/components/MoreActionsMenu' @@ -299,6 +301,41 @@ const FieldsList = ({ fields }: { fields: Record }) => { const retrieveMetricNames = (tableName: string): string[] => tableName.split(',').map((s) => s.trim()) +type UnitLabels = { + /** Spelled out, for the y-axis */ + axis: string + /** After a value in the tooltip, so symbols where there's a standard one */ + tooltip?: string +} + +const unitLabels: Record, UnitLabels> = { + // "12 count" reads oddly + count: { axis: 'Count' }, + bytes: { axis: 'Bytes', tooltip: 'bytes' }, + seconds: { axis: 'Seconds', tooltip: 's' }, + nanoseconds: { axis: 'Nanoseconds', tooltip: 'ns' }, + volts: { axis: 'Volts', tooltip: 'V' }, + amps: { axis: 'Amps', tooltip: 'A' }, + watts: { axis: 'Watts', tooltip: 'W' }, + joules: { axis: 'Joules', tooltip: 'J' }, + degrees_celsius: { axis: 'Degrees Celsius', tooltip: '°C' }, + rpm: { axis: 'RPM', tooltip: 'RPM' }, +} + +/** + * Units come from the snapshot of omicron's schema files because the schema + * endpoint returns `none` for everything. A joined table only gets labels if + * all its timeseries share a unit. + */ +const tableUnitLabels = (tableName: string): UnitLabels | undefined => { + const units = R.unique( + retrieveMetricNames(tableName).map((name) => timeseriesMetadata[name]?.units) + ) + return units.length === 1 && units[0] && units[0] !== 'none' + ? unitLabels[units[0]] + : undefined +} + const tableToGroup = (table: OxqlTable): ChartGroup => { const { name, timeseries } = table if (timeseries.length === 0) return 'empty-timeseries' @@ -654,6 +691,7 @@ function TimeseriesChartHeader({ } function ChartCard({ display }: { display: Extract }) { + const units = tableUnitLabels(display.name) return ( @@ -665,7 +703,8 @@ function ChartCard({ display }: { display: Extract @@ -674,6 +713,7 @@ function ChartCard({ display }: { display: Extract }) { + const units = tableUnitLabels(display.name) return ( @@ -682,6 +722,8 @@ function HeatmapCard({ display }: { display: Extract diff --git a/app/util/charts.ts b/app/util/charts.ts index 68010fbb0..f2d73b097 100644 --- a/app/util/charts.ts +++ b/app/util/charts.ts @@ -58,6 +58,7 @@ export const measureTextWidth = (text: string, font: string) => { export const AXIS_FONT_REM_XS = 0.6875 export const AXIS_TICK_LENGTH = 6 export const AXIS_TICK_GAP = 8 +const AXIS_LABEL_GAP = 12 export type ChartTheme = { fontFamily: string @@ -177,13 +178,20 @@ export function yValueAxis({ theme, grid, values, + label, }: { theme: ChartTheme grid: uPlot.Axis.Grid values: uPlot.Axis.Values + /** Drawn rotated alongside the tick labels, e.g. a unit */ + label?: string }): uPlot.Axis { - const { axisFont } = chartAxisFont(theme) + const { fontPx, axisFont } = chartAxisFont(theme) return { + label, + labelFont: axisFont, + labelGap: AXIS_LABEL_GAP, + labelSize: fontPx + AXIS_LABEL_GAP, stroke: theme.axisText, font: axisFont, side: 1, From 5882c075f887db2c801f54b673d98270d3d00ba9 Mon Sep 17 00:00:00 2001 From: benjaminleonard Date: Wed, 7 Oct 2026 15:41:06 +0100 Subject: [PATCH 42/46] Adjust modal description/title --- .../oxql-metrics/TimeseriesDocsSideModal.tsx | 11 ++++++---- app/pages/system/MetricsExplorer.tsx | 22 +++++++++---------- app/ui/lib/SideModal.tsx | 2 +- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/app/components/oxql-metrics/TimeseriesDocsSideModal.tsx b/app/components/oxql-metrics/TimeseriesDocsSideModal.tsx index 0896433ac..9170c2f22 100644 --- a/app/components/oxql-metrics/TimeseriesDocsSideModal.tsx +++ b/app/components/oxql-metrics/TimeseriesDocsSideModal.tsx @@ -16,12 +16,14 @@ import { type TimeseriesSchema, type Units, } from '@oxide/api' +import { Monitoring16Icon } from '@oxide/design-system/icons/react' import { Badge } from '@oxide/design-system/ui' import { targets, timeseries } from '~/api/__generated__/timeseries-metadata' import { ReadOnlySideModalForm } from '~/components/form/ReadOnlySideModalForm' import { ModalLink, ModalLinks } from '~/ui/lib/ModalLinks' import { PropertiesTable } from '~/ui/lib/PropertiesTable' +import { ResourceLabel } from '~/ui/lib/SideModal' import { ALL_ISH } from '~/util/consts' import { docLinks } from '~/util/links' @@ -141,12 +143,13 @@ export function TimeseriesDocsSideModal({ const [target, metric] = name.split(':') return ( lets long names wrap at the colon instead of mid-word - title={ - - {target}: + subtitle={ + + {target}: {metric} - + } onDismiss={onDismiss} animate diff --git a/app/pages/system/MetricsExplorer.tsx b/app/pages/system/MetricsExplorer.tsx index 3f812fd90..ec2dcc69b 100644 --- a/app/pages/system/MetricsExplorer.tsx +++ b/app/pages/system/MetricsExplorer.tsx @@ -620,18 +620,16 @@ function TimeseriesDocsButton({ name }: { name: string }) { const [showDocs, setShowDocs] = useState(false) return ( <> - - - + {showDocs && ( setShowDocs(false)} /> )} diff --git a/app/ui/lib/SideModal.tsx b/app/ui/lib/SideModal.tsx index 16b0dae57..4ad8b97c3 100644 --- a/app/ui/lib/SideModal.tsx +++ b/app/ui/lib/SideModal.tsx @@ -137,7 +137,7 @@ export function SideModal({ ) } -export const ResourceLabel = classed.h3`mt-2 flex items-center gap-1.5 text-sans-md text-accent` +export const ResourceLabel = classed.h3`mt-1.5 flex items-center gap-1.5 text-sans-lg text-accent [&>svg]:text-accent-tertiary` SideModal.Body = ({ children }: { children?: ReactNode }) => (
Date: Wed, 7 Oct 2026 15:41:28 +0100 Subject: [PATCH 43/46] Adjust field badge and icon colours --- app/pages/system/MetricsExplorer.tsx | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/app/pages/system/MetricsExplorer.tsx b/app/pages/system/MetricsExplorer.tsx index ec2dcc69b..8847166f3 100644 --- a/app/pages/system/MetricsExplorer.tsx +++ b/app/pages/system/MetricsExplorer.tsx @@ -31,11 +31,10 @@ import { type Units, } from '@oxide/api' import { - Info16Icon, + Info12Icon, Monitoring16Icon, Monitoring24Icon, } from '@oxide/design-system/icons/react' -import { Badge } from '@oxide/design-system/ui' import { timeseries as timeseriesMetadata } from '~/api/__generated__/timeseries-metadata' import { DocsPopover } from '~/components/DocsPopover' @@ -256,19 +255,21 @@ const FieldBadge = ({ fieldName, field }: { fieldName: string; field: FieldValue const truncated = value.length > maxLen const text = truncate(value, maxLen, 'middle') const badge = ( - -
- {camelToSnake(fieldName)} - {text} - -
-
+ + {camelToSnake(fieldName)} + + {text} + + ) if (!truncated) return badge return ( - {/* Tooltip applies a ref to its child, but Badge doesn't forward refs */} - {badge} + {badge} ) } @@ -673,7 +674,7 @@ function TimeseriesChartHeader({
{names.map((name, i) => ( - {i > 0 && } + {i > 0 && }

From c30b3156a6481c7f897e5b5769a3dc35dc66b6f1 Mon Sep 17 00:00:00 2001 From: benjaminleonard Date: Wed, 7 Oct 2026 15:50:32 +0100 Subject: [PATCH 44/46] Adjust schema modal style to be more like docs --- .../oxql-metrics/TimeseriesDocsSideModal.tsx | 89 ++++++++++++------- 1 file changed, 57 insertions(+), 32 deletions(-) diff --git a/app/components/oxql-metrics/TimeseriesDocsSideModal.tsx b/app/components/oxql-metrics/TimeseriesDocsSideModal.tsx index 9170c2f22..afa0c7a67 100644 --- a/app/components/oxql-metrics/TimeseriesDocsSideModal.tsx +++ b/app/components/oxql-metrics/TimeseriesDocsSideModal.tsx @@ -6,6 +6,7 @@ * Copyright Oxide Computer Company */ import { useQuery } from '@tanstack/react-query' +import type { ReactNode } from 'react' import * as R from 'remeda' import { @@ -21,7 +22,8 @@ import { Badge } from '@oxide/design-system/ui' import { targets, timeseries } from '~/api/__generated__/timeseries-metadata' import { ReadOnlySideModalForm } from '~/components/form/ReadOnlySideModalForm' -import { ModalLink, ModalLinks } from '~/ui/lib/ModalLinks' +import { FormDivider } from '~/ui/lib/Divider' +import { SideModalFormDocs } from '~/ui/lib/ModalLinks' import { PropertiesTable } from '~/ui/lib/PropertiesTable' import { ResourceLabel } from '~/ui/lib/SideModal' import { ALL_ISH } from '~/util/consts' @@ -65,19 +67,29 @@ function getDocs(name: string, schemas: TimeseriesSchema[] | undefined): Timeser return { fields: [] } } -function FieldList({ fields }: { fields: Field[] }) { +const DocsList = ({ children }: { children: ReactNode }) => ( +
    + {children} +
+) + +function DocsItem({ + name, + type, + description, +}: { + name: string + type?: string + description?: string +}) { return ( -
    - {fields.map((f) => ( -
  • -
    - {f.name} - {f.fieldType} -
    - {f.description &&

    {f.description}

    } -
  • - ))} -
+
  • +
    + {name} + {type && {type}} +
    + {description &&

    {description}

    } +
  • ) } @@ -161,30 +173,43 @@ export function TimeseriesDocsSideModal({ {docs.unit ?? '—'} {docs.description?.metric && ( -
    -

    Description

    - -
    + <> + +
    +

    Description

    + +
    + )} -
    -

    Target

    - - {target} - - {docs.description?.target && ( -

    {docs.description.target}

    - )} + +
    +

    Target

    + + +
    {docs.fields.length > 0 && ( -
    -

    Fields

    - f.name)} /> -
    + <> + +
    +

    Fields

    + + {R.sortBy(docs.fields, (f) => f.name).map((f) => ( + + ))} + +
    + )} {docs.docsHref && ( - - - + )} ) From 86bd8859ceb9ee44199b9790897ab66c8cc897dc Mon Sep 17 00:00:00 2001 From: benjaminleonard Date: Wed, 7 Oct 2026 15:52:48 +0100 Subject: [PATCH 45/46] Auto expand editor up to a max height --- app/ui/styles/components/oxql-editor.css | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/ui/styles/components/oxql-editor.css b/app/ui/styles/components/oxql-editor.css index c0de31497..5fa900dd1 100644 --- a/app/ui/styles/components/oxql-editor.css +++ b/app/ui/styles/components/oxql-editor.css @@ -15,13 +15,15 @@ .oxql-editor .cm-editor.cm-editor { background-color: var(--syntax-bg); color: var(--syntax-fg); - height: 7.5rem; + min-height: 7.5rem; + max-height: 15rem; &.cm-focused { outline: none; } .cm-scroller { + flex-grow: 1; overflow: auto; font-family: inherit; } From 6b2aa467a00adc08e9b9655ccea9db8ea36f22cf Mon Sep 17 00:00:00 2001 From: David Crespo Date: Wed, 7 Oct 2026 10:13:25 -0500 Subject: [PATCH 46/46] Fix timeseries docs e2e tests after modal retitle --- .../oxql-metrics/TimeseriesDocsSideModal.tsx | 11 ++++++++--- test/e2e/oxql.e2e.ts | 17 +++++++++++------ 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/app/components/oxql-metrics/TimeseriesDocsSideModal.tsx b/app/components/oxql-metrics/TimeseriesDocsSideModal.tsx index afa0c7a67..66ec776de 100644 --- a/app/components/oxql-metrics/TimeseriesDocsSideModal.tsx +++ b/app/components/oxql-metrics/TimeseriesDocsSideModal.tsx @@ -156,11 +156,16 @@ export function TimeseriesDocsSideModal({ return ( lets long names wrap at the colon instead of mid-word + // the lets long names wrap at the colon instead of mid-word. the + // span keeps it inline: as a direct flex child it would be blockified, + // which puts a space in the accessible name subtitle={ - {target}: - {metric} + + + {target}: + {metric} + } onDismiss={onDismiss} diff --git a/test/e2e/oxql.e2e.ts b/test/e2e/oxql.e2e.ts index 06ff47f67..a81459dbc 100644 --- a/test/e2e/oxql.e2e.ts +++ b/test/e2e/oxql.e2e.ts @@ -151,12 +151,13 @@ test('chart title opens timeseries docs', async ({ page }) => { .first() .click() - const modal = page.getByRole('dialog', { name: 'hardware_component:fan_speed' }) + const modal = page.getByRole('dialog', { name: 'Timeseries details' }) await expect(modal).toBeVisible() // read-only modal focuses its title instead of the docs link at the bottom + await expect(modal.getByRole('heading', { name: 'Timeseries details' })).toBeFocused() await expect( modal.getByRole('heading', { name: 'hardware_component:fan_speed' }) - ).toBeFocused() + ).toBeVisible() // descriptions come from the snapshot, not the schema endpoint await expect( modal.getByText('A fan speed measurement, in rotations per minute') @@ -183,8 +184,10 @@ test('joined chart title has docs for each timeseries', async ({ page }) => { .getByRole('button', { name: 'sled_data_link:bytes_received details' }) .first() .click() - const received = page.getByRole('dialog', { name: 'sled_data_link:bytes_received' }) - await expect(received).toBeVisible() + const received = page.getByRole('dialog', { name: 'Timeseries details' }) + await expect( + received.getByRole('heading', { name: 'sled_data_link:bytes_received' }) + ).toBeVisible() await expect(received.getByText('Number of bytes received on the link')).toBeVisible() await expect(received.getByText('Number of bytes sent on the link')).toBeHidden() await page.keyboard.press('Escape') @@ -194,8 +197,10 @@ test('joined chart title has docs for each timeseries', async ({ page }) => { .getByRole('button', { name: 'sled_data_link:bytes_sent details' }) .first() .click() - const sent = page.getByRole('dialog', { name: 'sled_data_link:bytes_sent' }) - await expect(sent).toBeVisible() + const sent = page.getByRole('dialog', { name: 'Timeseries details' }) + await expect( + sent.getByRole('heading', { name: 'sled_data_link:bytes_sent' }) + ).toBeVisible() await expect(sent.getByText('Number of bytes sent on the link')).toBeVisible() })