TracerProvider ForceFlush() Error Fix#7856
Merged
pellared merged 17 commits intoopen-telemetry:mainfrom Mar 5, 2026
Merged
Conversation
|
|
dashpole
reviewed
Feb 2, 2026
Contributor
dashpole
left a comment
There was a problem hiding this comment.
lgtm. Can you add a test?
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7856 +/- ##
=======================================
- Coverage 81.6% 81.6% -0.1%
=======================================
Files 304 304
Lines 23389 23389
=======================================
- Hits 19096 19095 -1
- Misses 3906 3907 +1
Partials 387 387
🚀 New features to boost your workflow:
|
Contributor
Author
|
Sorry for pinging while checks are failing - working on it. |
…y-go into trace-force-flush-errors
…opentelemetry-go into trace-force-flush-errors
dmathieu
approved these changes
Feb 10, 2026
Contributor
Author
|
Anything else I can/should do for this to get it merged? |
pellared
reviewed
Feb 23, 2026
Removed extra line breaks in CHANGELOG for clarity.
pellared
reviewed
Feb 23, 2026
Co-authored-by: Robert Pająk <pellared@hotmail.com>
flc1125
approved these changes
Feb 24, 2026
pellared
approved these changes
Mar 4, 2026
pellared
added a commit
that referenced
this pull request
Mar 6, 2026
### Added - Add `go.opentelemetry.io/otel/semconv/v1.40.0` package. The package contains semantic conventions from the `v1.40.0` version of the OpenTelemetry Semantic Conventions. See the [migration documentation](./semconv/v1.40.0/MIGRATION.md) for information on how to upgrade from `go.opentelemetry.io/otel/semconv/v1.39.0`. (#7985) - Add `Err` and `SetErr` on `Record` in `go.opentelemetry.io/otel/log` to attach an error and set record exception attributes in `go.opentelemetry.io/otel/log/sdk`. (#7924) ### Changed - `TracerProvider.ForceFlush` in `go.opentelemetry.io/otel/sdk/trace` joins errors together and continues iteration through SpanProcessors as opposed to returning the first encountered error without attempting exports on subsequent SpanProcessors. (#7856) ### Fixed - Fix missing `request.GetBody` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` to correctly handle HTTP2 GOAWAY frame. (#7931) - Fix semconv v1.39.0 generated metric helpers skipping required attributes when extra attributes were empty. (#7964) - Preserve W3C TraceFlags bitmask (including the random Trace ID flag) during trace context extraction and injection in `go.opentelemetry.io/otel/propagation`. (#7834) ### Removed - Drop support for [Go 1.24]. (#7984)
seh
reviewed
Mar 7, 2026
| if err := sps.sp.ForceFlush(ctx); err != nil { | ||
| return err | ||
| } | ||
| err = errors.Join(err, sps.sp.ForceFlush(ctx)) |
Contributor
There was a problem hiding this comment.
This creates a singly-linked list of errors.joinErrors, each of them but the first containing only two errors, one of which is the errors.joinError from the previous failure in calling ForceFlush.
What I expect that you intended to create here was a flat sequence of errors. Sketching:
errs := make([]error, 0, len(spss))
for _, sps := range spss {
// ...
if err := sps.sp.ForceFlush(ctx); err != nil {
errs = append(errs, err)
}
}
return errors.Join(errs...)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously upon a SpanProcessor's ForceFlush returning an error, it would return that error and not attempt to flush subsequent SpanProcessors. Now when an error is encountered, it will Join the new error with the existing errors and continue iterating through the SpanProcessors and return the consolidated error at the end of iteration. This is in line with the workflow found in LoggerProvider's ForceFlush.