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

[receiver/sqlquery] Add connection pool feature #36752

Open
stef-philipsen-tfs opened this issue Dec 10, 2024 · 2 comments
Open

[receiver/sqlquery] Add connection pool feature #36752

stef-philipsen-tfs opened this issue Dec 10, 2024 · 2 comments
Labels
enhancement New feature or request receiver/sqlquery SQL query receiver

Comments

@stef-philipsen-tfs
Copy link

stef-philipsen-tfs commented Dec 10, 2024

Component(s)

receiver/sqlquery

Is your feature request related to a problem? Please describe.

Currently, when adding new metrics with the sqlquery receiver, the receiver sets up a new connection for each query.

We currently have more than 40 of these metrics, which means Open Telemetry opens more than 40 database connections.

image

Describe the solution you'd like

It would be better if the PostgreSQL Connection pool feature would be available for this receiver too, so that the amount of database connections can be reduced.

Describe alternatives you've considered

Updating the maximum number of connections so that more connections are allowed, but this means the database needs more resources to keep all these connections open.

Additional context

No response

@stef-philipsen-tfs stef-philipsen-tfs added enhancement New feature or request needs triage New item requiring triage labels Dec 10, 2024
@github-actions github-actions bot added the receiver/sqlquery SQL query receiver label Dec 10, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@crobert-1
Copy link
Member

I took a quick look, sounds like a good enhancement to me.

it looks like this functionality is provided by golang's standard SQL package (example usage here), and can be implemented with all supported SQL drivers. This would require adding new configuration options and plumbing them down to here:

return sqlOpenerFunc(sqlCfg.Driver, sqlCfg.DataSource)

@crobert-1 crobert-1 removed the needs triage New item requiring triage label Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request receiver/sqlquery SQL query receiver
Projects
None yet
Development

No branches or pull requests

2 participants