Package brave
Class CurrentSpanCustomizer
- java.lang.Object
-
- brave.CurrentSpanCustomizer
-
- All Implemented Interfaces:
SpanCustomizer
public final class CurrentSpanCustomizer extends Object implements SpanCustomizer
Provides a mechanism for end users to be able to customise the current span.Handles the case of there being no current span in scope.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SpanCustomizerannotate(String value)Associates an event that explains latency with the current system time.static CurrentSpanCustomizercreate(Tracing tracing)Creates a span customizer that will affect the current span in scope if presentSpanCustomizername(String name)Sets the string name for the logical operation this span represents.SpanCustomizertag(String key, String value)Tags give your span context for search, viewing and analysis.
-
-
-
Method Detail
-
create
public static CurrentSpanCustomizer create(Tracing tracing)
Creates a span customizer that will affect the current span in scope if present
-
name
public SpanCustomizer name(String name)
Sets the string name for the logical operation this span represents.- Specified by:
namein interfaceSpanCustomizer
-
tag
public SpanCustomizer tag(String key, String value)
Tags give your span context for search, viewing and analysis. For example, a key "your_app.version" would let you lookup spans by version. A tag "sql.query" isn't searchable, but it can help in debugging when viewing a trace.Note:To guard potentially expensive parsing, implement
Taginstead, which avoids parsing into a no-op span.Ex.
{@code SUMMARY_TAG = new Tag("summary") { - Specified by:
tagin interfaceSpanCustomizer- Parameters:
key- Name used to lookup spans, such as "your_app.version".value- String value, cannot benull.- See Also:
Tag.tag(Object, SpanCustomizer)
-
annotate
public SpanCustomizer annotate(String value)
Associates an event that explains latency with the current system time.- Specified by:
annotatein interfaceSpanCustomizer- Parameters:
value- A short tag indicating the event, like "finagle.retry"
-
-