跳至内容

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.

已提问 1 年前335 查看次数

1 回答
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

已回答 1 年前

AWS
支持工程师

已审核 1 年前

  • 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

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。