Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

GraphQL performance spec #1001

Merged
merged 12 commits into from
Jul 27, 2023
Merged

GraphQL performance spec #1001

merged 12 commits into from
Jul 27, 2023

Conversation

marandaneto
Copy link
Contributor

No description provided.

@vercel
Copy link

vercel bot commented Jul 24, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
develop ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 27, 2023 9:29am


If there are hooks available and the transport layer is also instrumented (e.g. Apollo Interceptors for GraphQL and Spring), the SDK should give preference to the layer that has more information and void creating duplicate transactions/spans, or merge the information, if possible.

Changes in the product may be necessary, e.g. if `request.api_target` is set to `graphql`, the `request.data` and `contexts.response.data` should do syntax highlighting.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is probably a TODO, @malwilley did the implementation for errors, we could reuse the code for performance.

src/docs/sdk/features.mdx Outdated Show resolved Hide resolved
src/docs/sdk/features.mdx Outdated Show resolved Hide resolved
src/docs/sdk/features.mdx Outdated Show resolved Hide resolved

Spans should be created for [resolvers](https://www.apollographql.com/docs/apollo-server/data/resolvers/), if possible.

Spans should be created for [data loaders](https://graphql.org/learn/best-practices/#server-side-batching-caching/), if possible.
Copy link
Member

Choose a reason for hiding this comment

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

Assuming we add keys used as input for the data loader. How do we serialize non primitive keys that could bloat events?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@adinauer I'd fall back to .toString as best effort.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds OK but could still bloat if the language simply puts everything into toString() - so something to be aware of.

For Java it's a compromise between risking bloat (just put the objects in the breadcrumb and let serialization handle it) and having useless data like MyClass@12345 (by using toString). Let's go with toString for now. We can always change if we come up with something better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@adinauer maybe the best decision is to not add such values then, risking the event to be dropped or having useless data does not feel good.

Copy link
Member

@adinauer adinauer Jul 27, 2023

Choose a reason for hiding this comment

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

I think there are cases where this data is very valuable. The useless toString output only applies to complex keys. For simple keys it should be fine. So I vote for adding keys.

Edit: should probably mention in docs that toString should be implemented for complex key objects.

src/docs/sdk/features.mdx Outdated Show resolved Hide resolved
src/docs/sdk/features.mdx Outdated Show resolved Hide resolved
src/docs/sdk/features.mdx Show resolved Hide resolved
marandaneto and others added 5 commits July 26, 2023 14:40
Co-authored-by: Alexander Dinauer <adinauer@users.noreply.github.com>
Co-authored-by: Alexander Dinauer <adinauer@users.noreply.github.com>
Co-authored-by: Alexander Dinauer <adinauer@users.noreply.github.com>
Co-authored-by: Alexander Dinauer <adinauer@users.noreply.github.com>
Co-authored-by: Alexander Dinauer <adinauer@users.noreply.github.com>
@krystofwoldrich
Copy link
Member

I have two questions where I would not be sure how to implement it if I would. Otherwise, it's clear and understandable to me. 👍

Copy link
Member

@kahest kahest left a comment

Choose a reason for hiding this comment

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

added some questions/suggestions - pretty clear to me otherwise, thanks @marandaneto 👍

src/docs/sdk/features.mdx Show resolved Hide resolved
src/docs/sdk/features.mdx Outdated Show resolved Hide resolved
src/docs/sdk/features.mdx Outdated Show resolved Hide resolved
Copy link
Member

@adinauer adinauer left a comment

Choose a reason for hiding this comment

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

LGTM :shipit:

@marandaneto marandaneto merged commit 5147a29 into master Jul 27, 2023
4 checks passed
@marandaneto marandaneto deleted the choregraphql-performance branch July 27, 2023 09:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants