GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat(node): Add `useOperationNameForRootSpan` to`graphqlIntegration` by mydea · Pull Request #13248 · getsentry/sentry-javascript Conversation
|
| export function spanHasKind<SpanType extends AbstractSpan>(span: SpanType): span is SpanType & { kind: SpanKind } { | ||
| const castSpan = span as ReadableSpan; | ||
| return !!castSpan.kind; | ||
| return 'kind' in castSpan; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Noticed this was actually incorrect because this may be 0!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
size-limit report 📦
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Should we be concerned about transaction name cardinality here? This is a client-controlled field supporting arbitrary values. I'm not sure |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@mjq I would consider gql queries like these to be low cardinality. Why would you say this is hight cardinality? I think this is comparable to normal api route paths (?). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I agree - remember this is only using the operation name, not the query. So e.g. if your query is this: query MyQuery(id) { user(id): User } it would only capture |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@lforst @mydea If your only client is internal, it ought to be low cardinality and work well as a grouping mechanism. If it's a public API, every caller will use their own query names, meaning cardinality is effectively unbounded (and it seems less useful as a grouping mechanism since you don't control the grouping yourself). And every API is de facto a public API without further defence mechanisms 😅 The main differences from e.g. rest API URLs is that a well-configured SDK is immune to high cardinality no matter what a client sends, and a poorly-configured one can still have its cardinality reduced by our URL normalizer. It's fine if the answer is "no we shouldn't be concerned", and treat this as an unlikely hypothetical. We aren't forwarding the cardinality cost to users so e.g. malicious use only affects Sentry, not our users' wallets, and we're giving anyone with concerns an off switch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Ah, I see what you mean. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
There is one thing that needs addressing, otherwise lgtm!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| export function spanHasKind<SpanType extends AbstractSpan>(span: SpanType): span is SpanType & { kind: SpanKind } { | ||
| const castSpan = span as ReadableSpan; | ||
| return !!castSpan.kind; | ||
| return typeof castSpan.kind === 'number'; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
m: Quick explainer for this?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
sorry, had a comment here earlier but changed it again - this check was actually wrong, because this can be 0 which is valid, but we interpreted this as no kind before.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
707babf to
f71275c
Compare
|
I added a docs issue for this as this is not documented yet: getsentry/sentry-docs#12080 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Add graphql integration option to automatically rename root spans based ongraphql.operation.name
There was an error while loading. Please reload this page.