Skip to content

feat(eap): Always infer UA and IP in V2 standalone span pipeline#6047

Open
loewenheim wants to merge 5 commits into
masterfrom
sebastian/ua-ip-inference
Open

feat(eap): Always infer UA and IP in V2 standalone span pipeline#6047
loewenheim wants to merge 5 commits into
masterfrom
sebastian/ua-ip-inference

Conversation

@loewenheim
Copy link
Copy Markdown
Contributor

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.

ref: INGEST-946

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.
@loewenheim loewenheim requested a review from a team as a code owner June 4, 2026 16:05
@linear-code
Copy link
Copy Markdown

linear-code Bot commented Jun 4, 2026

INGEST-946

@loewenheim loewenheim self-assigned this Jun 4, 2026
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ 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.

Comment thread relay-event-normalization/src/eap/mod.rs
Comment thread relay-event-normalization/src/eap/mod.rs
"environment": "prod",
"replay_id": "3d76a6311de149b9b3f560827ea0ecf9",
"transaction": "/insights/projects/",
**_if_dict(client_address_auto, {"client.address": "{{auto}}"}),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty cool.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ 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.

}
}
"#);
"###);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1f3b966. Configure here.

Comment thread relay-event-normalization/src/eap/mod.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants