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
f37a595f
Commit
f37a595f
authored
Sep 15, 2017
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make samplerconfig.param configurable
parent
ec29b469
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
9 deletions
+27
-9
conf/defaults.ini
+9
-1
conf/sample.ini
+8
-0
pkg/tracing/tracing.go
+10
-8
No files found.
conf/defaults.ini
View file @
f37a595f
...
@@ -457,7 +457,15 @@ url = https://grafana.com
...
@@ -457,7 +457,15 @@ url = https://grafana.com
# jaeger destination (ex localhost:6831)
# jaeger destination (ex localhost:6831)
address
=
address
=
# tag that will always be included in when creating new spans. ex (tag1:value1,tag2:value2)
# tag that will always be included in when creating new spans. ex (tag1:value1,tag2:value2)
always_included_tag
=
always_included_tag
=
# jaeger samplerconfig param
# for "const" sampler, 0 or 1 for always false/true respectively
# for "probabilistic" sampler, a probability between 0 and 1
# for "rateLimiting" sampler, the number of spans per second
# for "remote" sampler, param is the same as for "probabilistic"
# and indicates the initial sampling rate before the actual one
# is received from the mothership
sampler_param
=
1
#################################### External Image Storage ##############
#################################### External Image Storage ##############
[external_image_storage]
[external_image_storage]
...
...
conf/sample.ini
View file @
f37a595f
...
@@ -397,6 +397,14 @@
...
@@ -397,6 +397,14 @@
;address = localhost:6831
;address = localhost:6831
# Tag that will always be included in when creating new spans. ex (tag1:value1,tag2:value2)
# Tag that will always be included in when creating new spans. ex (tag1:value1,tag2:value2)
;always_included_tag = tag1:value1
;always_included_tag = tag1:value1
# jaeger samplerconfig param
# for "const" sampler, 0 or 1 for always false/true respectively
# for "probabilistic" sampler, a probability between 0 and 1
# for "rateLimiting" sampler, the number of spans per second
# for "remote" sampler, param is the same as for "probabilistic"
# and indicates the initial sampling rate before the actual one
# is received from the mothership
;sampler_param = 1
#################################### Grafana.com integration ##########################
#################################### Grafana.com integration ##########################
# Url used to to import dashboards directly from Grafana.com
# Url used to to import dashboards directly from Grafana.com
...
...
pkg/tracing/tracing.go
View file @
f37a595f
...
@@ -16,13 +16,14 @@ import (
...
@@ -16,13 +16,14 @@ import (
)
)
var
(
var
(
logger
log
.
Logger
=
log
.
New
(
"tracing"
)
logger
log
.
Logger
=
log
.
New
(
"tracing"
)
customTags
map
[
string
]
string
=
map
[
string
]
string
{}
)
)
type
TracingSettings
struct
{
type
TracingSettings
struct
{
Enabled
bool
Enabled
bool
Address
string
Address
string
CustomTags
map
[
string
]
string
SamplerParam
float64
}
}
func
Init
(
file
*
ini
.
File
)
(
io
.
Closer
,
error
)
{
func
Init
(
file
*
ini
.
File
)
(
io
.
Closer
,
error
)
{
...
@@ -43,7 +44,8 @@ func parseSettings(file *ini.File) *TracingSettings {
...
@@ -43,7 +44,8 @@ func parseSettings(file *ini.File) *TracingSettings {
settings
.
Enabled
=
true
settings
.
Enabled
=
true
}
}
customTags
=
splitTagSettings
(
section
.
Key
(
"always_included_tag"
)
.
MustString
(
""
))
settings
.
CustomTags
=
splitTagSettings
(
section
.
Key
(
"always_included_tag"
)
.
MustString
(
""
))
settings
.
SamplerParam
=
section
.
Key
(
"sampler_param"
)
.
MustFloat64
(
1
)
return
settings
return
settings
}
}
...
@@ -55,9 +57,9 @@ func internalInit(settings *TracingSettings) (io.Closer, error) {
...
@@ -55,9 +57,9 @@ func internalInit(settings *TracingSettings) (io.Closer, error) {
cfg
:=
jaegercfg
.
Configuration
{
cfg
:=
jaegercfg
.
Configuration
{
Disabled
:
!
settings
.
Enabled
,
Disabled
:
!
settings
.
Enabled
,
Sampler
:
&
jaegercfg
.
SamplerConfig
{
Sampler
:
&
jaegercfg
.
SamplerConfig
{
//we currently only support SamplerConfig. Open an issue if you need another.
Type
:
jaeger
.
SamplerTypeConst
,
Type
:
jaeger
.
SamplerTypeConst
,
Param
:
1
,
Param
:
settings
.
SamplerParam
,
},
},
Reporter
:
&
jaegercfg
.
ReporterConfig
{
Reporter
:
&
jaegercfg
.
ReporterConfig
{
LogSpans
:
false
,
LogSpans
:
false
,
...
@@ -70,7 +72,7 @@ func internalInit(settings *TracingSettings) (io.Closer, error) {
...
@@ -70,7 +72,7 @@ func internalInit(settings *TracingSettings) (io.Closer, error) {
options
:=
[]
jaegercfg
.
Option
{}
options
:=
[]
jaegercfg
.
Option
{}
options
=
append
(
options
,
jaegercfg
.
Logger
(
jLogger
))
options
=
append
(
options
,
jaegercfg
.
Logger
(
jLogger
))
for
tag
,
value
:=
range
c
ustomTags
{
for
tag
,
value
:=
range
settings
.
C
ustomTags
{
options
=
append
(
options
,
jaegercfg
.
Tag
(
tag
,
value
))
options
=
append
(
options
,
jaegercfg
.
Tag
(
tag
,
value
))
}
}
...
...
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