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

Fail fast when pganalyze section is missing in config file #141

Merged
merged 1 commit into from
Jan 21, 2021

Conversation

msakrejda
Copy link
Contributor

Right now, if the pganalyze section is missing, we ignore this issue
and proceed with an empty api_key (and default api_base_url). If
there's a typo in the section name or a config structure issue (e.g.,
API key in the default section instead of the pganalyze section), it
can be hard to figure out why an API key is being rejected.

Instead, fail fast when reading the config if the [pganalyze] section
is missing or cannot be mapped onto the config struct.

Right now, if the pganalyze section is missing, we ignore this issue
and proceed with an empty api_key (and default api_base_url). If
there's a typo in the section name or a config structure issue (e.g.,
API key in the default section instead of the pganalyze section), it
can be hard to figure out why an API key is being rejected.

Instead, fail fast when reading the config if the [pganalyze] section
is missing or cannot be mapped onto the config struct.
@msakrejda msakrejda requested a review from lfittl January 19, 2021 22:30
@msakrejda msakrejda merged commit f4cbc5d into master Jan 21, 2021
@msakrejda msakrejda deleted the fail-fast-on-missing-pganalyze-section-in-config branch January 21, 2021 18:24
lfittl added a commit that referenced this pull request Jun 28, 2022
Relevant changes that apply to the collector:

- Fixes memory leak in pg_query_fingerprint error handling [#141](pganalyze/libpg_query#141)
- Add support for parsing more operators that include a `?` character (special cased to support old pg_stat_statements query texts)
  - ltree extension [#136](pganalyze/libpg_query#136)
  - promscale extension [#133](pganalyze/libpg_query#133)
lfittl added a commit that referenced this pull request Jun 29, 2022
Relevant changes that apply to the collector:

- Fixes memory leak in pg_query_fingerprint error handling [#141](pganalyze/libpg_query#141)
- Add support for parsing more operators that include a `?` character (special cased to support old pg_stat_statements query texts)
  - ltree extension [#136](pganalyze/libpg_query#136)
  - promscale extension [#133](pganalyze/libpg_query#133)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants