Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Time-Series Database Module

InfluxDB 3 integration for metrics, analytics, and operational data.

Overview

High-performance time-series storage supporting 2.5M+ points/sec ingestion with async batching.

Configuration

Add to config.csv:

influxdb-url,http://localhost:8086
influxdb-token,your-token
influxdb-org,pragmatismo
influxdb-bucket,metrics

Or environment variables:

INFLUXDB_URL=http://localhost:8086
INFLUXDB_TOKEN=your-token
INFLUXDB_ORG=pragmatismo
INFLUXDB_BUCKET=metrics

Metric Points

Structure:

FieldDescription
measurementMetric name (e.g., “messages”, “response_time”)
tagsIndexed key-value pairs for filtering
fieldsActual metric values
timestampWhen the metric was recorded

Built-in Metrics

MeasurementTagsFields
messagesbot, channel, usercount
response_timebot, endpointduration_ms
llm_tokensbot, model, typeinput, output, total
kb_queriesbot, collectioncount, latency_ms
errorsbot, type, severitycount

Usage in Rust

#![allow(unused)]
fn main() {
let client = TimeSeriesClient::new(config).await?;

client.write_point(
    MetricPoint::new("messages")
        .tag("bot", "sales-bot")
        .tag("channel", "whatsapp")
        .field_i64("count", 1)
).await?;
}

Querying

REST endpoint for analytics:

GET /api/analytics/timeseries/messages?range=24h
GET /api/analytics/timeseries/response_time?range=7d

Installation

The timeseries_db component is installed via package manager:

gb install timeseries_db

Ports: 8086 (HTTP API), 8083 (RPC)

See Also