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

pgbackrest-info.sh expectations on --log-level-console #401

Closed
jpargudo opened this issue Apr 17, 2024 · 6 comments · Fixed by #402
Closed

pgbackrest-info.sh expectations on --log-level-console #401

jpargudo opened this issue Apr 17, 2024 · 6 comments · Fixed by #402
Labels
UNCONFIRMED Initial state. Need's triaged

Comments

@jpargudo
Copy link

Describe the issue:

In https://github.com/CrunchyData/pgmonitor/blob/3d31a667b0a08f0aa6180655e1cc61a44867e6cc/postgres_exporter/linux/pgbackrest-info.sh ,

There's an expectation on the --log-level-console that is the default to "info".

But when used in an environment where that log-level is set somewhere to something else (eg. "debug"), then the output will add extra (debug or other) information, so the script returns wrong things.

A solution could be to enforce --log-level-console=info on any of the calls to "pgbackrest --output=json [...] info" ...

Describe the expected behavior:

A working script whatever the level of verbosity set in --log-level-console

Tell us about your environment:

  • pgMonitor version: all
  • Container or non-container: both
  • Container name / image:
  • Operating System for non-container:
  • PostgreSQL Version: all
  • Exporter(s) in use (incl. version):
  • Prometheus version:
  • AlertManager version:
  • Grafana version:
@jpargudo jpargudo added the UNCONFIRMED Initial state. Need's triaged label Apr 17, 2024
@cbandy
Copy link
Member

cbandy commented Apr 18, 2024

🤔 Does --log-level-stderr=debug have a similar negative effect?

@jpargudo
Copy link
Author

@cbandy good catch! Given my tests, yes, it has the same similar negative effect...

Any program parsing the output of pgbackrest --output=json [...] info will have problems here too with that --log-level-stderr=debug...

So likely, --log-level-stderr=info has to be set here... too.

Thank you !

@keithf4
Copy link
Collaborator

keithf4 commented Apr 19, 2024

Great catch! Thank you @cbandy

@cbandy
Copy link
Member

cbandy commented Apr 19, 2024

Looking at the other log options, should we also set log-level-file = off? Would anyone want something there for scrapes?

@keithf4
Copy link
Collaborator

keithf4 commented Apr 19, 2024

I would think that users would probably want all actions that backrest does logged there as they intend with their settings. Would also provide a place to look for more detailed info if something does go wrong with one of the script calls.

@keithf4
Copy link
Collaborator

keithf4 commented Apr 19, 2024

pgBackRest's default for --log-level-stderr is actually warn so that's what I'm going to set it to here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UNCONFIRMED Initial state. Need's triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants