Skip to content

Documentation / @tenancy-node/prometheus / PrometheusTelemetry

Interface: PrometheusTelemetry ​

Defined in: prometheus/src/index.ts:22

Enchufe para trazas y métricas (OpenTelemetry, Prometheus...). Todo es opcional: cada implementación usa lo que le sirve. Nunca debe lanzar; si lo hace, se ignora.

Extends ​

Properties ​

contentType ​

readonly contentType: string

Defined in: prometheus/src/index.ts:26


name ​

readonly name: string

Defined in: core/src/ports/telemetry.ts:30

Inherited from ​

Telemetry.name


registry ​

readonly registry: Registry

Defined in: prometheus/src/index.ts:23

Methods ​

logFields()? ​

optional logFields(): Record<string, unknown> | undefined

Defined in: core/src/ports/telemetry.ts:39

Campos que se agregan a los logs del observer (por ejemplo traceId y spanId).

Returns ​

Record<string, unknown> | undefined

Inherited from ​

Telemetry.logFields


metrics() ​

metrics(): Promise<string>

Defined in: prometheus/src/index.ts:25

Texto para GET /metrics.

Returns ​

Promise<string>


recordError()? ​

optional recordError(error): void

Defined in: core/src/ports/telemetry.ts:37

Parameters ​

error ​

TrackedError

Returns ​

void

Inherited from ​

Telemetry.recordError


recordOperation()? ​

optional recordOperation(sample): void

Defined in: core/src/ports/telemetry.ts:35

Parameters ​

sample ​

OperationSample

Returns ​

void

Inherited from ​

Telemetry.recordOperation


recordRequest()? ​

optional recordRequest(sample): void

Defined in: core/src/ports/telemetry.ts:36

Parameters ​

sample ​

RequestSample

Returns ​

void

Inherited from ​

Telemetry.recordRequest


span()? ​

optional span<T>(operation, attributes, fn): Promise<T>

Defined in: core/src/ports/telemetry.ts:32

Envuelve una operación en un span activo (las operaciones internas quedan como hijas).

Type Parameters ​

T ​

T

Parameters ​

operation ​

string

attributes ​

SpanAttributes

fn ​

() => Promise<T>

Returns ​

Promise<T>

Inherited from ​

Telemetry.span


tenantResolved()? ​

optional tenantResolved(tenantId): void

Defined in: core/src/ports/telemetry.ts:34

Se identificó el tenant de la petición en curso.

Parameters ​

tenantId ​

string | null

Returns ​

void

Inherited from ​

Telemetry.tenantResolved

Publicado bajo la licencia MIT.