Data Retrieval¶
Obsy AI Copilot can help write query statements or turn natural language into viewer filters. These capabilities serve different goals: the DQL / PromQL assistant delivers readable, reusable query statements, while natural-language viewer search filters data on the current page.
DQL / PromQL Assistant¶
The DQL / PromQL assistant generates, explains, fixes, and reviews query statements. It can also convert compatible DQL metric queries to platform PromQL. When generating DQL, Copilot first checks real data sources, fields, and tags in the current workspace whenever needed, then performs a syntax check on the final statement.
The assistant does not return DQL merely because a user asks to view recent logs. The query-language flow starts only when the user explicitly asks to write, explain, fix, review, or convert DQL or PromQL.
It is intended for query tasks such as:
- You need a query but are not familiar with DQL or PromQL syntax;
- An existing query fails, has an unclear calculation, or needs a risk review;
- You want to understand the filters, aggregation, grouping, and time window in a query;
- You need to convert a metric DQL statement to platform PromQL;
- You want a query grounded in fields from the current workspace instead of a generic example.
Generate or Review a Query¶
Describe the query goal in Copilot and provide as much of the following information as possible:
- Data domain: Metrics, logs, events, traces, RUM, or another type;
- Data object: A known measurement, source, service, or field;
- Time range: For example, the last 30 minutes or past 7 days;
- Calculation: Total, rate, average, percentile, TopN, or grouping dimension;
- Output type: DQL, platform PromQL, or standard Prometheus syntax.
Example:
Generate DQL for the current workspace that counts error logs by service over the last 30 minutes and returns the top 10 services in descending order.
To fix or explain a query, include the original statement and describe the expected result. When the data domain, time range, or calculation is ambiguous, Copilot asks for clarification rather than guessing a data source or field.
Query Output and Validation¶
For DQL generation, Copilot normally returns the single statement that best matches the request and has passed syntax checking, followed by a short explanation of the data source, filters, aggregation, and time range. If a data source or field cannot be confirmed in the current workspace, it explains the limitation and asks you to choose rather than presenting an unconfirmed field as available.
Platform PromQL uses the supported measurement:field metric convention by default. PromQL is not executed in this flow; run it on the target query page to verify the returned data. A DQL syntax check validates statement structure but does not guarantee that the selected time range contains data.
Note
The DQL / PromQL assistant generates query language; it is not the same as analyzing page data. To understand what is happening in the current log, trace, or alert, use Observability Analysis from the corresponding page.
Natural-Language Viewer Search¶
Natural-language viewer search converts a request into query conditions supported by the current viewer and passes those conditions, together with the current query and time range, back to the page. It is useful when you know what values, states, or numeric ranges to filter but do not know the viewer query syntax.
The capability applies to viewer types that have integrated natural-language search, including logs, traces, RUM, infrastructure objects, the resource catalog, events, synthetics, security, cloud billing, backup logs, Agent monitoring, and LLM data.
Build Search Conditions¶
Describe the filter on a supported viewer. For example:
Find records where service is checkout, status is abnormal, and duration is greater than 2 seconds. Only show the last 3 hours.
You can express equality, exclusion, contains, wildcards, regular expressions, numeric comparisons, ranges, field existence, and combinations with AND, OR, and NOT. The operations available for a field depend on its type.
By default, Copilot keeps the conditions already in the query box and appends the new conditions. To replace the existing query, explicitly ask to reset it, clear the current conditions, search only for the new criteria, or replace the query.
Condition Conversion Rules¶
Copilot builds the query from the field list supplied by the current viewer:
- Content that clearly matches an available field or alias becomes a structured filter;
- Keywords that cannot be mapped safely remain plain-text search terms instead of being forced into a similar field;
- Business values such as service names, resource names, IDs, URLs, paths, and error text are preserved whenever possible;
- An explicit time expression is handed to the viewer's time control.
The result filters the current viewer. It does not create DQL or modify data. If a field is not exposed by the current page, Copilot does not use it as a structured filter even when another viewer contains a field with the same name.