Skip to content

Commit

Permalink
Vulture fixes (#586)
Browse files Browse the repository at this point in the history
* Move JaegergRPCClient outside of the write loop

Signed-off-by: Daniel González Lopes <[email protected]>

* Fix: increase notfound bucket instead of failed

Signed-off-by: Daniel González Lopes <[email protected]>

* Panic if we can instantiate a new jaegergRPC client

Signed-off-by: Daniel González Lopes <[email protected]>
  • Loading branch information
dgzlopes authored Mar 11, 2021
1 parent f2a7f3d commit 73546da
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions cmd/tempo-vulture/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,15 @@ func main() {

// Write
go func() {
c, err := newJaegerGRPCClient(tempoPushURL)
if err != nil {
panic(err)
}

for {
<-tickerWrite.C

rand.Seed((time.Now().Unix() / interval) * interval)
c, err := newJaegerGRPCClient(tempoPushURL)
if err != nil {
glog.Error("error creating grpc client", err)
metricErrorTotal.Inc()
continue
}

traceIDHigh := rand.Int63()
traceIDLow := rand.Int63()
for i := int64(0); i < generateRandomInt(1, 100); i++ {
Expand Down Expand Up @@ -117,7 +115,7 @@ func main() {
if err != nil {
glog.Error("error querying Tempo ", err)
metricErrorTotal.Inc()
metricTracesErrors.WithLabelValues("failed").Inc()
metricTracesErrors.WithLabelValues("notfound").Inc()
continue
}

Expand Down

0 comments on commit 73546da

Please sign in to comment.