feat: implemented span stack trace configuration #2181
Draft
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.
EPIC link: https://jsw.ibm.com/browse/INSTA-57356
This will be the final PR to main for the stack trace filtering feature!
This PR proposes a refactor of the current instrumentation error/stack logic and introduces a new configuration option (
INSTANA_STACK_TRACE) to control stack trace collection behaviour across all instrumentations based on the EPIC design.Goals
none,error,all) - implementation1. Refactor & Unify Instrumentation Logic
1.1 Introduce a Common Error / Stack Handling Helper
Unify
setErrorlogicCreate a shared helper used by all instrumentations for attaching error details and stack traces.
Ensure
getErrorDetailsalways returns a stringGuarantees consistent type in
span.data.<tech>.error.Implement V8 string → stack trace conversion
Handle cases where the stack arrives as a plain string.
Add a test validating correct conversion behaviour.
Add dedicated tests
At least one test to ensure conversion logic is correct.
1.2 Update All Instrumentations to Use Shared Logic
All categories will be updated to call the new unified helper:
This ensures:
1.3 Add Category-Level Tests
Tests to validate:
2. Add Configurable Stack Trace Mode
Introduce a configuration setting:
INSTANA_STACK_TRACE = none | error | all
configuration via agent and custom file
2.1 Implement Stack Trace Mode Behaviour
2.2 Add or Update Tests
Add full coverage for the three modes:
Task List Summary
Refactoring Tasks
setErroracross all instrumentationsgetErrorDetailsStack Trace Configuration Tasks
INSTANA_STACK_TRACEconfignone | error | all)Optional
After Implementation