Search code examples
time-seriesgrafanaquestdb

Read-only user for Grafana when connecting to QuestDB


I have a Grafana dashboard connected to QuestDB to visualise low-latency data from cryptocurrency.

I would like to set the user as read-only, but it seems QuestDB is postgresql compatible only for queries, and user management statements like CREATE USER or GRANT don't work.

I know I can set my pgwire user in QuestDB as read-only, but that means I cannot execute CREATE TABLE statements from the web interface.

Any suggestions to have a read-only user for my dashboards?


Solution

  • Since QuestDB release 6.7, a second user can be enabled via config for read-only access.

    The default settings make this user disabled, but you can change the settings at server.conf (or via ENV variables when starting up QuestDB). These are the relevant config variables.

    pg.readonly.user.enabled=true
    # default username is "user"
    pg.readonly.user=my_ro_user
    # default password is "quest"
    pg.readonly.password=pwd
    

    Once you enable the second user, the main one (named by default 'Admin') will still be available and it is the one used by the web console, so you can still run your DDL statements from web console, but use the read-only user from Grafana for improved security.