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

[Reverted] add logrotate config for pgbouncer and filebeat input #921 #1823

Merged
merged 3 commits into from
Nov 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,17 @@ filebeat.inputs:
{{ k }}: {{ v }}
{% endfor %}
{% endif %}
- type: log
enabled: true
paths:
- /var/log/pgbouncer/*.log*
ar3ndt marked this conversation as resolved.
Show resolved Hide resolved
exclude_files: [".gz$"]
{% if specification.pgbouncer_input.multiline is defined -%}
multiline:
{% for k, v in specification.pgbouncer_input.multiline.items() %}
{{ k }}: {{ v }}
{% endfor %}
{% endif %}
{% endif %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a posibility to use multiline for pgbouncer as well. Dont forget about update docs. Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pgbouncer logs do not seem to generate multilines. Do you think it is neccessary anyways then?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm I don't know the structure of pgbouncer logs. It would be good to have this as an option (not enabled by default) as we already provided it for postgresql logs. So maybe let's involve someone else in discussion.

Copy link
Contributor

Choose a reason for hiding this comment

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

I've checked on Ubuntu, there is no any multi-line entry in log, even after changing verbose = 0 to verbose = 2.


{% if 'kubernetes_master' in group_names or 'kubernetes_node' in group_names %}
Expand Down
13 changes: 13 additions & 0 deletions core/src/epicli/data/common/defaults/configuration/postgresql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,16 @@ specification:
# to have multiple unique filenames per day when dateext option is set
dateformat -%Y%m%dH%H
}
/var/log/pgbouncer/pgbouncer.log {
Copy link
Contributor

Choose a reason for hiding this comment

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

On RHEL there is already existing configuration in /etc/logrotate.d/pgbouncer so this one duplicates it.

missingok
notifempty
sharedscripts
copytruncate
size 10M
daily
create 0640 pgbouncer pgbouncer
Copy link
Contributor

Choose a reason for hiding this comment

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

On Ubuntu we do not have such user:

id pgbouncer
id: ‘pgbouncer’: no such user

nodateext
postrotate
/bin/kill -HUP cat /run/pgbouncer/pgbouncer.pid 2>/dev/null 2> /dev/null || true
Copy link
Contributor

Choose a reason for hiding this comment

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

On Ubuntu the pidfile path is different:

grep pidfile /etc/pgbouncer/pgbouncer.ini
pidfile = /var/run/postgresql/pgbouncer.pid

endscript
}