Viewing Usage Metrics for Anypoint Datagraph | MuleSoft Documentation
# Viewing Usage Metrics for Anypoint Datagraph
Anypoint Datagraph provides API request metrics, and you can view additional usage metrics for DataGraph in Anypoint Monitoring.
## View API Request Metrics
DataGraph enables you to track metrics so you’re always aware of your usage relative to the limits specified for your business groups. Use these metrics to track the total number calls made to the unified schema in each environment.
Usage metrics are separated by Production and Sandbox environments per business group. More specifically, the metrics in any given environment show:
  * GraphQL API requests received for that environment
  * GraphQL API requests received for other environments of that type
  * GraphQL API requests received for all environments of that type


API request usage metrics are available in the Overview section of Anypoint DataGraph.
To view usage metrics, you need the Admin permission.
  1. Click Overview.
  2. Click Details and confirm you’re in the correct environment.
  3. Click Usage Metrics.
  4. To see metrics for a specific time period, set the calendar parameters. The metrics query runs automatically and updates the data.
  5. To refresh the metrics for the current time period, click the refresh icon.


## View Usage Metrics with Anypoint Monitoring
Anypoint Monitoring enables you to view usage metrics via built-in dashboards and custom dashboards. These metrics relate to calls made to your DataGraph application, not to calls made to APIs federated in your unified schema.
### Built-in Dashboards
In Anypoint Monitoring, DataGraph is considered a "managed API". You select the environment and the name of your DataGraph application when you view built-in dashboards.
Built-in dashboards require no configuration and include various pages to view different types of charts. For example, the overview page includes data related to:
  * Request volume
  * Failed requests
  * Total 4xx errors
  * Total 5xx errors
  * Average response time


### Custom Dashboards
Custom dashboards collect the same metrics as built-in dashboards. They require additional configuration and are useful for:
  * Correlating diverse metrics
  * Performing comparative analysis
  * Differentiating between regular trends and anomalies
  * Isolating issues quickly


The following example shows how to set up a custom dashboard to track request volume by client_id.
  1. From Anypoint Monitoring, select **Custom dashboards**.
  2. Click **+New Dashboard** , add then select the graph option.
  3. On the new graph, click the configure menu (the vertical ellipses), and then click **Configure**.
  4. Switch the **Advanced Mode** toggle to activate advanced mode.
  5. Edit the query as follows:
    1. In the **Panel Type** drop-down list, select **API Panel**. (Datagraph is an API application type.)
    2. Next to **Where** , click **+**.
    3. From the drop-down lists, select `api_id` and `api_version_id` and set the value for each to the Datagraph application from which you’re collecting info.
    4. From the **Select** drop-down list, select `field(request_size.count)`.
    5. From the **Group by** drop-down list, select `tag(client_id)`.
    6. In the **Alias by** field, add `$tag_client_id`.
  6. Click **Apply changes**.
  7. Open the time-picker, choose a timeframe, and click **Confirm**.


The following example shows a graph tracking requests over the previous hour:
## Additional Resources
  * https://docs.mulesoft.com/monitoring/dashboard-custom-config
  * https://docs.mulesoft.com/monitoring/create-custom-dashboard
  * https://docs.mulesoft.com/monitoring/app-dashboards