-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[receiver/prometheus] include scrape configs provided via scrape_config_files
#34897
[receiver/prometheus] include scrape configs provided via scrape_config_files
#34897
Conversation
… up receiver Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com>
Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com>
scrape_config_files
Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com>
Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com>
Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com>
if !enableNativeHistogramsGate.IsEnabled() { | ||
// Enforce scraping classic histograms to avoid dropping them. | ||
for _, scrapeConfig := range cfg.ScrapeConfigs { | ||
for _, scrapeConfig := range scrapeConfigs { |
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.
Here we have the limitation that the scrapeConfig.ScrapeClassigHistograms
property is only applied to the scrapeconfigs provided directly in the config, but not the ones via scrape_config_files
, as the scrapeManager
internally calls GetScrapeConfigs()
, which leads to the scrapeConfigs being read from the file system again.
One potential solution could be to set cfg.ScrapeConfigs
here to the result of GetScrapeConfigs()
, and clear the ScrapeConfigFiles
property, but this feels a bit hacky. What do you think @dashpole ?
# Conflicts: # receiver/prometheusreceiver/config.go # receiver/prometheusreceiver/metrics_receiver.go
Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com>
Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com>
Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com>
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.
LGTM
Co-authored-by: Antoine Toulme <antoine@toulme.name>
Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com>
…fig_files` (open-telemetry#34897) **Description:** This PR fixes a bug in the prometheus receiver where the scrape configs provided via `scrape_config_files` were not applied. Using `scrape_config_files` instead of providing the scrape configs directly does come with some limitations regarding the use of env vars, as also mentioned in open-telemetry#34786 (comment). **Link to tracking Issue:** open-telemetry#34786 **Testing:** Added unit tests --------- Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com> Co-authored-by: Antoine Toulme <antoine@toulme.name> Co-authored-by: David Ashpole <dashpole@google.com>
Description: This PR fixes a bug in the prometheus receiver where the scrape configs provided via
scrape_config_files
were not applied. Usingscrape_config_files
instead of providing the scrape configs directly does come with some limitations regarding the use of env vars, as also mentioned in #34786 (comment).Link to tracking Issue: #34786
Testing: Added unit tests