Signalstypetype Signals = { readonly traces?: readonly TraceBatch[]; readonly logs?: readonly LogBatch[]; readonly metrics?: readonly MetricBatch[] };What a question is about: the batches of each signal.
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");Signalstypetype Signals = { readonly traces?: readonly TraceBatch[]; readonly logs?: readonly LogBatch[]; readonly metrics?: readonly MetricBatch[] };What a question is about: the batches of each signal.
QueryOptionstypeno test imports ittype QueryOptions = { readonly limit?: number; readonly params?: readonly Value[] };What may be given to a question.
Answertypeno test imports ittype Answer = { readonly columns: readonly string[]; readonly rows: readonly (readonly Value[])[]; readonly truncated: boolean };What a question gives.
signalsCatalogfunctionfunction signalsCatalog(): CatalogThe catalog of the relations.
signalsRelationsfunctionfunction 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).
querySignalsfunctionfunction 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.