Skip to content

Conversation

adutra
Copy link
Contributor

@adutra adutra commented Oct 21, 2025

TracingFilter was lacking a proper test.

After discussing with @dimas-b on #2757 I decided to create a test to illustrate two things:

  • How the filter adds span attributes for the correlation ID and for the realm identifier;
  • How the filter honors any parent trace propagated via W3C Trace Context propagation.

snazy
snazy previously approved these changes Oct 21, 2025
@github-project-automation github-project-automation bot moved this from PRs In Progress to Ready to merge in Basic Kanban Board Oct 21, 2025
flyrain
flyrain previously approved these changes Oct 21, 2025
Copy link
Contributor

@flyrain flyrain left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @adutra !

Comment on lines 112 to 113
.containsEntry("rojo", "00f067aa0ba902b7")
.containsEntry("congo", "t61rcWkgMzE");
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: using variable or constant here? t61rcWkgMzE -> congoValue?

Suggested change
.containsEntry("rojo", "00f067aa0ba902b7")
.containsEntry("congo", "t61rcWkgMzE");
.containsEntry("rojo", spanId)
.containsEntry("congo", "t61rcWkgMzE");

dimas-b
dimas-b previously approved these changes Oct 21, 2025
Copy link
Contributor

@dimas-b dimas-b left a comment

Choose a reason for hiding this comment

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

The test code LGTM. My comment is more for discussion... I wonder if it might be preferable to move that to the dev ML 🤔

Map<AttributeKey<?>, Object> attributes = span.getAttributes().asMap();
assertThat(attributes)
.containsEntry(stringKey(TracingFilter.REALM_ID_ATTRIBUTE), "POLARIS")
.containsEntry(stringKey(TracingFilter.REQUEST_ID_ATTRIBUTE), "12345");
Copy link
Contributor

Choose a reason for hiding this comment

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

side note: my thinking was to reuse request ID from OTel (e.g. trace ID + span ID). Since we're moving towards "correlation", I think it makes sense to integrate with the existing OTel standard. In that case it should not be necessary to add REQUEST_ID_ATTRIBUTE to the span, but someone inspecting the response headers would be able to correlate them to the trace.

If OTel is present, what is the value of Polaris accepting / generating yet another request ID?

Are we considering the Polaris request ID as a first class feature of the protocol (REST API flowing into Events) as opposed to a "helper" or "observability" feature?

If OTel is not present, we can certainly generate a fresh request ID.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, let's move this conversation to the dev ML:

https://lists.apache.org/thread/bb1qyxjt827t3tomv2xp0s1kovxjsp94

@adutra adutra dismissed stale reviews from dimas-b, flyrain, and snazy via 402528f October 22, 2025 09:21
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.

4 participants