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
7c61c977
Commit
7c61c977
authored
Sep 05, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
c499724b
1c6aa98c
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
50 additions
and
44 deletions
+50
-44
app/helpers/external_link_helper.rb
app/helpers/external_link_helper.rb
+9
-0
app/views/projects/pages/_access.html.haml
app/views/projects/pages/_access.html.haml
+4
-2
app/views/projects/pages/_list.html.haml
app/views/projects/pages/_list.html.haml
+1
-3
app/views/projects/pages_domains/show.html.haml
app/views/projects/pages_domains/show.html.haml
+1
-3
changelogs/unreleased/66067-pages-domain-doesnt-set-target-blank.yml
...unreleased/66067-pages-domain-doesnt-set-target-blank.yml
+5
-0
changelogs/unreleased/66150-remove-dynamically-constructed-feature-flags-starting-with-promethe.yml
...ally-constructed-feature-flags-starting-with-promethe.yml
+5
-0
doc/administration/monitoring/prometheus/gitlab_metrics.md
doc/administration/monitoring/prometheus/gitlab_metrics.md
+0
-27
lib/gitlab/metrics/transaction.rb
lib/gitlab/metrics/transaction.rb
+2
-3
spec/helpers/external_link_helper_spec.rb
spec/helpers/external_link_helper_spec.rb
+17
-0
spec/lib/gitlab/metrics/transaction_spec.rb
spec/lib/gitlab/metrics/transaction_spec.rb
+4
-4
spec/lib/gitlab/metrics/web_transaction_spec.rb
spec/lib/gitlab/metrics/web_transaction_spec.rb
+2
-2
No files found.
app/helpers/external_link_helper.rb
0 → 100644
View file @
7c61c977
# frozen_string_literal: true
module
ExternalLinkHelper
def
external_link
(
body
,
url
,
options
=
{})
link_to
url
,
{
target:
'_blank'
,
rel:
'noopener noreferrer'
}.
merge
(
options
)
do
"
#{
body
}
#{
icon
(
'external-link'
)
}
"
.
html_safe
end
end
end
app/views/projects/pages/_access.html.haml
View file @
7c61c977
...
...
@@ -7,9 +7,11 @@
%strong
=
_
(
"Your pages are served under:"
)
%p
=
link_to
@project
.
pages_url
,
@project
.
pages_url
%p
=
external_link
(
@project
.
pages_url
,
@project
.
pages_url
)
-
@project
.
pages_domains
.
each
do
|
domain
|
%p
=
link_to
domain
.
url
,
domain
.
url
%p
=
external_link
(
domain
.
url
,
domain
.
url
)
.card-footer.alert-primary
=
_
(
"It may take up to 30 minutes before the site is available after the first deployment."
)
app/views/projects/pages/_list.html.haml
View file @
7c61c977
...
...
@@ -12,9 +12,7 @@
.domain-status.ci-status-icon.has-tooltip
{
class:
"ci-status-icon-#{status}"
,
title:
tooltip
}
=
sprite_icon
(
"status_
#{
status
}
"
,
size:
16
)
.domain-name
=
link_to
domain
.
url
do
=
domain
.
url
=
icon
(
'external-link'
)
=
external_link
(
domain
.
url
,
domain
.
url
)
-
if
domain
.
subject
%div
%span
.badge.badge-gray
Certificate:
#{
domain
.
subject
}
...
...
app/views/projects/pages_domains/show.html.haml
View file @
7c61c977
...
...
@@ -21,9 +21,7 @@
%td
=
_
(
"Domain"
)
%td
=
link_to
@domain
.
url
do
=
@domain
.
url
=
icon
(
'external-link'
)
=
external_link
(
@domain
.
url
,
@domain
.
url
)
%tr
%td
=
_
(
"DNS"
)
...
...
changelogs/unreleased/66067-pages-domain-doesnt-set-target-blank.yml
0 → 100644
View file @
7c61c977
---
title
:
Makes custom Pages domain open as external link in new tab
merge_request
:
32130
author
:
jakeburden
type
:
fixed
changelogs/unreleased/66150-remove-dynamically-constructed-feature-flags-starting-with-promethe.yml
0 → 100644
View file @
7c61c977
---
title
:
Remove dynamically constructed feature flags starting with prometheus_transaction_
merge_request
:
32395
author
:
Jacopo Beschi @jacopo-beschi
type
:
changed
doc/administration/monitoring/prometheus/gitlab_metrics.md
View file @
7c61c977
...
...
@@ -91,33 +91,6 @@ The following metrics can be controlled by feature flags:
|:---------------------------------------------------------------|:-------------------------------------------------------------------|
|
`gitlab_method_call_duration_seconds`
|
`prometheus_metrics_method_instrumentation`
|
|
`gitlab_transaction_allocated_memory_bytes`
|
`prometheus_metrics_transaction_allocated_memory`
|
|
`gitlab_transaction_event_build_found_total`
|
`prometheus_transaction_event_build_found_total`
|
|
`gitlab_transaction_event_build_invalid_total`
|
`prometheus_transaction_event_build_invalid_total`
|
|
`gitlab_transaction_event_build_not_found_cached_total`
|
`prometheus_transaction_event_build_not_found_cached_total`
|
|
`gitlab_transaction_event_build_not_found_total`
|
`prometheus_transaction_event_build_not_found_total`
|
|
`gitlab_transaction_event_change_default_branch_total`
|
`prometheus_transaction_event_change_default_branch_total`
|
|
`gitlab_transaction_event_create_repository_total`
|
`prometheus_transaction_event_create_repository_total`
|
|
`gitlab_transaction_event_etag_caching_cache_hit_total`
|
`prometheus_transaction_event_etag_caching_cache_hit_total`
|
|
`gitlab_transaction_event_etag_caching_header_missing_total`
|
`prometheus_transaction_event_etag_caching_header_missing_total`
|
|
`gitlab_transaction_event_etag_caching_key_not_found_total`
|
`prometheus_transaction_event_etag_caching_key_not_found_total`
|
|
`gitlab_transaction_event_etag_caching_middleware_used_total`
|
`prometheus_transaction_event_etag_caching_middleware_used_total`
|
|
`gitlab_transaction_event_etag_caching_resource_changed_total`
|
`prometheus_transaction_event_etag_caching_resource_changed_total`
|
|
`gitlab_transaction_event_fork_repository_total`
|
`prometheus_transaction_event_fork_repository_total`
|
|
`gitlab_transaction_event_import_repository_total`
|
`prometheus_transaction_event_import_repository_total`
|
|
`gitlab_transaction_event_push_branch_total`
|
`prometheus_transaction_event_push_branch_total`
|
|
`gitlab_transaction_event_push_commit_total`
|
`prometheus_transaction_event_push_commit_total`
|
|
`gitlab_transaction_event_push_tag_total`
|
`prometheus_transaction_event_push_tag_total`
|
|
`gitlab_transaction_event_rails_exception_total`
|
`prometheus_transaction_event_rails_exception_total`
|
|
`gitlab_transaction_event_receive_email_total`
|
`prometheus_transaction_event_receive_email_total`
|
|
`gitlab_transaction_event_remote_mirrors_failed_total`
|
`prometheus_transaction_event_remote_mirrors_failed_total`
|
|
`gitlab_transaction_event_remote_mirrors_finished_total`
|
`prometheus_transaction_event_remote_mirrors_finished_total`
|
|
`gitlab_transaction_event_remote_mirrors_running_total`
|
`prometheus_transaction_event_remote_mirrors_running_total`
|
|
`gitlab_transaction_event_remove_branch_total`
|
`prometheus_transaction_event_remove_branch_total`
|
|
`gitlab_transaction_event_remove_repository_total`
|
`prometheus_transaction_event_remove_repository_total`
|
|
`gitlab_transaction_event_remove_tag_total`
|
`prometheus_transaction_event_remove_tag_total`
|
|
`gitlab_transaction_event_sidekiq_exception_total`
|
`prometheus_transaction_event_sidekiq_exception_total`
|
|
`gitlab_transaction_event_stuck_import_jobs_total`
|
`prometheus_transaction_event_stuck_import_jobs_total`
|
|
`gitlab_transaction_event_update_build_total`
|
`prometheus_transaction_event_update_build_total`
|
|
`gitlab_view_rendering_duration_seconds`
|
`prometheus_metrics_view_instrumentation`
|
## Sidekiq Metrics available for Geo **(PREMIUM)**
...
...
lib/gitlab/metrics/transaction.rb
View file @
7c61c977
...
...
@@ -78,7 +78,7 @@ module Gitlab
# tags - A set of tags to attach to the event.
def
add_event
(
event_name
,
tags
=
{})
filtered_tags
=
filter_tags
(
tags
)
self
.
class
.
transaction_metric
(
event_name
,
:counter
,
prefix:
'event_'
,
use_feature_flag:
true
,
tags:
filtered_tags
).
increment
(
filtered_tags
.
merge
(
labels
))
self
.
class
.
transaction_metric
(
event_name
,
:counter
,
prefix:
'event_'
,
tags:
filtered_tags
).
increment
(
filtered_tags
.
merge
(
labels
))
@metrics
<<
Metric
.
new
(
EVENT_SERIES
,
{
count:
1
},
filtered_tags
.
merge
(
event:
event_name
),
:event
)
end
...
...
@@ -155,12 +155,11 @@ module Gitlab
with_feature
:prometheus_metrics_transaction_allocated_memory
end
def
self
.
transaction_metric
(
name
,
type
,
prefix:
nil
,
use_feature_flag:
false
,
tags:
{})
def
self
.
transaction_metric
(
name
,
type
,
prefix:
nil
,
tags:
{})
metric_name
=
"gitlab_transaction_
#{
prefix
}#{
name
}
_total"
.
to_sym
fetch_metric
(
type
,
metric_name
)
do
docstring
"Transaction
#{
prefix
}#{
name
}
#{
type
}
"
base_labels
tags
.
merge
(
BASE_LABELS
)
with_feature
"prometheus_transaction_
#{
prefix
}#{
name
}
_total"
.
to_sym
if
use_feature_flag
if
type
==
:gauge
multiprocess_mode
:livesum
...
...
spec/helpers/external_link_helper_spec.rb
0 → 100644
View file @
7c61c977
# frozen_string_literal: true
require
'spec_helper'
describe
ExternalLinkHelper
do
include
IconsHelper
it
'returns external link with icon'
do
expect
(
external_link
(
'https://gitlab.com'
,
'https://gitlab.com'
).
to_s
)
.
to
eq
(
'<a target="_blank" rel="noopener noreferrer" href="https://gitlab.com">https://gitlab.com <i aria-hidden="true" data-hidden="true" class="fa fa-external-link"></i></a>'
)
end
it
'allows options when creating external link with icon'
do
expect
(
external_link
(
'https://gitlab.com'
,
'https://gitlab.com'
,
{
"data-foo"
:
"bar"
,
class:
"externalLink"
}).
to_s
)
.
to
eq
(
'<a target="_blank" rel="noopener noreferrer" data-foo="bar" class="externalLink" href="https://gitlab.com">https://gitlab.com <i aria-hidden="true" data-hidden="true" class="fa fa-external-link"></i></a>'
)
end
end
spec/lib/gitlab/metrics/transaction_spec.rb
View file @
7c61c977
...
...
@@ -204,17 +204,17 @@ describe Gitlab::Metrics::Transaction do
end
it
'allows tracking of custom tags'
do
transaction
.
add_event
(
:
meow
,
animal:
'cat
'
)
transaction
.
add_event
(
:
bau
,
animal:
'dog
'
)
expect
(
metric
.
tags
).
to
eq
(
event: :
meow
,
animal:
'cat
'
)
expect
(
metric
.
tags
).
to
eq
(
event: :
bau
,
animal:
'dog
'
)
end
context
'with sensitive tags'
do
before
do
transaction
.
add_event
(
:
meow
,
**
sensitive_tags
.
merge
(
sane:
'yes'
))
transaction
.
add_event
(
:
baubau
,
**
sensitive_tags
.
merge
(
sane:
'yes'
))
end
it_behaves_like
'tag filter'
,
event: :
meow
,
sane:
'yes'
it_behaves_like
'tag filter'
,
event: :
baubau
,
sane:
'yes'
end
end
...
...
spec/lib/gitlab/metrics/web_transaction_spec.rb
View file @
7c61c977
...
...
@@ -253,11 +253,11 @@ describe Gitlab::Metrics::WebTransaction do
end
it
'allows tracking of custom tags'
do
transaction
.
add_event
(
:
meow
,
animal:
'cat
'
)
transaction
.
add_event
(
:
bau
,
animal:
'dog
'
)
metric
=
transaction
.
metrics
[
0
]
expect
(
metric
.
tags
).
to
eq
(
event: :
meow
,
animal:
'cat
'
)
expect
(
metric
.
tags
).
to
eq
(
event: :
bau
,
animal:
'dog
'
)
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