Skip to content

Prometheus metrics broken on prom 3.0 #4277

@ishioni

Description

@ishioni

Describe the bug
Prometheus 3.0 rejects the scrape because dragonfly does not set content-type

To Reproduce
Steps to reproduce the behavior:

  1. curl http://dragonflydb:adminport
  2. note the lack of content-type in the http response header
  3. Prometheus 3.0 complains with "Error scraping target: non-compliant scrape target sending blank Content-Type and no fallback_scrape_protocol specified for target"

Expected behavior
Prometheus metrics should work

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: [talos 1.8]
  • Kernel: # 6.6
  • Containerized?: [Kubernetes]
  • Dragonfly Version: [1.25.4]

Additional context
Setting something like
content-type text/plain; version=0.0.4; charset=utf-8; escaping=underscores
should be enough to make it work. Adding a fallback_scrape_protocol should be good as well, but the prometheus operator CRDs don't allow that unfortunately

More context https://prometheus.io/docs/prometheus/3.0/migration/#scrape-protocols

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions