fix(ddtrace/tracer): handle nil options in span configuration functions#3592
Merged
Conversation
Added checks to skip nil options in the Finish and SpanStart functions to prevent potential runtime errors when processing options.
…tions Introduced new test cases for the Finish and StartSpan functions to verify correct behavior when provided with nil options. These tests ensure that nil options are handled gracefully without causing runtime errors, enhancing the robustness of the span configuration.
darccio
marked this pull request as ready for review
June 4, 2025 08:49
kakkoyun
approved these changes
Jun 4, 2025
kakkoyun
enabled auto-merge (squash)
June 4, 2025 13:04
…ests Updated test function signatures in span tests to use a blank identifier for the testing.T parameter, improving code clarity and consistency. This change does not affect test functionality but enhances readability.
…e-go into dario.castane/issue-3558
Contributor
|
We have similar code in each of the contribs (i.e. whenever we call |
Member
Author
Yes, but let's do it in upcoming PRs. The odds of somebody explicitly passing a |
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.
What does this PR do?
Added checks to skip nil options in the Finish and SpanStart functions to prevent potential runtime errors when processing options.
Motivation
Closes #3558
Reviewer's Checklist
golangci-lint runlocally.Unsure? Have a question? Request a review!