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';
|
const url = '/api/prom/label';
|
||||||
try {
|
try {
|
||||||
this.logLabelFetchTs = Date.now();
|
this.logLabelFetchTs = Date.now();
|
||||||
|
const rangeParams = absoluteRange ? rangeToParams(absoluteRange) : {};
|
||||||
const res = await this.request(url, rangeToParams(absoluteRange));
|
const res = await this.request(url, rangeParams);
|
||||||
const labelKeys = res.data.data.slice().sort();
|
const labelKeys = res.data.data.slice().sort();
|
||||||
|
|
||||||
this.labelKeys = {
|
this.labelKeys = {
|
||||||
@@ -351,7 +351,8 @@ export default class LokiLanguageProvider extends LanguageProvider {
|
|||||||
async fetchLabelValues(key: string, absoluteRange: AbsoluteTimeRange) {
|
async fetchLabelValues(key: string, absoluteRange: AbsoluteTimeRange) {
|
||||||
const url = `/api/prom/label/${key}/values`;
|
const url = `/api/prom/label/${key}/values`;
|
||||||
try {
|
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();
|
const values = res.data.data.slice().sort();
|
||||||
|
|
||||||
// Add to label options
|
// Add to label options
|
||||||
|
|||||||
Reference in New Issue
Block a user