thanos-io/thanos · error

not supported remote read content type

Error message

not supported remote read content type: %s

What it means

After receiving the remote-read HTTP response, Series inspects Content-Type. Only 'application/x-protobuf' (sampled) and 'application/x-streamed-protobuf; proto=prometheus.ChunkedReadResponse' (streamed chunks) are supported; anything else errors with 'not supported remote read content type'.

Solutions

  1. Check the Content-Type your endpoint actually returns for /api/v1/read (curl -i).
  2. Fix the configured remote-read URL to point at the real Prometheus remote-read endpoint.
  3. Bypass/remove proxies or auth middlewares that alter the response body/headers, or make them pass the upstream Content-Type through.
  4. Upgrade the target Prometheus if its remote read lacks the streamed chunked content type and you require streaming.
Defensive patterns

Strategy: validation

Validate before calling

resp, err := http.Head(remoteReadURL)
if err != nil { return err }
ct := resp.Header.Get("Content-Type")
if ct != "application/x-protobuf" && !strings.HasPrefix(ct, "application/x-streamed-protobuf; proto=prometheus.ChunkedReadResponse") {
    return fmt.Errorf("endpoint content type %q not supported", ct)
}

Try / catch

if err := s.Series(ctx, req); err != nil {
    if strings.Contains(err.Error(), "not supported remote read content type") {
        // inspect returned Content-Type; fix endpoint/URL or disable streaming negotiation
    }
    return err
}

Prevention

When it happens

Trigger: The remote-read endpoint replies with a Content-Type other than the two supported ones — e.g. an intermediary, proxy, or gateway rewriting responses, or an endpoint that is not a real Prometheus remote-read handler.

Common situations: Pointing the store at the wrong URL (e.g. /api/v1/query or an HTML error page from a proxy), an auth layer returning JSON errors, or a Prometheus-compatible service with a different remote-read implementation.

Related errors


AI-assisted analysis of thanos-io/thanos@35b8b99117 (2026-09-07). Data as JSON: /api/errors/6af4d944ad0a643e. Report an issue: GitHub.

Appendix: source

Thrown at pkg/store/prometheus.go:217

	queryPrometheusSpan, ctx := tracing.StartSpan(s.Context(), "query_prometheus")
	queryPrometheusSpan.SetTag("query.request", q.String())

	httpResp, err := p.startPromRemoteRead(ctx, q)
	if err != nil {
		queryPrometheusSpan.Finish()
		return errors.Wrap(err, "query Prometheus")
	}

	// Negotiate content. We requested streamed chunked response type, but still we need to support old versions of
	// remote read.
	contentType := httpResp.Header.Get("Content-Type")
	if strings.HasPrefix(contentType, "application/x-protobuf") {
		return p.handleSampledPrometheusResponse(s, httpResp, queryPrometheusSpan, extLset, enableChunkHashCalculation, extLsetToRemove)
	}

	if !strings.HasPrefix(contentType, "application/x-streamed-protobuf; proto=prometheus.ChunkedReadResponse") {
		return errors.Errorf("not supported remote read content type: %s", contentType)
	}
	return p.handleStreamedPrometheusResponse(s, shardMatcher, httpResp, queryPrometheusSpan, extLset, enableChunkHashCalculation, extLsetToRemove)
}

func (p *PrometheusStore) handleSampledPrometheusResponse(
	s flushableServer,
	httpResp *http.Response,
	querySpan tracing.Span,
	extLset labels.Labels,
	calculateChecksums bool,
	extLsetToRemove map[string]struct{},
) error {
	level.Debug(p.logger).Log("msg", "started handling ReadRequest_SAMPLED response type.")

	resp, err := p.fetchSampledResponse(s.Context(), httpResp)
	querySpan.Finish()
	if err != nil {
		return err

View on GitHub (pinned to 35b8b99117)