-
Notifications
You must be signed in to change notification settings - Fork 103
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
chore(rfc): Extend core module system to support metrics #1130
base: dustin/eng-5535-create-an-rfc
Are you sure you want to change the base?
chore(rfc): Extend core module system to support metrics #1130
Conversation
eda719a
to
0efb9d1
Compare
0efb9d1
to
d091eab
Compare
d091eab
to
d083bff
Compare
@@ -235,21 +251,6 @@ type ApplicationErrorHook interface { | |||
OnAppError(err error) | |||
} | |||
|
|||
// TelemetryHooks are called when a span is created |
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.
👍 I wasn't a fan of it either. I think we can solve this with generic hooks and let the developer decide what to do at this time.
} | ||
|
||
type GraphQLOperationPlanHook interface { | ||
// OnPlan is called when an operation is planned | ||
type GraphQLOperationPostNormalizeHook interface { |
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.
I like the pre/post capabilities.
return nil | ||
} | ||
|
||
func (m *MyModule) OnRouterResponse(res *core.RouterResponse, err error) error { |
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.
The use case would be covered but I'm still not happy how data is shared across hooks. I think it can become cumbersome, if you have to use the context api. It would be great to have an API to hook into pre/post without the need to share data.
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Motivation and Context
It extends the open core module system RFC to enable custom metric modules.
New findings need to be discussed:
Added one example use case.
TODO