PromQL is powerful, but has a high barrier to entry
Prometheus is the open source standard for metrics monitoring. The standard for querying Prometheus is the Prometheus Query Language (PromQL). Engineers use PromQL to query and aggregate Prometheus metrics in real time. Check out our blog, “An Introduction to PromQL”, for more information.
As with any query language, PromQL has concepts you have to learn and a specific syntax you must follow. On top of that, with PromQL queries, you need to specify the metric name, filters based on label values, and the various ways to arrange data based on ranges, logic, functions, and aggregations. With so many possible variations and metric types to choose from, PromQL is a challenging query language for engineers to fully understand and utilize. This is why Chronosphere created Query Builder, a way to quickly and simply create queries in PromQL, even if you aren’t a PromQL wizard. This enhancement is now available to all Chronosphere customers.
Easily and quickly chart the (Prometheus) data you want
Query Builder has its roots in a solution by PromLabs called PromLens, which was developed by Julius Volz, co-founder of Prometheus and creator of PromQL. We’ve worked closely with Julius on our common goal of helping engineering teams and end users construct PromQL queries simply, quickly, and with high accuracy. Julius said, “Chronosphere is dedicated to further enabling Prometheus users, which is why I partnered with them on Query Builder. I’m excited to see how it will evolve in the hands of Chronosphere customers.”
Query Builder has the following benefits to end-user and SRE developers:
- Visualize your query while you build: Dynamically build and modify your PromQL queries with visualizations provided at every step along the way.
- Quickly chart the data you want to see: With Query Builder’s form or visual builder and metrics explorer, you can quickly and confidently query the data you want without having to memorize all of the various metric names or rely on your central observability team(s) for PromQL.
- Instantly troubleshoot your queries: Detect and fix any potential errors with hints and actions that can be applied with a press of a button.
There are also significant benefits to the central observability team, specifically:
- Empower and educate your team to self-serve: Team members can use Query Builder’s analysis and insights to “X-ray” their queries to understand every part of a query and learn the fundamentals of PromQL.
- Save time and on-ramp your team faster: Engineers new to PromQL no longer need to memorize or look up PromQL details. Query Builder’s form-based editor makes building and modifying a query easy with access to all query types and options.
How does Query Builder work?
Query Builder is built seamlessly into Chronosphere’s console and is extremely intuitive, even for a user not experienced in PromQL. To get started:
- Choose between building your query visually through a form or through the interactive visual builder.
- When using the form, Query Builder will prompt you to select the query type (e.g. binary operation), automatically displaying any remaining fields to complete based on the query type (e.g. aggregation type or operator).
- When using the visual builder, Query Builder will contextually provide real-time feedback (e.g. to “add sum”) and results (e.g. number of time series and time to query) in order to modify the query if needed.
Query Builder also allows you to troubleshoot and visualize queries and results right away. When building a query, the tool automatically produces a visualization of the query and lets you know of any potential errors or common pitfalls with suggested fixes applied with a click of a button. Query Builder takes the guesswork out of the query building process, enabling you to query with greater accuracy and confidence. The real-time feedback will also inform you about the size of your query result, instantly displaying the number of expected metrics or label occurrences when hovering over each given value. This level of insight enables you to fine tune your queries — whether it’s increasing the aggregation interval to reduce the size of the query or it’s choosing a different metric type to get the metrics you’re really looking for.
See the below image for how Query Builder is integrated into the Chronosphere console:
Want to learn more?
With Query Builder, engineers — whether new or experienced PromQL users — can easily and quickly chart the data they want. Ramping up a new user on PromQL can be time consuming, but Query Builder makes the learning curve more manageable. End-users and central observability teams are now able to spend less time crafting and troubleshooting their PromQL queries, and more time on driving high value work for their teams.
To learn more about Chronosphere and Query Builder, visit https://chronosphere.io/ or request a demo.