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
f1425489
Commit
f1425489
authored
Mar 20, 2018
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dataproxy: adds dashboardid and panelid as tags
closes #11315
parent
fdf7a4c4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
0 deletions
+14
-0
pkg/api/pluginproxy/ds_proxy.go
+11
-0
public/app/features/panel/metrics_panel_ctrl.ts
+1
-0
public/app/plugins/datasource/graphite/datasource.ts
+2
-0
No files found.
pkg/api/pluginproxy/ds_proxy.go
View file @
f1425489
...
@@ -89,6 +89,9 @@ func (proxy *DataSourceProxy) HandleRequest() {
...
@@ -89,6 +89,9 @@ func (proxy *DataSourceProxy) HandleRequest() {
span
.
SetTag
(
"user_id"
,
proxy
.
ctx
.
SignedInUser
.
UserId
)
span
.
SetTag
(
"user_id"
,
proxy
.
ctx
.
SignedInUser
.
UserId
)
span
.
SetTag
(
"org_id"
,
proxy
.
ctx
.
SignedInUser
.
OrgId
)
span
.
SetTag
(
"org_id"
,
proxy
.
ctx
.
SignedInUser
.
OrgId
)
proxy
.
addTraceFromHeaderValue
(
span
,
"X-Panel-Id"
,
"panel_id"
)
proxy
.
addTraceFromHeaderValue
(
span
,
"X-Dashboard-Id"
,
"dashboard_id"
)
opentracing
.
GlobalTracer
()
.
Inject
(
opentracing
.
GlobalTracer
()
.
Inject
(
span
.
Context
(),
span
.
Context
(),
opentracing
.
HTTPHeaders
,
opentracing
.
HTTPHeaders
,
...
@@ -98,6 +101,14 @@ func (proxy *DataSourceProxy) HandleRequest() {
...
@@ -98,6 +101,14 @@ func (proxy *DataSourceProxy) HandleRequest() {
proxy
.
ctx
.
Resp
.
Header
()
.
Del
(
"Set-Cookie"
)
proxy
.
ctx
.
Resp
.
Header
()
.
Del
(
"Set-Cookie"
)
}
}
func
(
proxy
*
DataSourceProxy
)
addTraceFromHeaderValue
(
span
opentracing
.
Span
,
headerName
string
,
tagName
string
)
{
panelId
:=
proxy
.
ctx
.
Req
.
Header
.
Get
(
headerName
)
dashId
,
err
:=
strconv
.
Atoi
(
panelId
)
if
err
==
nil
{
span
.
SetTag
(
tagName
,
dashId
)
}
}
func
(
proxy
*
DataSourceProxy
)
getDirector
()
func
(
req
*
http
.
Request
)
{
func
(
proxy
*
DataSourceProxy
)
getDirector
()
func
(
req
*
http
.
Request
)
{
return
func
(
req
*
http
.
Request
)
{
return
func
(
req
*
http
.
Request
)
{
req
.
URL
.
Scheme
=
proxy
.
targetUrl
.
Scheme
req
.
URL
.
Scheme
=
proxy
.
targetUrl
.
Scheme
...
...
public/app/features/panel/metrics_panel_ctrl.ts
View file @
f1425489
...
@@ -222,6 +222,7 @@ class MetricsPanelCtrl extends PanelCtrl {
...
@@ -222,6 +222,7 @@ class MetricsPanelCtrl extends PanelCtrl {
var
metricsQuery
=
{
var
metricsQuery
=
{
timezone
:
this
.
dashboard
.
getTimezone
(),
timezone
:
this
.
dashboard
.
getTimezone
(),
panelId
:
this
.
panel
.
id
,
panelId
:
this
.
panel
.
id
,
dashboardId
:
this
.
dashboard
.
id
,
range
:
this
.
range
,
range
:
this
.
range
,
rangeRaw
:
this
.
range
.
raw
,
rangeRaw
:
this
.
range
.
raw
,
interval
:
this
.
interval
,
interval
:
this
.
interval
,
...
...
public/app/plugins/datasource/graphite/datasource.ts
View file @
f1425489
...
@@ -50,6 +50,8 @@ export function GraphiteDatasource(instanceSettings, $q, backendSrv, templateSrv
...
@@ -50,6 +50,8 @@ export function GraphiteDatasource(instanceSettings, $q, backendSrv, templateSrv
data
:
params
.
join
(
'&'
),
data
:
params
.
join
(
'&'
),
headers
:
{
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
,
'Content-Type'
:
'application/x-www-form-urlencoded'
,
'X-Dashboard-Id'
:
options
.
dashboardId
,
// enables distributed tracing in ds_proxy
'X-Panel-Id'
:
options
.
panelId
,
// enables distributed tracing in ds_proxy
},
},
};
};
...
...
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