Configuration interface for OpenTelemetry compatible tracing functionality. This interface contains all the settings that control how traces are created, processed, and managed within the OpenTelemetry system.

const traceCfg: ITraceCfg = {
serviceName: "my-service",
generalLimits: {
attributeCountLimit: 128,
attributeValueLengthLimit: 4096
},
spanLimits: {
attributeCountLimit: 128,
linkCountLimit: 128,
eventCountLimit: 128
}
};

3.4.0

interface ITraceCfg {
    generalLimits?: IOTelAttributeLimits;
    serviceName?: string;
    suppressTracing?: boolean;
}

Properties

generalLimits?: IOTelAttributeLimits

Global attribute limits that apply to all telemetry items. These limits help prevent excessive memory usage and ensure consistent behavior across different telemetry types.

These limits are inherited by more specific configurations unless overridden. For example, spans will use these limits unless spanLimits specifies different values.

serviceName?: string

The name of the service generating telemetry data. This name will be included in all telemetry items as a resource attribute.

The service name is crucial for identifying and filtering telemetry data in observability systems. It should be consistent across all instances of the same service.

serviceName: "user-authentication-service"
suppressTracing?: boolean

A flag that indicates whether the tracing (creating of a "trace" event) should be suppressed when a IOTelSpan ends and the span isRecording is true. This value is also inherited by spans when they are created.