1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2024-12-12 10:04:29 +02:00
opentelemetry-go/sdk
Philip K. Warren 6d2aeb0dc3
Empty queued spans when ForceFlush called (#2335)
* Empty queued spans when ForceFlush called

Update the implementation of ForceFlush() to first ensure that all spans
which are queued are added to the batch before calling export spans.
Create a small ReadOnlySpan implementation which can be used as a marker
that ForceFlush has been invoked and used to notify when all spans are
ready to be exported.

Fixes #2080.

* Add a changelog entry.

* Update CHANGELOG.md

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update sdk/trace/batch_span_processor.go

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Improve test case to verify multiple flushes.

* Refactor code to use enqueue.

* Be more defensive on waiting for queue.

Update the handling of the force flush span so we only wait on the
channel if we were able to enqueue the span to the queue.

* Fix linter.

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-11-05 11:34:57 -04:00
..
export/metric Release stable-v1 as 1.1.0 (#2327) 2021-10-27 12:18:40 -07:00
instrumentation Prerelease v1.0.0 (#2250) 2021-09-20 13:02:46 -07:00
internal Add vanity imports to internal packages (#2280) 2021-10-29 09:34:37 -07:00
metric Release stable-v1 as 1.1.0 (#2327) 2021-10-27 12:18:40 -07:00
resource Add semconv/v1.7.0 package (#2320) 2021-10-22 08:43:47 -07:00
trace Empty queued spans when ForceFlush called (#2335) 2021-11-05 11:34:57 -04:00
go.mod Release stable-v1 as 1.1.0 (#2327) 2021-10-27 12:18:40 -07:00
go.sum OS description attribute detector (#1840) 2021-07-08 13:35:27 -07:00