Chronix

gRPC and Flight SQL

The chronixd gRPC service and Arrow Flight SQL endpoint: methods, ports, authentication and how to connect ADBC and JDBC clients.

On this page

chronixd serves a gRPC API on port 8087 and Arrow Flight SQL on port 8817. Both use the same authentication, authorization and namespace rules as HTTP; Flight SQL returns Arrow record batches, so ADBC, JDBC and Python clients read results without conversion.

gRPC API

The gRPC service runs on a separate port (default 4243). The proto definition is in crates/chronixd/proto/chronix.proto.

ChronixService

MethodTypeDescription
WriteUnaryWrite a batch of points
StreamWriteClient-streamingStream points with server-side batching and dedup
QueryServer-streamingQuery data and stream Arrow-format results
GetSchemaUnaryGet measurement schema
ListMeasurementsUnaryList all measurements with schemas
DeleteUnaryDelete points matching predicates
DropMeasurementUnaryDrop an entire measurement
ServerInfoUnaryServer metadata (version, uptime, stats)
ExecuteSqlUnaryExecute SQL queries via DataFusion (streaming internally)

Write timeout: gRPC Write and StreamWrite enforce the same write_timeout_secs deadline. Timeouts surface as gRPC status DEADLINE_EXCEEDED.

Example (grpcurl)

grpcurl -plaintext -d '{"measurement":"cpu","points":[...]}' \
  localhost:4243 chronix.ChronixService/Write

Flight SQL API

Arrow Flight SQL service runs on a separate port (default 4244). Compatible with any Flight SQL client (e.g., Grafana Flight SQL plugin, JDBC/ODBC drivers, DBeaver).

Query Resource Limits

Flight SQL queries enforce the same resource limits as the REST and gRPC interfaces:

SettingDefaultDescription
sql_query_timeout_secs30Maximum seconds for SQL query execution including result streaming
sql_max_rows100000Maximum rows returned by a single SQL query
prom_series_limit10000Maximum label-sets returned by /api/v1/series

Queries exceeding the timeout are cancelled. Row limits are enforced at the batch level — once the cumulative row count reaches the limit, the final batch is truncated via batch.slice() and no further batches are sent. This avoids materializing the entire result set in memory.

Supported Commands

CommandDescription
CommandStatementQueryExecute a SQL query and retrieve results
CommandStatementUpdateBulk write via DoPut (Arrow RecordBatch)
CommandGetCatalogsList catalogs (returns "chronix")
CommandGetTableTypesList table types (returns "TABLE")
CommandGetTablesList measurements as tables

Example (Python)

from adbc_driver_flightsql import dbapi

conn = dbapi.connect("grpc://localhost:4244")
cursor = conn.cursor()
cursor.execute("SELECT * FROM cpu WHERE host = 'srv1' LIMIT 10")
print(cursor.fetchall())

Edit this page on GitHub · Updated

Esc