Arex.TimeSeries (arex v0.1.0)

Copy Markdown View Source

Time-series helpers for ArcadeDB TimeSeries types and endpoints.

Arex.TimeSeries covers three layers of the ArcadeDB time-series surface:

  • SQL-backed DDL and analytical queries
  • dedicated JSON and line-protocol HTTP endpoints
  • PromQL, Grafana, and Prometheus-compatible HTTP endpoints

The helpers return the same {:ok, value} and {:error, error_map} shapes as the rest of Arex. When you need a TimeSeries capability that is not wrapped here yet, use Arex.Query.sql/3, Arex.Command.sql/3, or Arex.Http.request/4.

Arex treats time-series data as boundary-aware when you use the structured helpers:

  • helper-managed type creation adds tenant and scope tags when needed
  • helper-managed writes stamp active boundaries into rows or line protocol
  • wrapped SQL and latest-point helpers apply those boundary tags on read

Raw SQL, raw PromQL, and raw payload helpers remain available when callers need full control over the underlying ArcadeDB surface.

Summary

Functions

Adds one or more downsampling policies to a TimeSeries type.

Lists continuous aggregates from schema:continuousAggregates.

Creates a TimeSeries type with the given timestamp, tags, and fields definition.

Drops a continuous aggregate.

Drops all downsampling policies from a TimeSeries type.

Drops a TimeSeries type.

Checks the Grafana datasource health endpoint for ArcadeDB TimeSeries.

Fetches Grafana metadata for ArcadeDB TimeSeries types.

Executes a Grafana DataFrame-style query.

Inserts a single sample map into a TimeSeries type using SQL content syntax.

Inserts multiple sample maps into a TimeSeries type in one SQLScript transaction.

Fetches the latest point for a TimeSeries type.

Lists available values for a PromQL label.

Lists available PromQL label names.

Sends a raw Prometheus remote-read payload.

Sends a raw Prometheus remote-write payload.

Finds series matching one or more PromQL selectors.

Executes a PromQL instant query.

Executes a PromQL range query.

Evaluates a PromQL expression through SQL using promql().

Executes a TimeSeries JSON query against /api/v1/ts/:db/query.

Executes a SQL query against TimeSeries data.

Refreshes a continuous aggregate.

Writes InfluxDB line protocol samples to /api/v1/ts/:db/write.

Functions

add_downsampling_policy(name, policies, opts \\ [])

Adds one or more downsampling policies to a TimeSeries type.

continuous_aggregates(opts \\ [])

Lists continuous aggregates from schema:continuousAggregates.

create_continuous_aggregate(name, query, opts \\ [])

Creates a continuous aggregate.

create_type(name, timestamp, tags, fields, opts \\ [])

Creates a TimeSeries type with the given timestamp, tags, and fields definition.

drop_continuous_aggregate(name, opts \\ [])

Drops a continuous aggregate.

drop_type(name, opts \\ [])

Drops a TimeSeries type.

grafana_health(opts \\ [])

Checks the Grafana datasource health endpoint for ArcadeDB TimeSeries.

grafana_metadata(opts \\ [])

Fetches Grafana metadata for ArcadeDB TimeSeries types.

grafana_query(payload, opts \\ [])

Executes a Grafana DataFrame-style query.

insert(type, attrs, opts \\ [])

Inserts a single sample map into a TimeSeries type using SQL content syntax.

insert_many(type, rows, opts \\ [])

Inserts multiple sample maps into a TimeSeries type in one SQLScript transaction.

latest(type, opts \\ [])

Fetches the latest point for a TimeSeries type.

prom_label_values(name, opts \\ [])

Lists available values for a PromQL label.

prom_labels(opts \\ [])

Lists available PromQL label names.

prom_remote_read(payload, opts \\ [])

Sends a raw Prometheus remote-read payload.

prom_remote_write(payload, opts \\ [])

Sends a raw Prometheus remote-write payload.

prom_series(matchers, opts \\ [])

Finds series matching one or more PromQL selectors.

promql(expression, opts \\ [])

Executes a PromQL instant query.

promql_range(expression, opts \\ [])

Executes a PromQL range query.

promql_sql(expression, timestamp_ms \\ nil, opts \\ [])

Evaluates a PromQL expression through SQL using promql().

query_json(payload, opts \\ [])

Executes a TimeSeries JSON query against /api/v1/ts/:db/query.

query_sql(statement, params \\ %{}, opts \\ [])

Executes a SQL query against TimeSeries data.

refresh_continuous_aggregate(name, opts \\ [])

Refreshes a continuous aggregate.

write_lines(lines, opts \\ [])

Writes InfluxDB line protocol samples to /api/v1/ts/:db/write.