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

Apply defaults to undefined sections #546

Merged
merged 2 commits into from
Apr 16, 2021

Conversation

rfratto
Copy link
Member

@rfratto rfratto commented Apr 15, 2021

PR Description

#545 found that defining just an integrations block prevented integrations from being scraped. This was found to be because the default scrape_interval and scrape_timeout weren't being applied when prometheus wasn't present in the config file.

This change ensures that defaults are applied appropriately to empty files (or files without a given section). Only defaults for integrations and prometheus need to be defined, as integrations depends on prometheus (and no other subsystem has defaults).

Which issue(s) this PR fixes

Fixes #545

Notes to the Reviewer

PR Checklist

  • CHANGELOG updated
  • Documentation added
  • Tests updated

@rfratto rfratto requested a review from mattdurham April 15, 2021 20:43
Copy link
Collaborator

@mattdurham mattdurham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rfratto rfratto merged commit e874ac4 into grafana:main Apr 16, 2021
rfratto added a commit to rfratto/agent that referenced this pull request Apr 22, 2021
PR grafana#546 introduced a default value for the overall Config struct which
overwrote the defaults coming from flags. This commit ensures that
flag-level defaults take precedence.
rfratto added a commit to rfratto/agent that referenced this pull request Apr 22, 2021
PR grafana#546 introduced a default value for the overall Config struct which
overwrote the defaults coming from flags. This commit ensures that
flag-level defaults take precedence.
@rfratto rfratto mentioned this pull request Apr 22, 2021
3 tasks
rfratto added a commit that referenced this pull request Apr 22, 2021
PR #546 introduced a default value for the overall Config struct which
overwrote the defaults coming from flags. This commit ensures that
flag-level defaults take precedence.
@mattdurham mattdurham mentioned this pull request Sep 7, 2021
3 tasks
mattdurham pushed a commit that referenced this pull request Nov 11, 2021
mattdurham pushed a commit that referenced this pull request Nov 11, 2021
PR #546 introduced a default value for the overall Config struct which
overwrote the defaults coming from flags. This commit ensures that
flag-level defaults take precedence.
@rfratto rfratto deleted the prometheus-defaults 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
Development

Successfully merging this pull request may close these issues.

postgres_exporter: panic: runtime error: integer divide by zero
2 participants