1 minute initial 'load' with RUM/js agent 1.0 and APM server 6.4

I have setup a 6.4 APM server for testing RUM with the javascript code. I am testing this on an Atlassian Confluence instance using it's Custom HTML feature to load and initialize RUM.

My apm-server.yml looks like this (removed the comments). I have both frontend and rum in the config under apm-server as documentation said it should be rum but the reference config file only shows frontend:
apm-server:

  host: "0.0.0.0:8200"

  frontend:
    enabled: true
    rate_limit: 100000
    allow_origins: ['*']
    library_pattern: "node_modules|bower_components|~"
    exclude_from_grouping: "^/webpack"
    source_mapping.cache.expiration: 5m
    source_mapping.index_pattern: "apm-*-sourcemap*"
 
  rum:
    enabled: true
    rate_limit: 100000
    allow_origins: ['*']
    library_pattern: "node_modules|bower_components|~"
    exclude_from_grouping: "^/webpack"
    source_mapping.cache.expiration: 5m
    source_mapping.index_pattern: "apm-*-sourcemap*"

  ssl.enabled: true
  ssl.certificate : "D:/Applications/Elastic/APM-Server/vanderlande.com.pem"
  ssl.key : "D:/Applications/Elastic/APM-Server/vanderlande.com.key"

setup.template.settings:

  index:
    number_of_shards: 1
    codec: best_compression

setup.kibana:

  host: "srv02182.vi.corp:5601"

output.elasticsearch:
  hosts: ["srv02182.vi.corp:9200"]

  indices:
    - index: "apm-%{[beat.version]}-sourcemap"
      when.contains:
        processor.event: "sourcemap"

    - index: "apm-%{[beat.version]}-error-%{+yyyy.MM.dd}"
      when.contains:
        processor.event: "error"

    - index: "apm-%{[beat.version]}-transaction-%{+yyyy.MM.dd}"
      when.contains:
        processor.event: "transaction"

    - index: "apm-%{[beat.version]}-span-%{+yyyy.MM.dd}"
      when.contains:
        processor.event: "span"

The code I put in the Custom HTML for Confluence:
elasticApm.init({
serviceName: 'vikipedia-acc',
serverUrl: 'https://elastic-apm.vanderlande.com:8200',
})

I am seeing Page Load data on this service so connection seems to be working. However the first time I access the application in a new session (browser restart or new tab) the js file loads in 24ms but than the initialization (presumably) takes 1 minute. Subsequent actions on the application do not show this 'delay'.

Here is a screenshot from the client
elastic-apm-initial-load

What could be causing this (what seems like a timeout somewhere). How could I troubleshoot this?

Hi Peter,

Thanks for using Elastic APM.
The correct configuration (for 6.4+) is rum therefore frontend section can be removed. The apm-server.yml file is updated to use rum in the configuration as of 6.4 release. Would you please report the name of the file that has the wrong frontend section so we can fix it?

The load time that is shown in the networks panel of the dev tools is purely for fetching the JavaScript file, you can see the breakdown of time spent on different phases of the download by hovering the mouse over the bar under the waterfall column. You can find a detail explanation of timing breakdown phases here.
In your case the blue bar is "Content Download" which means the browser is receiving the content of the file (15.3 KB in size). A number of factors can cause this slowness in downloading the content, including the content provider and network situations.

As a side note, very little synchronous code execution happens during the initialisation process and it's mostly used for registering event listeners and create service objects.

I hope this helps. Let me know if you have more questions.

Cheers,
Hamid

Hi Hamid,

It seems somehow Tomcat/Confluence was causing this 1 minute delay. Why it did so I still do not know. For now I have just setup an apache server that only hosts the RUM js file and it is now loaded in 12ms into the application.

The frontend stuff was in a apm-server.reference.yml which shipped with APM server 6.3.2 and was still in my APM server working directory as it is no longer shipped with the 6.4.0 release. Although such a reference file is quite useful it is not really an issue on the current release.

Thanks for your help! I'll dive into RUM a bit further now this hurdle has been overcome.

Cheers,
Peter

Glad to know that it works now.
I'm looking forward to hear your feedback.

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