Last active
August 15, 2018 14:36
-
-
Save carlosalberto/191788de3014de9245510a7b4610af15 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Scope scope = null; | |
try { | |
scope = tracer.buildSpan("foo").startActive(); | |
} catch (Exception exc) { | |
Tags.ERROR.set(scope.span(), true); | |
scope.span().log(ImmutableMap.Builder<String, Object>() | |
.put("event", "error") | |
.put("error.object", exc) | |
.build()); | |
} finally { | |
if (scope != null) { | |
scope.close(); | |
// Optionally close Span (if you own it). | |
scope.span.finish(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment