Skip to content

Commit

Permalink
minor fixes; temp prints
Browse files Browse the repository at this point in the history
Signed-off-by: Aditi Ahuja <ahuja.aditi@gmail.com>
  • Loading branch information
metonymic-smokey committed Jun 22, 2022
1 parent 35b1933 commit d9572bd
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
5 changes: 5 additions & 0 deletions pkg/tracing/jaeger/config_yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package jaeger

import (
"fmt"
"net"
"net/url"
"os"
Expand Down Expand Up @@ -162,7 +163,11 @@ func parseTags(sTags string) []opentracing.Tag {
pairs := strings.Split(sTags, ",")
tags := make([]opentracing.Tag, 0)
for _, p := range pairs {
fmt.Printf("\n\n p is: %s", p)
kv := strings.SplitN(p, "=", 2)
if len(kv) < 2 {
continue // to avoid panic
}
k, v := strings.TrimSpace(kv[0]), strings.TrimSpace(kv[1])

if strings.HasPrefix(v, "${") && strings.HasSuffix(v, "}") {
Expand Down
10 changes: 8 additions & 2 deletions pkg/tracing/jaeger/jaeger.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,19 @@ func NewTracerProvider(ctx context.Context, logger log.Logger, conf []byte) (*tr
}
}

tags := getAttributesFromTags(config)
var tags []attribute.KeyValue
if config.Tags != "" {
tags = getAttributesFromTags(config)
}
samplingFraction := getSamplingFraction(config.SamplerType, config.SamplerParam)
var queueSize tracesdk.BatchSpanProcessorOption
var processor tracesdk.SpanProcessor
if config.ReporterMaxQueueSize != 0 {
queueSize = tracesdk.WithMaxQueueSize(config.ReporterMaxQueueSize)
processor = tracesdk.NewBatchSpanProcessor(exporter, queueSize)
} else {
processor = tracesdk.NewBatchSpanProcessor(exporter)
}
processor := tracesdk.NewBatchSpanProcessor(exporter, queueSize)
tp := newTraceProvider(ctx, logger, processor, samplingFraction, tags, config.ServiceName)

return tp, nil
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/e2ethanos/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func DefaultImage() string {
return os.Getenv("THANOS_IMAGE")
}

return "thanosio/thanos:main-2022-06-16-0d15bc0d"
return "thanos"
}

func defaultPromHttpConfig() string {
Expand Down
1 change: 1 addition & 0 deletions test/e2e/tracing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ config:

// Jaeger might give a 404 or 500 before the trace is there. Retry.
if response.StatusCode != http.StatusOK {
t.Logf("\n\n WAITING")
b.Wait()
continue
}
Expand Down

0 comments on commit d9572bd

Please sign in to comment.