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 posibility to run query on a given connection #90

Open
salacr opened this issue Jul 11, 2023 · 1 comment
Open

Add posibility to run query on a given connection #90

salacr opened this issue Jul 11, 2023 · 1 comment

Comments

@salacr
Copy link

salacr commented Jul 11, 2023

Hi,

For our use case, it would be helpful if we have the possibility to run some queries on specific connections.

So we would probably need to extend config to something like thisL

  connections:
  db1: 'postgres://postgres@localhost/postgres?sslmode=disable'
  db2: 'postgres://postgres@localhost/postgres?sslmode=disable'

and add posibility to define db in queries section

  queries:
    # name is prefied with sql_ and used as the metric name
  - name: "running_queries"
  - connections:
    - db1

I'm willing to contribute. I guess that the most difficult part will be to make the config backward compatible. My proposal is

  1. create a new section ?
named_connections:
  db1: 'postgres://postgres@localhost/postgres?sslmode=disable'
  db2: 'postgres://postgres@localhost/postgres?sslmode=disable'
  1. add somehow the name to the connection string
connections:
 - 'db1##postgres://postgres@localhost/postgres?sslmode=disable'
 - 'db1##postgres://postgres@localhost/postgres?sslmode=disable'
@dewey
Copy link
Member

dewey commented Jan 30, 2024

Hey, wouldn't it be easier to just add a new config block that always has one connection and the query you want to run on that connection? Maybe I'm not understanding the question though.

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

No branches or pull requests

2 participants