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
9c7e6a21
Commit
9c7e6a21
authored
Jun 03, 2016
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(alerting): add basic auth support for graphite
parent
eab81a77
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
pkg/services/alerting/datasources/graphite.go
+9
-2
No files found.
pkg/services/alerting/datasources/graphite.go
View file @
9c7e6a21
...
...
@@ -11,6 +11,7 @@ import (
"github.com/grafana/grafana/pkg/cmd/grafana-cli/log"
"github.com/grafana/grafana/pkg/components/simplejson"
m
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/util"
)
type
GraphiteClient
struct
{}
...
...
@@ -32,12 +33,18 @@ func (client GraphiteClient) GetSeries(rule m.AlertJob, datasource m.DataSource)
log
.
Debug
(
"Graphite: sending request with querystring: "
,
v
.
Encode
())
re
s
,
err
:=
goreq
.
Request
{
re
q
:=
goreq
.
Request
{
Method
:
"POST"
,
Uri
:
datasource
.
Url
+
"/render"
,
Body
:
v
.
Encode
(),
Timeout
:
5
*
time
.
Second
,
}
.
Do
()
}
if
datasource
.
BasicAuth
{
req
.
AddHeader
(
"Authorization"
,
util
.
GetBasicAuthHeader
(
datasource
.
User
,
datasource
.
Password
))
}
res
,
err
:=
req
.
Do
()
if
err
!=
nil
{
return
nil
,
err
...
...
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