feat(eap): Always infer UA and IP in V2 standalone span pipeline#6047
feat(eap): Always infer UA and IP in V2 standalone span pipeline#6047loewenheim wants to merge 5 commits into
Conversation
There was a discrepancy between the legacy and V2 standalone span
pipelines: the legacy pipeline would always infer client addresses
and user agents, whereas the V2 pipeline would infer client addresses
only if the attribute had the value `{{auto}}` and never infer user
agents at all. The fix is simply to switch both the corresponding options
on when expanding standalone spans in the processor.
It also drive-by fixes a related problem in the V2 pipeline: in the
legacy pipeline, the `user_agent.original` field/attribute was backfilled
from the client UA, in the V2 pipeline it wasn't.
There was a problem hiding this comment.
This file contains a bunch of user agent changes in existing tests. This is because in the test I'm adding the user agent should be inferred to be Firefox/42.0, which is the default UA we need for testing. In order to be able to reuse the lcp_cls_inp_differences function, I decided to switch to that UA in all tests. If this is too disruptive I can also think of something else.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 54d30d0. Configure here.
| "environment": "prod", | ||
| "replay_id": "3d76a6311de149b9b3f560827ea0ecf9", | ||
| "transaction": "/insights/projects/", | ||
| **_if_dict(client_address_auto, {"client.address": "{{auto}}"}), |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1f3b966. Configure here.
| } | ||
| } | ||
| "#); | ||
| "###); |
There was a problem hiding this comment.
Stale user agent unit test
Medium Severity
normalize_user_agent now backfills user_agent.original from client info before the early return when browser.name / browser.version already exist, but test_normalize_user_agent_existing still expects no user_agent.original field. That snapshot will fail against the new behavior.
Reviewed by Cursor Bugbot for commit 1f3b966. Configure here.


There was a discrepancy between the legacy and V2 standalone span pipelines: the legacy pipeline would always infer client addresses and user agents, whereas the V2 pipeline would infer client addresses only if the attribute had the value
{{auto}}and never infer user agents at all. The fix is simply to switch both the corresponding options on when expanding standalone spans in the processor.It also drive-by fixes a related problem in the V2 pipeline: in the legacy pipeline, the
user_agent.originalfield/attribute was backfilled from the client UA, in the V2 pipeline it wasn't.ref: INGEST-946