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
c9d5c8fe
Commit
c9d5c8fe
authored
Feb 11, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
38950881
25af9032
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
115 additions
and
2 deletions
+115
-2
app/assets/javascripts/performance_bar/components/performance_bar_app.vue
...cripts/performance_bar/components/performance_bar_app.vue
+7
-0
app/assets/javascripts/vue_shared/components/pikaday.vue
app/assets/javascripts/vue_shared/components/pikaday.vue
+2
-1
app/assets/javascripts/vue_shared/components/sidebar/date_picker.vue
...javascripts/vue_shared/components/sidebar/date_picker.vue
+2
-1
changelogs/unreleased/an-peek-jaeger.yml
changelogs/unreleased/an-peek-jaeger.yml
+5
-0
config/initializers/peek.rb
config/initializers/peek.rb
+1
-0
lib/gitlab/tracing.rb
lib/gitlab/tracing.rb
+19
-0
lib/peek/views/tracing.rb
lib/peek/views/tracing.rb
+13
-0
spec/lib/gitlab/tracing_spec.rb
spec/lib/gitlab/tracing_spec.rb
+66
-0
No files found.
app/assets/javascripts/performance_bar/components/performance_bar_app.vue
View file @
c9d5c8fe
...
...
@@ -134,6 +134,13 @@ export default {
>
ms /
<span
title=
"Invoke Count"
>
{{
currentRequest
.
details
.
gc
.
invokes
}}
</span>
gc
</span>
</div>
<div
v-if=
"currentRequest.details && currentRequest.details.tracing"
id=
"peek-view-trace"
class=
"view"
>
<a
:href=
"currentRequest.details.tracing.tracing_url"
>
trace
</a>
</div>
<request-selector
v-if=
"currentRequest"
:current-request=
"currentRequest"
...
...
app/assets/javascripts/vue_shared/components/pikaday.vue
View file @
c9d5c8fe
<
script
>
import
Pikaday
from
'
pikaday
'
;
import
{
parsePikadayDate
,
pikadayToString
}
from
'
~/lib/utils/datetime_utility
'
;
import
{
__
}
from
'
~/locale
'
;
export
default
{
name
:
'
DatePicker
'
,
...
...
@@ -8,7 +9,7 @@ export default {
label
:
{
type
:
String
,
required
:
false
,
default
:
'
Date picker
'
,
default
:
__
(
'
Date picker
'
)
,
},
selectedDate
:
{
type
:
Date
,
...
...
app/assets/javascripts/vue_shared/components/sidebar/date_picker.vue
View file @
c9d5c8fe
...
...
@@ -4,6 +4,7 @@ import datePicker from '../pikaday.vue';
import
toggleSidebar
from
'
./toggle_sidebar.vue
'
;
import
collapsedCalendarIcon
from
'
./collapsed_calendar_icon.vue
'
;
import
{
dateInWords
}
from
'
../../../lib/utils/datetime_utility
'
;
import
{
__
}
from
'
~/locale
'
;
export
default
{
name
:
'
SidebarDatePicker
'
,
...
...
@@ -42,7 +43,7 @@ export default {
label
:
{
type
:
String
,
required
:
false
,
default
:
'
Date picker
'
,
default
:
__
(
'
Date picker
'
)
,
},
selectedDate
:
{
type
:
Date
,
...
...
changelogs/unreleased/an-peek-jaeger.yml
0 → 100644
View file @
c9d5c8fe
---
title
:
Provide a performance bar link to the Jaeger UI
merge_request
:
24902
author
:
type
:
other
config/initializers/peek.rb
View file @
c9d5c8fe
...
...
@@ -19,6 +19,7 @@ Peek.into Peek::Views::Gitaly
Peek
.
into
Peek
::
Views
::
Rblineprof
Peek
.
into
Peek
::
Views
::
Redis
Peek
.
into
Peek
::
Views
::
GC
Peek
.
into
Peek
::
Views
::
Tracing
if
Gitlab
::
Tracing
.
tracing_url_enabled?
# rubocop:disable Naming/ClassAndModuleCamelCase
class
PEEK_DB_CLIENT
...
...
lib/gitlab/tracing.rb
View file @
c9d5c8fe
...
...
@@ -13,5 +13,24 @@ module Gitlab
def
self
.
connection_string
ENV
[
'GITLAB_TRACING'
]
end
def
self
.
tracing_url_template
ENV
[
'GITLAB_TRACING_URL'
]
end
def
self
.
tracing_url_enabled?
enabled?
&&
tracing_url_template
.
present?
end
# This will provide a link into the distributed tracing for the current trace,
# if it has been captured.
def
self
.
tracing_url
return
unless
tracing_url_enabled?
tracing_url_template
%
{
correlation_id:
Gitlab
::
CorrelationId
.
current_id
.
to_s
,
service:
Gitlab
.
process_name
}
end
end
end
lib/peek/views/tracing.rb
0 → 100644
View file @
c9d5c8fe
# frozen_string_literal: true
module
Peek
module
Views
class
Tracing
<
View
def
results
{
tracing_url:
Gitlab
::
Tracing
.
tracing_url
}
end
end
end
end
spec/lib/gitlab/tracing_spec.rb
0 → 100644
View file @
c9d5c8fe
# frozen_string_literal: true
require
'fast_spec_helper'
require
'rspec-parameterized'
describe
Gitlab
::
Tracing
do
using
RSpec
::
Parameterized
::
TableSyntax
describe
'.enabled?'
do
where
(
:connection_string
,
:enabled_state
)
do
nil
|
false
""
|
false
"opentracing://jaeger"
|
true
end
with_them
do
it
'should return the correct state for .enabled?'
do
expect
(
described_class
).
to
receive
(
:connection_string
).
and_return
(
connection_string
)
expect
(
described_class
.
enabled?
).
to
eq
(
enabled_state
)
end
end
end
describe
'.tracing_url_enabled?'
do
where
(
:enabled?
,
:tracing_url_template
,
:tracing_url_enabled_state
)
do
false
|
nil
|
false
false
|
""
|
false
false
|
"http://localhost"
|
false
true
|
nil
|
false
true
|
""
|
false
true
|
"http://localhost"
|
true
end
with_them
do
it
'should return the correct state for .tracing_url_enabled?'
do
expect
(
described_class
).
to
receive
(
:enabled?
).
and_return
(
enabled?
)
allow
(
described_class
).
to
receive
(
:tracing_url_template
).
and_return
(
tracing_url_template
)
expect
(
described_class
.
tracing_url_enabled?
).
to
eq
(
tracing_url_enabled_state
)
end
end
end
describe
'.tracing_url'
do
where
(
:tracing_url_enabled?
,
:tracing_url_template
,
:correlation_id
,
:process_name
,
:tracing_url
)
do
false
|
"https://localhost"
|
"123"
|
"web"
|
nil
true
|
"https://localhost"
|
"123"
|
"web"
|
"https://localhost"
true
|
"https://localhost?service=%{service}"
|
"123"
|
"web"
|
"https://localhost?service=web"
true
|
"https://localhost?c=%{correlation_id}"
|
"123"
|
"web"
|
"https://localhost?c=123"
true
|
"https://localhost?c=%{correlation_id}&s=%{service}"
|
"123"
|
"web"
|
"https://localhost?c=123&s=web"
true
|
"https://localhost?c=%{correlation_id}"
|
nil
|
"web"
|
"https://localhost?c="
end
with_them
do
it
'should return the correct state for .tracing_url'
do
expect
(
described_class
).
to
receive
(
:tracing_url_enabled?
).
and_return
(
tracing_url_enabled?
)
allow
(
described_class
).
to
receive
(
:tracing_url_template
).
and_return
(
tracing_url_template
)
allow
(
Gitlab
::
CorrelationId
).
to
receive
(
:current_id
).
and_return
(
correlation_id
)
allow
(
Gitlab
).
to
receive
(
:process_name
).
and_return
(
process_name
)
expect
(
described_class
.
tracing_url
).
to
eq
(
tracing_url
)
end
end
end
end
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