Observability Engineer 7.9 - Lab 5.4 unable to get petclinic-react to appear

Course: Elastic Observability Engineer
Version: 7.9
Question:
I have not been successful with getting petclinic-react to appear in the list of Services in APM.

I can get the other three services to appear fine in APM and provide me with data.

I have redone all the parts of Lab 5 to make sure I haven't missed anything, as well as disconnecting from Strigo for an hour and reconnecting just incase it was an issue with the AWS instance I was on. However no matter what I do, I still don't get petclinic-react to appear even though apm-server does say RUM endpoints are enabled and restarting node.js on petclinic-client reports no errors after changing the apm_server_js location.

Here's a copy of my config.js from the petclinic-client server:

[elastic@petclinic-client server]$ cat config.js 


var config = {
  apm_server: process.env.ELASTIC_APM_SERVER_URL || 'http://apm-server:8200',
  apm_server_js: process.env.ELASTIC_APM_SERVER_JS_URL || 'http://ec2-3-250-38-36.eu-west-1.compute.amazonaws.com:8200',
  apm_service_name: process.env.ELASTIC_APM_SERVICE_NAME || 'petclinic-node',
  apm_client_service_name: process.env.ELASTIC_APM_CLIENT_SERVICE_NAME || 'petclinic-react',
  apm_service_version: process.env.ELASTIC_APM_SERVICE_VERSION || '1.0.0',
  api_server: process.env.API_SERVER || 'http://petclinic-server:8000',
  api_prefix: process.env.API_PREFIX || '/petclinic/api',
  address_server: process.env.ADDRESS_SERVER || 'http://address-finder:5000',
  distributedTracingOrigins: process.env.DISTRIBUTED_TRACINGS_ORIGINS || 'http://petclinic-client:4000,http://petclinic-server:8000,http://localhost:4000,http://localhost:8080,http://localhost:8081'
}

Here's the part in start up of the apm-server app showing RUM endpoints are enabled:

2023-03-28T03:04:49.942Z INFO [beater] beater/http.go:87 RUM endpoints enabled!

Hi @deccman ,

did you try using the Dynamic DNS in the apm_server_js setting? When your machine restarts you get a different Public DNS and maybe that's the reason why you're not getting any data.

Best,
Andre

Hi Andre,

I made sure I updated the address each time I restarted the Strigo session. The lab instructions
also shows the updated AWS address as well.

I also tried just leaving the apm_server_js line set to http://apm-server:8200 but that did nothing.

Cheers

Hi @deccman ,

did you set apm-server.host to 0.0.0.0:8200 in apm-server.yml ?

Also, when your machine is restarted you need to restart the apm-server.

You can use this command in the apm-server container to check whether it is running:

ps aux | grep apm

You should see something like this:

elastic    138  1.3  0.1 887628 64176 pts/2    Sl+  12:51   0:00 ./apm-server -e
elastic    180  0.0  0.0  12536  2332 pts/3    S+   12:52   0:00 grep --color=auto apm

If you don't see the apm-server line you should restart it.

You can also use the Developer Tools in your browser to check why PetClinic cannot access the APM Server.

Best,
Andre

Hi @Andre_Murbach_Maidl

My apologises for taking so long to get back to you.

I have the apm server host set to 0.0.0.0:8200. I have confirmed that apm-server is running when I do a ps -aux check

I have had a co-worker who has completed the training and done the exam to double check my config settings on both the apm-server and petclinic-client and found no issues there.

I don't know much about Developer Tools (I'm using Chrome). How do I use that to find out why the petclinic website isn't communicating with the apm server?

Cheers,

Declan

hi @deccman ,

in Chrome you can click on the three dots next to the profile picture, select More Tools and then access Developer Tools. This will open a console in your Chrome browser. After that you can access PetClinic and see if any errors appear in the console. That will make it easier to understand what might be the issue.

Best,
Andre

Hi @Andre_Murbach_Maidl

I have taken a screenshot of the error that I get with the Petclinic server and APM.

I have done some Googling but can't really find why there's an error here.

I have made sure I have the latest Amazon AWS server listed in the config.js on the PetClinic Client

Cheers,
rum-error

Hi @deccman ,

did you enable the RUM endpoint by setting apm-server.rum.enabled: true in apm-server.yml?

Best,
Andre

Hi @Andre_Murbach_Maidl ,

I have made sure each time on the apm-server before I start the actual service that apm-server.yml has got RUM enabled in it. I have attached two screenshots of the setting in the yaml file as well as the apm server startup showing RUM is running.

Cheers,


Hi @deccman ,

are you accessing PetClinic using HTTP or HTTPS? Please make sure you use HTTP, otherwise you might have problems. Please also check if you don't have any white spaces in your config.js.

If you still have issues, please send me a DM with your Public DNS, so I can take a look.

Best,
Andre

I found out what the issue was - the Adblocker I was using in all my browsers was breaking the communication between the the PetClinic website and the APM server

This Stack Overflow link has the answer:

Disabling the Ad Blocker for that page has allowed petclinic-react to work. Running the site in an incognito/private session browser window also works.

Thanks for the update @deccman.

It's good to know what was causing the issue.

Best,
Andre

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