mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Loki: fix labels fetching when no initial range given (#21000)
This commit is contained in:
@@ -324,8 +324,8 @@ export default class LokiLanguageProvider extends LanguageProvider {
|
||||
const url = '/api/prom/label';
|
||||
try {
|
||||
this.logLabelFetchTs = Date.now();
|
||||
|
||||
const res = await this.request(url, rangeToParams(absoluteRange));
|
||||
const rangeParams = absoluteRange ? rangeToParams(absoluteRange) : {};
|
||||
const res = await this.request(url, rangeParams);
|
||||
const labelKeys = res.data.data.slice().sort();
|
||||
|
||||
this.labelKeys = {
|
||||
@@ -351,7 +351,8 @@ export default class LokiLanguageProvider extends LanguageProvider {
|
||||
async fetchLabelValues(key: string, absoluteRange: AbsoluteTimeRange) {
|
||||
const url = `/api/prom/label/${key}/values`;
|
||||
try {
|
||||
const res = await this.request(url, rangeToParams(absoluteRange));
|
||||
const rangeParams = absoluteRange ? rangeToParams(absoluteRange) : {};
|
||||
const res = await this.request(url, rangeParams);
|
||||
const values = res.data.data.slice().sort();
|
||||
|
||||
// Add to label options
|
||||
|
||||
Reference in New Issue
Block a user