elastic / elastic/apm-agent-nodejs

Only sends first batch of events to Elastic Agent on Deno

Open
#4,604 1 comment 0 reactions 0 assignees View on GitHub
community triage
Dominant language
JavaScript
Stars
594
Forks
244
Avg merge
1d 8h
Merged PRs (30d)
16

Description

I guess _Deno_ is not a supported platform but...
When running _apm-agent-nodejs_ (4.13.0) in _Deno_ (2.3.1) **I only get the transactions sent the first 10 seconds**.
When running _apm-agent-nodejs_ in _Node.js_ it works as expected.

Here is some meta code.

Before starting Deno I set (among others):
`export ELASTIC_APM_LOG_LEVEL=trace`

At the top of the file:
`import apm from "elastic-apm-node/start.js";`

I make a number of transactions in a loop as a test.
```
loop
const trans = apm.startTransaction
trans.addLabels
trans.end
```

Unfortunately I cannot get the full logs, but here is the essence of the _trace_ messages in _Node.js_ and _Deno_ where you can see the differences.

Node.js
```
_write: encode object
gzipStream "finish"
start intakeResTimer
gzipStream "end"
completePart gzipStream
intakeReq "finish"
completePart intakeReq
intakeReq "response"
intakeRes "end"
completePart intakeRes
timeline...

intake request start
_write: encode object
intakeReq "socket": unref it

```

Deno
```
_write: encode object
gzipStream "finish"
start intakeResTimer
gzipStream "end"
completePart gzipStream
intakeReq "response"
intakeRes "end"
completePart intakeRes

```

As you can see the `intakeReq "finish"`, `completePart intakeReq`, the timeline and the three last traces where the socket is unrefed are missing when running in Deno.

Any thoughts?

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.