Skip to content

Telemetry (server-telemetry)

The Telemetry service handles log aggregation via VictoriaLogs and event tracking via a database. It provides query and write APIs for structured logs.

Running

bash
# Development
npm run dev --workspace=apps/server-telemetry

# CLI
npm run cli --workspace=apps/server-telemetry -- start

# Docker
docker run -e ... privateaim/hub telemetry cli start

Dependencies

  • Database — MySQL, PostgreSQL, or SQLite (for event entities)
  • Authup — OAuth2 identity provider
  • VictoriaLogs (optional) — log storage backend
  • RabbitMQ — AMQP message bus

Environment Variables

Service-Specific

VariableDefaultDescription
VICTORIA_LOGS_URLVictoriaLogs base URL
VICTORIA_LOGS_INGESTOR_URLVictoriaLogs ingest endpoint (overrides base URL)
VICTORIA_LOGS_QUERIER_URLVictoriaLogs query endpoint (overrides base URL)

All VictoriaLogs variables are optional. When unset, an in-memory log store is used as a fallback.

Inherited

See Shared Configuration and Database Configuration.

Key Endpoints

MethodEndpointDescription
GET/eventsList events
GET/events/:idGet event
POST/eventsCreate event
DELETE/events/:idDelete event
GET/logsQuery logs (VictoriaLogs)
POST/logsWrite logs
DELETE/logsDelete logs
GET/docsSwagger/OpenAPI documentation

Architecture

  • LogStore port (core/services/log-store/types.ts) — defines query, write, delete operations
  • VictoriaLogsLogStore — production implementation with query injection protection
  • MemoryLogStore — in-memory fallback for startup and testing
  • EventComponent / LogComponent — AMQP consumers for async event and log ingestion

WARNING

The telemetry service is the log writer itself, so its own logger cannot use the log component caller (would be circular). It uses a MemoryLogStore fallback internally.

Released under the Apache-2.0 License.