Skip to content

Content-Type "text/plain; version=0.0.4, charset=utf-8" fails to parse, and requires fallback_scrape_protocol=PrometheusText0.0.4 #15777

@gberche-orange

Description

@gberche-orange

What did you do?

Confiigure scraping of exporter which specifies the charset=utf-8 in its content-type, i.e. text/plain; version=0.0.4, charset=utf-8

What did you expect to see?

Prometheus should properly extract the content-type

https://www.rfc-editor.org/rfc/rfc9110.html#name-content-type

HTTP uses "charset" names to indicate or negotiate the character encoding scheme ([RFC6365], Section 2) of a textual representation. In the fields defined by this document, charset names appear either in parameters (Content-Type), [...]

What did you see instead? Under which circumstances?

Error scraping target: cannot parse Content-Type "text/plain; version=0.0.4, charset=utf-8" and no fallback_scrape_protocol for target mime: invalid media parameter

System information

No response

Prometheus version

prometheus, version 3.0.1 (branch: HEAD, revision: 1f56e8492c31a558ccea833027db4bd7f8b6d0e9)
  build user:       root@9c13055ffc3c
  build date:       20241128-17:20:55
  go version:       go1.23.3
  platform:         linux/amd64
  tags:             netgo,builtinassets,stringlabels

Prometheus configuration file

No response

Alertmanager version

No response

Alertmanager configuration file

No response

Logs

Failed to determine correct type of scrape target." component="scrape manager" scrape_pool=serviceMonitor/gitlab/gitlab-gitlab-exporter/0 target=http://192.168.12.14:9168/metrics content_type="text/plain; version=0.0.4, charset=utf-8" fallback_media_type="" err="cannot parse Content-Type \"text/plain; version=0.0.4, charset=utf-8\" and no fallback_scrape_protocol for target\nmime: invalid media parameter"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions