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

Fix for segfault on prometheus metrics logging #513

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ilya-maltsev
Copy link
Contributor

Based on #508

@ilya-maltsev
Copy link
Contributor Author

changes only in sources/cron.c....
sources/frontend.c - realy need to be formatted?

@reshke
Copy link
Contributor

reshke commented Jul 14, 2023

changes only in sources/cron.c.... sources/frontend.c - realy need to be formatted?
Yes, seems that.

If this is true resolves issue, we can actually drop function od_logger_write_plain completely

@ilya-maltsev
Copy link
Contributor Author

after this changes prometheus metrics in syslog looks like:

Jul 14 06:02:49 test-odyssey odyssey: 1716060 2023-07-14T06:02:49Z info [none-none] [none-none] stats # HELP client_pool_total Total database clients count\n# TYPE client_pool_total gauge\nclient_pool_total{database\="default_db"} 1\n\n# HELP avg_tx_count Average transactions count per second\n# TYPE avg_tx_count gauge\navg_tx_count{user\="default_user",database\="default_db"} 0\n\n# HELP avg_tx_time Average transaction time in usec\n# TYPE avg_tx_time gauge\navg_tx_time{user\="default_user",database\="default_db"} 0\n\n# HELP avg_query_count Average query count per second\n# TYPE avg_query_count gauge\navg_query_count{user\=

but size of prom_metrics more then OD_LOGLINE_MAXLEN

#define OD_LOGLINE_MAXLEN 1024

and with od_log all of prometheus metrics cannot be placed in logfile

so I would like to suggest to remove this functionality which was added in earlier implementations of prometheus metrics support - #346

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