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

Add application_name to Connection string when using Postgres Driver #9135

Open
fracca opened this issue Jan 23, 2025 · 2 comments
Open

Add application_name to Connection string when using Postgres Driver #9135

fracca opened this issue Jan 23, 2025 · 2 comments
Assignees
Labels
driver:postgres Issues relating to the Postgres driver question The issue is a question. Please use Stack Overflow for questions.

Comments

@fracca
Copy link

fracca commented Jan 23, 2025

I am using AWS RDS Aurora with Postgres, and they can segment Database load by Application name. I have been able to set this configuration for all my other clients, but I am unable to configure this with CubeJS.

I would like to see either a new ENV variable or a configuration Option or a Default Value if nothing is set.

Looking at the "pg" package documentation, they say that this option is supported. So this change should be pretty simple and quick to implement.

Thanks Team, Keep up the great work.

@igorlukanin
Copy link
Member

Looking at the "pg" package documentation, they say that this option is supported.

Could you please share the relevant part? How is it supposed to be configured there?

@igorlukanin igorlukanin self-assigned this Jan 24, 2025
@igorlukanin igorlukanin added question The issue is a question. Please use Stack Overflow for questions. driver:postgres Issues relating to the Postgres driver labels Jan 24, 2025
@fracca
Copy link
Author

fracca commented Jan 26, 2025

Hi Igor,

Thanks for getting back to me!

I referenced the following documents:

From this, I saw that the application_name parameter is supported as part of the client configuration. Additionally, the documentation indicates that if no value is explicitly set, the client will check for corresponding environment variables.

Based on this, I experimented a bit and found that setting the PGAPPNAME environment variable on the Cube.js API server successfully propagated the application_name in the connection string.

This serves as a workaround for my use case. However, I believe this feature could be more user-friendly if:

  1. A configuration option or environment variable specific to Cube.js were implemented to set the application_name value.
  2. Alternatively, the documentation could be updated to mention that PGAPPNAME can be used as a workaround to configure application_name.

Let me know what you think, and I’m happy to provide further details or help test any changes!

Thanks again for your time and all the great work the team is doing!

Best regards,
Scott Francis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
driver:postgres Issues relating to the Postgres driver question The issue is a question. Please use Stack Overflow for questions.
Projects
None yet
Development

No branches or pull requests

2 participants