elastic / elastic/apm-agent-nodejs

[META 693] Send logs through APM Agents

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

Description

See meta issue and spec for the description and details:
- Meta issue: https://github.com/elastic/apm/issues/693
- Spec issue: https://github.com/elastic/apm/issues/694

---

**Describe the bug**

I am trying to do a simple NodeJS proof-of-concept app for a customer to showcase the NodeJS APM on Elastic Cloud, I have tried setting it up following the guide - https://www.elastic.co/guide/en/apm/agent/nodejs/current/express.html

I am able to get metrics but no logs are flowing in:
![image](https://user-images.githubusercontent.com/5335756/186064633-4f7e520e-3a95-4cb1-aeb5-4de8ba4ee79e.png)
![image](https://user-images.githubusercontent.com/5335756/186064643-a31bbefb-cf82-4746-864d-3a9b95e21dad.png)

Also, I have included my code too as well the command line terminal, set to debug mode ...I created a dummy "Error" but this is not being captured in the logs or metrics as well:
![image](https://user-images.githubusercontent.com/5335756/186064687-6b6e1e5f-c732-46c4-ae0c-b85b68bc15ed.png)
![image](https://user-images.githubusercontent.com/5335756/186064697-ec6092ba-a8ed-45b7-8c63-fad74be8a6cf.png)

Included the package.json file too as well as the live output on the actual libraries being used, in case it helps to shed more light on the issue:
![image](https://user-images.githubusercontent.com/5335756/186064725-87e03969-c342-4420-802c-eaf3082e7df3.png)
![image](https://user-images.githubusercontent.com/5335756/186064733-052296bc-790f-4952-8d1e-2bb805c3b579.png)

The customer has tried also and is experiencing the same issue with their own proof-of-concept app on their end :disappointed:
Would anyone happen to have any guidance on making this work? (i.e. Logs are not being sent back / no logs data received)

**To Reproduce**
See above screenshots

**Expected behaviour**
It should report logs back but it is not reporting any logs back. On the bright side, metrics are being reported back.

**Environment (please complete the following information)**

- OS: MacOS M1 Montery
- Node.js version: v18.6.0
- APM Server version: v8.3.3
- Agent version: v3.38.0

**How are you starting the agent? (please tick one of the boxes)**
(Please see the screenshot provided)

- [✅ ] Calling `agent.start()` directly (e.g. `require('elastic-apm-node').start(...)`)
- [ ] Requiring `elastic-apm-node/start` from within the source code
- [ ] Starting node with `-r elastic-apm-node/start`

**Additional context**
See above screenshots

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.