diff --git a/1.3.x/multi/multi__managing_spans_with_annotations.html b/1.3.x/multi/multi__managing_spans_with_annotations.html
index 4820f37f8..7f7996ef4 100644
--- a/1.3.x/multi/multi__managing_spans_with_annotations.html
+++ b/1.3.x/multi/multi__managing_spans_with_annotations.html
@@ -32,14 +32,16 @@ with the @NewSpan annotation you can also add logs
// method execution
this.testBean.testMethod11("test");
That way the span will get continued and:
testMethod11.before and testMethod11.after will be createdtestMethod11.afterFailure will also be createdtestTag11 and value test will be createdThere are 3 different ways to add tags to a span. All of them are controlled by the SpanTag annotation.
Precedence is:
TagValueResolver type and provided nameTagValueExpressionResolver bean.
-The default implementation uses SPEL expression resolution.toString() value of the parameterThe value of the tag for following method will be computed by an implementation of TagValueResolver interface.
+The default implementation uses SPEL expression resolution. If we do not find any expression to evaluate, return the toString()
+value of the parameter.
+IMPORTANT You can only reference properties from the SPEL expression. Method execution is not allowed due to security constraints.
toString() value of the parameterThe value of the tag for following method will be computed by an implementation of TagValueResolver interface.
Its class name has to be passed as the value of the resolver attribute.
Having such an annotated method:
@NewSpan public void getAnnotationForTagValueResolver(@SpanTag(key = "test", resolver = TagValueResolver.class) String test) { }
and such a TagValueResolver bean implementation
@Bean(name = "myCustomTagValueResolver") public TagValueResolver tagValueResolver() { return parameter -> "Value from myCustomTagValueResolver"; }
Will lead to setting of a tag value equal to Value from myCustomTagValueResolver.
Having such an annotated method:
@NewSpan -public void getAnnotationForTagValueExpression(@SpanTag(key = "test", expression = "length() + ' characters'") String test) { +public void getAnnotationForTagValueExpression(@SpanTag(key = "test", expression = "'hello' + ' characters'") String test) { }
and no custom implementation of a TagValueExpressionResolver will lead to evaluation of the SPEL expression and a tag with value 4 characters will be set on the span.
If you want to use some other expression resolution mechanism you can create your own implementation
of the bean.
Having such an annotated method:
@NewSpan
diff --git a/1.3.x/single/spring-cloud-sleuth.html b/1.3.x/single/spring-cloud-sleuth.html
index 7924c4d33..4555fa7f3 100644
--- a/1.3.x/single/spring-cloud-sleuth.html
+++ b/1.3.x/single/spring-cloud-sleuth.html
@@ -405,14 +405,16 @@ with the @NewSpan annotation you can also add logs
// method execution
this.testBean.testMethod11("test");That way the span will get continued and:
testMethod11.before and testMethod11.after will be createdtestMethod11.afterFailure will also be createdtestTag11 and value test will be createdThere are 3 different ways to add tags to a span. All of them are controlled by the SpanTag annotation.
Precedence is:
TagValueResolver type and provided nameTagValueExpressionResolver bean.
-The default implementation uses SPEL expression resolution.toString() value of the parameterThe value of the tag for following method will be computed by an implementation of TagValueResolver interface.
+The default implementation uses SPEL expression resolution. If we do not find any expression to evaluate, return the toString()
+value of the parameter.
+IMPORTANT You can only reference properties from the SPEL expression. Method execution is not allowed due to security constraints.
toString() value of the parameterThe value of the tag for following method will be computed by an implementation of TagValueResolver interface.
Its class name has to be passed as the value of the resolver attribute.
Having such an annotated method:
@NewSpan public void getAnnotationForTagValueResolver(@SpanTag(key = "test", resolver = TagValueResolver.class) String test) { }
and such a TagValueResolver bean implementation
@Bean(name = "myCustomTagValueResolver") public TagValueResolver tagValueResolver() { return parameter -> "Value from myCustomTagValueResolver"; }
Will lead to setting of a tag value equal to Value from myCustomTagValueResolver.
Having such an annotated method:
@NewSpan -public void getAnnotationForTagValueExpression(@SpanTag(key = "test", expression = "length() + ' characters'") String test) { +public void getAnnotationForTagValueExpression(@SpanTag(key = "test", expression = "'hello' + ' characters'") String test) { }
and no custom implementation of a TagValueExpressionResolver will lead to evaluation of the SPEL expression and a tag with value 4 characters will be set on the span.
If you want to use some other expression resolution mechanism you can create your own implementation
of the bean.
Having such an annotated method:
@NewSpan diff --git a/1.3.x/spring-cloud-sleuth.xml b/1.3.x/spring-cloud-sleuth.xml index 045b98fc0..d022f28aa 100644 --- a/1.3.x/spring-cloud-sleuth.xml +++ b/1.3.x/spring-cloud-sleuth.xml @@ -4,7 +4,7 @@Spring Cloud Sleuth -2018-04-06 +2018-04-07 Adrian Cole, Spencer Gibb, Marcin Grzejszczak, Dave Syer @@ -1004,7 +1004,9 @@ Precedence is:if one hasn’t provided the bean name, try to evaluate an expression. We’re searching for a +The default implementation uses SPEL expression resolution. If we do not find any expression to evaluate, return theTagValueExpressionResolver bean. -The default implementation uses SPEL expression resolution.toString() +value of the parameter. +IMPORTANT You can only reference properties from the SPEL expression. Method execution is not allowed due to security constraints.if one hasn’t provided any expression to evaluate just return a @@ -1029,7 +1031,7 @@ public TagValueResolver tagValueResolver() {toString() value of the parameterResolving expressions for value Having such an annotated method: @NewSpan -public void getAnnotationForTagValueExpression(@SpanTag(key = "test", expression = "length() + ' characters'") String test) { +public void getAnnotationForTagValueExpression(@SpanTag(key = "test", expression = "'hello' + ' characters'") String test) { } and no custom implementation of a TagValueExpressionResolver will lead to evaluation of the SPEL expression and a tag with value4 characters will be set on the span. If you want to use some other expression resolution mechanism you can create your own implementation