APM Configuration

Hi,
I have installed a new apm server with the following configurations,
APM Server - http://my-apmserver:8200

The APM Agent is node.js and added the following to the first file that is loaded in my application.

module.exports = {
  // Set required service name (allowed characters: a-z, A-Z, 0-9, -, _, and space)
  serviceName: '',

  // Use if APM Server requires a token
  secretToken: '',

  // Set custom APM Server URL (default: http://localhost:8200)
  serverUrl: 'http://my-apmserver:8200'
}

I have not provided any service name in the code.
And started the apm.ES and application.
But my Kibana APM dashboards are empty. Nothing gets populated in the dashboards.
Is there anything iam missing?
Request to advise!

Thanks

Hi!

Thanks for trying Elastic APM! You are indeed missing the serviceName, that is a required parameter so then you can see your service in Kibana.
You might observe that APM Server is returning 400 response codes to your app because of that.

Also check out the documentation, hopefully it can point you to the right direction, specifically: https://www.elastic.co/guide/en/apm/server/master/common-problems.html

Hope this helps!

1 Like

Thanks @jalvz!
I have already provided the service name and changed the agent type to JS and done accordingly.
The developers are analyzing the code and later I will update.

Thanks

Hi @jalvz ,
I had configured the APM server and added the agents. The apm server is getting prompted with the following error in the logs.
Request to advise,

beater/beater.go:172 self instrumentation is disabled
2018-08-27T12:40:02.253+0530 INFO [handler] beater/handlers.go:161 Path /v1/rum/sourcemaps added to request handler
2018-08-27T12:40:02.253+0530 INFO [handler] beater/handlers.go:161 Path /v1/transactions added to request handler
2018-08-27T12:40:02.253+0530 INFO [handler] beater/handlers.go:161 Path /v1/client-side/transactions added to request handler
2018-08-27T12:40:02.253+0530 INFO [handler] beater/handlers.go:161 Path /v1/errors added to request handler
2018-08-27T12:40:02.254+0530 INFO [handler] beater/handlers.go:161 Path /v1/client-side/errors added to request handler
2018-08-27T12:40:02.254+0530 INFO [handler] beater/handlers.go:161 Path /v1/rum/errors added to request handler
2018-08-27T12:40:02.254+0530 INFO [handler] beater/handlers.go:161 Path /v1/metrics added to request handler
2018-08-27T12:40:02.254+0530 INFO [handler] beater/handlers.go:161 Path /v1/rum/transactions added to request handler
2018-08-27T12:40:02.254+0530 INFO [handler] beater/handlers.go:161 Path /v1/client-side/sourcemaps added to request handler
2018-08-27T12:40:02.280+0530 INFO [server] beater/server.go:69 Starting apm-server [59fbf0b6146ca5c50a94d1c435d0cf704e5b2a3f built 2018-08-17 22:13:22 +0000 UTC]. Hit CTRL-C to stop it.
2018-08-27T12:40:02.280+0530 INFO [server] beater/server.go:70 Listening on: my-apm--server:8200
2018-08-27T12:40:02.280+0530 INFO [server] beater/server.go:75 RUM endpoints disabled
2018-08-27T12:40:02.281+0530 INFO [request] beater/handlers.go:282 handled request {"request_id": "2cfa7ce7-0ca5-4776-a3ee-a032a15c92e0", "method": "GET", "URL": "/healthcheck", "content_length": 0, "remote_address": "x.x.x.x", "user-agent": "Go-http-client/1.1", "response_code": 200}
2018-08-27T12:40:02.281+0530 INFO [http_client] beater/client.go:49 HTTP Server ready
2018-08-27T12:40:02.281+0530 INFO [onboarding] beater/onboarding.go:36 Publishing onboarding document
2018-08-27T12:40:03.323+0530 INFO elasticsearch/client.go:708 Connected to Elasticsearch version 6.4.0
2018-08-27T12:40:03.430+0530 INFO template/load.go:82 Loading template for Elasticsearch version: 6.4.0
2018-08-27T12:40:04.857+0530 INFO template/load.go:145 Elasticsearch template with name 'apm-6.4.0' loaded
2018-08-30T12:25:15.380+0530 ERROR [request] beater/handlers.go:452 error handling request {"request_id": "80bcc8b8-dd5b-465e-9f00-7f1f532edd10", "method": "OPTIONS", "URL": "/v1/client-side/errors", "content_length": 0, "remote_address": "", "user-agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36", "response_code": 403, "error": "forbidden request: endpoint is disabled"}

Thanks

It looks like you try to use the RUM endpoint, which is disabled by default. You can enable it by setting apm-server.rum.enabled: true in your configuration file apm-server.yml. Find more information about setting up RUM.

Thanks @simitt!
I missed that doc! Thanks. Its working now! But I am having a sourcemap error!

failed to apply sourcemap Sourcemap Key Error for Service Name: 'APM_REG_TEST', Service Version: '' and Path: ''
2018-08-30T13:02:21.402+0530 ERROR [stacktrace] model/stacktrace_frame.go:219 Sourcemap Key Error for Service Name: 'APM_REG_TEST', Service Version: '' and Path: ''

Request to advise!

Have you uploaded the according sourcemap? It looks like the stacktrace frame cannot be mapped to any sourcemap. Please see how you can upload sourcemaps and how sourcemaps get applied.

Let me know if that helps.

Hi @simitt,
Thanks for the reply.
Still having a little doubt about the sourcemaps.
From my understanding please find the points,
So the sourcemaps will be different for each applications!
For each applications we will require to upload the respective mapping to the apm server!
The source map is a pure thing that is related with the backend development of the aplication !

Once the source map is uploaded into the apm server, it automatically checks for the uploaded data and the logs shiped from the aplpication !

Request to correct if iam wrong!
Thanks in advance

@vishnuduttpv, if you want a source map to be applied, you first need to upload it. The combination of the service_name, service_version and bundle_filepath build the unique id for a source map. This means you need to upload a source map per service (app) version and file path.

In case no source map is found for a stacktrace frame, the data are still ingested, just without source mapping being applied.

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.