Skip to content

Commit

Permalink
Only use OpenMetrics and Text in contentType
Browse files Browse the repository at this point in the history
  • Loading branch information
CatherineF-dev committed Mar 13, 2023
1 parent 054f2a4 commit a3bd5d5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/metricshandler/metrics_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ func (m *MetricsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {

contentType := expfmt.NegotiateIncludingOpenMetrics(r.Header)

if contentType != expfmt.FmtOpenMetrics {
contentType = expfmt.FmtText
}
resHeader.Set("Content-Type", string(contentType))

if m.enableGZIPEncoding {
Expand Down

0 comments on commit a3bd5d5

Please sign in to comment.