This feature is in Early Access (EA), and might not be visible in your app. To learn
more about this program and the features it contains, see the
Early access page.
Generate PromQL from natural language prompts
You can generate PromQL from natural language in Metrics Explorer. Fields that support natural language queries include an Edit with AI button.- Open Metrics Explorer.
- In the PromQL query field, click Edit with AI to open the natural language prompt field. You can also click or focus on the query field and use the keyboard shortcut Control+I (Command+I on macOS) to open the prompt field.
- In the Describe your query prompt field that appears, write your query as a natural language prompt.
- Click Generate or press Enter (Return on macOS) to submit your prompt.
Refine your query with additional prompts
Observability Platform generates a PromQL query based on your prompt. To use the generate query, click Accept or press Tab. To revert the query field to its previous state, click Reject or press Esc. To provide additional prompts, click Refine your query and enter a new prompt. Observability Platform adjusts the query with this new context as a diff, with green indicators on new changes or additions and red indicators on lines being removed or changed. You can Accept or Reject the resulting changes and repeatedly refine your query to continue iterating.Write effective natural language prompts
To write effective prompts for PromQL queries:- Write the goal of the query you want to generate as a specific and concise statement.
- Provide relevant context that you already have, such as metric or label names.
- State the form of data you want, such as a count, rate, or histogram.
- Avoid vague and ambiguous requests.
Tell me why I’m getting so many downtime alerts this week.A more concise and precise prompt helps the large language model generate a more focused query:
Which shopping cart service alerts fired in the last 7 days, and why?Providing more information or refining your criteria can further focus the result:
Show success rates versus failures for requests to the shopping cart service in the last 7 days.While you might not have enough information to write such prompts from the start, iterate by refining your query with a goal of improving your prompts.

