src/main/java/com/linecorp/armeria/server/tracing/TracingServiceInvocationHandler.java
/**
     * Returns server side annotations that should be added to span.
     */
Returns server side annotations that should be added to span.
Returns server side annotations that should be added to span .
protected <T> List<KeyValueAnnotation> annotations(ServiceInvocationContext ctx, Future<? super T> result) {
        final List<KeyValueAnnotation> annotations = new ArrayList<>(5);
        final StringBuilder uriBuilder = new StringBuilder();
        uriBuilder.append(ctx.scheme() != null ? ctx.scheme().uriText() : "unknown");
        uriBuilder.append("://");
        uriBuilder.append(ctx.host() != null ? ctx.host() : "<unknown-host>");
        uriBuilder.append(ctx.path() != null ? ctx.path() : "/<unknown-path>");
        if (ctx.method() != null) {
            uriBuilder.append('#');
            uriBuilder.append(ctx.method());
        }
        annotations.add(KeyValueAnnotation.create("server.uri", uriBuilder.toString()));
        if (ctx.remoteAddress() != null) {
            annotations.add(KeyValueAnnotation.create("server.remote", ctx.remoteAddress().toString()));
        }
        if (ctx.localAddress() != null) {
            annotations.add(KeyValueAnnotation.create("server.local", ctx.localAddress().toString()));
        }
        if (result != null && result.isDone()) {
            final String resultText = result.isSuccess() ? "success" : "failure";
            annotations.add(KeyValueAnnotation.create("server.result", resultText));
            if (result.cause() != null) {
                annotations.add(KeyValueAnnotation.create("server.cause", result.cause().toString()));
            }
        }
        return annotations;
    }
protected < T > List < KeyValueAnnotation > annotations ( ServiceInvocationContext ctx , Future < ? super T > result ) { final List < KeyValueAnnotation > annotations = new ArrayList < > ( 5 ) ; final StringBuilder uriBuilder = new StringBuilder ( ) ; uriBuilder . append ( ctx . scheme ( ) != null ? ctx . scheme ( ) . uriText ( ) : "unknown" ) ; uriBuilder . append ( "://" ) ; uriBuilder . append ( ctx . host ( ) != null ? ctx . host ( ) : "<unknown-host>" ) ; uriBuilder . append ( ctx . path ( ) != null ? ctx . path ( ) : "/<unknown-path>" ) ; if ( ctx . method ( ) != null ) { uriBuilder . append ( '#' ) ; uriBuilder . append ( ctx . method ( ) ) ; } annotations . add ( KeyValueAnnotation . create ( "server.uri" , uriBuilder . toString ( ) ) ) ; if ( ctx . remoteAddress ( ) != null ) { annotations . add ( KeyValueAnnotation . create ( "server.remote" , ctx . remoteAddress ( ) . toString ( ) ) ) ; } if ( ctx . localAddress ( ) != null ) { annotations . add ( KeyValueAnnotation . create ( "server.local" , ctx . localAddress ( ) . toString ( ) ) ) ; } if ( result != null && result . isDone ( ) ) { final String resultText = result . isSuccess ( ) ? "success" : "failure" ; annotations . add ( KeyValueAnnotation . create ( "server.result" , resultText ) ) ; if ( result . cause ( ) != null ) { annotations . add ( KeyValueAnnotation . create ( "server.cause" , result . cause ( ) . toString ( ) ) ) ; } } return annotations ; }
Returns server side annotations that should be added to span.
Returns server side annotations that should be added to span .