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 Details

  • Constructor Details

    • DefaultCassandraObservationConvention

      public DefaultCassandraObservationConvention()
  • Method Details

    • getLowCardinalityKeyValues

      public io.micrometer.common.KeyValues getLowCardinalityKeyValues(CassandraObservationContext context)
      Specified by:
      getLowCardinalityKeyValues in interface io.micrometer.observation.ObservationConvention<CassandraObservationContext>
    • getHighCardinalityKeyValues

      public io.micrometer.common.KeyValues getHighCardinalityKeyValues(CassandraObservationContext context)
      Specified by:
      getHighCardinalityKeyValues in interface io.micrometer.observation.ObservationConvention<CassandraObservationContext>
    • tryGetSocketAddress

      @Nullable protected InetSocketAddress tryGetSocketAddress(com.datastax.oss.driver.api.core.metadata.EndPoint endPoint)
    • getContextualName

      public String getContextualName(CassandraObservationContext context)
      Specified by:
      getContextualName in interface io.micrometer.observation.ObservationConvention<CassandraObservationContext>
    • getOperationName

      public String getOperationName(String cql, String defaultName)
      Tries to parse the CQL query or provides the default name.
      Parameters:
      defaultName - if there's no query
      Returns:
      span name
    • getCql

      protected static String getCql(com.datastax.oss.driver.api.core.cql.Statement<?> statement)
      Extract the CQL query from the delegate Statement.
      Parameters:
      statement -
      Returns:
      string-based CQL of the delegate
    • getQuery

      protected static String getQuery(com.datastax.oss.driver.api.core.cql.Statement<?> statement)
      Extract the query from a Statement.
      Parameters:
      statement -
      Returns:
      query