APM is not sending


(Oriol Val) #1

Hey everyone!

I have recently installed APM but my agents are not sending data to my APM server. I used the node.js installation, with: npm install elastic-apm-node --save. I have installed a server, and an agent in the directory of elasticsearch, so I hope that when it will be all well configured, I will be able to monitor elasticsearch service.

In setup instructions of Kibana, I check the server status and the agent status, and both are started and running.


I have configured the url of apm server in the section apm-server, and the url of kibana in setup.kibana, both in apm-server.yml.

In the agent, I added this code in index.js, at the top of it:
// Add this to the VERY top of the first file loaded in your app
var apm = require('elastic-apm-node').start({
_ // Override service name from package.json_
_ // Allowed characters: a-z, A-Z, 0-9, -, , and space
_ serviceName: 'elasticsearch',_

_ // Use if APM Server requires a token_
_ secretToken: '',_

_ // Set custom APM Server URL (default: http://localhost:8200)_
_ serverUrl: '<URL_APM_server>',_
})

When I start the server with ./apm-server -e -c apm-server.yml, the logs don't give me any error, it goes well, but I don't receive in Kibana any data of the services:


The time range in Kibana is well configured, because I have done some requests to elasticsearch with curl and I can't see this information here or in the dashboards.

Someone can help me?
Thank you so much.
Oriol Val.


(Ronald Tumulak) #2

It seems the connection from the APM server to Elasticsearch seems okay based on the status check above.

Have you tried sending a mock metric to the APM server and see if it is recorded in Elasticsearch?

Simulate an agent by trying to send a properly formatted metric to the APM server. Refer to the intake formats below: https://www.elastic.co/guide/en/apm/server/current/example-intakev2-events.html

I used Postman. If metrics are recorded then it is more likely the agent configuration that needs checking:

Sample payload
Target URL: http://your_apm_server:port/v1/transactions
Payload:
{
"service": {
"name": "mock_agent_service",
"agent": {
"name": "python",
"version": "1.0"
}
},
"transactions": [
{
"id": "786154c5-67a5-5426-8a4e-aa29efcca756",
"type": "request",
"duration": 13.226653
}
]
}


(Thomas Watson) #3

Hi Oriol

Thanks for trying out Elastic APM and the Node.js agent.

We have a section in our troubleshooting docs about this issue:
https://www.elastic.co/guide/en/apm/agent/nodejs/current/troubleshooting.html

Could I get you to read that and if nothing obvious comes to mind, try to enable debug mode and see if the logs might give away what's wrong.

/thomas


(Oriol Val) #4

Hey @digitalron!

Thank you for your reply.

I have tested but APM doesn't record the request.

Any more idea?

Thanks!


(Oriol Val) #5

Thanks @wa7son!

I have tested de debug mode too, but doesn't work.

The logs are all positive, there is none negative log.

What I should test more?

Thanks a lot!!


(Ronald Tumulak) #6

Have you tried doing a curl against ElasticAPM from the network where your applications are supposed to be sending metrics from? One thing I can think of is that ElasticAPM and Elasticsearch are in the same network and can see each other, but the agent is in a different network and cannot reach Elastic APM. If this is the case then a couple of whitelisting of IP addresses and ports may need to be done.


(Thomas Watson) #7

As @digitalron mentions, make sure that the app can access the APM Server and that the APM Server can access the Elasticsearch cluster. But if any of those components can't do that, you should see warnings in the logs (there were a bug in v2.0.0 of the agent, that would swallow that warning, bug in v2.0.1 this have been fixed).

Do you mind sharing the debug logs generated when your application responds to an incoming HTTP request? (Be sure to anonymize any personally identifiable information before sharing.)