mirror of
https://github.com/grafana/grafana.git
synced 2025-01-10 08:03:58 -06:00
Update getTimeRangeParams to return start & end instead of from & to (#36268)
This commit is contained in:
parent
c3e26657e9
commit
abb1c10776
@ -289,7 +289,7 @@ export class LokiDatasource extends DataSourceApi<LokiQuery, LokiOptions> {
|
||||
|
||||
getTimeRangeParams() {
|
||||
const timeRange = this.timeSrv.timeRange();
|
||||
return { from: timeRange.from.valueOf() * NS_IN_MS, to: timeRange.to.valueOf() * NS_IN_MS };
|
||||
return { start: timeRange.from.valueOf() * NS_IN_MS, end: timeRange.to.valueOf() * NS_IN_MS };
|
||||
}
|
||||
|
||||
async importQueries(queries: DataQuery[], originDataSource: DataSourceApi): Promise<LokiQuery[]> {
|
||||
|
@ -442,7 +442,7 @@ export default class LokiLanguageProvider extends LanguageProvider {
|
||||
*/
|
||||
fetchSeriesLabels = async (match: string): Promise<Record<string, string[]>> => {
|
||||
const url = '/loki/api/v1/series';
|
||||
const { from: start, to: end } = this.datasource.getTimeRangeParams();
|
||||
const { start, end } = this.datasource.getTimeRangeParams();
|
||||
|
||||
const cacheKey = this.generateCacheKey(url, start, end, match);
|
||||
let value = this.seriesCache.get(cacheKey);
|
||||
@ -464,7 +464,7 @@ export default class LokiLanguageProvider extends LanguageProvider {
|
||||
*/
|
||||
fetchSeries = async (match: string): Promise<Array<Record<string, string>>> => {
|
||||
const url = '/loki/api/v1/series';
|
||||
const { from: start, to: end } = this.datasource.getTimeRangeParams();
|
||||
const { start, end } = this.datasource.getTimeRangeParams();
|
||||
const params = { match, start, end };
|
||||
return await this.request(url, params);
|
||||
};
|
||||
@ -489,7 +489,7 @@ export default class LokiLanguageProvider extends LanguageProvider {
|
||||
async fetchLabelValues(key: string): Promise<string[]> {
|
||||
const url = `/loki/api/v1/label/${key}/values`;
|
||||
const rangeParams = this.datasource.getTimeRangeParams();
|
||||
const { from: start, to: end } = rangeParams;
|
||||
const { start, end } = rangeParams;
|
||||
|
||||
const cacheKey = this.generateCacheKey(url, start, end, key);
|
||||
const params = { start, end };
|
||||
|
Loading…
Reference in New Issue
Block a user