Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
e8790c32
Commit
e8790c32
authored
Aug 03, 2019
by
David
Committed by
Torkel Ödegaard
Aug 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Loki: Apply start parameter to speed up test query (#18266)
parent
48d436ea
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletions
+4
-1
public/app/plugins/datasource/loki/datasource.ts
+4
-1
No files found.
public/app/plugins/datasource/loki/datasource.ts
View file @
e8790c32
...
...
@@ -357,7 +357,10 @@ export class LokiDatasource extends DataSourceApi<LokiQuery, LokiOptions> {
};
testDatasource
()
{
return
this
.
_request
(
'/api/prom/label'
)
// Consider only last 10 minutes otherwise request takes too long
const
startMs
=
Date
.
now
()
-
10
*
60
*
1000
;
const
start
=
`
${
startMs
}
000000`
;
// API expects nanoseconds
return
this
.
_request
(
'/api/prom/label'
,
{
start
})
.
then
((
res
:
DataQueryResponse
)
=>
{
if
(
res
&&
res
.
data
&&
res
.
data
.
values
&&
res
.
data
.
values
.
length
>
0
)
{
return
{
status
:
'success'
,
message
:
'Data source connected and labels found.'
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment