Enable engine reporting in Lambda#1313
Merged
Merged
Conversation
| 'sendReport()' on other signals if you'd like. Note that 'sendReport()' | ||
| does not run synchronously so it cannot work usefully in an 'exit' handler. | ||
|
|
||
| * `disableInterval`: boolean; |
Contributor
There was a problem hiding this comment.
Do we need to expose this on ApolloServer? I would expect it to be a setting that particular integrations (like the Lambda one) can turn on.
| // does not run synchronously so it cannot work usefully in an 'exit' handler. | ||
| handleSignals?: boolean; | ||
| // Disables reporting on an interval for stateless environments | ||
| disableInterval?: boolean; |
Contributor
There was a problem hiding this comment.
It seems clearer to me to turn this around, so instead of disableInterval maybe something like sendReportsImmediately.
| this.options.reportIntervalMs || 10 * 1000, | ||
| ); | ||
| this.sendReportsImmediately = options.sendReportsImmediately; | ||
| if (this.sendReportsImmediately) { |
Contributor
There was a problem hiding this comment.
This looks backwards to me. Should it be if (!this.sendReportsImmediately)?
|
I don't see this in the documentation here https://www.apollographql.com/docs/apollo-server/api/apollo-server/ , am I missing something? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the ability to report from a stateless environment by adding the option to disable the interval that the engine reporting agent uses.
Ideally there would be a way to determine when the lambda is spinning down and gracefully send a report, however a quick skim of the documentation does not illicit any nice hook. @adnsio if you have any advice, I'd love to hear your thoughts.