Class DefaultCassandraObservationConvention
java.lang.Object
org.springframework.data.cassandra.observability.DefaultCassandraObservationConvention
- All Implemented Interfaces:
io.micrometer.observation.KeyValuesConvention
,io.micrometer.observation.ObservationConvention<CassandraObservationContext>
,CassandraObservationConvention
public class DefaultCassandraObservationConvention
extends Object
implements CassandraObservationConvention
Default
CassandraObservationConvention
implementation.- Since:
- 4.0
- Author:
- Greg Turnquist, Mark Paluch
-
Field Summary
Fields inherited from interface io.micrometer.observation.ObservationConvention
EMPTY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static String
getCql
(com.datastax.oss.driver.api.core.cql.Statement<?> statement) Extract the CQL query from the delegateStatement
.io.micrometer.common.KeyValues
io.micrometer.common.KeyValues
getOperationName
(String cql, String defaultName) Tries to parse the CQL query or provides the default name.protected static String
getQuery
(com.datastax.oss.driver.api.core.cql.Statement<?> statement) Extract the query from aStatement
.protected InetSocketAddress
tryGetSocketAddress
(com.datastax.oss.driver.api.core.metadata.EndPoint endPoint) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.data.cassandra.observability.CassandraObservationConvention
supportsContext
Methods inherited from interface io.micrometer.observation.ObservationConvention
getName
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
DefaultCassandraObservationConvention
public DefaultCassandraObservationConvention()
-
-
Method Details
-
getLowCardinalityKeyValues
public io.micrometer.common.KeyValues getLowCardinalityKeyValues(CassandraObservationContext context) - Specified by:
getLowCardinalityKeyValues
in interfaceio.micrometer.observation.ObservationConvention<CassandraObservationContext>
-
getHighCardinalityKeyValues
public io.micrometer.common.KeyValues getHighCardinalityKeyValues(CassandraObservationContext context) - Specified by:
getHighCardinalityKeyValues
in interfaceio.micrometer.observation.ObservationConvention<CassandraObservationContext>
-
tryGetSocketAddress
@Nullable protected InetSocketAddress tryGetSocketAddress(com.datastax.oss.driver.api.core.metadata.EndPoint endPoint) -
getContextualName
- Specified by:
getContextualName
in interfaceio.micrometer.observation.ObservationConvention<CassandraObservationContext>
-
getOperationName
Tries to parse the CQL query or provides the default name.- Parameters:
defaultName
- if there's no query- Returns:
- span name
-
getCql
Extract the CQL query from the delegateStatement
.- Parameters:
statement
-- Returns:
- string-based CQL of the delegate
-
getQuery
Extract the query from aStatement
.- Parameters:
statement
-- Returns:
- query
-