IF Commons GitHub

query

Written to: 3 requirements: 3 proved, 0 partly, 0 failing, 0 with no test recorded. 0002-telemetry-query FR-001, 0002-telemetry-query FR-002, 0002-telemetry-query FR-003

Questions of captured signals in SQL (commons telemetry 0002-telemetry-query): the spans, the log records and the metric points of a journal or of any OTLP batches, made into relations, and a read-only SQL answered over them with the SQL language library (its guard judges that the text is one read and binds it to the catalog, its engine answers). Pure: it is given the batches it reads, so that the slowest spans, the errors of a service and the logs of one trace are one line of SQL each.

import { querySignals } from "@intellectual-frontiers/telemetry/query";
// querySignals(signals, "SELECT name, duration_ms FROM spans ORDER BY duration_ms DESC LIMIT 5");

Source: commons/telemetry/src/query.ts

4 of 6 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

Signalstype
type Signals = { readonly traces?: readonly TraceBatch[]; readonly logs?: readonly LogBatch[]; readonly metrics?: readonly MetricBatch[] };

What a question is about: the batches of each signal.

Imported by 3 tests of the run (3 passed, 0 failed): the library's results

QueryOptionstypeno test imports it
type QueryOptions = { readonly limit?: number; readonly params?: readonly Value[] };

What may be given to a question.

Answertypeno test imports it
type Answer = { readonly columns: readonly string[]; readonly rows: readonly (readonly Value[])[]; readonly truncated: boolean };

What a question gives.

signalsCatalogfunction
function signalsCatalog(): Catalog

The catalog of the relations.

Imported by 3 tests of the run (3 passed, 0 failed): the library's results

signalsRelationsfunction
function signalsRelations(signals: Signals): Readonly<Record<string, Table>>

The relations of the signals: a span lasts from its start to its end, in milliseconds; a metric point holds a number (a histogram's sum, and its count).

Imported by 3 tests of the run (3 passed, 0 failed): the library's results

querySignalsfunction
function querySignals(signals: Signals, sql: string, options?: QueryOptions): Result<Answer, string>

The answer to one read-only question over the signals, or why it is refused (with its place) or cannot be answered.

Imported by 3 tests of the run (3 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.