public class LabelExtractor extends Object
This extracts Stackdriver Span labels equivalent from Zipkin Span.
Zipkin Span annotations with equivalent Stackdriver labels will be renamed to the Stackdriver name. Any Sleuth Span without a Stackdriver label equivalent are renamed to spring.sleuth/[key_name]
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_AGENT_NAME |
static String |
DEFAULT_PREFIX |
static String |
DEFAULT_TIMESTAMP_FORMAT |
Constructor and Description |
---|
LabelExtractor() |
LabelExtractor(String agentName,
String prefix,
Map<String,String> labelRenameMap,
DateFormat timestampFormat) |
LabelExtractor(TraceKeys traceKeys) |
Modifier and Type | Method and Description |
---|---|
Map<String,String> |
extract(Span zipkinSpan)
Extracts the Stackdriver span labels that are equivalent to the Zipkin Span
annotations.
|
protected String |
formatTimestamp(long milliseconds) |
protected String |
label(String key) |
static Map<String,String> |
newDefaultLabelRenameMap()
Default Zipkin to Stackdriver tag/label mapping if not using legacy mode.
|
static Map<String,String> |
newDefaultLabelRenameMap(TraceKeys traceKeys)
Default Sleuth to Stackdriver tag/label mapping if using legacy mode.
|
public static final String DEFAULT_AGENT_NAME
public static final String DEFAULT_PREFIX
public static final String DEFAULT_TIMESTAMP_FORMAT
public LabelExtractor()
public LabelExtractor(TraceKeys traceKeys)
public static Map<String,String> newDefaultLabelRenameMap()
public static Map<String,String> newDefaultLabelRenameMap(TraceKeys traceKeys)
traceKeys
- public Map<String,String> extract(Span zipkinSpan)
zipkinSpan
- The Zipkin Spanprotected String formatTimestamp(long milliseconds)
Copyright © 2018 Pivotal Software, Inc.. All rights reserved.