Want to query logs instead of metrics?
PromQL can only query metrics. To query logs, use SQL queries instead.
Create your first chart using a PromQL query. Start by creating a dashboard in Metrics → Create dashboard.
Create a new chart on your dashboard, select PromQL as the query type, and use a query like the one below:
PromQL can only query metrics. To query logs, use SQL queries instead.
PromQL is designed for querying time series data. Use your existing PromQL knowledge to query the metrics you send to Better Stack.
Better Stack supports the following PromQL operations:
http_requests_total{method="GET"}by and without clausesAggregation operators include:
sum: Calculate the sum of elements in the vectoravg: Calculate the average of elements in the vectormin: Select the minimum element of the vectormax: Select the maximum element of the vectorcount: Count the number of elements in the vectortopk: Select the k largest elements of the vectorbottomk: Select the k smallest elements of the vectorstddev and stdvar: Calculate the standard deviation or variance of the vectorrate, irate, increase, and delta.avg_over_time, sum_over_time, min_over_time, max_over_time, and count_over_time.histogram_quantile and histogram_fraction.absent and absent_over_time.round, clamp, clamp_min, clamp_max, and timestamp.abs, ceil, floor, exp, ln, log2, log10, sqrt, and sgn.hour, minute, day_of_week, day_of_month, day_of_year, days_in_month, month, and year.See the examples below for full queries using PromQL in Better Stack.
This query returns the rate of HTTP requests, grouped by HTTP method.
This query returns the per-second rate of CPU usage over the last 15 minutes for each pod, excluding the "id" label.
This query calculates the average per-second rate of memory usage for each instance.
This query returns the top 5 API endpoints with the highest per-second request rate.
This query returns the per-second rate of network transmission (in bytes), grouped by network interface.
Please let us know at hello@betterstack.com.
We're happy to help! 🙏
We use cookies to authenticate users, improve the product user experience, and for personalized ads. Learn more.