Skip to content

Commit

Permalink
Flush metric events prior to shutdown in OTLP example (#1678)
Browse files Browse the repository at this point in the history
* Flush metric events prior to shutdown in OTLP example

* Add changes to changelog
  • Loading branch information
MrAlias authored Mar 10, 2021
1 parent 66b1135 commit 9c305bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- `SamplingResult.TraceState` is correctly propagated to a newly created
span's `SpanContext`. (#1655)
- Jaeger Exporter: Ensure mapping between OTEL and Jaeger span data complies with the specification. (#1626)
- The `otel-collector` example now correctly flushes metric events prior to shutting down the exporter. (#1678)

## [0.18.0] - 2020-03-03

Expand Down
6 changes: 3 additions & 3 deletions example/otel-collector/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ func initProvider() func() {
handleErr(cont.Start(context.Background()), "failed to start controller")

return func() {
// Shutdown will flush any remaining spans.
handleErr(tracerProvider.Shutdown(ctx), "failed to shutdown TracerProvider")

// Push any last metric events to the exporter.
handleErr(cont.Stop(context.Background()), "failed to stop controller")

// Shutdown will flush any remaining spans and shut down the exporter.
handleErr(tracerProvider.Shutdown(ctx), "failed to shutdown TracerProvider")
}
}

Expand Down

0 comments on commit 9c305bd

Please sign in to comment.