-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Upgrade Prometheus to v0.302.1 #40103
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
Conversation
cf42107
to
595ef6f
Compare
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.
please rebase
…abelNameLimitConfig` since it is deprecated
595ef6f
to
4201547
Compare
@songy23 done |
pinging prometheus receiver code owners @Aneurysm9, @dashpole, @ArthurSens, @krajorama for approval |
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.
Thanks a lot for picking up the work I left unfinished ❤️
This problem with the Reload was driving me nuts, I'm super glad you found a solution!
I've tested a few different configurations and the collector seems to start without problems :)
#### Description This PR superseeds open-telemetry#38530 (as it went stale)~~, but goes to `v0.303.1` instead of `v0.302.x`~~. In order to workaround the behavior change when calling `prometheus.config.GetScrapeConfigs()` (mentioned [here](open-telemetry#38530 (comment))) I've made the following changes in `prometheusreceiver`: 1. Added a `reloadPromConfig` func that will marshal an input as yaml and then load it using `prometheus.config.Load` to ensure that the un-exported field `loaded` is set to `true` 2. Updated `PromConfig.Unmarshal` to delegate to `reloadPromConfig` 3. Added `PromConfig.Reload` which delegates to `reloadPromConfig` to reload itself 4. Updated `newPrometheusReceiver` to call `PromConfig.Reload` to ensure the Prometheus config is `loaded` 5. Updated `Config.Validate` to only check if scrape configs or files have been set instead of calling `GetScrapeConfigs` since it's not necessary they get built here 6. Updated `PromConfig.Validate` to only call `GetScrapeConfigs` if any where configured
Description
This PR superseeds #38530 (as it went stale)
, but goes to.v0.303.1
instead ofv0.302.x
In order to workaround the behavior change when calling
prometheus.config.GetScrapeConfigs()
(mentioned here) I've made the following changes inprometheusreceiver
:reloadPromConfig
func that will marshal an input as yaml and then load it usingprometheus.config.Load
to ensure that the un-exported fieldloaded
is set totrue
PromConfig.Unmarshal
to delegate toreloadPromConfig
PromConfig.Reload
which delegates toreloadPromConfig
to reload itselfnewPrometheusReceiver
to callPromConfig.Reload
to ensure the Prometheus config isloaded
Config.Validate
to only check if scrape configs or files have been set instead of callingGetScrapeConfigs
since it's not necessary they get built herePromConfig.Validate
to only callGetScrapeConfigs
if any where configured