Skip to content

Add posibility to run query on a given connection #90

@salacr

Description

@salacr

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions