Skip to main content
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.
Chronosphere Observability Platform provides generative artificial intelligence (AI) tools to generate PromQL queries from natural language prompts. Write natural language that reflects what you want Observability Platform to query, and Observability Platform generates PromQL that returns relevant data.
Generative AI features can produce incorrect results, hallucinate data, and deliver inaccurate analysis. Use generative AI features with care, and independently verify all information produced by generative AI tools before applying it.Certain prompts, data, or other inputs might produce irrelevant content. Don’t rely on generative AI features or responses for any uses that exceed their designed scope.

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.
  1. Open Metrics Explorer.
  2. 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.
  3. In the Describe your query prompt field that appears, write your query as a natural language prompt.
  4. Click Generate or press Enter (Return on macOS) to submit your prompt.
Observability Platform populates the query field with its generated PromQL query. You can edit or run the query as if you had entered it into the field, and you can also refine it with additional prompts.

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.
For example, a vague and imprecise prompt with unnecessary information is less likely to generate an actionable prompt:
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.

Troubleshoot generated queries

Confirm that the time range selector is set to a relevant span of time for your prompt. To investigate the query and identify any errors or unexpected results, click Debug. You can copy and paste any reported errors as prompts that refine the query. Remember that the resulting query represents the large language model’s hypothesis, and isn’t a definitive answer to your question. For example, it might not select the most relevant metrics or labels for your request. Critically review the generated query and manually edit when necessary. Observability Platform can incorporate your edits to guide further refinements or changes to the generated query.

Close the natural language query field

To close the natural language query field, click X or press Control+I (Command+I on macOS).