-
Notifications
You must be signed in to change notification settings - Fork 487
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 2.25.0 #415
Conversation
@@ -3,55 +3,54 @@ module github.com/grafana/agent | |||
go 1.15 | |||
|
|||
require ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish I knew why sometimes go mod vendor
changes the indentation depending on what computer I'm on 😞
var ErrNotReady = errors.New("Scrape manager not ready") | ||
|
||
// readyScrapeManager allows a scrape manager to be retrieved. Even if it's set at a later point in time. | ||
type readyScrapeManager struct { | ||
mtx sync.RWMutex | ||
m *scrape.Manager | ||
} | ||
|
||
// Set the scrape manager. | ||
func (rm *readyScrapeManager) Set(m *scrape.Manager) { | ||
rm.mtx.Lock() | ||
defer rm.mtx.Unlock() | ||
|
||
rm.m = m | ||
} | ||
|
||
// Get the scrape manager. If is not ready, return an error. | ||
func (rm *readyScrapeManager) Get() (*scrape.Manager, error) { | ||
rm.mtx.RLock() | ||
defer rm.mtx.RUnlock() | ||
|
||
if rm.m != nil { | ||
return rm.m, nil | ||
} | ||
|
||
return nil, ErrNotReady | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We used to import this directly from Prometheus but recently the logic got moved to Prometheus' main package, so we have to reimplement it now.
@@ -40,7 +40,7 @@ func (r walReplayer) Replay(dir string) error { | |||
startFrom++ | |||
} | |||
|
|||
_, last, err := w.Segments() | |||
_, last, err := wal.Segments(w.Dir()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wal.(*Wal).Segments
got removed and replaced with a package-level function.
* update prometheus to 2.25.0 * changelog * update docs to include new headers field in remote_write
PR Description
Updates the Prometheus dependency to 2.25.0.
Which issue(s) this PR fixes
Closes #410
Closes #412
Closes #340
Closes #385
Notes to the Reviewer
PR Checklist