diff --git a/model/textparse/interface.go b/model/textparse/interface.go index 2e8c40e72..df01dbc34 100644 --- a/model/textparse/interface.go +++ b/model/textparse/interface.go @@ -71,8 +71,8 @@ type Parser interface { // if the scrape protocol or metric type does not support created timestamps. CreatedTimestamp() *int64 - // Next advances the parser to the next sample. It returns false if no - // more samples were read or an error occurred. + // Next advances the parser to the next sample. + // It returns (EntryInvalid, io.EOF) if no samples were read. Next() (Entry, error) } diff --git a/model/textparse/openmetricsparse.go b/model/textparse/openmetricsparse.go index ea92bc55f..b7ad1dd85 100644 --- a/model/textparse/openmetricsparse.go +++ b/model/textparse/openmetricsparse.go @@ -239,8 +239,8 @@ func (p *OpenMetricsParser) parseError(exp string, got token) error { return fmt.Errorf("%s, got %q (%q) while parsing: %q", exp, p.l.b[p.l.start:e], got, p.l.b[p.start:e]) } -// Next advances the parser to the next sample. It returns false if no -// more samples were read or an error occurred. +// Next advances the parser to the next sample. +// It returns (EntryInvalid, io.EOF) if no samples were read. func (p *OpenMetricsParser) Next() (Entry, error) { var err error diff --git a/model/textparse/promparse.go b/model/textparse/promparse.go index 54b5306e6..a611f3aea 100644 --- a/model/textparse/promparse.go +++ b/model/textparse/promparse.go @@ -280,8 +280,8 @@ func (p *PromParser) parseError(exp string, got token) error { return fmt.Errorf("%s, got %q (%q) while parsing: %q", exp, p.l.b[p.l.start:e], got, p.l.b[p.start:e]) } -// Next advances the parser to the next sample. It returns false if no -// more samples were read or an error occurred. +// Next advances the parser to the next sample. +// It returns (EntryInvalid, io.EOF) if no samples were read. func (p *PromParser) Next() (Entry, error) { var err error