Skip to content

[telemetry-sdk-node] Validate BatchSpanProcessor tuning before SDK startup #1700

Description

@kang-heewon

Priority: P1

Problem

Public telemetry configuration forwards batch timeout, count, and size directly to the upstream BatchSpanProcessor. Invalid values cause opaque provider behavior rather than a Croco configuration diagnostic.

Evidence

packages/telemetry-sdk-node/src/libs/config.ts:21-31 exposes batchTimeout, batchCount, and batchSize; packages/telemetry-sdk-node/src/libs/runtime.ts:146-150 forwards them without local validation.

Desired outcome

Telemetry startup rejects unsafe queue configuration deterministically.

Implementation path

  1. Validate finite integer ranges and the relation batchSize <= batchCount before SDK construction.
  2. Add a typed TelemetryRuntime Problem with field context.
  3. Cover invalid values and a valid boundary configuration.

Acceptance criteria

  • NaN, Infinity, non-integers, and invalid relationships fail before initialization.
  • Error codes are stable and actionable.
  • Valid tuning reaches the processor unchanged.

Validation

pnpm --filter @croco/telemetry-sdk-node test

Scope boundaries

Does not change exporter selection or sampling policy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Priority 1 issueobservabilityTracing, metrics, lifecycle inspection, and debug visibilitytelemetry-sdk-node

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions