Hyperlinkv0.8.0-beta.28

Telemetry

Telemetry.Tagconstsrc/Telemetry.ts:295
<Self>(): {
  (): TelemetryTag<Self>
  <HSelf>(options: {
    readonly node: NodeKey<HSelf>
    readonly description?: string
  }): TelemetryNodeTag<Self, HSelf>
}

Declare a Telemetry tag: class FleetTelemetry extends Telemetry.Tag<FleetTelemetry>()() {} (nodeless — the dashboard reaches each node via Hyperlink.client(FleetTelemetry, node)), or …Tag<FleetTelemetry>()({ node: MiniNode }) to bind + serve it on a specific node.

constructors
Source src/Telemetry.ts:29524 lines
export const Tag = <Self>() => {
  function build(): TelemetryTag<Self>;
  function build<HSelf>(options: {
    readonly node: NodeKey<HSelf>;
    readonly description?: string;
  }): TelemetryNodeTag<Self, HSelf>;
  function build(
    options?: TelemetryConstructOptions<unknown>,
  ): TelemetryTag<Self> {
    const node = options?.node;
    const key = keyFor(node);
    return node === undefined
      ? resourceTag<Self>()(key, telemetrySpec, {
          kind,
          description: options?.description,
        })
      : resourceTag<Self>()(key, telemetrySpec, {
          kind,
          description: options?.description,
          node,
        });
  }
  return build;
};