Class ClickhouseUrlParser

java.lang.Object
io.opentelemetry.instrumentation.jdbc.internal.parser.ClickhouseUrlParser
All Implemented Interfaces:
JdbcUrlParser

public final class ClickhouseUrlParser extends Object implements JdbcUrlParser
Parser for ClickHouse JDBC URLs.

Sample URLs:

  • clickhouse:http://host:8123/db
  • clickhouse:https://host:8443/db
  • clickhouse://host:9000/db

This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.

  • Field Details

  • Method Details

    • parse

      public void parse(String jdbcUrl, ParseContext ctx)
      Description copied from interface: JdbcUrlParser
      Parse the JDBC URL and populate the context with extracted information.

      Implementations are responsible for the full parsing lifecycle:

      1. Set driver-specific defaults (system name, default host/port/user)
      2. Call ParseContext.applyDataSourceProperties() or ParseContext.applyUserProperty() at the appropriate point to match driver-specific precedence semantics. Use applyUserProperty() for drivers whose DataSource does not support the standard serverName/portNumber/databaseName properties.
      3. Parse the URL structure

      The placement of ParseContext.applyDataSourceProperties() controls precedence:

      • Before URL parsing: URL values take precedence (e.g., PostgreSQL, MySQL, Oracle)
      • After URL parsing: DataSource properties take precedence (e.g., Microsoft SQL Server)
      Specified by:
      parse in interface JdbcUrlParser
      Parameters:
      jdbcUrl - the JDBC URL to parse (without the "jdbc:" prefix)
      ctx - the parse context containing type and optional DataSource properties