Repository navigation
Move SQL configs to swo_jdbc instrumentation config - #653
Open
cleverchuk wants to merge 1 commit into
Open
cleverchuk wants to merge 1 commit into
cleverchuk wants to merge 1 commit into
Conversation
…y a before agent listener
Contributor
There was a problem hiding this comment.
🔵 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This pull request refactors how SQL tagging settings for JDBC instrumentation are configured and loaded, moving configuration from the legacy
solarwindsnode to a newswo_jdbcnode underinstrumentation/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 theswo_jdbcnode instead of thesolarwindsnode in YAML config files. This is reflected in all relevant test and example configs. [1] [2] [3] [4] [5] [6]Introduced
JdbcConfigandJdbcConfigListenerclasses to read and apply the newswo_jdbcconfiguration before any instrumentation is installed, ensuring JDBC and Hibernate modules get correct settings at install time. [1] [2]Dependency and Build Updates:
Test and Code Cleanup:
Added comprehensive unit tests for the new
JdbcConfiglogic, 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