You can specify application_name in posgres connection string:
application_name
postgresql://.../database?application_name=myapp
If other Query parameters are already present use & to concatenate them.
&