elasticApm not sending data

Kibana version: 7.6.1

Elasticsearch version: 7.6.1

APM Server version: 7.6.1

Browser version: chrome, Version 80.0.3987.149 (Official Build) (64-bit)

Original install method (e.g. download page, yum, deb, from source, etc.) and version: brew

Fresh install or upgraded from other version? fresh

I am not getting any data in APM-agent for my vagrant machine. first, I have tried with given example in documentation and then I created one single file in both cases I got data,

but my actual requirement is to setup this in vagrant box. so I have written an RUM agent with HTML configuration.

     <script>
        elasticApm.init({
            serviceName: 'osett',
            serverUrl: 'http://127.0.0.1:8200/',
            serviceVersion: '0.90'
        })
    </script>

in this case, if I console the "elasticApm" object, I am getting a JSON which tells "_initialized: true"

{
	"_disable":false,
	"serviceFactory":{
		"_serviceCreators":{

		},
		"_serviceInstances":{
			"PatchUtils":{
				"globalState":{
					"fetchInProgress":false
				},
				"XHR_IGNORE":"__apm_symbol__xhrIgnore",
				"XHR_SYNC":"__apm_symbol__xhrSync",
				"XHR_URL":"__apm_symbol__xhrURL",
				"XHR_METHOD":"__apm_symbol__xhrMethod"
			},
			"Utils":{

			},
			"ConfigService":{
				"config":{
					"serviceName":"osett",
					"serviceVersion":"0.90",
					"environment":"",
					"agentName":"js-base",
					"agentVersion":"4.0.0",
					"serverUrl":"http://127.0.0.1:8200/",
					"serverUrlPrefix":"/intake/v2/rum/events",
					"active":true,
					"debug":false,
					"logLevel":"warn",
					"browserResponsivenessInterval":500,
					"browserResponsivenessBuffer":3,
					"checkBrowserResponsiveness":true,
					"groupSimilarSpans":true,
					"similarSpanThreshold":0.05,
					"capturePageLoad":true,
					"ignoreTransactions":[

					],
					"errorThrottleLimit":20,
					"errorThrottleInterval":30000,
					"transactionThrottleLimit":20,
					"transactionThrottleInterval":30000,
					"transactionDurationThreshold":60000,
					"queueLimit":-1,
					"flushInterval":500,
					"sendPageLoadTransaction":true,
					"serverStringLimit":1024,
					"distributedTracing":true,
					"distributedTracingOrigins":[

					],
					"distributedTracingHeaderName":"elastic-apm-traceparent",
					"transactionSampleRate":1,
					"context":{

					},
					"platform":{

					}
				},
				"defaults":{
					"serviceName":"",
					"serviceVersion":"",
					"environment":"",
					"agentName":"js-base",
					"agentVersion":"4.0.0",
					"serverUrl":"http://localhost:8200",
					"serverUrlPrefix":"/intake/v2/rum/events",
					"active":true,
					"debug":false,
					"logLevel":"warn",
					"browserResponsivenessInterval":500,
					"browserResponsivenessBuffer":3,
					"checkBrowserResponsiveness":true,
					"groupSimilarSpans":true,
					"similarSpanThreshold":0.05,
					"capturePageLoad":true,
					"ignoreTransactions":[

					],
					"errorThrottleLimit":20,
					"errorThrottleInterval":30000,
					"transactionThrottleLimit":20,
					"transactionThrottleInterval":30000,
					"transactionDurationThreshold":60000,
					"queueLimit":-1,
					"flushInterval":500,
					"sendPageLoadTransaction":true,
					"serverStringLimit":1024,
					"distributedTracing":true,
					"distributedTracingOrigins":[

					],
					"distributedTracingHeaderName":"elastic-apm-traceparent",
					"transactionSampleRate":1,
					"context":{

					},
					"platform":{

					}
				},
				"_changeSubscription":{
					"subscriptions":[
						null
					]
				},
				"filters":[

				]
			},

.................
.................

],
"isHardNavigation":true,
"browserResponsivenessCounter":6,
"context":{
	"page":{
		"referer":"https://telesales.dev.dynacommerce.io/agent/account/login/",
		"url":"https://telesales.dev.dynacommerce.io/"
	}
}
},
"_subscription":{
	"subscriptions":[
		null
	]
},
"_alreadyCapturedPageLoad":true
},

................
................

"_alreadyCapturedPageLoad":true
}
}
},
"initialized":true
},
"_initialized":true
}

BUT, i can not see agent "osett" in kibana.

Hi @inandi,

Thanks for using the RUM agent and the details. Could you enable the debug logs in the agent and check if the agent is successfully creating the transactions/errors?

logLevel: debug - https://www.elastic.co/guide/en/apm/agent/rum-js/current/configuration.html#log-level

Thanks,
Vignesh

@vigneshshanmugam thank you for early reply :slight_smile: after adding your suggestion

    <script>
        elasticApm.init({
            serviceName: 'osettrr2',
            serverUrl: 'http://192.168.1.4:8200',
            serviceVersion: '0.90',
            logLevel: 'debug'
        })
    </script> 

but I am not sure, what happened!!! I didn't get anything different.

@inandi Once you have the logLevel: 'debug' , you would be able to see debug logs on the browser console. If you are not seeing it, then you might need to use the bundle with NODE_ENV set to development as debug logs are only enabled for dev builds.

You can use this script - https://github.com/elastic/apm-agent-rum-js/releases/download/%40elastic%2Fapm-rum%405.0.0/elastic-apm-rum.umd.js

More details here - https://www.elastic.co/guide/en/apm/agent/rum-js/current/install-the-agent.html#using-production-build

Also, could you please check if the agent is sending the events to the APM server? You can see this from the developer tools network tab.

Thanks,
Vignesh

only when first time i reload the page, it calls the event. but it shows "provisional header are shown"

I hope this is what you are asking here. I will do the rest you mentioned in your comment. thanks for your help !!!!

@inandi From the request, It seems like the payload is being sent to the APM server, I would do two things here

  • Check APM server logs for any errors.
  • Use the latest RUM agent version which is 5.0.0. Saying because you might be using an incompatible version of RUM agent against APM server.

https://www.elastic.co/guide/en/apm/agent/rum-js/current/upgrade-to-v5.html#v5-upgrade-server

Thanks,
Vignesh

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