mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-01-18 03:22:12 +02:00
Flush metric events prior to shutdown in OTLP example (#1678)
* Flush metric events prior to shutdown in OTLP example * Add changes to changelog
This commit is contained in:
parent
66b1135af4
commit
9c305bde9c
@ -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
|
- `SamplingResult.TraceState` is correctly propagated to a newly created
|
||||||
span's `SpanContext`. (#1655)
|
span's `SpanContext`. (#1655)
|
||||||
- Jaeger Exporter: Ensure mapping between OTEL and Jaeger span data complies with the specification. (#1626)
|
- 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
|
## [0.18.0] - 2020-03-03
|
||||||
|
|
||||||
|
@ -90,11 +90,11 @@ func initProvider() func() {
|
|||||||
handleErr(cont.Start(context.Background()), "failed to start controller")
|
handleErr(cont.Start(context.Background()), "failed to start controller")
|
||||||
|
|
||||||
return func() {
|
return func() {
|
||||||
// Shutdown will flush any remaining spans.
|
|
||||||
handleErr(tracerProvider.Shutdown(ctx), "failed to shutdown TracerProvider")
|
|
||||||
|
|
||||||
// Push any last metric events to the exporter.
|
// Push any last metric events to the exporter.
|
||||||
handleErr(cont.Stop(context.Background()), "failed to stop controller")
|
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")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user