Package brave

Interface SpanCustomizer

All Known Implementing Classes:
CurrentSpanCustomizer, NoopSpanCustomizer, ScopedSpan, Span

public interface SpanCustomizer
Simple interface users can customize a span with. For example, this can add custom tags useful in looking up spans.

Usage notes

This type is safer to expose directly to users than Span, as it has no hooks that can affect the span lifecycle.
See Also:
Tag
  • Method Summary

    Modifier and Type Method Description
    SpanCustomizer annotate​(String value)
    Associates an event that explains latency with the current system time.
    SpanCustomizer name​(String name)
    Sets the string name for the logical operation this span represents.
    SpanCustomizer tag​(String key, String value)
    Tags give your span context for search, viewing and analysis.
  • Method Details

    • name

      SpanCustomizer name​(String name)
      Sets the string name for the logical operation this span represents.
    • tag

      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 Tag instead, which avoids parsing into a no-op span.

      Ex.

      {@code
       SUMMARY_TAG = new Tag("summary") {
      Parameters:
      key - Name used to lookup spans, such as "your_app.version".
      value - String value, cannot be null.
      See Also:
      Tag.tag(Object, SpanCustomizer)
    • annotate

      SpanCustomizer annotate​(String value)
      Associates an event that explains latency with the current system time.
      Parameters:
      value - A short tag indicating the event, like "finagle.retry"