MSSQL Linked Server DataSource Syntax in Grafana

  • What Grafana version and what operating system are you using?
    Windows 2019 Data Server - Grafana 9.4

  • What are you trying to achieve?
    Configure a datasource in Grafana that connects to a linked server in MSSQL vs the default databases.

  • How are you trying to achieve it?
    The syntax in the datasource connection screen.

  • What happened?
    The linked server datasource configuration returns, "cannot open database that was requested by the login.

  • What did you expect to happen?
    I’ve been testing different linked server connection strings in granafa without success.

  • Can you copy/paste the configuration(s) that you are having problems with?
    Underneath the MS SQL Datasource connection. I’ve added the user to the allowed permissions under MSSQL permissions for linked server and have been manipulating this string in attempt to connect to the linked server. If anyone is unfamiliar with linked server I posted a link below.
    [LINKED_SERVER].[CATALOG].[SCHEMA].[TABLE_NAME]

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    cannot open database that was requested by the login.

  • Did you follow any online instructions? If so, what is the URL?
    No errors are listed in the logs and no instructions listed in the error.

For reference this is a link to the MS SQL Linked server. I’ve linked to an Oracle DB.
Create linked servers - SQL Server | Microsoft Learn

Screenshot 2023-06-05 185347

When I attempt to connect this is the return message.
login error: mssql: Cannot open database “[LINKED_SERVER].[CATALOG].[SCHEMA].[TABLE_NAME]” that was requested by the login. Using the user default database “master” instead.

My at a loss. I’ve added the spc account to the linked server with permissions as an impersonator in SQL as well as making it the security context.

Any clues would be appreciated.

What do you see on the sql server security events service. It should give you a hint