Skip to content

Commit

Permalink
stream: create telemetry span in kafka produce
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdecaf committed Nov 9, 2023
1 parent 4bb9f1b commit b93349e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/incoming/stream/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ import (
"fmt"
"net/url"

"github.com/Shopify/sarama"
"github.com/moov-io/achgateway/internal/kafka"
"github.com/moov-io/achgateway/internal/service"
"github.com/moov-io/base/log"
"github.com/moov-io/base/telemetry"

"github.com/Shopify/sarama"
"gocloud.dev/pubsub"
_ "gocloud.dev/pubsub/mempubsub"
)
Expand Down Expand Up @@ -58,6 +59,9 @@ type kafkaProducer struct {
}

func (kp *kafkaProducer) Send(ctx context.Context, m *pubsub.Message) error {
_, span := telemetry.StartSpan(ctx, "producer-kafka-send")
defer span.End()

err := kp.topic.Send(ctx, m)
if err != nil {
var producerError sarama.ProducerError
Expand Down

0 comments on commit b93349e

Please sign in to comment.