Symptom:
One or more Custom Dashboard panels in Anypoint Monitoring fail to load and display a 504 Network Error when the selected time range is set to 90 days(>30 days). The error occurs consistently every time the affected panel is loaded with a wide time window. Reducing the time range to 30 days or less may allow some panels to load, but panels with broad, unaggregated queries may still fail even at shorter ranges depending on data volume.
Error:
504 Gateway Timeout Error
Option 1: Add an aggregation function and a time bucket
Two changes are required together in the affected panel query:
mean() for average-type metrics (for example: response time).sum() for count or total-type metrics (for example: request count).GROUP BY clause which has the relevant tag dimension(s) (for example: time($_interval), time(5m), time(15m), time(1h))Before (causes 504):
SELECT "<metric_field>"
FROM "<measurement>"
WHERE ("org_id" = '<org_id>' AND "app_id" = '<app_id>')
AND time >= now() - 90d
GROUP BY "<tag>"
After using mean() — resolves 504:
SELECT mean("<metric_field>")
FROM "<measurement>"
WHERE ("org_id" = '<org_id>' AND "app_id" = '<app_id>')
AND time >= now() - 90d
GROUP BY time(1h), "<tag>"
After using sum() — resolves 504:
SELECT sum("<metric_field>")
FROM "<measurement>"
WHERE ("org_id" = '<org_id>' AND "app_id" = '<app_id>')
AND time >= now() - 90d
GROUP BY time(1h), "<tag>"
Option 2 — Reduce the time range:
If aggregation is not suitable for the use case, reduce the dashboard time range to a shorter window (for example, the last 1 hour) and page through smaller time slices rather than querying a full 90-day window at once.
Option 3 — Narrow the query scope with additional WHERE filters:
Add more specific filters to the WHERE clause - for example, a particular application ID, endpoint, or response type - to reduce the volume of data scanned per request. This option can be combined with Option 1.
After applying any of the above changes, reload the dashboard with the 90-day time range and confirm the panels render without 504 errors.
005391038

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.