Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Improve fallback handling
  • Loading branch information
mstrandboge committed Sep 10, 2025
commit 867a29cab72c3e0f8b5d811e4416f117f0ad1bda
6 changes: 4 additions & 2 deletions plugins/parsers/prometheus/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ func (p *Parser) Parse(data []byte) ([]telegraf.Metric, error) {
if !bytes.HasSuffix(data, []byte("\n")) {
data = append(data, []byte("\n")...)
}
// As of prometheus common 0.66.0, ProtoText is disallowed from the decoder. Before this version, it used
// to fall back to TextPlain, so we do that here instead to mimic the old behavior.
fallthrough
case expfmt.TypeProtoCompact:
// As of prometheus common 0.66.0, ProtoText and ProtoCompact are disallowed from the decoder. Before this
// version, it used to fall back to TextPlain, so we do that here instead to mimic the old behavior.
format = expfmt.NewFormat(expfmt.TypeTextPlain)
case expfmt.TypeUnknown:
p.Log.Debugf("Unknown format %q... Trying to continue...", p.Header.Get("Content-Type"))
Expand Down
Loading