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

Die on errors during import #19

Merged
merged 1 commit into from
Dec 19, 2024
Merged

Die on errors during import #19

merged 1 commit into from
Dec 19, 2024

Conversation

jjatria
Copy link
Owner

@jjatria jjatria commented Dec 14, 2024

The specification states that

OpenTelemetry implementations MUST NOT throw unhandled exceptions
at run time.

but it also says that

The [...] SDK MAY fail fast and cause the application to fail on
initialization, e.g. because of a bad user config or environment,
but MUST NOT cause the application to fail later at run time, e.g.
due to dynamic config settings received from the Collector.

Before this change, the SDK was not "failing fast" for the sake of application stability. However, this could result in setups that were misconfigured but kept running, giving the user the incorrect impression that things had gone according to plan. This made debugging harder.

The situation was made worse because before 56d6689 (which added the OTLP exporter as a dependency of the SDK) because in that case the SDK was defaulting to a broken configuration state, and failing silently. This is no longer the case, so any remaining cases of a misconfigured SDK are bugs that should be addressed, and are probably going unnoticed by users.

Fixes #18, but at what cost?

@jjatria
Copy link
Owner Author

jjatria commented Dec 14, 2024

@tobyink @abh @tm604 I'd love to hear your thoughts on this. It's a breaking change, but one that might actually be desirable. I'm just a little nervous about removing the safeties, but I think these safeties were making things harder for us.

@abh
Copy link
Contributor

abh commented Dec 15, 2024

Given that the dependencies will be specified in the distribution this feels appropriate enough (no different than any other dependency missing).

If there's ever another exporter, you can revisit how this is done.

The [specification] states that

> OpenTelemetry implementations MUST NOT throw unhandled exceptions
> at run time.

but it also says that

> The [...] SDK MAY _fail fast_ and cause the application to fail on
> initialization, e.g. because of a bad user config or environment,
> but MUST NOT cause the application to fail later at run time, e.g.
> due to dynamic config settings received from the Collector.

Before this change, the SDK was not "failing fast" for the sake of
application stability. However, this could result in setups that were
misconfigured but kept running, giving the user the incorrect impression
that things had gone according to plan. This made debugging harder.

The situation was made worse because before 56d6689
(which added the OTLP exporter as a dependency of the SDK) because in
that case the SDK was defaulting to a broken configuration state, and
failing silently. This is no longer the case, so any remaining cases of
a misconfigured SDK are bugs that should be addressed, and are probably
going unnoticed by users.

Fixes #18, but at what cost?

[specification]: https://opentelemetry.io/docs/specs/otel/error-handling/#basic-error-handling-principles
@jjatria
Copy link
Owner Author

jjatria commented Dec 19, 2024

I'm not a fan of adding exceptions, but I think this is a change for the better.

@jjatria jjatria merged commit f083c10 into main Dec 19, 2024
5 of 6 checks passed
@jjatria jjatria deleted the fail-fast branch December 19, 2024 23:07
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

Successfully merging this pull request may close these issues.

default config with otlp exporter silently fails
2 participants