beats
beats copied to clipboard
Prometheus metricbeat module doesn't fetch metrics when content type is blank
Current behavior
Prometheus v3 has stricter handling of the Content-Type header: it expects a valid header, and if none is present, returns a fallback type. Code here.
The current fallback text/plain; version=0.0.4; charset=utf-8 in Beats does not match any known media type while initializing the text parser. This causes the Prometheus library to send a nil parser, and a non-fatal error which isn't handled properly in Beats.
Potential Fix
Use text/plain as the fallback type and only return error if it's not the one that is returned when the content type is blank and a fallback is used instead.