Skip to content

Commit

Permalink
Add Null check to second processRequest (#631)
Browse files Browse the repository at this point in the history
Co-authored-by: Giorgio Trettenero <[email protected]>
  • Loading branch information
gtrettenero and Giorgio Trettenero authored Feb 14, 2025
1 parent cb03b4a commit 7841ff6
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ public <R> R processRequest(
if (requestTags != null) {
tags.putAll(requestTags);
}

tags.put("request", resourceRequestName);
tags.put("scheme", MetacatContextManager.getContext().getScheme());
String clientAppName = MetacatContextManager.getContext().getClientAppName();
Expand Down Expand Up @@ -249,7 +248,11 @@ public <R> R processRequest(
final long start = registry.clock().wallTime();
final Map<String, String> tags = Maps.newHashMap();
tags.put("request", resourceRequestName);
tags.put("caller", MetacatContextManager.getContext().getClientAppName());
String clientAppName = MetacatContextManager.getContext().getClientAppName();
if (clientAppName == null) {
clientAppName = "UNKNOWN";
}
tags.put("caller", clientAppName);
registry.counter(requestCounterId.withTags(tags)).increment();
try {
MetacatContextManager.getContext().setRequestName(resourceRequestName);
Expand Down

0 comments on commit 7841ff6

Please sign in to comment.