Open source Enterprise Grafana Cloud

Query editor

The Infinity query editor allows you to retrieve data from HTTP endpoints and transform it for visualization in Grafana. This document explains the query editor interface and how to build queries.

Before you begin

  • You must have a configured Infinity data source. Refer to Configure the Infinity data source for instructions.
  • Familiarize yourself with the data format you want to query (JSON, CSV, XML, GraphQL, or HTML).

Query editor overview

The query editor consists of several key components:

ComponentDescription
TypeThe data format to query: JSON, CSV, TSV, XML, GraphQL, or HTML
ParserHow to process the data: Default, JSONata, JQ, UQL, or GROQ
SourceWhere to get the data: URL, Inline, Azure Blob, or Reference
FormatOutput format: Table, Time series, Data frame, Logs, Trace, or Node graph

Create a query

To create a basic query:

  1. In the query editor, select the Type that matches your data format (for example, JSON).
  2. Select a Parser based on your transformation needs:
    • JSONata (default) - JSONata expressions, runs in backend (supports alerting)
    • JQ - JQ expressions, runs in backend (supports alerting)
    • UQL - Unstructured Query Language, runs in frontend
    • Frontend - Simple column mapping, runs in frontend
  3. Select the Source:
    • URL - Fetch data from an HTTP endpoint
    • Inline - Enter data directly in the editor
    • Azure Blob - Retrieve from Azure Blob Storage
    • Reference - Use pre-configured reference data
  4. Select the output Format based on your visualization needs.
  5. If using URL source, enter the endpoint URL and configure the HTTP method.

URL configuration

When using URL as the source:

SettingDescription
MethodHTTP method: GET or POST. PUT, PATCH, and DELETE are available only when Allow dangerous HTTP methods is enabled in the data source configuration.
URLThe endpoint URL
Headers, Request paramsClick to configure additional headers and query parameters

Use variables in URLs

You can use Grafana variables and time macros in URLs:

https://api.example.com/data?from=${__timeFrom}&to=${__timeTo}

For more information about URL configuration, refer to URL configuration.

Parsing options

The Parsing options & Result fields section configures how data is extracted:

SettingDescription
Rows/RootJSONata or JQ selector that returns an array of elements from the API response
ColumnsDefine which fields to extract and their data types

Configure columns

Click Add Columns to define the fields to extract:

PropertyDescription
SelectorPath to the field in your data
TitleDisplay name for the column
TypeData type: String, Number, Time, Time (UNIX ms), Time (UNIX s), or Boolean

Computed columns, filters, and grouping

The Computed columns, Filter, Group by section provides additional data transformation options when using backend parsers (JSONata or JQ):

FeatureDescription
Computed ColumnsCreate new fields using expressions (for example, price * qty)
FilterFilter rows using expressions (for example, age >= 18)
SummarizeAggregate data using functions like sum(), count(), mean()
Summarize ByGroup aggregations by a field
Summarize AliasName for the summarized result

For detailed information about expressions and operators, refer to JSONata backend parser.

Parser options

Choose a parser based on your needs:

ParserRuns inAlerting supportBest for
JSONata (default)BackendYesComplex transformations, alerting
JQBackendYesJQ-style queries, alerting
UQLFrontendNoSQL-like queries, pivoting
FrontendFrontendNoSimple queries with column mapping

For detailed parser documentation:

Output formats

Select the appropriate format for your visualization:

FormatUse case
TableDisplay data in table panels
Time seriesTime-based data for graph panels
Data frameGeneric format for most visualizations
LogsLog data for the Logs panel
TraceTrace data for the Traces panel
Node graph (nodes/edges)Network topology visualization

For specialized formats, refer to:

Use queries for alerting

To use Infinity queries with Grafana Alerting, you must use a backend parser (JSONata or JQ). Frontend parsers (Default, UQL, GROQ) do not support alerting.

Backend parsers also enable:

Use the parsing assistant

Click Use Assistant to parse data to open the AI-powered parsing assistant. The assistant can help you:

  • Automatically detect data structure
  • Suggest column configurations
  • Generate parser expressions

Note

The parsing assistant requires Grafana’s AI features to be enabled.

Next steps