# PromQL for Beginners: Getting Started With Prometheus

## Metadata
- Author: [[Gabriel Diaz]]
- Full Title: PromQL for Beginners: Getting Started With Prometheus
- Category: #articles
- Summary: PromQL is a query language used with Prometheus to retrieve and analyze time-series data. It helps you monitor system metrics by writing simple or complex queries with filters and functions. PromQL is useful for real-time monitoring, alerting, and optimizing system performance.
- URL: https://last9.io/blog/promql-for-beginners-getting-started-with-prometheus-query-language/
## Highlights
- What is PromQL?
PromQL is a query language designed to work with time series data, allowing you to select and aggregate data in real time. It’s used for both graphing and alerting in Prometheus. ([View Highlight](https://read.readwise.io/read/01kwsmrwhchgxwpjybedv9hyrr))
- PromQL Structure
 ([View Highlight](https://read.readwise.io/read/01kwsmtedr1dn1b9e5284jg0y6))
- **Metric Name**: This is the name of the metric you want to query, such as `http_requests_total`
**Label Selectors**: These allow you to filter the metric based on specific labels, like `method="GET"` and `status="200"`
**Time Range** This optional component specifies the time range for the query, such as `[5m]` for the last 5 minutes. In the example query: ([View Highlight](https://read.readwise.io/read/01kwsmv1we4dtgdmf92157vzbt))
- Simple Queries
The most basic PromQL query is just the name of a metric:
http_requests_total
Basic PromQL Query
This returns the *current* value of the `http_requests_total` metric for all monitored endpoints. ([View Highlight](https://read.readwise.io/read/01kwsn9nwpzxy86f3yd97qkajk))
- Note: This shows every endpoint / label