Class DatabaseClientTracer<CONNECTION,​STATEMENT,​SANITIZEDSTATEMENT>

  • Type Parameters:
    CONNECTION - type of the database connection.
    STATEMENT - type of the database statement being executed.
    SANITIZEDSTATEMENT - type of the database statement after sanitization.

    public abstract class DatabaseClientTracer<CONNECTION,​STATEMENT,​SANITIZEDSTATEMENT>
    extends BaseTracer
    Base class for implementing Tracers for database clients.
    • Constructor Detail

      • DatabaseClientTracer

        public DatabaseClientTracer​(NetPeerAttributes netPeerAttributes)
      • DatabaseClientTracer

        public DatabaseClientTracer​(io.opentelemetry.api.OpenTelemetry openTelemetry,
                                    NetPeerAttributes netPeerAttributes)
    • Method Detail

      • shouldStartSpan

        public boolean shouldStartSpan​(io.opentelemetry.context.Context parentContext)
      • startSpan

        public io.opentelemetry.context.Context startSpan​(io.opentelemetry.context.Context parentContext,
                                                          CONNECTION connection,
                                                          STATEMENT statement)
      • conventionSpanName

        public static String conventionSpanName​(@Nullable String dbName,
                                                @Nullable String operation,
                                                @Nullable String table)
        A helper method for constructing the span name formatting according to DB semantic conventions: <db.operation> <db.name><table>.
      • conventionSpanName

        public static String conventionSpanName​(@Nullable String dbName,
                                                @Nullable String operation,
                                                @Nullable String table,
                                                String defaultValue)
        A helper method for constructing the span name formatting according to DB semantic conventions: <db.operation> <db.name><table>. If dbName and operation are not provided then defaultValue is returned.