Skip to content

Commit a3bd5d5

Browse files
Only use OpenMetrics and Text in contentType
1 parent 054f2a4 commit a3bd5d5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/metricshandler/metrics_handler.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ func (m *MetricsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
187187

188188
contentType := expfmt.NegotiateIncludingOpenMetrics(r.Header)
189189

190+
if contentType != expfmt.FmtOpenMetrics {
191+
contentType = expfmt.FmtText
192+
}
190193
resHeader.Set("Content-Type", string(contentType))
191194

192195
if m.enableGZIPEncoding {

0 commit comments

Comments
 (0)