Skip to content

Remove shared use of libhoney from goroutines. Fixes #272. #305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions exporter/honeycombexporter/honeycomb.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (

tracepb "github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1"
libhoney "github.com/honeycombio/libhoney-go"
"github.com/honeycombio/libhoney-go/transmission"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/component/componenterror"
"go.opentelemetry.io/collector/consumer/consumerdata"
Expand Down Expand Up @@ -118,7 +119,7 @@ func (e *honeycombExporter) pushTraceData(ctx context.Context, td consumerdata.T
// Run the error logger. This just listens for messages in the error
// response queue and writes them out using the logger.
ctx, cancel := context.WithCancel(ctx)
go e.RunErrorLogger(ctx)
go e.RunErrorLogger(ctx, libhoney.TxResponses())
defer cancel()

// Extract Node and Resource attributes, labels and other information.
Expand Down Expand Up @@ -289,8 +290,7 @@ func (e *honeycombExporter) Shutdown(context.Context) error {
//
// This method will block until the passed context.Context is canceled, or until
// exporter.Close is called.
func (e *honeycombExporter) RunErrorLogger(ctx context.Context) {
responses := libhoney.TxResponses()
func (e *honeycombExporter) RunErrorLogger(ctx context.Context, responses chan transmission.Response) {
for {
select {
case r, ok := <-responses:
Expand Down