Skip to content

Commit

Permalink
don't scare the gosec linter
Browse files Browse the repository at this point in the history
  • Loading branch information
Cory Schwartz committed May 26, 2021
1 parent e6b6310 commit d50b59b
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions lib/tracing/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit d50b59b

Please sign in to comment.