\Drupal\strata\Telemetry TelemetryPass

Takes one reading of everything worth graphing, and exports it.

Every number here is already computed by something else; this class exists so there is one place that decides which of them are metrics and what they are called. A collector's dashboards are built against those names, so they are as much a public interface as a route is.

RPO lag is the one metric an operator should alert on. It is the age of the newest sealed commit, which is exactly how much work would be lost if the host died now. Every other metric describes the shape of the history; this one describes the risk.

A site with no history reports a lag of zero rather than the age of the epoch. A brand new install has lost nothing, and a graph starting at fifty years of lag would be alerted on immediately.

Summary

Methods
Properties
Constants
__construct
run
measure
rpoLag
findingsBySeverity
No public properties found
No public constants found
No protected methods found
No protected properties found
No protected constants found
addProviderMetrics
exporter
commits
frames
journal
ledger
time
stats
No private constants found

Properties

$exporter

$exporter : \Drupal\strata\Telemetry\OtlpExporter

Type

OtlpExporter

$commits

$commits : \Drupal\strata\Tree\CommitIndex

Type

CommitIndex

$journal

$journal : \Drupal\strata\Journal\JournalInterface

Type

JournalInterface

$time

$time : \Drupal\Component\Datetime\TimeInterface

Type

TimeInterface

$stats

$stats : ?\Drupal\strata\Storage\ProviderStats

Type

ProviderStats|null

Methods

__construct()

__construct(\Drupal\strata\Telemetry\OtlpExporter  $exporter, \Drupal\strata\Tree\CommitIndex  $commits, \Drupal\strata\Cas\FrameIndexInterface  $frames, \Drupal\strata\Journal\JournalInterface  $journal, \Drupal\strata\Health\HealthLedgerInterface  $ledger, \Drupal\Component\Datetime\TimeInterface  $time, \Drupal\strata\Storage\ProviderStats|null  $stats = null) : mixed

Constructs a pass.

Parameters

\Drupal\strata\Telemetry\OtlpExporter $exporter

Where the readings go.

\Drupal\strata\Tree\CommitIndex $commits

Supplies the head and the operation counts.

\Drupal\strata\Cas\FrameIndexInterface $frames

Supplies the store totals.

\Drupal\strata\Journal\JournalInterface $journal

Supplies what is captured and not yet flushed.

\Drupal\strata\Health\HealthLedgerInterface $ledger

Supplies open findings by severity.

\Drupal\Component\Datetime\TimeInterface $time

Measures the lag.

\Drupal\strata\Storage\ProviderStats|null $stats

Request counts and latencies from this process, or NULL when the provider is not recording.

Returns

mixed —

run()

run(\Drupal\strata\Telemetry\Tracer|null  $tracer = null) : \Drupal\strata\Telemetry\MetricSet

Takes a reading and exports it.

Parameters

\Drupal\strata\Telemetry\Tracer|null $tracer

A tracer to drain alongside the metrics, or NULL to export metrics only.

Returns

\Drupal\strata\Telemetry\MetricSet —

What was read, whether or not the export landed.

measure()

measure() : \Drupal\strata\Telemetry\MetricSet

Takes a reading without exporting it.

Returns

\Drupal\strata\Telemetry\MetricSet —

The metrics.

rpoLag()

rpoLag() : float

How much captured work would be lost if the host died now.

Returns

float —

Seconds since the newest commit was sealed, or 0.0 when there is no history.

findingsBySeverity()

findingsBySeverity() : array<string,int>

How many findings are open at each severity.

Every severity is reported, including the ones at zero. A gauge that disappears when it reaches zero leaves a collector holding the last non-zero value, so a resolved error keeps alerting.

Returns

array

Severity name keyed to count.

addProviderMetrics()

addProviderMetrics(\Drupal\strata\Telemetry\MetricSet  $metrics) : void

Adds what this process asked of the storage provider.

Parameters

\Drupal\strata\Telemetry\MetricSet $metrics

The set to add to.

Returns

void —