Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Prometheus to v0.40.1 #5896

Merged
merged 16 commits into from
Dec 16, 2022
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
Next Next commit
Added missing nil check for delSeriesIterator and comment
Signed-off-by: Sebastian Rabenhorst <sebastian.rabenhorst@shopify.com>
rabenhorst committed Dec 13, 2022

Verified

This commit was signed with the committer’s verified signature.
stmcginnis Sean McGinnis
commit ee234a85d810002c1c001953f3e3d6b5e5c71b6a
2 changes: 1 addition & 1 deletion pkg/compact/downsample/downsample.go
Original file line number Diff line number Diff line change
@@ -706,7 +706,7 @@ func (it *AverageChunkIterator) Next() chunkenc.ValueType {
cok, sok := it.cntIt.Next(), it.sumIt.Next()
if cok != sok {
it.err = errors.New("sum and count iterator not aligned")
return chunkenc.ValFloat
return chunkenc.ValNone
}
if cok == chunkenc.ValNone {
return chunkenc.ValNone
12 changes: 10 additions & 2 deletions pkg/compactv2/modifiers.go
Original file line number Diff line number Diff line change
@@ -236,7 +236,11 @@ type delSeriesIterator struct {
}

func (p *delSeriesIterator) Next() chunkenc.ValueType {
if valueType := p.curr.Next(); p.curr != nil && valueType != chunkenc.ValNone {
if p.curr == nil {
return chunkenc.ValNone
}

if valueType := p.curr.Next(); valueType != chunkenc.ValNone {
return valueType
}

@@ -254,7 +258,11 @@ func (p *delSeriesIterator) Next() chunkenc.ValueType {
}

func (p *delSeriesIterator) Seek(t int64) chunkenc.ValueType {
if valueType := p.curr.Seek(t); p.curr != nil && valueType != chunkenc.ValNone {
if p.curr == nil {
return chunkenc.ValNone
}

if valueType := p.curr.Seek(t); valueType != chunkenc.ValNone {
return valueType
}
for p.Next() != chunkenc.ValNone {
5 changes: 3 additions & 2 deletions pkg/server/http/http.go
Original file line number Diff line number Diff line change
@@ -78,7 +78,7 @@ func (s *Server) ListenAndServe() error {

flags := &toolkit_web.FlagConfig{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should just import flags from exporter-toolkit and pass those options. There is https://pkg.go.dev/github.com/prometheus/exporter-toolkit@v0.8.1/web/kingpinflag#AddFlags

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that would introduce more changes. I can do that in a separate followup PR. WDYT?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, follow-up sounds good!

WebListenAddresses: &([]string{s.opts.listen}),
WebSystemdSocket: OfBool(false),
WebSystemdSocket: ofBool(false),
WebConfigFile: &s.opts.tlsConfigPath,
}

@@ -139,6 +139,7 @@ func registerProbes(mux *http.ServeMux, p *prober.HTTPProbe, logger log.Logger)
}
}

func OfBool(i bool) *bool {
// Helper for exporter toolkit FlagConfig
func ofBool(i bool) *bool {
return &i
}