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
97727d16
Commit
97727d16
authored
Sep 09, 2018
by
Erik Sundell
Committed by
Daniel Lee
Sep 14, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stackdriver: Add backed query using
parent
73a42df0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
2 deletions
+23
-2
public/app/plugins/datasource/stackdriver/datasource.ts
+23
-2
No files found.
public/app/plugins/datasource/stackdriver/datasource.ts
View file @
97727d16
/** @ngInject */
/** @ngInject */
export
default
class
StackdriverDatasource
{
export
default
class
StackdriverDatasource
{
id
:
number
;
url
:
string
;
url
:
string
;
baseUrl
:
string
;
baseUrl
:
string
;
...
@@ -7,10 +8,30 @@ export default class StackdriverDatasource {
...
@@ -7,10 +8,30 @@ export default class StackdriverDatasource {
this
.
baseUrl
=
`/stackdriver/`
;
this
.
baseUrl
=
`/stackdriver/`
;
this
.
url
=
instanceSettings
.
url
;
this
.
url
=
instanceSettings
.
url
;
this
.
doRequest
=
this
.
doRequest
;
this
.
doRequest
=
this
.
doRequest
;
this
.
id
=
instanceSettings
.
id
;
}
}
query
()
{
async
query
(
options
)
{
return
Promise
.
resolve
();
const
queries
=
options
.
targets
.
filter
(
target
=>
!
target
.
hide
).
map
(
t
=>
({
queryType
:
'raw'
,
refId
:
t
.
refId
,
datasourceId
:
this
.
id
,
metric
:
t
.
metricType
,
}));
try
{
const
response
=
await
this
.
backendSrv
.
datasourceRequest
({
url
:
'/api/tsdb/query'
,
method
:
'POST'
,
data
:
{
from
:
options
.
range
.
from
.
valueOf
().
toString
(),
to
:
options
.
range
.
to
.
valueOf
().
toString
(),
queries
,
},
});
return
response
;
}
catch
(
error
)
{
console
.
log
(
error
);
}
}
}
testDatasource
()
{
testDatasource
()
{
...
...
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