java.lang.Object
io.opentelemetry.instrumentation.api.incubator.semconv.db.SqlQuery

public abstract class SqlQuery extends Object
  • Constructor Details

    • SqlQuery

      public SqlQuery()
  • Method Details

    • createWithSummary

      public static SqlQuery createWithSummary(@Nullable String queryText, @Nullable String storedProcedureName, @Nullable String querySummary)
      Creates a SqlQuery for stable semconv (uses querySummary).
    • create

      public static SqlQuery create(@Nullable String queryText, @Nullable String operationName, @Nullable String target)
      Creates a SqlQuery for old semconv (no querySummary). Package-private for backward compatibility with old jflex-generated sanitizer.
    • getQueryText

      @Nullable public abstract String getQueryText()
    • getOperationName

      @Nullable @Deprecated public abstract String getOperationName()
      Deprecated.
    • getCollectionName

      @Nullable @Deprecated public abstract String getCollectionName()
      Deprecated.
      Returns the table/collection name, or null for CALL operations.
      See Also:
    • getStoredProcedureName

      @Nullable public abstract String getStoredProcedureName()
      Returns the stored procedure name for CALL operations, or null for other operations.
    • getQuerySummary

      @Nullable public abstract String getQuerySummary()
      Returns a low cardinality summary of the database query suitable for use as a span name or metric attribute.

      The summary contains operations (e.g., SELECT, INSERT) and their targets (e.g., table names) in the order they appear in the query. For example:

      • SELECT wuser_table
      • INSERT shipping_details SELECT orders
      • SELECT songs artists (multiple tables)
      See Also: