MCPcopy
hub / github.com/prometheus/prometheus / HeaderMediaType

Method HeaderMediaType

config/config.go:562–571  ·  view source on GitHub ↗

HeaderMediaType returns the MIME mediaType for a particular ScrapeProtocol.

()

Source from the content-addressed store, hash-verified

560
561// HeaderMediaType returns the MIME mediaType for a particular ScrapeProtocol.
562func (s ScrapeProtocol) HeaderMediaType() string {
563 if _, ok := ScrapeProtocolsHeaders[s]; !ok {
564 return ""
565 }
566 mediaType, _, err := mime.ParseMediaType(ScrapeProtocolsHeaders[s])
567 if err != nil {
568 return ""
569 }
570 return mediaType
571}
572
573var (
574 PrometheusProto ScrapeProtocol = "PrometheusProto"

Callers 3

TestNewParserFunction · 0.80
newScrapeLoopFunction · 0.80
TestScrapeProtocolHeaderFunction · 0.80

Calls

no outgoing calls

Tested by 2

TestNewParserFunction · 0.64
TestScrapeProtocolHeaderFunction · 0.64