springboot整合Prometheus监控Java服务报错:
org.springframework.web.HttpMediaTypeNotAcceptableException: Could not parse 'Accept' header [application/openmetrics-text;version=1.0.0;q=0.5,application/openmetrics-text;version=0.0.1;q=0.4,text/plain;version=0.0.4;q=0.3,*/*;q=2]: Invalid media type "*/*;q=2": Invalid quality value "2": should be between 0.0 and 1.0
原因:springboot对应的Prometheus版本不对,我用的最新版本报错,于是我降到了2.14.0
成功解决。
历史版本下载:
Releases · prometheus/prometheus · GitHub
如果你不知道springboot对应的版本,可以私信我。