Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SoftFail after span closure masks exec failure #360

Open
mechie opened this issue Sep 6, 2024 · 0 comments
Open

SoftFail after span closure masks exec failure #360

mechie opened this issue Sep 6, 2024 · 0 comments

Comments

@mechie
Copy link

mechie commented Sep 6, 2024

If config.SoftFail is called after an exec has finished (e.g. due to the OTel collector returning a non-compliant header), otel-cli will return 0 (or 1, if --fail/OTEL_CLI_FAIL=true), masking any failures in the underlying operation.

Instead, it should probably do something like:

        # exitCode could be a parameter, or come from a helper that fetches it?
	if c.Fail {
		os.Exit(exitCode | 1)  // or just `1`?
	} else {
		os.Exit(exitCode)
	}

Otherwise, otel-cli should probably make clear that its surfacing of the operation's return code is incidental, maybe provide some alternative method of surfacing it (export an OTEL_CLI_LAST_RC?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant