Datadog collects Real User Monitoring (RUM) events from browser and mobile RUM SDKs that you can use to build a quick graph and compute performance indicator metrics such as Apdex.
To compute your Apdex score, you can use service monitoring from APM or user monitoring data from the RUM SDKs. This guide provides instructions on computing Apdex for an application with RUM data and the Query Value widget in a Quick Graph.
Events from your application are available in Datadog.
Compute an Apdex score
The example below calculates an Apdex score using the Largest Contentful Paint performance metric from RUM events, and a hypothetical threshold of T = 2 sec. The minimum frustrating latency is 4T = 8 sec. The resulting value is shown in a Query Value widget quick graph that you can export to dashboards or notebooks.
Create a quick graph
Navigate to Dashboards > Quick Graph.
Create three RUM queries:
Query a for all satisfying page loads (RUM views where Largest Contentful Paint takes less than 2 seconds to load).
Query b for all tolerated page loads (RUM views where Largest Contentful Paint takes less than 8 seconds to load).
In the Formula field, enter the Apdex formula (a + 0.5 * b) / c.
Under Select a visualization, click Query Value. A query value widget appears.
In the time frame selector, select Past 1 Day. By default, the widget displays in Global Time.
Enter a name for your graph, such as Apdex Score.
Optionally, export or copy and paste the quick graph to a dashboard or notebook, or click Export > New Dashboard to create a dashboard with this quick graph.
Query A
In Graph your data, select RUM as the data source for query a and enter @view.largest_contentful_paint:<2s.
Press Enter or click Update query in the dropdown menu. The Largest Contentful Paint:<2s query appears next to RUM for query a.
Query B
To create query b, click + Add Query.
Select RUM as the data source for query b and enter @view.largest_contentful_paint:[2s TO 8s].
Press Enter or click Update query in the dropdown menu. The Largest Contentful Paint:[2s - 8s] query appears next to RUM for query b.
Query C
To create query c, click + Add Query.
Select RUM as the data source for query c and enter @Type:view.
Press Enter or click Update query in the dropdown menu. The Type:view query appears next to RUM for query c.
JSON configuration
To access the JSON code for this graph, click the JSON tab next to Edit.
Click the copy icon on the right hand corner to copy the quick graph JSON to your clipboard.
In the example above, the Apdex score is relevant to the View RUM events and Largest Contentful Paint performance metric.
You can also calculate other Apdex scores with the following methods:
To see the Apdex score trend over time, select Timeseries instead of Query Value in Select your visualization.
To compute the Apdex score for a specific application, add an additional @application.name query and update your formula.
To compute the Apdex score with another RUM performance metric such as First Contentful Paint, replace @view.LargestContentfulPaint with @view.FirstContentfulPaint in the queries.
To compute additional performance indicators for your applications, determine what data points you need and which RUM events are relevant for you before creating a quick graph.
Further Reading
Additional helpful documentation, links, and articles: