Interface DocumentedSpan
-
public interface DocumentedSpanIn order to describe your spans via e.g. enums instead of Strings you can use this interface that returns all the characteristics of a span. In Spring Cloud Sleuth we analyze the sources and reuse this information to build a table of known spans, their names, tags and events. We can generate documentation for all created spans but certain requirements need to be met - spans are grouped within an enum - the enum implements theDocumentedSpaninterface - if the span containsTagKeyorEventValuethen those need to be declared as nested enums - thegetTagKeys()andgetEvents()need to call the nested enum'svalues()method to retrieve the array of allowed keys / events- Since:
- 3.1.0
- Author:
- Marcin Grzejszczak
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default EventValue[]getEvents()StringgetName()default TagKey[]getTagKeys()default Stringprefix()Returns required prefix to be there for events and tags.default AssertingSpanwrap(Span span)Asserts on tags, names and allowed events.default AssertingSpanBuilderwrap(Span.Builder span)Asserts on tags, names and allowed events.default AssertingSpanCustomizerwrap(SpanCustomizer span)Asserts on tags, names and allowed events.
-
-
-
Method Detail
-
getName
String getName()
- Returns:
- span name
-
getTagKeys
default TagKey[] getTagKeys()
- Returns:
- allowed tag keys
-
getEvents
default EventValue[] getEvents()
- Returns:
- allowed events
-
prefix
default String prefix()
Returns required prefix to be there for events and tags. Examplefoo.would require the tags and events to have a {code foo} prefix like this for tags:foo.bar=trueandfoo.startedfor events.- Returns:
- required prefix
-
wrap
default AssertingSpan wrap(Span span)
Asserts on tags, names and allowed events.- Parameters:
span- to wrap- Returns:
- wrapped span
-
wrap
default AssertingSpanCustomizer wrap(SpanCustomizer span)
Asserts on tags, names and allowed events.- Parameters:
span- to wrap- Returns:
- wrapped span
-
wrap
default AssertingSpanBuilder wrap(Span.Builder span)
Asserts on tags, names and allowed events.- Parameters:
span- builder to wrap- Returns:
- wrapped span
-
-