Skip to content

Commit

Permalink
use global handler for span export err in otlp (#946)
Browse files Browse the repository at this point in the history
Currently there is no way to report errors using the global handlers for spans in the OTLP exporter, this change fixes that. Errors for the metrics exporter are already handled by the global handler.

Co-authored-by: Liz Fong-Jones <lizf@honeycomb.io>
  • Loading branch information
alrex and lizthegrey authored Jul 21, 2020
1 parent f6b51df commit c8b657e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions exporters/otlp/otlp.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
colmetricpb "go.opentelemetry.io/otel/internal/opentelemetry-proto-gen/collector/metrics/v1"
coltracepb "go.opentelemetry.io/otel/internal/opentelemetry-proto-gen/collector/trace/v1"

"go.opentelemetry.io/otel/api/global"
"go.opentelemetry.io/otel/api/metric"
"go.opentelemetry.io/otel/exporters/otlp/internal/transform"
metricsdk "go.opentelemetry.io/otel/sdk/export/metric"
Expand Down Expand Up @@ -301,6 +302,7 @@ func (e *Exporter) uploadTraces(ctx context.Context, sdl []*tracesdk.SpanData) {
e.senderMu.Unlock()
if err != nil {
e.setStateDisconnected(err)
global.Handle(err)
}
}
}

0 comments on commit c8b657e

Please sign in to comment.