From 12924341ec2e019a29075dfa7bdb9e78c63fe3cc Mon Sep 17 00:00:00 2001 From: Aditi Ahuja Date: Wed, 22 Jun 2022 21:28:09 +0530 Subject: [PATCH] draft: minor fixes Signed-off-by: Aditi Ahuja --- pkg/tracing/jaeger/config_yaml.go | 5 +++++ pkg/tracing/jaeger/jaeger.go | 5 ++++- test/e2e/tracing_test.go | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pkg/tracing/jaeger/config_yaml.go b/pkg/tracing/jaeger/config_yaml.go index d999ec81fa5..247d105545c 100644 --- a/pkg/tracing/jaeger/config_yaml.go +++ b/pkg/tracing/jaeger/config_yaml.go @@ -4,6 +4,7 @@ package jaeger import ( + "fmt" "net" "net/url" "os" @@ -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, "}") { diff --git a/pkg/tracing/jaeger/jaeger.go b/pkg/tracing/jaeger/jaeger.go index a4416204ae8..afe20cd92fb 100644 --- a/pkg/tracing/jaeger/jaeger.go +++ b/pkg/tracing/jaeger/jaeger.go @@ -72,7 +72,10 @@ 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 if config.ReporterMaxQueueSize != 0 { diff --git a/test/e2e/tracing_test.go b/test/e2e/tracing_test.go index a60ae063ddc..afdd6315dc4 100644 --- a/test/e2e/tracing_test.go +++ b/test/e2e/tracing_test.go @@ -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 }