From d50b59b4c70fd0428a46bf2c28662f4be1be9f53 Mon Sep 17 00:00:00 2001 From: Cory Schwartz Date: Tue, 25 May 2021 23:55:46 -0700 Subject: [PATCH] don't scare the gosec linter --- lib/tracing/setup.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/tracing/setup.go b/lib/tracing/setup.go index 9f30b7714..1ace962e5 100644 --- a/lib/tracing/setup.go +++ b/lib/tracing/setup.go @@ -17,19 +17,20 @@ const ( envAgentEndpoint = "LOTUS_JAEGER_AGENT_ENDPOINT" envAgentHost = "LOTUS_JAEGER_AGENT_HOST" envAgentPort = "LOTUS_JAEGER_AGENT_PORT" - envUsername = "LOTUS_JAEGER_USERNAME" - envPassword = "LOTUS_JAEGER_PASSWORD" + envJaegerUser = "LOTUS_JAEGER_USERNAME" + envJaegerCred = "LOTUS_JAEGER_PASSWORD" ) // When sending directly to the collector, agent options are ignored. // The collector endpoint is an HTTP or HTTPs URL. -// The agent endpoint is a thrift/udp protocol given like "hostname:port" -// or separate host and port environment variables. +// The agent endpoint is a thrift/udp protocol and should be given +// as a string like "hostname:port". The agent can also be configured +// with separate host and port variables. func jaegerOptsFromEnv(opts *jaeger.Options) bool { var e string var ok bool - if e, ok = os.LookupEnv(envUsername); ok { - if p, ok := os.LookupEnv(envPassword); ok { + if e, ok = os.LookupEnv(envJaegerUser); ok { + if p, ok := os.LookupEnv(envJaegerCred); ok { opts.Username = e opts.Password = p } else { @@ -67,7 +68,7 @@ func SetupJaegerTracing(serviceName string) *jaeger.Exporter { opts.ServiceName = serviceName je, err := jaeger.NewExporter(opts) if err != nil { - log.Errorw("Failed to create the Jaeger exporter", "error", err) + log.Errorw("failed to create the jaeger exporter", "error", err) return nil }