Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
2ada0c8e
Commit
2ada0c8e
authored
Jan 18, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
eceffa99
33a6f237
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
17 deletions
+48
-17
changelogs/unreleased/an-dtracing-test-for-invalid-tracers.yml
...elogs/unreleased/an-dtracing-test-for-invalid-tracers.yml
+5
-0
lib/gitlab/tracing/jaeger_factory.rb
lib/gitlab/tracing/jaeger_factory.rb
+1
-1
spec/lib/gitlab/tracing/jaeger_factory_spec.rb
spec/lib/gitlab/tracing/jaeger_factory_spec.rb
+42
-16
No files found.
changelogs/unreleased/an-dtracing-test-for-invalid-tracers.yml
0 → 100644
View file @
2ada0c8e
---
title
:
Avoid overwriting default jaeger values with nil
merge_request
:
24482
author
:
type
:
fixed
lib/gitlab/tracing/jaeger_factory.rb
View file @
2ada0c8e
...
...
@@ -22,7 +22,7 @@ module Gitlab
service_name:
service_name
,
sampler:
get_sampler
(
options
[
:sampler
],
options
[
:sampler_param
]),
reporter:
get_reporter
(
service_name
,
options
[
:http_endpoint
],
options
[
:udp_endpoint
])
}
}
.
compact
extra_params
=
options
.
except
(
:sampler
,
:sampler_param
,
:http_endpoint
,
:udp_endpoint
,
:strict_parsing
,
:debug
)
# rubocop: disable CodeReuse/ActiveRecord
if
extra_params
.
present?
...
...
spec/lib/gitlab/tracing/jaeger_factory_spec.rb
View file @
2ada0c8e
...
...
@@ -6,36 +6,62 @@ describe Gitlab::Tracing::JaegerFactory do
describe
'.create_tracer'
do
let
(
:service_name
)
{
'rspec'
}
it
'processes default connections'
do
expect
(
described_class
.
create_tracer
(
service_name
,
{})).
to
respond_to
(
:active_span
)
shared_examples_for
'a jaeger tracer'
do
it
'responds to active_span methods'
do
expect
(
tracer
).
to
respond_to
(
:active_span
)
end
it
'yields control'
do
expect
{
|
b
|
tracer
.
start_active_span
(
'operation_name'
,
&
b
)
}.
to
yield_control
end
end
context
'processes default connections'
do
it_behaves_like
'a jaeger tracer'
do
let
(
:tracer
)
{
described_class
.
create_tracer
(
service_name
,
{})
}
end
end
it
'handles debug options'
do
expect
(
described_class
.
create_tracer
(
service_name
,
{
debug:
"1"
})).
to
respond_to
(
:active_span
)
context
'handles debug options'
do
it_behaves_like
'a jaeger tracer'
do
let
(
:tracer
)
{
described_class
.
create_tracer
(
service_name
,
{
debug:
"1"
})
}
end
end
it
'handles const sampler'
do
expect
(
described_class
.
create_tracer
(
service_name
,
{
sampler:
"const"
,
sampler_param:
"1"
})).
to
respond_to
(
:active_span
)
context
'handles const sampler'
do
it_behaves_like
'a jaeger tracer'
do
let
(
:tracer
)
{
described_class
.
create_tracer
(
service_name
,
{
sampler:
"const"
,
sampler_param:
"1"
})
}
end
end
it
'handles probabilistic sampler'
do
expect
(
described_class
.
create_tracer
(
service_name
,
{
sampler:
"probabilistic"
,
sampler_param:
"0.5"
})).
to
respond_to
(
:active_span
)
context
'handles probabilistic sampler'
do
it_behaves_like
'a jaeger tracer'
do
let
(
:tracer
)
{
described_class
.
create_tracer
(
service_name
,
{
sampler:
"probabilistic"
,
sampler_param:
"0.5"
})
}
end
end
it
'handles http_endpoint configurations'
do
expect
(
described_class
.
create_tracer
(
service_name
,
{
http_endpoint:
"http://localhost:1234"
})).
to
respond_to
(
:active_span
)
context
'handles http_endpoint configurations'
do
it_behaves_like
'a jaeger tracer'
do
let
(
:tracer
)
{
described_class
.
create_tracer
(
service_name
,
{
http_endpoint:
"http://localhost:1234"
})
}
end
end
it
'handles udp_endpoint configurations'
do
expect
(
described_class
.
create_tracer
(
service_name
,
{
udp_endpoint:
"localhost:4321"
})).
to
respond_to
(
:active_span
)
context
'handles udp_endpoint configurations'
do
it_behaves_like
'a jaeger tracer'
do
let
(
:tracer
)
{
described_class
.
create_tracer
(
service_name
,
{
udp_endpoint:
"localhost:4321"
})
}
end
end
it
'ignores invalid parameters'
do
expect
(
described_class
.
create_tracer
(
service_name
,
{
invalid:
"true"
})).
to
respond_to
(
:active_span
)
context
'ignores invalid parameters'
do
it_behaves_like
'a jaeger tracer'
do
let
(
:tracer
)
{
described_class
.
create_tracer
(
service_name
,
{
invalid:
"true"
})
}
end
end
it
'accepts the debug parameter when strict_parser is set'
do
expect
(
described_class
.
create_tracer
(
service_name
,
{
debug:
"1"
,
strict_parsing:
"1"
})).
to
respond_to
(
:active_span
)
context
'accepts the debug parameter when strict_parser is set'
do
it_behaves_like
'a jaeger tracer'
do
let
(
:tracer
)
{
described_class
.
create_tracer
(
service_name
,
{
debug:
"1"
,
strict_parsing:
"1"
})
}
end
end
it
'rejects invalid parameters when strict_parser is set'
do
...
...
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