java.lang.Object
io.opentelemetry.instrumentation.jdbc.datasource.internal.Experimental

public final class Experimental extends Object
This class is internal and experimental. Its APIs are unstable and can change at any time. Its APIs (or a version of them) may be promoted to the public stable API in the future, but no guarantees are made.
  • Method Details

    • setEnableSqlCommenter

      public static void setEnableSqlCommenter(JdbcTelemetryBuilder builder, boolean sqlCommenterEnabled)
      Sets whether to augment sql query with comment containing the tracing information. See sqlcommenter for more info.

      WARNING: augmenting queries with tracing context will make query texts unique, which may have adverse impact on database performance. Consult with database experts before enabling. If this is an issue, consider replacing the default W3C Trace Context propagator with a propagator that only adds static values, such as service name.

      WARNING: for prepared statements query is modified when the statement is created, this means that the inserted tracing context could be wrong if the prepared statement is reused. Consider replacing the default W3C Trace Context propagator with a propagator that only adds static values, such as service name.

    • setSqlCommenterPropagator

      public static void setSqlCommenterPropagator(JdbcTelemetryBuilder builder, io.opentelemetry.context.propagation.TextMapPropagator propagator)
      Set the propagator used to inject tracing context into sql comments. By default, W3C Trace Context propagator is used.
    • setSqlCommenterPrepend

      public static void setSqlCommenterPrepend(JdbcTelemetryBuilder builder, boolean sqlCommenterPrepend)
      Sets whether to prepend the sql comment to the query instead of appending it. Default is to append. This is useful for preserving the comment on databases that truncate long queries in their diagnostic output.
    • internalSetSqlCommenterBuilder

      public static void internalSetSqlCommenterBuilder(Function<JdbcTelemetryBuilder,io.opentelemetry.instrumentation.api.incubator.semconv.db.internal.SqlCommenterBuilder> sqlCommenterBuilder)