Skip to content

Commit

Permalink
Apparently null isn't accepted by micrometer
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerwowen committed Nov 14, 2024
1 parent 5110eba commit b69ec02
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import io.dropwizard.auth.Authenticator;
import io.micrometer.core.instrument.Counter;
import io.micrometer.core.instrument.Metrics;
import java.util.Objects;
import java.util.Optional;

/**
Expand Down Expand Up @@ -55,7 +56,7 @@ public Optional<ScriptTokenPrincipal<R>> authenticate(String credentials)
"principal",
principal.get().getName(),
"env",
principal.get().getResource().getEnvName())
Objects.toString(principal.get().getResource().getEnvName(), "NA"))
.register(Metrics.globalRegistry)
.increment();
} else {
Expand Down

0 comments on commit b69ec02

Please sign in to comment.