Skip to content
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
5 changes: 5 additions & 0 deletions collector/receiver/telemetryapireceiver/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"os"
"strconv"
"strings"
"sync"
"time"

"github.com/golang-collections/go-datastructures/queue"
Expand Down Expand Up @@ -62,6 +63,7 @@ type telemetryAPIReceiver struct {
httpServer *http.Server
logger *zap.Logger
queue *queue.Queue // queue is a synchronous queue and is used to put the received log events to be dispatched later
mu sync.Mutex
nextTraces consumer.Traces
nextLogs consumer.Logs
lastPlatformStartTime string
Expand Down Expand Up @@ -138,6 +140,9 @@ func (r *telemetryAPIReceiver) httpHandler(w http.ResponseWriter, req *http.Requ
return
}

r.mu.Lock()
defer r.mu.Unlock()

for _, el := range slice {
r.logger.Debug(fmt.Sprintf("Event: %s", el.Type), zap.Any("event", el))
switch el.Type {
Expand Down
Loading