Commit 7c61c977 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab-ce master

parents c499724b 1c6aa98c
# 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
......@@ -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.")
......@@ -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}
......
......@@ -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")
......
---
title: Makes custom Pages domain open as external link in new tab
merge_request: 32130
author: jakeburden
type: fixed
---
title: Remove dynamically constructed feature flags starting with prometheus_transaction_
merge_request: 32395
author: Jacopo Beschi @jacopo-beschi
type: changed
......@@ -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)**
......
......@@ -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
......
# 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
......@@ -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
......
......@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment