RUM Custom Metrics not appearing

0

I'm currently stuck trying to add custom RUM metrics.

I have the following MetricDefinition (output from aws rum batch-get-rum-metric-definitions --app-monitor-name MyAppMonitor --destination CloudWatch --region us-west-2)

{
            "EventPattern": "{\"event_type\": [\"report_download\"] }",
            "MetricDefinitionId": "<metric-definition-id>",
            "Name": "RecordsSize",
            "Namespace": "MyNamespace",
            "UnitLabel": "Size",
            "ValueKey": "event_details.count"
}

I can see those events in my RUM monitor e.g.

{
  "event_timestamp": 1698324351000,
  "event_type": "report_download",
  "event_id": "<event-id>",
  "event_version": "1.0.0",
  "log_stream": "2023-10-26T13",
  "application_id": "<application-id>,
  "application_version": "1.1081.0",
  "metadata": {  },
  "user_details": {
    "userId": "00000000-0000-0000-0000-000000000000",
    "sessionId": "<session-id>"
  },
  "event_details": {
    "count": 3
  }
}

But Im not seeing the Cloudwatch Metrics appear. I'd expect to see RUM/CustomMetrics/MyNamespace but it does not appear. Can anyone help?

Kieran
asked 6 months ago294 views
1 Answer
0

Cloudwatch RUM by default has 12 metrics that will be automatically send to the AWS/RUM namespace. These are listed here[1]. Furthermore, you can enable few additional metrics by using the 'Extended metrics' feature on the console. With this feature, you get another set of metrics that you may define as per your need. These metrics are listed here[2].


After configuration, the extended metrics will be sent to the CloudWatch with additional dimensions. For example, you may select 'HttpErrorCount' for all the Chrome users.

Please note that the metrics will only be sent when there is a related action (i.e. an HTTP error from a Chrome browser) else these metrics would not be visible on the console. However, as you reported, you are able to see the related events but not the metrics. I suspect that you are using a set of custom metrics in this use case.


For custom metrics defined in the RUM script, please make sure that the event pattern is defined without any errors and matches the actual event.

Additionally, you may choose to create a metric filter patterns that can count pattern matches in CloudWatch log streams, and even extract values from these event logs. Each log entry for a particular event type or any other event field can be converted into a metric using a metric filter. This will help you to create any custom metrics apart from the metrics already defined in the document [1][2][3]. Please feel free to refer to this documentation[4] for more details on the same.


I would also request you to reach out to the AWS support team via Support console with RUM app name and event/log group and RUM configuration details (i.e. pattern details and actual event) and we will investigate the same in detail.

Hope the information provided above is helpful. Have a great day ahead.


References:

[1] RUM default metrics: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-metrics.html

[2] RUM extended metrics: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-custom-and-extended-metrics.html#CloudWatch-RUM-vended-metrics

[3] Custom metrics: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-custom-and-extended-metrics.html

[4] Create Custom metrics using metric filters: https://aws.amazon.com/blogs/mt/create-metrics-and-alarms-for-specific-web-pages-amazon-cloudwatch-rum/

AWS
SUPPORT ENGINEER
answered 6 months ago

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.

Guidelines for Answering Questions