grafana/public/app/plugins/datasource/mssql
Piotr Jamróz 9ace8686a1
Datasources: Improve error handling for testing data sources (#35120)
* Improve error handling for error messages

The error message will be read from error object from the following properties in the following order:
- message
- data.message
- statusText

* Convert api/ds/query errors to TestingStatus

SQL datasources (mysql, mssql, postgres) and CloudWatch use api/ds/query to test the data source, but previously didn't handle errors returned by this endpoint. If the error cannot be handled it's re-thrown to be handled in public/app/features/datasources/state/actions.ts

* Use async/await instead of Promises

* Remove incorrect type import

TestingStatus is in app/types. Should be pulled down to grafana/data but it depends on HealthCheckResultDetails that is public and lives in grafana/runtime. Ideally TestingStatus should live in grafana/data but I'm not sure if HealthCheckResultDetails can be move there too (?)

* Update packages/grafana-data/src/types/datasource.ts

Co-authored-by: Erik Sundell <erik.sundell@grafana.com>

* Handle errors with no details in toTestingStatus instead of re-throwing

* Update packages/grafana-data/src/types/datasource.ts

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

Co-authored-by: Erik Sundell <erik.sundell@grafana.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-07-08 14:32:27 +02:00
..
img mssql: add logo 2018-07-28 11:31:30 +02:00
partials MSSQL: By default let driver choose port (#32417) 2021-03-30 10:54:57 +02:00
specs Postgres/MySQL/MSSQL: Fix so that numeric/non-string values are returned from query variables (#35411) 2021-06-09 14:18:54 +02:00
config_ctrl.ts SQL data sources: Fix configuration UI (#33110) 2021-04-19 10:30:29 +02:00
datasource.ts Datasources: Improve error handling for testing data sources (#35120) 2021-07-08 14:32:27 +02:00
module.ts SQL data sources: Convert to return data frames (#32257) 2021-05-05 16:46:07 +02:00
plugin.json Chore: show grafana labs not project (#23913) 2020-04-26 15:34:56 -07:00
query_ctrl.ts SQL data sources: Convert to return data frames (#32257) 2021-05-05 16:46:07 +02:00
README.md mssql: update readme 2018-03-19 11:20:17 +01:00
response_parser.ts Annotations: Fix sql annotation parsing for empty responses (#35367) 2021-06-09 21:14:28 +08:00
types.ts SQL data sources: Convert to return data frames (#32257) 2021-05-05 16:46:07 +02:00

Grafana Microsoft SQL Server Data Source - Native Plugin

Grafana ships with a built-in Microsoft SQL Server (MSSQL) data source plugin that allows you to query and visualize data from any Microsoft SQL Server 2005 or newer.

Adding the data source

  1. Open the side menu by clicking the Grafana icon in the top header.
  2. In the side menu under the Configuration link you should find a link named Data Sources.
  3. Click the + Add data source button in the top header.
  4. Select Microsoft SQL Server from the Type dropdown.

For more information, check the docs.