Top Fields Constructors Methods
com.mysql.cj.otel

public Class OpenTelemetrySpan

extends Object
implements TelemetrySpan
Class Inheritance
All Implemented Interfaces
com.mysql.cj.telemetry.TelemetrySpan, java.lang.AutoCloseable
Imports
java.util.function.Supplier, com.mysql.cj.telemetry.TelemetryAttribute, .TelemetryScope, .TelemetrySpan, io.opentelemetry.api.trace.Span, .StatusCode

Field Summary

Modifier and TypeField and Description
private OpenTelemetryScope
private Span

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides default com.mysql.cj.telemetry.TelemetrySpan.close.

AutoCloseable#close() that can be used to end this span and, making it possible to create new span within the try-with-resources blocks.

public void
end()

Overrides default com.mysql.cj.telemetry.TelemetrySpan.end.

Marks the end of the execution of this span.

public TelemetryScope
makeCurrent()

Implements com.mysql.cj.telemetry.TelemetrySpan.makeCurrent.

Takes this telemetry span and makes it current in the global telemetry context.

public void
setAttribute(TelemetryAttribute
the key for this attribute
key
,
String
the value for this attribute
value
)

Overrides default com.mysql.cj.telemetry.TelemetrySpan.setAttribute.

Adds the specified String attribute to this telemetry span.

public void
setAttribute(TelemetryAttribute
the key for this attribute
key
,
long
the value for this attribute
value
)

Overrides default com.mysql.cj.telemetry.TelemetrySpan.setAttribute.

Adds the specified long attribute to this telemetry span.

public <T> void
setAttribute(TelemetryAttribute
the key for this attribute
key
,
Supplier<T>
the supplier for the value for this attribute
valueSupplier
)

Overrides default com.mysql.cj.telemetry.TelemetrySpan.setAttribute.

Adds the attribute given by the specified supplier to this telemetry span.

public void
setError(Throwable
the cause for setting this span status code to ERROR
cause
)

Overrides default com.mysql.cj.telemetry.TelemetrySpan.setError.

Sets the status code of this telemetry span as ERROR and records the stack trace of the specified exception.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

scopeback to summary
private OpenTelemetryScope scope
spanback to summary
private Span span

Constructor Detail

OpenTelemetrySpanback to summary
public OpenTelemetrySpan(Span span)

Method Detail

closeback to summary
public void close()

Overrides default com.mysql.cj.telemetry.TelemetrySpan.close.

Doc from com.mysql.cj.telemetry.TelemetrySpan.close.

AutoCloseable#close() that can be used to end this span and, making it possible to create new span within the try-with-resources blocks.

Annotations
@Override
endback to summary
public void end()

Overrides default com.mysql.cj.telemetry.TelemetrySpan.end.

Doc from com.mysql.cj.telemetry.TelemetrySpan.end.

Marks the end of the execution of this span.

Annotations
@Override
makeCurrentback to summary
public TelemetryScope makeCurrent()

Implements com.mysql.cj.telemetry.TelemetrySpan.makeCurrent.

Doc from com.mysql.cj.telemetry.TelemetrySpan.makeCurrent.

Takes this telemetry span and makes it current in the global telemetry context.

Returns:TelemetryScope

an AutoCloseable telemetry scope that represents the current telemetry context.

Annotations
@Override
setAttributeback to summary
public void setAttribute(TelemetryAttribute key, String value)

Overrides default com.mysql.cj.telemetry.TelemetrySpan.setAttribute.

Doc from com.mysql.cj.telemetry.TelemetrySpan.setAttribute.

Adds the specified String attribute to this telemetry span.

Parameters
key:TelemetryAttribute

the key for this attribute

value:String

the value for this attribute

Annotations
@Override
setAttributeback to summary
public void setAttribute(TelemetryAttribute key, long value)

Overrides default com.mysql.cj.telemetry.TelemetrySpan.setAttribute.

Doc from com.mysql.cj.telemetry.TelemetrySpan.setAttribute.

Adds the specified long attribute to this telemetry span.

Parameters
key:TelemetryAttribute

the key for this attribute

value:long

the value for this attribute

Annotations
@Override
setAttributeback to summary
public <T> void setAttribute(TelemetryAttribute key, Supplier<T> valueSupplier)

Overrides default com.mysql.cj.telemetry.TelemetrySpan.setAttribute.

Doc from com.mysql.cj.telemetry.TelemetrySpan.setAttribute.

Adds the attribute given by the specified supplier to this telemetry span.

Parameters
<T>
the type of the attribute value
key:TelemetryAttribute

the key for this attribute

valueSupplier:Supplier<T>

the supplier for the value for this attribute

Annotations
@Override
setErrorback to summary
public void setError(Throwable cause)

Overrides default com.mysql.cj.telemetry.TelemetrySpan.setError.

Doc from com.mysql.cj.telemetry.TelemetrySpan.setError.

Sets the status code of this telemetry span as ERROR and records the stack trace of the specified exception.

Parameters
cause:Throwable

the cause for setting this span status code to ERROR

Annotations
@Override