Repository navigation
NH-152875 Re-add URL_QUERY check to sampler attributes collection; remove dead helper - #919
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The sampler’s query-string handling update has no active review issues.
No open issues 🎉
What changed in this PR
Restores query-string handling in the sampler’s HTTP URL construction using current OpenTelemetry semantic conventions, while retaining the legacy HTTP_TARGET fallback.
Changes:
- Combines
URL_PATHandURL_QUERY, adding the?delimiter when needed. - Adds sampler tests for query-only and path-plus-query attributes.
- Removes the unused
get_url_attrshelper, its tests, and obsolete package entries.
| File | Description |
|---|---|
tests/unit/test_semconv/test_trace.py |
Removes tests for the retired helper. |
tests/unit/test_semconv/__init__.py |
Removes the obsolete test package marker. |
tests/unit/test_oboe/test_sampler.py |
Tests query-only and path-plus-query URL construction. |
solarwinds_apm/semconv/trace/__init__.py |
Removes the unused get_url_attrs helper. |
solarwinds_apm/semconv/__init__.py |
Removes the obsolete package marker. |
solarwinds_apm/oboe/sampler.py |
Adds query handling while preserving the legacy fallback. |
pyproject.toml |
Removes retired semantic-convention packages from packaging. |
Review effort: Balanced
tammy-baylis-swi
marked this pull request as ready for review
November 5, 2026 00:40
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 PR "re-adds" a check for the
URL_QUERYattribute that is similar to what was originally added in #377 and used by the sampler, but correctly according to the current HTTP semconv and what the modernized instrumentors are doing:URL_PATH/searchURL_QUERY?delimiter.page=2HTTP_TARGET/search?page=2We then remove the dead helper get_url_attrs that was introduced in #377 but no longer used with implementation of pure Python sampling and export.
We still need the
HTTP_TARGETfallback because not all upstream instrumentors are supportingURL_*yet (WSGI and Tornado).