Prometheus: Add info that using Loki as Prometheus data source is no longer supported and might stop working (#34650)

* Add information that Loki as Prometheus data source is not supported

* Fix ugly error when loki as prometheus used

* Refactor, add test

* Fix type error

* Fix test by passing missing method

* Update public/app/plugins/datasource/prometheus/query_hints.ts

* Remove optionality in prop
This commit is contained in:
Ivana Huckova
2021-05-28 17:10:10 +02:00
committed by GitHub
parent 6adcfa9e50
commit add1b827ae
6 changed files with 94 additions and 14 deletions

View File

@@ -119,7 +119,7 @@ export default class PromQlLanguageProvider extends LanguageProvider {
// TODO #33976: make those requests parallel
await this.fetchLabels();
this.metrics = await this.fetchLabelValues('__name__');
this.metrics = (await this.fetchLabelValues('__name__')) || [];
this.metricsMetadata = fixSummariesMetadata(await this.request('/api/v1/metadata', {}));
this.processHistogramMetrics(this.metrics);