Skip to main content

compute

Reporting the compute and its children to Datadog.

Nothing here raises: a compute that cannot report itself must still run.

Module​

Functions​

report_certificate​

def report_certificate(    stage: ComputeCertificateStage, *, level: int = 20, **fields: Any,) ‑> None:

Send a ComputeCertificateEvent. Never raises.

Arguments

  • stage: Which step of the certificate lifecycle.
  • level: The log level, which Datadog shows as the event's severity.
  • **fields: The event's other fields; see ComputeCertificateEvent.

report_child_event​

def report_child_event(    child: str, transition: ComputeChildTransition, *, level: int = 20, **fields: Any,) ‑> None:

Send a ComputeChildEvent. Never raises.

Arguments

  • child: The child's name, as the hub knows it.
  • transition: What happened.
  • level: The log level, which Datadog shows as the event's severity.
  • **fields: The event's other fields; see ComputeChildEvent.

report_compute_summary​

def report_compute_summary(**fields: Any) ‑> None:

Send a ComputeSummaryEvent. Never raises.

Arguments

  • **fields: The event's fields; see ComputeSummaryEvent.

report_registration​

def report_registration(    status: ComputeRegistrationStatus, *, consecutive_failures: int,) ‑> None:

Send a ComputeRegistrationEvent. Never raises.

Arguments

  • status: Whether registration has started failing or recovered.
  • consecutive_failures: Failed registrations in a row.

report_supervision​

def report_supervision(    status: ComputeSupervisionStatus, *, seconds_since_last_pass: float,) ‑> None:

Send a ComputeSupervisionEvent. Never raises.

Arguments

  • status: Whether the supervisor has stalled or is running again.
  • seconds_since_last_pass: How long it had gone without finishing a pass when this was reported.

setup_compute_telemetry​

def setup_compute_telemetry(identity: ComputeIdentity, *, service: str) ‑> None:

Point this process's telemetry at Datadog, if it is configured for it.

The compute's host and its patient API child are processes of their own, which no pod startup passes through, so without this their events are assembled and dropped. Safe to call more than once.

Arguments

  • identity: The compute, whose name and owner tag every event.
  • service: The Datadog service the events are filed under.