-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
feat(EAP): Trace Item resolvers #6732
base: master
Are you sure you want to change the base?
Conversation
3d283d7
to
07f5413
Compare
❌ 1 Tests Failed:
View the top 1 failed tests by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
class ResolverAttributeNames( | ||
TraceItemDataResolver[ | ||
TraceItemAttributeNamesRequest, TraceItemAttributeNamesResponse | ||
] | ||
): | ||
@classmethod | ||
def endpoint_name(cls) -> str: | ||
return "AttributeNames" | ||
|
||
|
||
class ResolverAttributeValues( | ||
TraceItemDataResolver[ | ||
TraceItemAttributeValuesRequest, TraceItemAttributeValuesResponse | ||
] | ||
): | ||
@classmethod | ||
def endpoint_name(cls) -> str: | ||
return "AttributeValues" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also implement resolvers for these in the future (subsequent PR)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely
Context
In order to make room for new kinds of TraceItems (e.g. uptime monitors, errors, logs, etc),add a layer of indirection to the RPC layer
Before:
After:
For rationale, please read this doc
How it works:
Every EAP endpoint has a
get_resolver
method based on theTraceItemName
passed in the request meta. A resolver has the same inputs and outputs as the RPCEndpoint.For each endpoint in EAP, there is a resolver class:
https://github.com/getsentry/snuba/pull/6732/files#diff-c018ef30d919d555c5e69908ce74e5f9144d613de3588a48d849f8c757b58628R22-R53
For each TraceItem we have, we implement the appropriate resolvers, this PR moves EndpointTraceItemTable and EndpointTimeSeries implementations for EAP spans into resolver implementations.
Resolvers are picked up automatically if they follow the directory structure:
Implementing resolver classes in these directories will ❇️ just work ❇️ without needing to change endpoint code.
Outstanding things
It's not clear yet what is really "common" and what is not. We will figure this out through the course of doing this work