Skip to content

[pull] main from prometheus:main #63

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

Merged
merged 2 commits into from
Mar 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 0 additions & 4 deletions discovery/openstack/loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,5 @@ func (i *LoadBalancerDiscovery) refresh(ctx context.Context) ([]*targetgroup.Gro
tg.Targets = append(tg.Targets, labels)
}

if err != nil {
return nil, err
}

return []*targetgroup.Group{tg}, nil
}
5 changes: 0 additions & 5 deletions discovery/vultr/vultr.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ package vultr
import (
"context"
"errors"
"fmt"
"log/slog"
"net"
"net/http"
Expand Down Expand Up @@ -137,10 +136,6 @@ func NewDiscovery(conf *SDConfig, logger *slog.Logger, metrics discovery.Discove

d.client.SetUserAgent(version.PrometheusUserAgent())

if err != nil {
return nil, fmt.Errorf("error setting up vultr agent: %w", err)
}

d.Discovery = refresh.NewDiscovery(
refresh.Options{
Logger: logger,
Expand Down
10 changes: 1 addition & 9 deletions model/labels/labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,15 +250,7 @@ func (ls Labels) WithoutEmpty() Labels {

// Equal returns whether the two label sets are equal.
func Equal(ls, o Labels) bool {
if len(ls) != len(o) {
return false
}
for i, l := range ls {
if l != o[i] {
return false
}
}
return true
return slices.Equal(ls, o)
}

// EmptyLabels returns n empty Labels value, for convenience.
Expand Down
7 changes: 3 additions & 4 deletions tsdb/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -2280,10 +2280,9 @@ func (db *DB) CleanTombstones() (err error) {
db.logger.Error("failed to delete block after failed `CleanTombstones`", "dir", dir, "err", err)
}
}
if err != nil {
return fmt.Errorf("reload blocks: %w", err)
}
return nil

// This should only be reached if an error occurred.
return fmt.Errorf("reload blocks: %w", err)
}
}
return nil
Expand Down
4 changes: 2 additions & 2 deletions tsdb/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9104,7 +9104,7 @@ func compareSeries(t require.TestingT, expected, actual map[string][]chunks.Samp
require.Equal(t, eS.F(), aS.F(), "sample %d in series %q differs", i, key)
case chunkenc.ValHistogram:
eH, aH := eS.H(), aS.H()
if aH.CounterResetHint == histogram.UnknownCounterReset && aH.CounterResetHint != histogram.GaugeType {
if aH.CounterResetHint == histogram.UnknownCounterReset {
eH = eH.Copy()
// It is always safe to set the counter reset hint to UnknownCounterReset
eH.CounterResetHint = histogram.UnknownCounterReset
Expand All @@ -9114,7 +9114,7 @@ func compareSeries(t require.TestingT, expected, actual map[string][]chunks.Samp

case chunkenc.ValFloatHistogram:
eFH, aFH := eS.FH(), aS.FH()
if aFH.CounterResetHint == histogram.UnknownCounterReset && aFH.CounterResetHint != histogram.GaugeType {
if aFH.CounterResetHint == histogram.UnknownCounterReset {
eFH = eFH.Copy()
// It is always safe to set the counter reset hint to UnknownCounterReset
eFH.CounterResetHint = histogram.UnknownCounterReset
Expand Down
Loading