Skip to content

CloudWatch RUM | Log Sending Issue from angular application

0

I am sending data to cloud watch Rum service from my angular application, only for few times it sends data after that it does not send any data, also does not call the dataplan api, I tired to setup the script in head section of html file and also in ngOninit the app component. I also tried to change the config values like sessionSampleRate set to 1 and others but still no impact. It only works when I change the script from html file to app component or move script from app component to main.ts file. Cannot understand this behavior, event the app does not send data after 1 day, when I close and restart the machine.

asked a year ago326 views

1 Answer
0

This issue with CloudWatch RUM not consistently sending data from your Angular application could be caused by several factors.

First, ensure that the CloudWatch RUM code snippet is correctly inserted in your application. The snippet should be placed inside the <head> element of your application, before the <body> element or any other <script> tags. For Angular applications, placing it in the head section of your index.html file is typically the best approach.

Since you mentioned that data is sent initially but then stops, there could be a few possible causes:

  1. Traffic generation: Make sure there's consistent traffic to your application. If there's no user activity, there might not be any data to send.

  2. Domain configuration: If you're using an actual domain name (not localhost), verify that the domain configured in your app monitor matches exactly with the domain where your application is running. Mismatches can cause 403 Forbidden errors.

  3. Permissions and configuration: Check that your IdentityPoolId and other configuration parameters are correct and have the necessary permissions.

  4. Network issues: The CloudWatch RUM web client periodically sends data to the CloudWatch RUM service. If there are network connectivity issues, this could prevent data from being sent.

  5. Application updates: If your Angular application undergoes updates or route changes, ensure the RUM code snippet remains active across these changes.

To troubleshoot further:

  • Check your browser's developer console for any error messages related to the CloudWatch RUM client
  • Verify that cookies are allowed if your configuration has allowCookies set to true
  • Consider monitoring the network requests in your browser's developer tools to see if the requests to the dataplane endpoint are being attempted but failing

If you've verified all these aspects and are still experiencing issues, you might need to regenerate your app monitor code snippet from the CloudWatch RUM console and reinstall it in your application.
Sources
Troubleshooting CloudWatch RUM - Amazon CloudWatch
CloudWatch RUM - Amazon CloudWatch
RUM App monitor with actual domain name throws 403 error | AWS re:Post
Inserting the CloudWatch app monitor code snippet into your application - Amazon CloudWatch

answered a year ago

AWS
SUPPORT ENGINEER

reviewed a year ago

  • I verify but there are no network calls to data plan api also there are no errors in console there should not be any configuration issues, as it sends data on first time load

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.