Skip to content

[cmd/telemetrygen] Flag --allow-export-failures has inconsistent behavior across signal types. #47215

@bogdan-st

Description

@bogdan-st

Component(s)

cmd/telemetrygen

What happened?

Description

For traces, --allow-export-failures is accepted but has no effect. Traces use the SDK's SpanProcessor which handles export errors internally, so the worker never sees them. Traces always continue on failure regardless of the flag.

For logs and metrics in non-batch mode, it works as expected. When an export fails, logger.Fatal is called and the process crashes, unless --allow-export-failures is set.

For logs and metrics in batch mode, the flushBuffer() function always logs the error and continues. It never calls logger.Fatal, so the flag is effectively ignored.

Steps to Reproduce

Run telemetrygen logs in batch mode against a non-existent endpoint:

telemetrygen logs --otlp-insecure --otlp-endpoint localhost:19999 --logs 3 --batch=true --batch-size 2

The process continues running after the export fails (only logs an ERROR). Compare with non-batch mode:

telemetrygen logs --otlp-insecure --otlp-endpoint localhost:19999 --logs 3 --batch=false

This one crashes with FATAL as expected.

Expected Result

When --allow-export-failures is not set and an export fails.

Actual Result

The process should crash regardless of whether batching is enabled or not when sending to a non-existing endpoint.

Collector version

v0.148.0

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcmd/telemetrygentelemetrygen command

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions