Created
January 31, 2019 14:14
-
-
Save vietj/8485fd7d53e38ae54a143ce29c3d1282 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
public Scope receiveRequest(Map<Object, Object> context, Object request, String operation, Iterable<Map.Entry<String, String>> headers, Iterable<Map.Entry<String, String>> tags) { | |
SpanContext sc = tracer.extract(Format.Builtin.HTTP_HEADERS, new TextMap() { | |
@Override | |
public Iterator<Map.Entry<String, String>> iterator() { | |
return headers.iterator(); | |
} | |
@Override | |
public void put(String key, String value) { | |
throw new UnsupportedOperationException(); | |
} | |
}); | |
Tracer.SpanBuilder builder = tracer.buildSpan(operation); | |
if (sc != null) { | |
builder = builder.asChildOf(sc); | |
} | |
builder | |
.ignoreActiveSpan() | |
.withTag(Tags.SPAN_KIND.getKey(), Tags.SPAN_KIND_SERVER) | |
.withTag(Tags.COMPONENT.getKey(), "vertx"); | |
Scope scope = builder.startActive(false); | |
reportTags(scope.span(), tags); | |
scope.close(); | |
context.put(ACTIVE_SCOPE, scope); | |
return scope; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment