feature: Adds common transport for Client Awareness and Enhanced Client Awareness metadata#8503
Conversation
✅ Docs preview has no changesThe preview was not built because there were no changes. Build ID: 05f197fa31a2af92ca3f2058 |
This comment has been minimized.
This comment has been minimized.
1b34917 to
bfbb873
Compare
|
@apollographql/router-core, @bonnici - would love a review on this PR when you get a free moment please, thank you. |
...uter/src/configuration/snapshots/apollo_router__configuration__tests__schema_generation.snap
Show resolved
Hide resolved
...uter/src/configuration/snapshots/apollo_router__configuration__tests__schema_generation.snap
Show resolved
Hide resolved
...uter/src/configuration/snapshots/apollo_router__configuration__tests__schema_generation.snap
Show resolved
Hide resolved
bonnici
left a comment
There was a problem hiding this comment.
The changes look good to me, but from memory the reason we went with using request.extensions was to make it hard for people to modify the library name and version. Adding user-configurable options for deciding which header values to use for this seems to go against that goal. But if we've decided that this is the way we want to go, we should also update the docs here: https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/enabling-telemetry/usage-guides/client-id-enforcement
It wasn't necessarily to make it more difficult but rather that using HTTP headers and being on-by-default would have negative consequences for web applications re. CORS. All clients offer a way to disable sending the library values but use hard-coded values, so the only way for an app to modify the values would be to modify the request after it has been composed. This change now is to clean up the inefficient split sending methods in use today and support a couple recent use cases.
Thanks for the prompt about the docs. I'll get those updated. |
|
@bonnici, looking into the documentation now is making me question whether customers that choose to send client name and version via The section titled "Why enforce client reporting?" lists a few items and I'm not certain of where they are derived from: client field usage; traffic patterns; and operation-level observability. Do you know which of those are derived from traces vs. metrics? |
|
Putting this PR back into 'draft' while I update the documentation and figure out the trace report questions.. |
|
I'll need to look into this tomorrow. |
|
Not possible, see description. |
994fbc4 to
8ba33e8
Compare
26f0343 to
6c8a652
Compare
6c8a652 to
a1090a6
Compare
|
@bonnici - I've removed the client name/version handling from It would be great if you could please give this another quick glance over before I merge it - thanks. |
There was a problem hiding this comment.
Looks good! I tested a request with client name/version in headers on a router running locally and the name/version got set properly in the trace payload. If you want to check the dev data lake you should see a request for the QueryHeadersOnly operation with the library name and version set.
…nt Awareness metadata (#8503)
At the moment we have a split between two closely related features; the Client Awareness feature is activated through HTTP headers, whereas Enhanced Client Awareness is activated through
request.extensions. The long-term goal for these two has always been to enable a common transport for them. So that they can both be sent via HTTP headers, orrequest.extensions.This PR enables that:
TheThis cannot be done because of the timing of trace report generation and sending. The request extensions map is only available post-HTTP processing at which point the trace report has already started and the client identified, doing that in theenhanced_client_awarenessplugin now looks for client name/version and adds it to the request context and those values get sent off in the metrics report.enhanced_client_awarenessplugin is too late and breaks trace reports.telemetryplugin now looks for the library name/version, adds it to the request context, and those values get sent off in the metrics report.Checklist
Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.
Exceptions
Note any exceptions here
Notes
Footnotes
It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this. ↩
Configuration is an important part of many changes. Where applicable please try to document configuration examples. ↩
A lot of (if not most) features benefit from built-in observability and
debug-level logs. Please read this guidance on metrics best-practices. ↩Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions. ↩