How do PromQL aggregation operators and `by`/`without` work?

BeginnerConceptPromQL & Recording Rules
Answer

Operators: sum, avg, min, max, count, stddev, stdvar, topk, bottomk, quantile, count_values, group, and in 3.x limitk/limit_ratio (experimental).

sum by (namespace) (rate(container_cpu_usage_seconds_total[5m]))
sum without (instance, pod) (rate(http_requests_total[5m]))
topk(5, sum by (pod) (container_memory_working_set_bytes))

by keeps only the listed labels; without drops the listed ones and keeps the rest.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on PromQL & Recording Rules