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
- Validate finite integer ranges and the relation
batchSize <= batchCount before SDK construction.
- Add a typed TelemetryRuntime Problem with field context.
- 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.
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-31exposesbatchTimeout,batchCount, andbatchSize;packages/telemetry-sdk-node/src/libs/runtime.ts:146-150forwards them without local validation.Desired outcome
Telemetry startup rejects unsafe queue configuration deterministically.
Implementation path
batchSize <= batchCountbefore SDK construction.Acceptance criteria
Validation
pnpm --filter @croco/telemetry-sdk-node testScope boundaries
Does not change exporter selection or sampling policy.