@InterfaceAudience.Private public class ConnectionSpanBuilder extends Object implements Supplier<io.opentelemetry.api.trace.Span>
Span
instances originating from the client side of a connection.Modifier and Type | Field and Description |
---|---|
private Map<io.opentelemetry.api.common.AttributeKey<?>,Object> |
attributes |
private String |
name |
Constructor and Description |
---|
ConnectionSpanBuilder(AsyncConnectionImpl conn) |
Modifier and Type | Method and Description |
---|---|
<T> ConnectionSpanBuilder |
addAttribute(io.opentelemetry.api.common.AttributeKey<T> key,
T value) |
io.opentelemetry.api.trace.Span |
build() |
io.opentelemetry.api.trace.Span |
get() |
(package private) static void |
populateConnectionAttributes(Map<io.opentelemetry.api.common.AttributeKey<?>,Object> attributes,
AsyncConnectionImpl conn)
Static utility method that performs the primary logic of this builder.
|
(package private) static void |
populateConnectionAttributes(Map<io.opentelemetry.api.common.AttributeKey<?>,Object> attributes,
ClusterConnection conn) |
(package private) static void |
populateConnectionAttributes(Map<io.opentelemetry.api.common.AttributeKey<?>,Object> attributes,
Supplier<String> connectionStringSupplier,
Supplier<User> userSupplier)
Static utility method that performs the primary logic of this builder.
|
ConnectionSpanBuilder |
setName(String name) |
private final Map<io.opentelemetry.api.common.AttributeKey<?>,Object> attributes
public ConnectionSpanBuilder(AsyncConnectionImpl conn)
public io.opentelemetry.api.trace.Span get()
public ConnectionSpanBuilder setName(String name)
public <T> ConnectionSpanBuilder addAttribute(io.opentelemetry.api.common.AttributeKey<T> key, T value)
public io.opentelemetry.api.trace.Span build()
static void populateConnectionAttributes(Map<io.opentelemetry.api.common.AttributeKey<?>,Object> attributes, ClusterConnection conn)
static void populateConnectionAttributes(Map<io.opentelemetry.api.common.AttributeKey<?>,Object> attributes, AsyncConnectionImpl conn)
attributes
- the attributes map to be populated.conn
- the source of connection attribute values.static void populateConnectionAttributes(Map<io.opentelemetry.api.common.AttributeKey<?>,Object> attributes, Supplier<String> connectionStringSupplier, Supplier<User> userSupplier)
attributes
- the attributes map to be populated.connectionStringSupplier
- the source of the db.connection_string
attribute value.userSupplier
- the source of the db.user
attribute value.Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.