Skip to main content
MoleSignal exposes a single query endpoint backed by DataFusion. The endpoint supports full SQL — including joins, CTEs, and window functions — or a PromQL subset for metrics, all against the same store.

The query endpoint

Request body

Response

The response carries columns, array-shaped rows, scanned_rows, and took_ms. Federated responses may also carry federation metadata.
Send Accept: application/x-ndjson to stream objects row-by-row, followed by a __meta__ record. Streaming bypasses the result cache.

SQL

Because logs, metrics, and traces live in the same store, one query can join across signals — for example, join error logs to matching spans on trace_id:

PromQL

Set language: "promql" to run PromQL over metric streams. Both instant and range queries are supported (range steps through [start, end] and returns a matrix). Coverage is broad — the rate family and all *_over_time, the standard aggregations (incl. topk / limitk), histogram_quantile, label_replace / label_join, math & trig, the and / or / unless set operators with on / ignoring + group_left / group_right matching, selector @ / offset, and subqueries.

PromQL support matrix

The full list of supported functions, operators, and modifiers — plus the known gaps (native-histogram functions, the binary default fill-in).

Search around an event

To pull the N events immediately before and after a given one (log context view), use POST /api/v1/query/search_around with event_timestamp_us, stream, stream_type, and optional before / after counts (default 50 each).

Async, inspection, and cancellation

  • Add Prefer: respond-async to POST /api/v1/query, or submit directly to POST /api/v1/query/jobs, for a durable search job.
  • GET /api/v1/query/jobs/{id} reports state; /results returns completed output.
  • POST /api/v1/query/inspect plans without executing and returns query metadata and the available logical plan.
  • POST /api/v1/query/recommendations analyzes a query profile without executing the query.
  • GET /api/v1/query/running and POST /api/v1/query/{id}/cancel let organization administrators inspect and cancel active work.
Standard queries require streams.query. Active-query administration requires org.settings.read or org.settings.manage. Enterprise Edition can add ?clusters=local,cluster-name to the query endpoint. Any non-local target requires the federated_search entitlement. Unreachable remotes are represented as degraded clusters in federation metadata instead of silently becoming local data.

Caching

Queries flow through a 3-level cache — file_meta, parquet_meta, and query_result — plus a parquet disk cache enabled by default (./data/cache/parquet, 10 GB LRU). Caching is transparent to the response contract; use server metrics to measure cache behavior.
Last modified on August 4, 2026