Skip to content

Commit

Permalink
Don't configure traces without honeycomb
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanratcliffe committed Nov 6, 2024
1 parent cdb382f commit e9bc90a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions adapters/iam_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ type TestIAMClient struct{}
func TestMain(m *testing.M) {
// Add tracing if present
key, _ := os.LookupEnv("HONEYCOMB_API_KEY")
opts := make([]otlptracehttp.Option, 0)
if key != "" {
opts = []otlptracehttp.Option{
opts := []otlptracehttp.Option{
otlptracehttp.WithEndpoint("api.honeycomb.io"),
otlptracehttp.WithHeaders(map[string]string{"x-honeycomb-team": key}),
}
}

if err := tracing.InitTracing(opts...); err != nil {
log.Fatal(err)
if err := tracing.InitTracing(opts...); err != nil {
log.Fatal(err)
}
defer tracing.ShutdownTracing()

}
defer tracing.ShutdownTracing()

os.Exit(m.Run())
}
Expand Down

0 comments on commit e9bc90a

Please sign in to comment.