fix: emit url.query_params as nested otel attributes#517
Open
fix: emit url.query_params as nested otel attributes#517
Conversation
Send each URL query param as its own `url.query_params.<key>` attribute instead of one JSON-stringified blob, so the backend's hlog.FormatAttributes flattens them natively into a nested attribute map without needing custom JSON parsing. Repeated keys become array-valued attributes (the previous Object.fromEntries path silently dropped dupes). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ntiner1
approved these changes
Apr 30, 2026
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.
Summary
url.query_params.<key>OTel span attribute instead of one JSON-stringified blob, so the backend'shlog.FormatAttributesflattens them natively into a nested attribute map with no JSON parsing required.?id=1&id=2) now become array-valued attributes; singletons stay as strings. The previousObject.fromEntriespath silently dropped duplicates.convertSearchParamsToOtelAttributesmirrors the existingconvertHeadersToOtelAttributespattern.Test plan
yarn turbo run test --filter highlight.run(413 tests pass; 7 new for the helper)yarn turbo run lint --filter highlight.runyarn format-checkyarn turbo run build enforce-size --filter highlight.run --filter @launchdarkly/observability(brotli: 166 kB, under 256 kB limit)🤖 Generated with Claude Code
Note
Low Risk
Low risk: changes only how URL query params are represented on OTEL spans, with added unit tests; primary risk is minor downstream query/attribute-shape expectations.
Overview
Switches HTTP span query-param capture from a single JSON-stringified
url.query_paramsattribute to per-param dotted attributes (e.g.url.query_params.foo), allowing backend attribute formatting to build nested maps without JSON parsing.Adds
convertSearchParamsToOtelAttributesto preserve repeated query keys as ordered arrays while keeping singletons as strings, and introduces a focused test suite covering duplicates, empty values, decoding, and custom prefixes.Reviewed by Cursor Bugbot for commit ddc1e02. Bugbot is set up for automated code reviews on this repo. Configure here.