With the query builder you can run queries of your data to create custom charts and other visualizations. The query builder comes with three working modes: basic query-less mode, advanced (NRQL) mode, and advanced PromQL-style mode, which takes PromQL queries as an input for accessing metrics and building charts.
Use the query builder in PromQL mode
You can access the query builder advanced (PromQL) mode by going to one.newrelic.com and clicking on Query your data at the top right corner. Go to the query builder tab on the left, then select PromQL-style on the right.
New Relic supports PromQL, the Prometheus query language, using a PromQL-like query mode that automatically translates Prometheus query language (PromQL) syntax queries into the closest NRQL approximation. For more information on how this works, see Supported PromQL features.
Build your query with the following parameters:
- Account: Select the account you want to query.
- PromQL prompt: Write you query here. You can view the list of valid options of the metrics and functions in the account.
- Step and range: Select the step and range for the query, or click on instant.
Run the query to obtain the chart with the results. You can name the chart, change the type of chart, or add it to a dashboard.
Switch to the NRQL tab to see how your PromQL query is translated to NRQL.
PromQL and the query builder
The query builder in advanced PromQL mode translates your PromQL query to NRQL before running the query. The results may be different from how Prometheus executes the query.
If you would like to learn more about New Relic's PromQL-like query language and how it behaves, including troubleshooting information for translated queries, see Supported PromQL features.