Metrics intro
📊
Watch the numbers move.
Each environment has a metrics tab in the dashboard. It graphs storage, traffic, MySQL, PHP, jobs and HTTP errors over time, one bar per hour or day.
Server metrics
The metrics come from the server, the way a log analyzer such as AWStats works. There is no script in the pages, no cookie, and no code, agent or extension to install:
- The load balancer counts requests, traffic and status codes, and times every PHP request.
- The containers report memory, storage and the OPcache fill level.
The counts cover every request the platform handled, crawlers and bots included. Visitors, sessions and referrers come from web analytics.
The platform takes a sample of each metric at short intervals. A chart groups the samples into one bar per hour or day.
Metric groups
The metrics tab groups the metrics like this:
- Storage & traffic: web storage, traffic, static requests
- MySQL: MySQL storage
- PHP: response time, requests, memory, OPcache, OOM kills
- Jobs: memory, OOM kills
- Errors: 404, 500, 503 and 504 responses
A group appears once its component is booked: MySQL with the MySQL component, jobs with the Jobs component.
Time frame and resolution
The time frame sets the range and what one bar stands for. Times are UTC.
| Time frame | One bar |
|---|---|
| Last 2 days | Hour |
| Last 30, 60, 90 days | Day |
| The two previous months | Day |
| Custom range | Hour up to two days, else day |
The last two days are yesterday and today. The bar of the current hour or day is still filling.
Chart box, lines and scale
The box on the chart shows the figures for the whole time frame, see metric values.
- Hover over a bar, or click it, to see the values of that hour or day in the box. Click the bar again to clear the selection.
- A max or min figure names the day it happened. Click the day to select that bar.
Around the chart:
- Horizontal lines mark thresholds, such as Slow for PHP response time, or the plan sizes of the component, such as the memory of each PHP plan.
- The Scale slider sets the value at the top of the chart. Move it left to enlarge small bars, right to bring back bars that run out of the chart.
- Links below the chart open the logs behind the metric for that time frame, as long as the logs reach back that far.
Metrics, logs and APM
To find the cause of a slow or failing request, combine the metrics with the logs, and with an APM tool for the code:
| Tool | Shows | Example |
|---|---|---|
| Metrics | That something changed, and when | PHP response time doubled at 14:00 |
| Logs | The single requests behind it | The URLs and status codes of the slow requests |
| APM | Where the time went inside the code | One database query in one controller |
Start with the metric and narrow the time frame to the spike. Then read the logs for that window to find the URLs. When the logs show which request is slow but not why, an APM tool traces it through functions, queries and calls to other services.