@grow-codes/opentelemetry-collector - v0.1.1
    Preparing search index...

    Class OtelCollectorConfig

    Immutable configuration of OtelCollectorClient and of the OTLP exporters.

    Implements

    Index
    compression: "none" | "gzip"

    Export compression.

    connectTimeoutMs: number
    environment?: string

    deployment.environment.name.

    exportTimeoutMs: number

    Export deadline in ms.

    grpcUrl: string

    OTLP/gRPC target.

    headers: Readonly<Record<string, string>>
    healthUrl: string

    health_check URL.

    healthUrlExplicit: boolean

    Whether healthUrl was set explicitly.

    hooks?: Hooks
    logger?: ClientLogger
    logs: boolean

    Log export on/off.

    logsBatch: Readonly<BatchOptions>

    Log batch settings (unset fields use the SPEC defaults).

    logsHeaders: Readonly<Record<string, string>>

    Log-only export headers.

    logsUrl?: string

    Explicit OTLP/HTTP logs URL.

    metricExportIntervalMs: number

    Metric export interval in ms.

    metrics: boolean

    Metric export on/off.

    metricsHeaders: Readonly<Record<string, string>>

    Metric-only export headers.

    metricsUrl?: string

    Explicit OTLP/HTTP metrics URL.

    propagators: readonly string[]

    Propagators.

    protocol: OtlpProtocol

    Export protocol.

    proxy?: string
    requestTimeoutMs: number
    resourceAttributes: Readonly<SpanAttributes>

    Resource attributes.

    resourceDetectors: readonly ResourceDetectorName[]

    Resource detectors run by initTelemetry.

    runtimeMetrics: boolean

    Runtime metrics on/off.

    sampler: SamplerName

    Trace sampler.

    samplerRatio: number

    Sampler ratio.

    serviceName: string

    service.name.

    serviceVersion?: string

    service.version.

    telemetryUrl?: string

    Internal telemetry (Prometheus) URL.

    tls: Readonly<TlsOptions>
    totalTimeoutMs: number
    traces: boolean

    Trace export on/off.

    tracesBatch: Readonly<TracingBatchConfig>

    Batch span processor settings (unset fields use the SPEC defaults).

    tracesHeaders: Readonly<Record<string, string>>

    Trace-only export headers.

    tracesUrl?: string

    Explicit OTLP/HTTP traces URL.

    url: string
    userAgentSuffix?: string
    zpagesUrl: string

    zpages base URL.

    DEFAULT_EXPORT_TIMEOUT_MS: 10000 = 10_000

    Default export deadline in ms.

    DEFAULT_GRPC_URL: "http://127.0.0.1:4317"

    Default OTLP/gRPC target.

    DEFAULT_METRIC_EXPORT_INTERVAL_MS: 60000 = 60_000

    Default metric export interval in ms.

    DEFAULT_URL: "http://127.0.0.1:4318"

    Default OTLP/HTTP base URL.

    ENV_PREFIX: "GROW_OPENTELEMETRY_COLLECTOR_"

    Prefix of every environment variable.

    • The export endpoint of a signal for the configured protocol: the explicit <signal>Url when set (in both protocols), else grpcUrl for gRPC and url + /v1/<signal> for HTTP.

      Parameters

      Returns string

    • Export headers of a signal: headers with the per-signal headers on top.

      Parameters

      Returns Record<string, string>

    • Values of sensitive export headers (authorization, *token*, *key*, …) to redact.

      Returns string[]

    • OTLP/HTTP URL of a signal: the explicit <signal>Url, else url + /v1/<signal>.

      Parameters

      Returns string

    • Debug form: every header value redacted, URL credentials hidden.

      Returns Record<string, unknown>

    • Returns a string representation of an object.

      Returns string

    • Builds a config from the environment. Precedence per field: explicit overrides > GROW_OPENTELEMETRY_COLLECTOR_<NAME> > GROW_OTEL_<NAME> > per-signal OTEL_* > generic OTEL_* > default. Map fields (headers, resourceAttributes, per-signal headers, batch settings) merge key by key in the same order. A present but invalid value throws ConfigError naming the variable, never its value.

      Parameters

      Returns OtelCollectorConfig