Skip to content

Enable engine reporting in Lambda#1313

Merged
evans merged 9 commits into
version-2from
server-2.0/lambda-engine-reporting
Jul 10, 2018
Merged

Enable engine reporting in Lambda#1313
evans merged 9 commits into
version-2from
server-2.0/lambda-engine-reporting

Conversation

@evans

@evans evans commented Jul 9, 2018

Copy link
Copy Markdown
Contributor

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.

@ghost ghost added the ⛲️ feature New addition or enhancement to existing solutions label Jul 9, 2018
@evans evans requested a review from martijnwalraven July 9, 2018 06:43
@evans evans added this to the Release 2.0 milestone Jul 9, 2018
Comment thread docs/source/api/apollo-server.md Outdated
'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;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks backwards to me. Should it be if (!this.sendReportsImmediately)?

@evans evans merged commit e29f804 into version-2 Jul 10, 2018
@evans evans deleted the server-2.0/lambda-engine-reporting branch July 10, 2018 02:29
@khaledosman

Copy link
Copy Markdown

I don't see this in the documentation here https://www.apollographql.com/docs/apollo-server/api/apollo-server/ , am I missing something?

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

⛲️ feature New addition or enhancement to existing solutions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants