Skip to content

Move SQL configs to swo_jdbc instrumentation config - #653

Open
cleverchuk wants to merge 1 commit into
mainfrom
cc/NH-152650
Open

cleverchuk wants to merge 1 commit into
mainfrom
cc/NH-152650

Conversation

@cleverchuk

Copy link
Copy Markdown
Contributor

This pull request refactors how SQL tagging settings for JDBC instrumentation are configured and loaded, moving configuration from the legacy solarwinds node to a new swo_jdbc node under instrumentation/development.java. It introduces new classes to apply and listen for these settings, updates dependencies, and cleans up now-obsolete code and tests. The changes improve modularity, clarity, and future extensibility for JDBC-related configuration.

Configuration Refactoring and Instrumentation:

  • JDBC SQL tagging settings (sql_tag, sql_tag_prepared, sql_tag_databases, sql_query_max_length) are now configured under the swo_jdbc node instead of the solarwinds node in YAML config files. This is reflected in all relevant test and example configs. [1] [2] [3] [4] [5] [6]

  • Introduced JdbcConfig and JdbcConfigListener classes to read and apply the new swo_jdbc configuration before any instrumentation is installed, ensuring JDBC and Hibernate modules get correct settings at install time. [1] [2]

Dependency and Build Updates:

  • Added new compile-time dependencies for OpenTelemetry incubator and agent tooling to support the new configuration mechanism.

Test and Code Cleanup:

  • Added comprehensive unit tests for the new JdbcConfig logic, ensuring correct publishing of all SQL settings, handling of edge cases, and non-overriding of existing settings.

  • Removed obsolete custom YAML config parsers and their associated tests for SQL tagging settings, as these are now handled by the new mechanism. (SqlTagDatabasesParser, SqlQueryMaxLengthParser, and their tests were deleted.) [1] [2] [3] [4]

Test services data

  1. e-1712644058766987264
  2. e-1712643928659124224
  3. e-1742334541200846848
  4. e-1777406072376840192

Copilot AI balanced review requested due to automatic review settings October 21, 2026 20:15
@cleverchuk
cleverchuk requested review from a team as code owners October 21, 2026 20:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Listener registration and startup ordering need integration verification before approval.

1 open issue
What changed in this PR

Moves JDBC SQL settings from the legacy solarwinds configuration node to swo_jdbc, with a listener that applies settings before instrumentation installation.

Changes:

  • Adds configuration loading, validation, and unit tests.
  • Migrates YAML fixtures to the new node.
  • Removes obsolete parsers and adds supporting dependencies.
File Description
smoke-tests/​sdk-config.yaml Migrates SQL settings.
libs/​shared/​src/​test/​resources/​sdk-config.yaml Migrates all SQL settings.
libs/​shared/​src/​test/​resources/​sdk-config-bad-transaction-settings-1.yaml Updates configuration fixture.
libs/​shared/​src/​test/​resources/​sdk-config-bad-transaction-settings-0.yaml Updates configuration fixture.
libs/​shared/​src/​test/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​parser/​yaml/​SqlTagDatabasesParserTest.java Removes obsolete parser tests.
libs/​shared/​src/​test/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​parser/​yaml/​SqlQueryMaxLengthParserTest.java Removes obsolete validation tests.
libs/​shared/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​parser/​yaml/​SqlTagDatabasesParser.java Removes legacy database parser.
libs/​shared/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​parser/​yaml/​SqlQueryMaxLengthParser.java Removes legacy length parser.
instrumentation/​instrumentation-shared/​src/​test/​java/​com/​solarwinds/​opentelemetry/​instrumentation/​JdbcConfigTest.java Tests settings, validation, and precedence.
instrumentation/​instrumentation-shared/​src/​main/​java/​com/​solarwinds/​opentelemetry/​instrumentation/​JdbcConfigListener.java Adds startup configuration listener.
instrumentation/​instrumentation-shared/​src/​main/​java/​com/​solarwinds/​opentelemetry/​instrumentation/​JdbcConfig.java Applies and validates SQL settings.
instrumentation/​instrumentation-shared/​build.gradle.kts Adds configuration and tooling dependencies.
custom/​src/​test/​resources/​sdk-config.yaml Migrates SQL tagging setting.

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants