Skip to content

Sources Log

A periodic snapshot of every time synchronization source and its current state.

The sources log provides a periodic snapshot of all configured time synchronization sources and their current state. It is designed for compliance auditing, monitoring the health of redundant sources, and understanding why one source is selected over another.

This log also serves as the backend for the cbctl sources CLI command.

Log location 

path
<log_directory>/sources.log
  • Format: Newline-delimited JSON (one JSON object per line)
  • Configuration: Optional (highly recommended). Enable it with [logging.sources]; <log_directory> is logging.log_directory.
  • Requirement: Without this log enabled, the cbctl sources command will be unusable.

Event types 

Each line in the log file is a JSON object. The following top level keys are included in every JSON object (examples on this page are pretty-printed; in the file each object is on a single line):

json
{
  "timestamp": "2026-07-16T14:34:00.000000Z",
  "event": "sources_snapshot",
  "sources_snapshot": {
    "sources": [ ... ]
  },
  "version": "3.0.0"
}
FieldTypeDescription
timestampstringISO 8601 UTC timestamp, with microsecond precision, of when the snapshot was taken
eventstringAlways sources_snapshot
sources_snapshot.sourcesarrayOne item per time synchronization source
versionstringClockBound daemon version
EventFrequencyDescription
sources_snapshotEvery 60 secondsAn array where each item describes a single time synchronization source

Event: sources_snapshot 

Each item in sources_snapshot.sources has the same keys. Information about a source's identity:

FieldTypePresenceDescription
typestringAlwaysSource type: ntp, or phc
identifierstringAlwaysNetwork address of the NTP server (ip:port) or filepath of the PHC device
poll_interval_secnumberAlwaysHow often this source is polled, in seconds
healthobjectAlwaysHealth
statsobjectAlwaysStats

Health 

The source's inferred status and selection history.

FieldTypePresenceDescription
health.selected_atstringCan be null if source has never been selectedISO 8601 UTC timestamp of when the time source was selected
health.deselected_atstringCan be null if source has never been selected or is currently selectedISO 8601 UTC timestamp of when the time source was deselected
health.statusstringAlwaysThe inferred clock synchronization status of the upstream source clock, one of SYNCHRONIZED, FREE_RUNNING, or UNKNOWN

Status 

The inferred clock status of the source is determined from its last response, measured against the clock of the currently selected source:

  • SYNCHRONIZED - if the source provided a response in the last 60 seconds and the last response was healthy.
  • FREE_RUNNING - if the source provided a response in the last 60 seconds but the last response was unsynchronized.
  • UNKNOWN - if the source has not provided any response in the last 60 seconds, if its last response was unusable for another reason, or if no source is currently selected.

Stats 

Aggregate statistics about the source's quality, network distance, and responsiveness.

FieldTypeDescription
stats.requestsintegerNumber of requests made to the source since it started
stats.responsesintegerNumber of responses from the source since it started
stats.latency_nsstats or nullStatistical summary of sample read latencies over the window. null if there are no samples in the window, or no source is currently selected.
stats.source_clock_error_bound_nsstats or nullStatistical summary of sample source clock error bound values over the window. null if there are no samples in the window.
stats.window_duration_secintegerDuration in seconds for the current snapshot's look-back window, up to 600 seconds (10 minutes).

Stats summary 

Summary statistics for a particular value over the window duration, in nanoseconds.

FieldTypeDescription
minintegerMinimum value.
medianintegerMedian value.
maxintegerMaximum value.

Full example 

json
{
  "timestamp": "2026-07-16T14:34:00.000000Z",
  "event": "sources_snapshot",
  "sources_snapshot": {
    "sources": [
      {
        "type": "phc",
        "identifier": "/dev/ptp0",
        "poll_interval_sec": 0.5,
        "health": {
          "selected_at": "2026-07-16T12:00:00.000000Z",
          "deselected_at": "2026-07-16T13:22:01.000000Z",
          "status": "SYNCHRONIZED"
        },
        "stats": {
          "requests": 18240,
          "responses": 18240,
          "latency_ns": { "min": 2400, "median": 2500, "max": 2600 },
          "source_clock_error_bound_ns": { "min": 20000, "median": 21000, "max": 22000 },
          "window_duration_sec": 600
        }
      },
      {
        "type": "ntp",
        "identifier": "169.254.169.123:123",
        "poll_interval_sec": 2.0,
        "health": {
          "selected_at": "2026-07-16T13:22:01.000000Z",
          "deselected_at": null,
          "status": "SYNCHRONIZED"
        },
        "stats": {
          "requests": 4562,
          "responses": 4558,
          "latency_ns": { "min": 128400, "median": 141200, "max": 155000 },
          "source_clock_error_bound_ns": { "min": 27800, "median": 30100, "max": 31200 },
          "window_duration_sec": 600
        }
      },
      {
        "type": "ntp",
        "identifier": "192.0.2.1:123",
        "poll_interval_sec": 16.0,
        "health": {
          "selected_at": null,
          "deselected_at": null,
          "status": "UNKNOWN"
        },
        "stats": {
          "requests": 64,
          "responses": 0,
          "latency_ns": null,
          "source_clock_error_bound_ns": null,
          "window_duration_sec": 0
        }
      }
    ]
  },
  "version": "3.0.0"
}