Skip to content

Add swo_stacktrace declarative config component - #654

Merged
cleverchuk merged 2 commits into
mainfrom
cc/NH-152835
Oct 28, 2026
Merged

cleverchuk merged 2 commits into
mainfrom
cc/NH-152835

Conversation

@cleverchuk

Copy link
Copy Markdown
Contributor

This pull request refactors the way stacktrace filtering is configured and integrated into the OpenTelemetry extensions. It removes the YAML-based StacktraceFilterParser in favor of a new component provider approach, simplifies processor injection, and updates related tests. The changes aim to streamline configuration, improve extensibility, and ensure the default filter behavior is consistent.

Key changes:

Stacktrace Filter Configuration and Integration

  • Introduced StacktraceComponentProvider for stacktrace filtering:
    Added a new StacktraceComponentProvider class that acts as a drop-in replacement for the previous stacktrace processor injection. It defaults to using SpanStacktraceFilter and allows configuring filter attributes, always including db.system by default. This replaces the previous YAML parser and processor customization logic.

  • Removed YAML-based StacktraceFilterParser and its test:
    Deleted the StacktraceFilterParser class and its corresponding test, eliminating the old way of parsing stacktrace filter configuration from YAML files. [1] [2]

Simplification of Processor Injection

  • Removed custom processor injection logic from SharedConfigCustomizerProvider:
    The logic that injected or updated the experimental stacktrace processor (stacktrace/development) in SharedConfigCustomizerProvider was removed, as this is now handled by the new component provider. Associated imports and helper methods were also cleaned up. [1] [2] [3] [4]

SpanStacktraceFilter Improvements

  • Enhanced SpanStacktraceFilter to support explicit filters with default:
    Updated SpanStacktraceFilter to accept an explicit collection of filter attributes, always including db.system as a default, and added a test to validate this behavior. [1] [2] [3]

Test Updates

  • Updated tests to reflect new processor behavior:
    Adjusted tests in SharedConfigCustomizerProviderTest to expect only one processor (not two), and removed tests that depended on the old stacktrace processor injection logic. [1] [2] [3] [4]

Test services data

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

@cleverchuk
cleverchuk requested review from a team as code owners October 26, 2026 19:33
Copilot AI balanced review requested due to automatic review settings October 26, 2026 19:33

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.

🟡 Changes recommended

The root configuration lacks the replacement component, so removing automatic insertion disables its previously enabled database stacktrace capture.

1 open issue
What changed in this PR

Moves declarative stacktrace configuration into a dedicated swo_stacktrace component within the shared OpenTelemetry extensions.

Changes:

  • Adds a component provider with configurable filter attributes and a default db.system filter.
  • Removes the legacy YAML filter parser and automatic stacktrace processor injection.
  • Migrates smoke-test configuration and updates unit tests for explicit component configuration.
File Description
smoke-tests/​sdk-config.yaml Uses swo_stacktrace with explicit filters.
libs/​shared/​src/​test/​resources/​sdk-config.yaml Removes legacy filter configuration.
libs/​shared/​src/​test/​resources/​sdk-config-bad-transaction-settings-1.yaml Removes legacy filter configuration.
libs/​shared/​src/​test/​resources/​sdk-config-bad-transaction-settings-0.yaml Removes legacy filter configuration.
libs/​shared/​src/​test/​java/​com/​solarwinds/​opentelemetry/​extensions/​SpanStacktraceFilterTest.java Tests explicit filters alongside the database default.
libs/​shared/​src/​test/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​provider/​StacktraceComponentProviderTest.java Tests duration thresholds, filtering, and custom predicates.
libs/​shared/​src/​test/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​provider/​SharedConfigCustomizerProviderTest.java Updates processor expectations and removes injection tests.
libs/​shared/​src/​test/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​parser/​yaml/​StacktraceFilterParserTest.java Deletes obsolete parser tests.
libs/​shared/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​SpanStacktraceFilter.java Adds explicit filter construction with the database default.
libs/​shared/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​provider/​StacktraceComponentProvider.java Registers and creates the new stacktrace component.
libs/​shared/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​provider/​SharedConfigCustomizerProvider.java Removes automatic stacktrace processor injection.
libs/​shared/​src/​main/​java/​com/​solarwinds/​opentelemetry/​extensions/​config/​parser/​yaml/​StacktraceFilterParser.java Deletes the legacy YAML filter parser.

Review effort: Balanced

@jerrytfleung jerrytfleung left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@jerrytfleung

Copy link
Copy Markdown

@cleverchuk Can you also document this apm-java specific component to declarative spec too? Thanks!

@cleverchuk
cleverchuk merged commit b4459bd into main Oct 28, 2026
17 checks passed
@cleverchuk
cleverchuk deleted the cc/NH-152835 branch October 28, 2026 17:18
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.

3 participants