Class OtelUtil
- java.lang.Object
-
- uk.gov.gchq.gaffer.commonutil.otel.OtelUtil
-
public final class OtelUtil extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
GRAPH_ID_ATTRIBUTE
static String
GREMLIN_QUERY_ATTRIBUTE
static String
JOB_ID_ATTRIBUTE
static String
USER_ATTRIBUTE
static String
VIEW_ATTRIBUTE
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
getOpenTelemetryActive()
Get if OpenTelemetry is in use.static void
setOpenTelemetryActive(boolean active)
Set if OpenTelemetry is in use.static io.opentelemetry.api.trace.Span
startSpan(String tracerName, String spanName)
Creates a new span with the given tracer and span names, note will return an 'invalid' span if OpenTelementry is turned off.
-
-
-
Field Detail
-
USER_ATTRIBUTE
public static final String USER_ATTRIBUTE
- See Also:
- Constant Field Values
-
JOB_ID_ATTRIBUTE
public static final String JOB_ID_ATTRIBUTE
- See Also:
- Constant Field Values
-
GRAPH_ID_ATTRIBUTE
public static final String GRAPH_ID_ATTRIBUTE
- See Also:
- Constant Field Values
-
VIEW_ATTRIBUTE
public static final String VIEW_ATTRIBUTE
- See Also:
- Constant Field Values
-
GREMLIN_QUERY_ATTRIBUTE
public static final String GREMLIN_QUERY_ATTRIBUTE
- See Also:
- Constant Field Values
-
-
Method Detail
-
startSpan
public static io.opentelemetry.api.trace.Span startSpan(String tracerName, String spanName)
Creates a new span with the given tracer and span names, note will return an 'invalid' span if OpenTelementry is turned off.- Parameters:
tracerName
- Name of the Tracer to usespanName
- Name of theSpan
to use.- Returns:
- new
Span
-
getOpenTelemetryActive
public static boolean getOpenTelemetryActive()
Get if OpenTelemetry is in use.- Returns:
- Is active
-
setOpenTelemetryActive
public static void setOpenTelemetryActive(boolean active)
Set if OpenTelemetry is in use.- Parameters:
active
- Is active
-
-