Skip to content

@codesoul-co/hypha-core / modules/runtime/runtime-operational-telemetry

Using this module

Use the Runtime operational telemetry module for executing runtime behavior at this boundary. It exports 1 class, 1 constant, 1 interface, 3 types.

Import from the package entrypoint

ts
import {
  RuntimeOperationalTelemetry,
  RUNTIME_OPERATIONAL_METRIC_NAMES,
} from '@codesoul-co/hypha-core';

import type {
  RuntimeOperationalTelemetryOptions,
  RuntimeLeaseResource,
  RuntimeQuarantineReason,
  RuntimeQuarantineSource,
} from '@codesoul-co/hypha-core';

Usage patterns

  • Use the 4 type/interface exports as static contracts in application code, adapters, or tests. Import them with import type; they do not exist at runtime.
  • The module exposes 1 class as constructable runtime implementations. Each symbol entry lists its constructor and public methods.
  • The 1 constant/enum export provides stable values, schemas, definitions, or defaults. Reuse these exports instead of copying internal values into an application.

Public exports

SymbolKindSignatureDescription
RuntimeOperationalTelemetryclassnew RuntimeOperationalTelemetry(options: RuntimeOperationalTelemetryOptions): RuntimeOperationalTelemetryStable, low-cardinality Runtime metrics. Run and fingerprint identities stay in durable Events and checkpoints instead of becoming metric attributes.
RUNTIME_OPERATIONAL_METRIC_NAMESconstantconst RUNTIME_OPERATIONAL_METRIC_NAMES: { readonly quarantineTotal: "hypha.runtime.quarantine.total"; readonly continuationLatencyMs: "hypha.runtime.continuation.latency_ms"; readonly leaseRenewalLatencyMs: "hypha.runtime.lease.renewal.latency_ms"; readonly leaseRenewalTotal: "hypha.runtime.lease.renewal.total"; readonly noProgressFingerprintTotal: "hypha.runtime.no_progress.fingerprint.total"; readonly noProgress...RUNTIME OPERATIONAL METRIC NAMES constant exported by the modules/runtime/runtime-operational-telemetry module.
RuntimeOperationalTelemetryOptionsinterfaceinterface RuntimeOperationalTelemetryOptionsRuntime Operational Telemetry Options interface with 2 public fields or methods.
RuntimeLeaseResourcetypetype RuntimeLeaseResource = 'session_command' | 'run' | 'state_claim'Public type alias for Runtime Lease Resource; the declaration contains its complete type expression.
RuntimeQuarantineReasontypetype RuntimeQuarantineReason = 'checkpoint_missing' | 'checkpoint_identity_mismatch' | 'checkpoint_hash_mismatch' | 'command_without_valid_checkpoint' | 'canonical_stream_corrupt'Public type alias for Runtime Quarantine Reason; the declaration contains its complete type expression.
RuntimeQuarantineSourcetypetype RuntimeQuarantineSource = 'continuation_reconciler' | 'startup_integrity_audit'Public type alias for Runtime Quarantine Source; the declaration contains its complete type expression.

RuntimeOperationalTelemetry

Stable, low-cardinality Runtime metrics. Run and fingerprint identities stay in durable Events and checkpoints instead of becoming metric attributes.

Declaration

text
export declare class RuntimeOperationalTelemetry {
    constructor(options: RuntimeOperationalTelemetryOptions);
    recordQuarantine(input: {
            source: RuntimeQuarantineSource;
            reason: RuntimeQuarantineReason;
        }): Promise<void>;
    recordContinuationLatency(input: {
            suspendedAt: string;
            resumedAt: string;
            outcome: 'resumed' | 'scheduled' | 'reused';
        }): Promise<void>;
    recordLeaseRenewal(input: {
            resource: RuntimeLeaseResource;
            durationMs: number;
            outcome: 'succeeded' | 'failed';
        }): Promise<void>;
    recordNoProgressFingerprint(input: {
            consecutiveNoProgress: number;
            source: 'react_checkpoint' | 'recovery';
        }): Promise<void>;
}

Public members

MemberKindSignatureDescription
constructorconstructor(options: RuntimeOperationalTelemetryOptions): RuntimeOperationalTelemetryCreates an instance of this class.
recordContinuationLatencymethodrecordContinuationLatency(input: { suspendedAt: string; resumedAt: string; outcome: "resumed" | "scheduled" | "reused"; }): Promise<void>Public method; parameters and return type are shown in the signature.
recordLeaseRenewalmethodrecordLeaseRenewal(input: { resource: RuntimeLeaseResource; durationMs: number; outcome: "succeeded" | "failed"; }): Promise<void>Public method; parameters and return type are shown in the signature.
recordNoProgressFingerprintmethodrecordNoProgressFingerprint(input: { consecutiveNoProgress: number; source: "react_checkpoint" | "recovery"; }): Promise<void>Public method; parameters and return type are shown in the signature.
recordQuarantinemethodrecordQuarantine(input: { source: RuntimeQuarantineSource; reason: RuntimeQuarantineReason; }): Promise<void>Public method; parameters and return type are shown in the signature.

RUNTIME_OPERATIONAL_METRIC_NAMES

RUNTIME OPERATIONAL METRIC NAMES constant exported by the modules/runtime/runtime-operational-telemetry module.

Declaration

text
export declare const RUNTIME_OPERATIONAL_METRIC_NAMES: { readonly quarantineTotal: "hypha.runtime.quarantine.total"; readonly continuationLatencyMs: "hypha.runtime.continuation.latency_ms"; readonly leaseRenewalLatencyMs: "hypha.runtime.lease.renewal.latency_ms"; readonly leaseRenewalTotal: "hypha.runtime.lease.renewal.total"; readonly noProgressFingerprintTotal: "hypha.runtime.no_progress.fingerprint.total"; readonly noProgressConsecutive: "hypha.runtime.no_progress.consecutive"; };

RuntimeOperationalTelemetryOptions

Runtime Operational Telemetry Options interface with 2 public fields or methods.

Declaration

text
export interface RuntimeOperationalTelemetryOptions {
    recorder: TelemetryRecorder;
    now?: () => string;
}

Contract members

MemberKindSignatureDescription
nowmethodnow?(): stringPublic method; parameters and return type are shown in the signature.
recorderpropertyrecorder: TelemetryRecorderPublic property; its type, readonly modifier and optionality are shown in the signature.

RuntimeLeaseResource

Public type alias for Runtime Lease Resource; the declaration contains its complete type expression.

Declaration

text
export type RuntimeLeaseResource = 'session_command' | 'run' | 'state_claim';

RuntimeQuarantineReason

Public type alias for Runtime Quarantine Reason; the declaration contains its complete type expression.

Declaration

text
export type RuntimeQuarantineReason = 'checkpoint_missing' | 'checkpoint_identity_mismatch' | 'checkpoint_hash_mismatch' | 'command_without_valid_checkpoint' | 'canonical_stream_corrupt';

RuntimeQuarantineSource

Public type alias for Runtime Quarantine Source; the declaration contains its complete type expression.

Declaration

text
export type RuntimeQuarantineSource = 'continuation_reconciler' | 'startup_integrity_audit';