@codesoul-co/hypha-core / telemetry
- Package index:
@codesoul-co/hypha-core - Source:
packages/core/src/telemetry.ts - Exports: 4
Using this module
Use the Telemetry module for using the public contracts and operations for this capability boundary. It exports 1 class, 2 interfaces, 1 type.
Import from the package entrypoint
ts
import {
InMemoryTelemetryRecorder,
} from '@codesoul-co/hypha-core';
import type {
TelemetryMetric,
TelemetryRecorder,
TelemetryMetricKind,
} from '@codesoul-co/hypha-core';Usage patterns
- Use the 3 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.
Public exports
| Symbol | Kind | Signature | Description |
|---|---|---|---|
InMemoryTelemetryRecorder | class | new InMemoryTelemetryRecorder(): InMemoryTelemetryRecorder | In Memory Telemetry Recorder class with 4 public constructor or member entries; its exact declarations are listed below. |
TelemetryMetric | interface | interface TelemetryMetric | Telemetry Metric interface with 5 public fields or methods. |
TelemetryRecorder | interface | interface TelemetryRecorder | Telemetry Recorder interface with 1 public fields or methods. |
TelemetryMetricKind | type | type TelemetryMetricKind = 'counter' | 'histogram' | 'gauge' | Public type alias for Telemetry Metric Kind; the declaration contains its complete type expression. |
InMemoryTelemetryRecorder
In Memory Telemetry Recorder class with 4 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { InMemoryTelemetryRecorder } from '@codesoul-co/hypha-core'; - Source module:
telemetry
Declaration
text
export declare class InMemoryTelemetryRecorder implements TelemetryRecorder {
recordMetric(metric: TelemetryMetric): void;
list(name?: string): TelemetryMetric[];
sum(name: string): number;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
constructor | constructor | (): InMemoryTelemetryRecorder | Creates an instance of this class. |
list | method | list(name?: string): TelemetryMetric[] | Public method; parameters and return type are shown in the signature. |
recordMetric | method | recordMetric(metric: TelemetryMetric): void | Public method; parameters and return type are shown in the signature. |
sum | method | sum(name: string): number | Public method; parameters and return type are shown in the signature. |
TelemetryMetric
Telemetry Metric interface with 5 public fields or methods.
- Kind: interface
- Import:
import type { TelemetryMetric } from '@codesoul-co/hypha-core'; - Source module:
telemetry
Declaration
text
export interface TelemetryMetric {
name: string;
kind: TelemetryMetricKind;
value: number;
recordedAt: string;
attributes?: Record<string, string | number | boolean>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
attributes | property | attributes?: Record<string, string | number | boolean> | Public property; its type, readonly modifier and optionality are shown in the signature. |
kind | property | kind: TelemetryMetricKind | Public property; its type, readonly modifier and optionality are shown in the signature. |
name | property | name: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
recordedAt | property | recordedAt: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
value | property | value: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
TelemetryRecorder
Telemetry Recorder interface with 1 public fields or methods.
- Kind: interface
- Import:
import type { TelemetryRecorder } from '@codesoul-co/hypha-core'; - Source module:
telemetry
Declaration
text
export interface TelemetryRecorder {
recordMetric(metric: TelemetryMetric): Promise<void> | void;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
recordMetric | method | recordMetric(metric: TelemetryMetric): Promise<void> | void | Public method; parameters and return type are shown in the signature. |
TelemetryMetricKind
Public type alias for Telemetry Metric Kind; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { TelemetryMetricKind } from '@codesoul-co/hypha-core'; - Source module:
telemetry
Declaration
text
export type TelemetryMetricKind = 'counter' | 'histogram' | 'gauge';