-
Notifications
You must be signed in to change notification settings - Fork 51
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
Add an application_name for check_pgactivity #336
Comments
Hello, I'm not against this. However, monitoring should use a dedicated user, non-privileged for current supported PostgreSQL releases. So it's easy to filter them out this way. |
You're right, of course. But I don't see it much in the wild. I repeat that it could be a way to indicate which service is running. |
Yup. I'm fine with your proposal. This feature came with PostgreSQL 9.0 which is now quite old. I'm not sure that there are still older PostgreSQL releases monitored with check_pga. |
I wouldn't be surprised if people have multiple monitoring stuff (say check_pga, prometheus...) and use the same role for both. In any case, having a better application name than "psql" definitely looks like a good idea. Not sure about having the service too, it seems like it could add some overhead and might end up bloating any application_name monitoring stuff. Compatibility with pre9.0 should be maintained, so we will likely need to do it with a plan SQL query. |
Overhead? It would be set once for each service.
Yes, it would bloat pgbadger reports and similar tools, but we usually filter monitoring queries in these kinds of reports. An easy work around would be to update
I don't understand. I may miss a bit of history or ignore a trick. |
I think rjuju meant using SET and not relying on PGAPPNAME - which may leads to produce errors on <9.0 clusters if the client is ≥9.0. |
One or two additional queries are still more overhead than 0 query.
Yes, but AFAICS we only retrieve the server version for services that have version requirements (in set_pgversion), so a service like check_connection would have 2 additional queries. |
Right, but it's likely that it would simply be silently ignored on older versions (I don't think client tools think that PG is a reserved prefix or anything for env variable). But we don't know the server version when launching psql, so we can't rely on env variable unfortunately. edit: I mean if we want to put anything specific per some db informaiton. I still prefer simply putting "check_pg_activity" as application name. |
I'm not sure to understand. So, let sets this env variable and forget about it. I'm +1 on setting |
And by the way: any existing |
Currently
check_pgactivity
appears inpostgresql.log
with such lines:You can often change the
application_name
one way or another, but I suggest a default one forcheck_pgactivity
,eg:
Perhaps adding some info on what is happening inside the service, like parameters? (probably overkill)
If it's ok, I may do the PR.
The text was updated successfully, but these errors were encountered: