Postgres: For template queries return [] and not error (#38060)

* Postgres: For template queries return [] and not error

* remove the console error

* update mssql and mysql

Co-authored-by: Ying WANG <ying.wang@grafana.com>
This commit is contained in:
Ivana Huckova 2021-08-19 07:43:41 -04:00 committed by GitHub
parent ecfa32c8cb
commit 7f8576ee37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 19 additions and 7 deletions

View File

@ -26,10 +26,12 @@ Report a bug by submitting a [bug report](https://github.com/grafana/grafana/iss
Follow the issue template and add additional information that will help us replicate the problem. Follow the issue template and add additional information that will help us replicate the problem.
For data visualization issues: For data visualization issues:
- Query results from the inspect drawer (data tab & query inspector) - Query results from the inspect drawer (data tab & query inspector)
- Panel settings can be extracted in the panel inspect drawer JSON tab - Panel settings can be extracted in the panel inspect drawer JSON tab
For a dashboard related issues: For a dashboard related issues:
- Dashboard JSON can be found in the dashboard settings JSON model view - Dashboard JSON can be found in the dashboard settings JSON model view
For authentication and alerting Grafana server logs are useful. For authentication and alerting Grafana server logs are useful.

View File

@ -25,6 +25,7 @@ Edit content in the `sources` directory.
Use the Hugo shortcode [relref](https://gohugo.io/content-management/cross-references/#use-ref-and-relref) any time you are linking to other internal docs pages. Use the Hugo shortcode [relref](https://gohugo.io/content-management/cross-references/#use-ref-and-relref) any time you are linking to other internal docs pages.
Syntax is: Syntax is:
``` ```
{{< relref "example.md" >}} {{< relref "example.md" >}}
``` ```
@ -33,7 +34,7 @@ You might need to add more context for the link (containing folders and so on, `
### Managing redirects ### Managing redirects
When moving content around or removing pages it's important that users following old links are properly redirected to the new location. We do this using the [aliases](https://gohugo.io/content-management/urls/#aliases) feature in Hugo. When moving content around or removing pages it's important that users following old links are properly redirected to the new location. We do this using the [aliases](https://gohugo.io/content-management/urls/#aliases) feature in Hugo.
If you are moving a page, add an `aliases` entry in the front matter referencing the old location of the page which will redirect the old url to the new location. If you are moving a page, add an `aliases` entry in the front matter referencing the old location of the page which will redirect the old url to the new location.
@ -57,7 +58,7 @@ Images are currently hosted in the grafana/website repo.
When a PR is merged with changes in the `docs/sources` directory, those changes are automatically synced by a GitHub action (`.github/workflows/publish.yml`) to the grafana/website repo. When a PR is merged with changes in the `docs/sources` directory, those changes are automatically synced by a GitHub action (`.github/workflows/publish.yml`) to the grafana/website repo.
* A PR that targets the `main` branch syncs to the `content/docs/grafana/next` directory in the `website` repository, and publishes to `https://grafana.com/docs/grafana/next/`. - A PR that targets the `main` branch syncs to the `content/docs/grafana/next` directory in the `website` repository, and publishes to `https://grafana.com/docs/grafana/next/`.
* A PR targeting the `latest/current` release branch syncs to the `content/docs/grafana/latest` directory in the `website` repository, and publishes to `https://grafana.com/docs/grafana/latest/`. - A PR targeting the `latest/current` release branch syncs to the `content/docs/grafana/latest` directory in the `website` repository, and publishes to `https://grafana.com/docs/grafana/latest/`.
Once the sync is complete, the website will automatically publish to production - no further action is needed. Once the sync is complete, the website will automatically publish to production - no further action is needed.

View File

@ -20,7 +20,7 @@ You can configure Grafana to only allow certain IP addresses or hostnames to be
The request security configuration option allows users to limit requests from the Grafana server. It targets requests that are generated by users. For more information, refer to [Request security]({{< relref "../enterprise/request-security.md" >}}) in [Grafana Enterprise]({{< relref "../enterprise" >}}). The request security configuration option allows users to limit requests from the Grafana server. It targets requests that are generated by users. For more information, refer to [Request security]({{< relref "../enterprise/request-security.md" >}}) in [Grafana Enterprise]({{< relref "../enterprise" >}}).
> **Note:** Request security is available in Grafana Enterprise v7.4 and later versions. > **Note:** Request security is available in Grafana Enterprise v7.4 and later versions.
## Firewall rules ## Firewall rules

View File

@ -53,4 +53,4 @@ go tool trace <trace file>
2019/11/24 22:20:42 Opening browser. Trace viewer is listening on http://127.0.0.1:39735 2019/11/24 22:20:42 Opening browser. Trace viewer is listening on http://127.0.0.1:39735
``` ```
For more information about how to analyze trace files, refer to [Go command trace](https://golang.org/cmd/trace/). For more information about how to analyze trace files, refer to [Go command trace](https://golang.org/cmd/trace/).

View File

@ -147,6 +147,9 @@ export class MssqlDatasource extends DataSourceWithBackend<MssqlQuery, MssqlOpti
.pipe( .pipe(
map((rsp) => { map((rsp) => {
return this.responseParser.transformMetricFindResponse(rsp); return this.responseParser.transformMetricFindResponse(rsp);
}),
catchError((err) => {
return of([]);
}) })
) )
); );

View File

@ -157,6 +157,9 @@ export class MysqlDatasource extends DataSourceWithBackend<MySQLQuery, MySQLOpti
.pipe( .pipe(
map((rsp) => { map((rsp) => {
return this.responseParser.transformMetricFindResponse(rsp); return this.responseParser.transformMetricFindResponse(rsp);
}),
catchError((err) => {
return of([]);
}) })
) )
); );

View File

@ -1,6 +1,6 @@
import { map as _map } from 'lodash'; import { map as _map } from 'lodash';
import { lastValueFrom } from 'rxjs'; import { lastValueFrom, of } from 'rxjs';
import { map } from 'rxjs/operators'; import { map, catchError } from 'rxjs/operators';
import { BackendDataSourceResponse, DataSourceWithBackend, FetchResponse, getBackendSrv } from '@grafana/runtime'; import { BackendDataSourceResponse, DataSourceWithBackend, FetchResponse, getBackendSrv } from '@grafana/runtime';
import { AnnotationEvent, DataSourceInstanceSettings, MetricFindValue, ScopedVars } from '@grafana/data'; import { AnnotationEvent, DataSourceInstanceSettings, MetricFindValue, ScopedVars } from '@grafana/data';
@ -159,6 +159,9 @@ export class PostgresDatasource extends DataSourceWithBackend<PostgresQuery, Pos
.pipe( .pipe(
map((rsp) => { map((rsp) => {
return this.responseParser.transformMetricFindResponse(rsp); return this.responseParser.transformMetricFindResponse(rsp);
}),
catchError((err) => {
return of([]);
}) })
) )
); );