Crate telemetry_service[][src]

Kubos Service for interacting with the telemetry database.

Configuration

The service can be configured in the /home/system/etc/config.toml with the following fields:

[telemetry-service]
database = "/var/lib/telemetry.db"

[telemetry-service.addr]
ip = "127.0.0.1"
port = 8089

Where database specifies the path to the telemetry database file, ip specifies the service's IP address, and port specifies the port on which the service will be listening for UDP packets.

Starting the Service

The service should be started automatically by its init script, but may also be started manually:

$ telemetry-service
Listening on: 127.0.0.1:8089

Panics

Attempts to grab database path from Configuration and will panic! if not found. Attempts to connect to database at provided path and will panic! if connection fails. Attempts to create telemetry table and will panic! if table creation fails.

GraphQL Schema

type Entry {
  timestamp: Integer!
  subsystem: String!
  parameter: String!
  value: Float!
}

query telemetry(timestampGe: Integer, timestampLe: Integer, subsystem: String, parameter: String): Entry

Example Queries

Select all attributes of all telemetry entries

{
  telemetry {
    timestamp,
    subsystem,
    parameter,
    value
  }
}

Select all attributes of all telemetry entries for the eps subsystem

{
  telemetry(subsystem: "eps") {
    timestamp,
    subsystem,
    parameter,
    value
  }
}

Select all attributes of all telemetry entries for the voltage parametereter of the eps subsystem

{
  telemetry(subsystem: "eps", parameter: "voltage") {
    timestamp,
    subsystem,
    parameter,
    value
  }
}

Select all attributes of all telemetry entries occurring between the timestamps 100 and 200

{
  telemetry(timestampGe: 101, timestampLe: 199) {
    timestamp,
    subsystem,
    parameter,
    value
  }
}

Select all attributes of all telemetry entries occurring at the timestamp 101

{
  telemetry(timestampGe: 101, timestampLe: 101) {
    timestamp,
    subsystem,
    parameter,
    value
  }
}

Select ten entries occurring on or after the timestamp 1008

{
  telemetry(limit: 10, timestampGe: 1008) {
    timestamp,
    subsystem,
    parameter,
    value
  }
}