quickwit-oss/quickwit · error
{} contains an empty label value: {}
Error message
{} contains an empty label value: {} What it means
parse_metrics_labels rejects any 'name=value' label in QW_METRICS_LABELS_ENV_VAR whose value (after '=') is empty or whitespace-only after trimming, since an empty label value is meaningless for metrics.
Source
Thrown at quickwit/quickwit-metrics/src/lib.rs:445
for label in labels.split(LABELS_SEPARATOR) {
let (name, value) = label.split_once(KEY_VALUE_SEPARATOR).ok_or_else(|| {
anyhow::anyhow!(
"{} contains invalid label format: {}",
QW_METRICS_LABELS_ENV_VAR,
label
)
})?;
let name = name.trim();
if name.is_empty() {
anyhow::bail!(
"{} contains an empty label name: {}",
QW_METRICS_LABELS_ENV_VAR,
label
);
}
let value = value.trim();
if value.is_empty() {
anyhow::bail!(
"{} contains an empty label value: {}",
QW_METRICS_LABELS_ENV_VAR,
label
);
}
let label = Label::new(name.to_string(), value.to_string());
parsed_labels.push(label);
}
Ok(parsed_labels)
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_parse_metrics_labels() {View on GitHub (pinned to a39730c5cd)
Solutions
- Provide a non-empty value for each label: "cluster=prod" instead of "cluster="
- Ensure interpolated shell variables are set before export, or hardcode the value
- Drop labels you don't intend to set instead of leaving them empty
Example fix
// before export QW_METRICS_LABELS_ENV_VAR="cluster=" // after export QW_METRICS_LABELS_ENV_VAR="cluster=prod"
Defensive patterns
Strategy: validation
Validate before calling
fn all_values_present(s: &str) -> bool {
s.split(',').filter(|l| !l.is_empty()).all(|l| {
l.split_once('=').map(|(_, v)| !v.trim().is_empty()).unwrap_or(false)
})
} Try / catch
match parse_metrics_labels(&raw) {
Err(e) if e.to_string().contains("empty label value") => {
eprintln!("missing value in QW_METRICS_LABELS_ENV_VAR: {e}");
}
other => other?,
} Prevention
- Verify shell variables used in interpolation are non-empty before export
- Drop labels whose values are unknown instead of leaving them blank
- Validate the full env var string at config-load time
When it happens
Trigger: Setting QW_METRICS_LABELS_ENV_VAR to entries like "cluster=" or "team= ,a=b" where a value is missing after the '='.
Common situations: Variable interpolation producing an empty value, e.g. QW_METRICS_LABELS_ENV_VAR="cluster=${CLUSTER}" with CLUSTER unset; partial manual edits.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- {} contains an empty label name: {}
- {QW_METRICS_LABELS_ENV_VAR} must contain valid Unicode
- index ID pattern `{pattern}` is invalid: patterns must not c
- index ID pattern `{pattern}` is invalid: an index ID must ha
- index config merge policy `max_merge_factor` must be superio
AI-assisted analysis of quickwit-oss/quickwit@a39730c5cd (2026-09-08).
Data as JSON: /api/errors/d07bc7294fd4e698.
Report an issue: GitHub.