ores.telemetry.service_samples

Table of Contents

The service liveness surface: one heartbeat every service publishes, one request/reply that lists the latest sample per running instance, and one that serves the services roster, every expected instance with its state.

These are operations rather than entity verbs. A heartbeat arrives from outside the service and is stored as it arrives, and the list is read from the newest sample of every instance rather than addressed by key, so neither is a row a caller reaches by primary key.

1. Physical space

The shell commands are switched off. The shell has no telemetry part, so a generated unit would have nowhere to land. Every service writes the heartbeat, and the operations dashboard reads the samples.

2. Includes

#include <chrono>
#include <optional>
#include <string>
#include <string_view>
#include <vector>
#include "ores.telemetry.core/domain/service_state.hpp"

3. Messages

3.1. service_sample

/**
 * @brief The latest heartbeat recorded for one running service instance.
 */

3.1.1. sampled_at

/**
 * @brief When the service last reported.
 */

3.1.2. service_name

/**
 * @brief Canonical service name, for example @c ores.compute.service.
 */

3.1.3. instance_id

/**
 * @brief Per-process identifier, so two instances of one service are told
 * apart.
 */

3.1.4. host_id

/**
 * @brief The host the instance runs on, empty when the publisher does not
 * know it.
 */

3.1.5. version

/**
 * @brief Version the instance reports.
 */

3.2. service_heartbeat_message

/**
 * @brief One service instance reporting that it is alive.
 *
 * The service publishes it on a timer, and the telemetry service timestamps
 * the receipt and stores it. It carries no response, so the publisher does
 * not wait for one.
 */

3.2.1. service_name

/**
 * @brief Canonical service name, for example @c ores.compute.service.
 */

3.2.2. instance_id

/**
 * @brief Per-process identifier, generated once at startup.
 */

3.2.3. host_id

/**
 * @brief The host the instance runs on, empty when the publisher does not
 * know it.
 */

3.2.4. version

/**
 * @brief Version the instance reports.
 */

3.3. get_service_samples_request

/**
 * @brief Asks for the latest sample of every running instance.
 *
 * It carries no fields: the reply covers every service the caller may see.
 */

3.4. get_service_samples_response

/**
 * @brief The latest sample of every running instance.
 */

3.4.1. success

/**
 * @brief Whether the samples were read.
 */

3.4.2. message

/**
 * @brief Why they were not, when they were not.
 */

3.4.3. samples

/**
 * @brief One sample per running instance, in no particular order.
 */

3.5. service_roster_slot

/**
 * @brief One expected instance of one service, and its last report.
 *
 * A service expects as many slots as the registry gives it replicas. The
 * newest reporting instances fill the slots, newest first; a slot no
 * instance fills is missing, and its report fields are empty.
 */

3.5.1. service_name

/**
 * @brief Canonical service name, for example @c ores.iam.service.
 */

3.5.2. display_name

/**
 * @brief The name a person reads, for example @c Analytics @c Service.
 */

3.5.3. description

/**
 * @brief What the service does, in one sentence from the service registry.
 */

3.5.4. service_account

/**
 * @brief The IAM service account the process signs in as, empty for a process
 * that signs in as no account of its own.
 */

3.5.5. slot

/**
 * @brief Which expected instance this is, from 1 to the service's replicas.
 */

3.5.6. state

/**
 * @brief Running, lost or missing, read from the heartbeats.
 */

3.5.7. instance_id

/**
 * @brief The instance that fills the slot, empty when the slot is missing.
 */

3.5.8. host_id

/**
 * @brief The host the instance last reported from, empty when the slot is
 * missing.
 */

3.5.9. version

/**
 * @brief The version the instance last reported, empty when the slot is
 * missing.
 */

3.5.10. sampled_at

/**
 * @brief When the instance last reported, at any age; empty when the slot is
 * missing.
 */

3.6. get_service_roster_request

/**
 * @brief Asks for the services roster: every expected instance and its state.
 *
 * It carries no fields: the roster covers the whole installation.
 */

3.7. get_service_roster_response

/**
 * @brief Every expected instance of every enabled service, with its state.
 */

3.7.1. success

/**
 * @brief Whether the roster was read.
 */

3.7.2. message

/**
 * @brief Why it was not, when it was not.
 */

3.7.3. slots

/**
 * @brief One slot per expected instance, ordered by service name, then slot.
 */

4. See also

Emacs 29.3 (Org mode 9.6.15)