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
c0697b99
Commit
c0697b99
authored
Aug 29, 2016
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(alerting): adds support for basic auth
closes #5897
parent
9c08d7ae
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
pkg/services/alerting/conditions/query.go
+6
-0
pkg/tsdb/graphite/graphite.go
+7
-2
No files found.
pkg/services/alerting/conditions/query.go
View file @
c0697b99
...
...
@@ -110,6 +110,12 @@ func (c *QueryCondition) getRequestForAlertRule(datasource *m.DataSource) *tsdb.
Name
:
datasource
.
Name
,
PluginId
:
datasource
.
Type
,
Url
:
datasource
.
Url
,
User
:
datasource
.
User
,
Password
:
datasource
.
Password
,
Database
:
datasource
.
Database
,
BasicAuth
:
datasource
.
BasicAuth
,
BasicAuthUser
:
datasource
.
BasicAuthUser
,
BasicAuthPassword
:
datasource
.
BasicAuthPassword
,
},
},
},
...
...
pkg/tsdb/graphite/graphite.go
View file @
c0697b99
...
...
@@ -43,12 +43,17 @@ func (e *GraphiteExecutor) Execute(queries tsdb.QuerySlice, context *tsdb.QueryC
}
client
:=
http
.
Client
{
Timeout
:
time
.
Duration
(
10
*
time
.
Second
)}
res
,
err
:=
client
.
PostForm
(
e
.
Url
+
"/render?"
,
params
)
req
,
_
:=
http
.
NewRequest
(
http
.
MethodPost
,
e
.
Url
+
"/render?"
,
strings
.
NewReader
(
params
.
Encode
()))
if
e
.
BasicAuth
{
req
.
SetBasicAuth
(
"carl"
,
"carl"
)
}
res
,
err
:=
client
.
Do
(
req
)
defer
res
.
Body
.
Close
()
if
err
!=
nil
{
result
.
Error
=
err
return
result
}
defer
res
.
Body
.
Close
()
body
,
err
:=
ioutil
.
ReadAll
(
res
.
Body
)
if
err
!=
nil
{
...
...
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