From: Daniel Swarbrick <dswarbrick@debian.org>
Date: Tue, 27 Feb 2024 06:16:51 +0100
Subject: Support prometheus/common 0.47.0

Forwarded: not-needed

This cherry-picks part of a commit relating to negotiation of the
"Accept" header, which became more complex with prometheus/common
0.47.0. See upstream commit a28d786.
---
 web/federate.go | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/web/federate.go b/web/federate.go
index b0f4c06..7707f1b 100644
--- a/web/federate.go
+++ b/web/federate.go
@@ -185,8 +185,9 @@ Loop:
 	)
 	for _, s := range vec {
 		isHistogram := s.H != nil
+		formatType := format.FormatType()
 		if isHistogram &&
-			format != expfmt.FmtProtoDelim && format != expfmt.FmtProtoText && format != expfmt.FmtProtoCompact {
+			formatType != expfmt.TypeProtoDelim && formatType != expfmt.TypeProtoText && formatType != expfmt.TypeProtoCompact {
 			// Can't serve the native histogram.
 			// TODO(codesome): Serve them when other protocols get the native histogram support.
 			continue
