quickwit-oss/quickwit · error

unsupported OTLP protocol

Error message

unsupported OTLP protocol `{other}`, supported values are `{OTLP_PROTOCOL_GRPC}`, `{OTLP_PROTOCOL_HTTP_JSON}`, and `{OTLP_PROTOCOL_HTTP_PROTO}`

What it means

OtlpProtocol implements FromStr and accepts only the literal protocol names `grpc`, `http/protobuf` (plus alias `protobuf`), and `http/json`. Any other string in an OTLP exporter endpoint's `protocol=` parameter makes parsing fail with the list of supported values embedded in the message.

Solutions

  1. Set protocol to exactly one of: `grpc`, `http/json`, or `http/protobuf` (alias `protobuf`).
  2. Lowercase and normalize the value before parsing if it comes from user input or env.
  3. If HTTP is wanted but unsure of payload format, use `http/json` for JSON, `http/protobuf` for protobuf.

Example fix

// before
protocol = "http_json"
// after
protocol = "http/json"
Defensive patterns

Strategy: validation

Validate before calling

const VALID: [&str; 3] = ["grpc", "http/json", "http/protobuf"];
if !VALID.contains(&protocol.as_str()) && protocol != "protobuf" {
    panic!("protocol must be one of grpc, http/json, http/protobuf");
}

Try / catch

match protocol.parse::<OtlpProtocol>() {
    Ok(p) => p,
    Err(e) => { log::error!("fix OTLP protocol value: {e}"); return Err(e); }
}

Prevention

When it happens

Trigger: Configuring an OTLP exporter with `otlp/exporter/protocol` set to something like `http-json`, `HTTP`, or `https` instead of the exact accepted values.

Common situations: Typos or casing mistakes in telemetry config (e.g. `http_json`), copying OpenTelemetry SDK defaults like `http/protobuf` misspelled, or inventing `https` assuming it is a protocol.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of quickwit-oss/quickwit@a39730c5cd (2026-09-08). Data as JSON: /api/errors/ea85f947bf97e863. Report an issue: GitHub.

Appendix: source

Thrown at quickwit/quickwit-telemetry-exporters/src/otlp/config.rs:52

    HttpJson,
}

impl FromStr for OtlpProtocol {
    type Err = anyhow::Error;

    fn from_str(protocol_str: &str) -> anyhow::Result<Self> {
        const OTLP_PROTOCOL_GRPC: &str = "grpc";
        const OTLP_PROTOCOL_HTTP_JSON: &str = "http/json";
        const OTLP_PROTOCOL_HTTP_PROTO: &str = "http/proto";
        const OTLP_PROTOCOL_HTTP_PROTOBUF: &str = "http/protobuf";

        match protocol_str {
            OTLP_PROTOCOL_GRPC => Ok(OtlpProtocol::Grpc),
            OTLP_PROTOCOL_HTTP_JSON => Ok(OtlpProtocol::HttpJson),
            OTLP_PROTOCOL_HTTP_PROTO | OTLP_PROTOCOL_HTTP_PROTOBUF => {
                Ok(OtlpProtocol::HttpProtobuf)
            }
            other => anyhow::bail!(
                "unsupported OTLP protocol `{other}`, supported values are \
                 `{OTLP_PROTOCOL_GRPC}`, `{OTLP_PROTOCOL_HTTP_JSON}`, and \
                 `{OTLP_PROTOCOL_HTTP_PROTO}`"
            ),
        }
    }
}

pub(crate) struct OtlpExporterConfig {
    enabled: bool,
    default_protocol: String,
}

impl OtlpExporterConfig {
    pub(crate) fn load_from_env() -> Self {
        OtlpExporterConfig {
            enabled: get_bool_from_env(QW_ENABLE_OPENTELEMETRY_OTLP_EXPORTER_ENV_KEY, false),
            default_protocol: get_from_env(

View on GitHub (pinned to a39730c5cd)