Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide request signature calculated by usage plugin in context #4558

Closed
theJC opened this issue Jan 27, 2024 · 6 comments · Fixed by #4864
Closed

Provide request signature calculated by usage plugin in context #4558

theJC opened this issue Jan 27, 2024 · 6 comments · Fixed by #4864
Assignees

Comments

@theJC
Copy link
Contributor

theJC commented Jan 27, 2024

Is your feature request related to a problem? Please describe.
The instrumentation required by our company leverages the exact same operation signature as generated by the UsageReporting plugin and exposed on the span as apollo_private.operation_signature via plugins/telemetry/mod.rs

Describe the solution you'd like
Please provide the ability to expose and make available the string representation of the operation via the context

Describe alternatives you've considered
We have considered repeating the operation signature calculation (and caching) a second time in our own plugin code.... this will add additional processing and memory overhead that we do not want to incur in Router.

Additional context
Currently these fields are available in the context:
operation_name
operation_kind

so something like operation_signature seems like a candidate key to make available via the context.

@o0Ignition0o
Copy link
Contributor

Hi, thanks for opening this issue!

We introduced the context's apollo_operation_id in #3586.

It behaves the same as operation signature, and is used in studio as well:

https://studio.apollographql.com/graph/<your_graph_variant>/variant/<your_graph_variant>/operations?query=<apollo_operation_id>

Would this fit your usecase?

@theJC
Copy link
Contributor Author

theJC commented Jan 29, 2024

Unfortunately not --- that is not the same as operation signature, its a hash of the operation signature.

We require the actual signature itself for our own observability purposes -> we want acces to the value usage_reporting.stats_report_key, not stats_report_key_hash(usage_reporting.stats_report_key.as_str())

let _ = response.context.insert(
"apollo_operation_id",
stats_report_key_hash(usage_reporting.stats_report_key.as_str()),

@lrlna
Copy link
Member

lrlna commented Feb 5, 2024

We are making some changes to the operation signature soon, and we'd want to wait for those to land before we expose this API.

@theJC
Copy link
Contributor Author

theJC commented Feb 7, 2024

Q: Double checking for planning purposes..... will the resulting signature for the same query in Apollo Gateway and Apollo Router still stay the same, its just more about the implementation details thats changing?

@bonnici
Copy link
Contributor

bonnici commented Mar 26, 2024

It will be the same signature and "Apollo operation ID".

@Geal
Copy link
Contributor

Geal commented Mar 27, 2024

after discussion, it appears this won't be blocked by the operation signature changes, so I'm opening a PR to make it available in #4864

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants