elastic / apm-nodejs-http-client

**Moved to elastic/apm-agent-nodejs.** A low-level Node.js HTTP client for communicating with the Elastic APM intake API
MIT License
21 stars 30 forks source link

feat: Add APM Server version fetching and client.supportsKeepingUnsampledTransaction() #176

Closed trentm closed 2 years ago

trentm commented 2 years ago

This is to support the Node.js APM agent changing its behaviour based on the APM Server version. Specifically whether to send or drop unsampled transactions.

Refs: https://github.com/elastic/apm-agent-nodejs/issues/2455

trentm commented 2 years ago

The first commit here is a first stab that has the APM Server fetching retry if it fails on earlier attempts. IIUC the java agent does not retry (see https://github.com/elastic/apm-agent-java/blob/master/apm-agent-core/src/main/java/co/elastic/apm/agent/report/ApmServerHealthChecker.java). I think I am going to remove the retrying in the node.js agent, but I am not sure yet. If there are no retries, then if the APM Server happens to be down when the agent starts, then the agent will stay in a "degraded" state not knowing the APM server version. If this "degraded" state just assumes the latest APM Server version then that is perhaps fine, but it could mean not getting data to the (older) APM server version if there is a compat issue.

apmmachine commented 2 years ago

:green_heart: Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

#### Build stats * Reason: `null` * Start Time: 2022-01-25T23:33:24.385+0000 * Duration: 11 min 39 sec * Commit: fca8cf1063a481c8cb07caadb23dc9cf8b814ef9 #### Test stats :test_tube: | Test | Results | | ------------ | :-----------------------------: | | Failed | 0 | | Passed | 17206 | | Skipped | 0 | | Total | 17206 |

:robot: GitHub comments

To re-run your PR in the CI, just comment with:

trentm commented 2 years ago

elastic-apm-http-client@10.4.0 published v10.4.0 tagged