The metrics query builder provides an intuitive structured method for creating metrics queries without having to know how the metrics query language works. Instead, the metrics query builder allows you to select the building blocks for your metrics query from the dashboard user interface (UI).
For in-depth information on metrics and how to use them to your best advantage with Sumo Logic, see the Metrics documentation.
Creating a query with Metrics Query Builder
With the metric query builder, you can intuitively filter on a source by selecting it from a drop-down menu, then add a metric by choosing it from a list as well. Optionally, you can add one or more operators to the query, selecting each one from a drop-down list. You must first select a source filter or metric for the query before you can add an operator, however. In the following example, we create a metrics query that uses cluster and service sources, then calculates CPU usage (in seconds) for a container and applies rate and sum operators.
To create a metrics query to calculate the CPU for a host in a cluster, do the following:
- In the Sumo Logic UI, click + New and choose Metrics from the drop-down list.
- On the Metrics page, click inside the From field and select a source on which to filter from the list. Optionally, you can begin typing to dynamically narrow the list, then select the source. You can add multiple sources on which to filter, as we have in our example.
- Click inside the get metric field, and select the desired metric from the list. Optionally, you can begin typing to dynamically narrow the list from which to select the metric.
- Optionally, click the plus (+) icon and select an Operator from the list. You can apply multiple operators to a query, as we have in our example.
- Click Chart on the left for a chart display of the data. The default is Preview Table.
- Optionally, you can change the chart display by clicking the downward arrow and then making a selection from the drop-down list.