public class DefaultBeeline extends Object
Modifier and Type | Method | Description |
---|---|---|
void |
addField(String key,
Object value) |
Add a field to the active Span.
|
void |
close() |
|
void |
endTrace() |
endTrace ends the currently active trace on the thread it is called from
|
Span |
getActiveSpan() |
Returns the span that is currently active on this thread - the one that is top of the stack.
|
Beeline |
getBeeline() |
getBeeline returns the Beeline in this instance for times when the convenience wrappers aren't sufficient
|
static DefaultBeeline |
getInstance(String dataset,
String serviceName,
String writeKey) |
|
static DefaultBeeline |
getInstance(String dataset,
String serviceName,
String writeKey,
URI apiHost,
io.honeycomb.libhoney.TransportOptions transportOptions) |
|
void |
sendActiveSpan() |
Sends the currently active span.
|
Span |
startSpan(String spanName) |
Starts a new span with the given span name.
|
public static DefaultBeeline getInstance(String dataset, String serviceName, String writeKey)
public static DefaultBeeline getInstance(String dataset, String serviceName, String writeKey, URI apiHost, io.honeycomb.libhoney.TransportOptions transportOptions)
public Span startSpan(String spanName)
Span.close()
.spanName
- will be set in the name field of this spanpublic void addField(String key, Object value)
The field key will be prefixed with "app." to make it part of the "app" namespace for user-added fields. This is to avoid clashes and distinguish it from standard fields provided by automatic instrumentations like the "Spring Beeline".
if (underAttack) { beeline.addField("alert-message", "We are under attack!"); }
key
- of the field.value
- of the field.getActiveSpan()
public Span getActiveSpan()
Note, this method is null-safe - a "noop" span is returned if no trace is currently active. This may be due to the current execution not being instrumented or because the trace was not sampled.
if (underAttack) { final Span currentSpan = beeline.getActiveSpan() .addField("alert-message", "We are under attack!") .addField("alert-level", "red"); }
public void sendActiveSpan()
public Beeline getBeeline()
public void endTrace()
public void close()
Copyright © 2019–2020 Honeycomb. All rights reserved.