Interview Prep/Monitoring & Observability/PromQL and recording rules

Query fails with `parse error: unexpected character inside braces: '-'`

BeginnerTroubleshootingPromQL and recording rules
Answer

Likely causes → A label name contains characters PromQL does not allow unquoted, or quotes are missing around a value.

Diagnose → Check the selector: {app-name=checkout} is invalid.

Fix → Label values must be quoted: {app="checkout"}. Label names must match [a-zA-Z_][a-zA-Z0-9_]*; fix the label at relabel time (labelmap converts unsupported characters to _ for Kubernetes labels).

Prevent → Use Grafana's query builder or autocomplete.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on PromQL and recording rules