Skip to content
Snippets Groups Projects
Commit 6d43720a authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent 46bfa73d
No related branches found
No related tags found
No related merge requests found
Showing
with 129 additions and 30 deletions
import { __ } from '~/locale';
<script>
export default {
data() {
return {
inputEnabled: false,
urlOrRequestId: '',
};
},
methods: {
toggleInput() {
this.inputEnabled = !this.inputEnabled;
},
addRequest() {
this.$emit('add-request', this.urlOrRequestId);
this.clearForm();
},
clearForm() {
this.urlOrRequestId = '';
this.toggleInput();
},
},
};
</script>
<template>
<div id="peek-view-add-request" class="view">
<form class="form-inline" @submit.prevent>
<button
class="btn-blank btn-link bold"
type="button"
:title="__(`Add request manually`)"
@click="toggleInput"
>
+
</button>
<input
v-if="inputEnabled"
v-model="urlOrRequestId"
type="text"
:placeholder="__(`URL or request ID`)"
class="form-control form-control-sm d-inline-block ml-1"
@keyup.enter="addRequest"
@keyup.esc="clearForm"
/>
</form>
</div>
</template>
<script>
import { glEmojiTag } from '~/emoji';
 
import AddRequest from './add_request.vue';
import DetailedMetric from './detailed_metric.vue';
import RequestSelector from './request_selector.vue';
import { s__ } from '~/locale';
 
export default {
components: {
AddRequest,
DetailedMetric,
RequestSelector,
},
Loading
Loading
@@ -118,6 +120,7 @@ export default {
>
<a :href="currentRequest.details.tracing.tracing_url">{{ s__('PerformanceBar|trace') }}</a>
</div>
<add-request v-on="$listeners" />
<request-selector
v-if="currentRequest"
:current-request="currentRequest"
Loading
Loading
import Vue from 'vue';
import axios from '~/lib/utils/axios_utils';
import PerformanceBarService from './services/performance_bar_service';
import PerformanceBarStore from './stores/performance_bar_store';
 
Loading
Loading
@@ -32,6 +34,15 @@ export default ({ container }) =>
PerformanceBarService.removeInterceptor(this.interceptor);
},
methods: {
addRequestManually(urlOrRequestId) {
if (urlOrRequestId.startsWith('https://') || urlOrRequestId.startsWith('http://')) {
// We don't need to do anything with the response, we just
// want to trace the request.
axios.get(urlOrRequestId);
} else {
this.loadRequestDetails(urlOrRequestId, urlOrRequestId);
}
},
loadRequestDetails(requestId, requestUrl) {
if (!this.store.canTrackRequest(requestUrl)) {
return;
Loading
Loading
@@ -58,6 +69,9 @@ export default ({ container }) =>
peekUrl: this.peekUrl,
profileUrl: this.profileUrl,
},
on: {
'add-request': this.addRequestManually,
},
});
},
});
Loading
Loading
@@ -2,7 +2,7 @@
@import 'framework/variables_overrides';
@import 'framework/mixins';
 
@import '@gitlab/ui/scss/gitlab_ui';
@import '@gitlab/ui/src/scss/gitlab_ui';
 
@import 'bootstrap_migration';
@import 'framework/layout';
Loading
Loading
Loading
Loading
@@ -18,6 +18,11 @@
width: 200px;
}
 
input {
color: $gl-gray-400;
width: $input-short-width - 60px;
}
&.disabled {
display: none;
}
Loading
Loading
@@ -25,7 +30,8 @@
&.production {
background-color: $perf-bar-production;
 
select {
select,
input {
background: $perf-bar-production;
}
}
Loading
Loading
@@ -33,7 +39,8 @@
&.staging {
background-color: $perf-bar-staging;
 
select {
select,
input {
background: $perf-bar-staging;
}
}
Loading
Loading
@@ -41,7 +48,8 @@
&.development {
background-color: $perf-bar-development;
 
select {
select,
input {
background: $perf-bar-development;
}
}
Loading
Loading
Loading
Loading
@@ -12,6 +12,7 @@ class ApplicationController < ActionController::Base
include EnforcesTwoFactorAuthentication
include WithPerformanceBar
include SessionlessAuthentication
include SessionsHelper
include ConfirmEmailWarning
include Gitlab::Tracking::ControllerConcern
include Gitlab::Experimentation::ControllerConcern
Loading
Loading
@@ -35,7 +36,7 @@ class ApplicationController < ActionController::Base
around_action :set_session_storage
 
after_action :set_page_title_header, if: :json_request?
after_action :limit_unauthenticated_session_times
after_action :limit_session_time, if: -> { !current_user }
 
protect_from_forgery with: :exception, prepend: true
 
Loading
Loading
@@ -101,24 +102,6 @@ class ApplicationController < ActionController::Base
end
end
 
# By default, all sessions are given the same expiration time configured in
# the session store (e.g. 1 week). However, unauthenticated users can
# generate a lot of sessions, primarily for CSRF verification. It makes
# sense to reduce the TTL for unauthenticated to something much lower than
# the default (e.g. 1 hour) to limit Redis memory. In addition, Rails
# creates a new session after login, so the short TTL doesn't even need to
# be extended.
def limit_unauthenticated_session_times
return if current_user
# Rack sets this header, but not all tests may have it: https://github.com/rack/rack/blob/fdcd03a3c5a1c51d1f96fc97f9dfa1a9deac0c77/lib/rack/session/abstract/id.rb#L251-L259
return unless request.env['rack.session.options']
# This works because Rack uses these options every time a request is handled:
# https://github.com/rack/rack/blob/fdcd03a3c5a1c51d1f96fc97f9dfa1a9deac0c77/lib/rack/session/abstract/id.rb#L342
request.env['rack.session.options'][:expire_after] = Settings.gitlab['unauthenticated_session_expire_delay']
end
def render(*args)
super.tap do
# Set a header for custom error pages to prevent them from being intercepted by gitlab-workhorse
Loading
Loading
Loading
Loading
@@ -16,7 +16,7 @@ module Groups
 
render json: ContainerRepositoriesSerializer
.new(current_user: current_user)
.represent(@images)
.represent_read_only(@images)
end
end
end
Loading
Loading
Loading
Loading
@@ -4,4 +4,20 @@ module SessionsHelper
def unconfirmed_email?
flash[:alert] == t(:unconfirmed, scope: [:devise, :failure])
end
# By default, all sessions are given the same expiration time configured in
# the session store (e.g. 1 week). However, unauthenticated users can
# generate a lot of sessions, primarily for CSRF verification. It makes
# sense to reduce the TTL for unauthenticated to something much lower than
# the default (e.g. 1 hour) to limit Redis memory. In addition, Rails
# creates a new session after login, so the short TTL doesn't even need to
# be extended.
def limit_session_time
# Rack sets this header, but not all tests may have it: https://github.com/rack/rack/blob/fdcd03a3c5a1c51d1f96fc97f9dfa1a9deac0c77/lib/rack/session/abstract/id.rb#L251-L259
return unless request.env['rack.session.options']
# This works because Rack uses these options every time a request is handled:
# https://github.com/rack/rack/blob/fdcd03a3c5a1c51d1f96fc97f9dfa1a9deac0c77/lib/rack/session/abstract/id.rb#L342
request.env['rack.session.options'][:expire_after] = Settings.gitlab['unauthenticated_session_expire_delay']
end
end
Loading
Loading
@@ -11,7 +11,7 @@ class ContainerRepository < ApplicationRecord
delegate :client, to: :registry
 
scope :ordered, -> { order(:name) }
scope :with_api_entity_associations, -> { preload(:project) }
scope :with_api_entity_associations, -> { preload(project: [:route, { namespace: :route }]) }
 
# rubocop: disable CodeReuse/ServiceClass
def registry
Loading
Loading
Loading
Loading
@@ -2,4 +2,8 @@
 
class ContainerRepositoriesSerializer < BaseSerializer
entity ContainerRepositoryEntity
def represent_read_only(resource)
represent(resource, except: [:destroy_path])
end
end
---
title: Allow adding requests to performance bar manually
merge_request: 18464
author:
type: other
---
title: Fix N+1 for group container repositories view
merge_request: 18979
author:
type: performance
---
title: Set shorter TTL for all unauthenticated requests
merge_request: 19064
author:
type: fixed
doc/administration/monitoring/performance/img/performance_bar.png

32.9 KiB | W: | H:

doc/administration/monitoring/performance/img/performance_bar.png

69.6 KiB | W: | H:

doc/administration/monitoring/performance/img/performance_bar.png
doc/administration/monitoring/performance/img/performance_bar.png
doc/administration/monitoring/performance/img/performance_bar.png
doc/administration/monitoring/performance/img/performance_bar.png
  • 2-up
  • Swipe
  • Onion skin
Loading
Loading
@@ -8,14 +8,17 @@ activated, it looks as follows:
It allows you to see (from left to right):
 
- the current host serving the page
- time taken and number of DB queries, click through for details of these queries
- time taken and number of DB queries; click through for details of these queries
![SQL profiling using the Performance Bar](img/performance_bar_sql_queries.png)
- time taken and number of [Gitaly] calls, click through for details of these calls
- time taken and number of [Gitaly] calls; click through for details of these calls
![Gitaly profiling using the Performance Bar](img/performance_bar_gitaly_calls.png)
- time taken and number of [Rugged] calls, click through for details of these calls
- time taken and number of [Rugged] calls; click through for details of these calls
![Rugged profiling using the Performance Bar](img/performance_bar_rugged_calls.png)
- time taken and number of Redis calls, click through for details of these calls
- time taken and number of Redis calls; click through for details of these calls
![Redis profiling using the Performance Bar](img/performance_bar_redis_calls.png)
- a link to add a request's details to the performance bar; the request can be
added by its full URL (authenticated as the current user), or by the value of
its `X-Request-Id` header
 
On the far right is a request selector that allows you to view the same metrics
(excluding the page timing and line profiler) for any requests made while the
Loading
Loading
Loading
Loading
@@ -25,6 +25,7 @@ See the documentation below for details on how to configure these services.
- [PlantUML](../administration/integration/plantuml.md) Configure PlantUML to use diagrams in AsciiDoc documents.
- [reCAPTCHA](recaptcha.md) Configure GitLab to use Google reCAPTCHA for new users
- [SAML](saml.md) Configure GitLab as a SAML 2.0 Service Provider
- [Sentry](../user/project/operations/error_tracking.md#sentry-error-tracking) Enable issue linking from Sentry and view Sentry crash reports in GitLab
- [Trello](trello_power_up.md) Integrate Trello with GitLab
 
> GitLab Enterprise Edition contains [advanced Jenkins support](jenkins.md).
Loading
Loading
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
Loading
Loading
@@ -6,7 +6,7 @@ Error tracking allows developers to easily discover and view the errors that the
 
## Sentry error tracking
 
[Sentry](https://sentry.io/) is an open source error tracking system. GitLab allows administrators to connect Sentry to GitLab, to allow users to view a list of Sentry errors in GitLab itself.
[Sentry](https://sentry.io/) is an open source error tracking system. GitLab allows administrators to connect Sentry to GitLab, to allow users to view a list of Sentry errors in GitLab.
 
### Deploying Sentry
 
Loading
Loading
@@ -31,6 +31,10 @@ GitLab provides an easy way to connect Sentry to your project:
1. Click **Save changes** for the changes to take effect.
1. You can now visit **Operations > Error Tracking** in your project's sidebar to [view a list](#error-tracking-list) of Sentry errors.
 
### Enabling Gitlab issues links
You may also want to enable Sentry's GitLab integration by following the steps in the [Sentry documentation](https://docs.sentry.io/workflow/integrations/global-integrations/#gitlab)
## Error Tracking List
 
NOTE: **Note:**
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment