elastic / elastic/apm-agent-nodejs

ensure metrics are flushed on shutdown

Open
#2,088 0 comments 1 reaction 0 assignees View on GitHub
agent-nodejs
Dominant language
JavaScript
Stars
594
Forks
244
Avg merge
1d 8h
Merged PRs (30d)
16

Description

https://github.com/elastic/apm/pull/444 is adding an APM spec requirement that the APM agent make an attempt to flush metrics on shutdown and/or provide an API so the user can explicitly flush metrics. (I think we should provide the API even if the agent attempts to do so automatically.)

Some notes:
- The http-client has a `process.once('beforeExit', ...` handler for its own graceful exit attempt. However, I don't believe the APM agent itself does.
- When adding this we should see about flushing metrics when exiting in `Agent.prototype.handleUncaughtExceptions`.
- As well, we should suggest the "flush the metrics now please" API in the doc section for `apm.handleUncaughtExceptions`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.