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 2.25.0 #415

Merged
merged 3 commits into from
Feb 18, 2021
Merged

Conversation

rfratto
Copy link
Member

@rfratto rfratto commented Feb 18, 2021

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

  • CHANGELOG updated
  • Documentation added
  • Tests updated

@rfratto rfratto changed the title Update prometheus 2.25.0 Update Prometheus to 2.25.0 Feb 18, 2021
@@ -3,55 +3,54 @@ module github.com/grafana/agent
go 1.15

require (
Copy link
Member Author

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 😞

Comment on lines +924 to +950
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
}
Copy link
Member Author

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())
Copy link
Member Author

@rfratto rfratto Feb 18, 2021

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.

@rfratto rfratto merged commit 7428f50 into grafana:main Feb 18, 2021
@mattdurham mattdurham mentioned this pull request Sep 7, 2021
3 tasks
mattdurham pushed a commit that referenced this pull request Nov 11, 2021
* update prometheus to 2.25.0

* changelog

* update docs to include new headers field in remote_write
@rfratto rfratto deleted the update-prometheus-2.25.0 branch March 14, 2022 18:18
@github-actions github-actions bot added the frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. label Apr 2, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed.
Projects
None yet
2 participants