summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-13 12:07:41 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-13 12:07:41 +0000
commit8cc5f2790908ba9bb8eecba2b78a3c5a88c77b90 (patch)
tree2d6211503a5111d43a9edce0c56b94fd1b347e1b /doc
parent17b91a3c6ab73fff087e91665e9afb8046cbf045 (diff)
downloadgitlab-ce-8cc5f2790908ba9bb8eecba2b78a3c5a88c77b90.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc')
-rw-r--r--doc/administration/monitoring/prometheus/postgres_exporter.md28
-rw-r--r--doc/development/logging.md62
-rw-r--r--doc/update/upgrading_from_ce_to_ee.md17
-rw-r--r--doc/user/application_security/dependency_scanning/index.md2
4 files changed, 85 insertions, 24 deletions
diff --git a/doc/administration/monitoring/prometheus/postgres_exporter.md b/doc/administration/monitoring/prometheus/postgres_exporter.md
index 044ce64af53..27771865e10 100644
--- a/doc/administration/monitoring/prometheus/postgres_exporter.md
+++ b/doc/administration/monitoring/prometheus/postgres_exporter.md
@@ -1,12 +1,12 @@
-# Postgres exporter
+# PostgreSQL Server Exporter
>**Note:**
-Available since [Omnibus GitLab 8.17][1131]. For installations from source
-you'll have to install and configure it yourself.
+Available since [Omnibus GitLab 8.17](https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests/1131).
+For installations from source you will have to install and configure it yourself.
-The [postgres exporter] allows you to measure various PostgreSQL metrics.
+The [PostgreSQL Server Exporter](https://github.com/wrouesnel/postgres_exporter) allows you to export various PostgreSQL metrics.
-To enable the postgres exporter:
+To enable the PostgreSQL Server Exporter:
1. [Enable Prometheus](index.md#configuring-prometheus).
1. Edit `/etc/gitlab/gitlab.rb` and enable `postgres_exporter`:
@@ -16,23 +16,22 @@ To enable the postgres exporter:
```
NOTE: **Note:**
-If PostgreSQL is configured on a separate node, make sure that the local
+If PostgreSQL Server Exporter is configured on a separate node, make sure that the local
address is [listed in `trust_auth_cidr_addresses`](../../high_availability/database.md#network-information) or the
exporter will not be able to connect to the database.
-1. Save the file and [reconfigure GitLab][reconfigure] for the changes to
+1. Save the file and [reconfigure GitLab](../../restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to
take effect.
Prometheus will now automatically begin collecting performance data from
-the postgres exporter exposed under `localhost:9187`.
+the PostgreSQL Server Exporter exposed under `localhost:9187`.
## Advanced configuration
-In most cases, Postgres exporter will work with the defaults and you should not
+In most cases, PostgreSQL Server Exporter will work with the defaults and you should not
need to change anything.
-The following configuration options can be used to further customize the
-Postgres exporter:
+To further customize the PostgreSQL Server Exporter, use the following configuration options:
1. Edit `/etc/gitlab/gitlab.rb`:
@@ -54,11 +53,6 @@ Postgres exporter:
postgres_exporter['sslrootcert'] = 'ssl-root.crt' # The location of the root certificate file. The file must contain PEM encoded data.
```
-1. Save the file and [reconfigure GitLab][reconfigure] for the changes to take effect.
+1. Save the file and [reconfigure GitLab](../../restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to take effect.
[← Back to the main Prometheus page](index.md)
-
-[1131]: https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests/1131
-[postgres exporter]: https://github.com/wrouesnel/postgres_exporter
-[prometheus]: https://prometheus.io
-[reconfigure]: ../../restart_gitlab.md#omnibus-gitlab-reconfigure
diff --git a/doc/development/logging.md b/doc/development/logging.md
index 22f3059d4b2..4ccb5a1a06e 100644
--- a/doc/development/logging.md
+++ b/doc/development/logging.md
@@ -127,6 +127,68 @@ importer progresses. Here's what to do:
logger.info(message: "Import error", error_code: 1, error: "I/O failure")
```
+## Exception Handling
+
+It often happens that you catch the exception and want to track it.
+
+It should be noted that manual logging of exceptions is not allowed, as:
+
+1. Manual logged exceptions can leak confidential data,
+1. Manual logged exception very often require to clean backtrace
+ which reduces the boilerplate,
+1. Very often manually logged exception needs to be tracked to Sentry as well,
+1. Manually logged exceptions does not use `correlation_id`, which makes hard
+ to pin them to request, user and context in which this exception was raised,
+1. It is very likely that manually logged exceptions will end-up across
+ multiple files, which increases burden scraping all logging files.
+
+To avoid duplicating and having consistent behavior the `Gitlab::Sentry`
+provides helper methods to track exceptions:
+
+1. `Gitlab::Sentry.track_and_raise_exception`: this method logs,
+ sends exception to Sentry (if configured) and re-raises the exception,
+1. `Gitlab::Sentry.track_exception`: this method only logs
+ and sends exception to Sentry (if configured),
+1. `Gitlab::Sentry.log_exception`: this method only logs the exception,
+ and DOES NOT send the exception to Sentry,
+1. `Gitlab::Sentry.track_and_raise_for_dev_exception`: this method logs,
+ sends exception to Sentry (if configured) and re-raises the exception
+ for development and test enviroments.
+
+It is advised to only use `Gitlab::Sentry.track_and_raise_exception`
+and `Gitlab::Sentry.track_exception` as presented on below examples.
+
+Consider adding additional extra parameters to provide more context
+for each tracked exception.
+
+### Example
+
+```ruby
+class MyService < ::BaseService
+ def execute
+ project.perform_expensive_operation
+
+ success
+ rescue => e
+ Gitlab::Sentry.track_exception(e, project_id: project.id)
+
+ error('Exception occurred')
+ end
+end
+```
+
+```ruby
+class MyService < ::BaseService
+ def execute
+ project.perform_expensive_operation
+
+ success
+ rescue => e
+ Gitlab::Sentry.track_and_raise_exception(e, project_id: project.id)
+ end
+end
+```
+
## Additional steps with new log files
1. Consider log retention settings. By default, Omnibus will rotate any
diff --git a/doc/update/upgrading_from_ce_to_ee.md b/doc/update/upgrading_from_ce_to_ee.md
index b553b4aa405..52a65a89cbf 100644
--- a/doc/update/upgrading_from_ce_to_ee.md
+++ b/doc/update/upgrading_from_ce_to_ee.md
@@ -59,17 +59,22 @@ sudo -u git -H git checkout EE_BRANCH
```sh
cd /home/git/gitlab
-# MySQL installations (note: the line below states '--without postgres')
-sudo -u git -H bundle install --without postgres development test --deployment
+sudo -u git -H bundle install --deployment --without development test mysql aws kerberos
-# PostgreSQL installations (note: the line below states '--without mysql')
-sudo -u git -H bundle install --without mysql development test --deployment
+# Optional: clean up old gems
+sudo -u git -H bundle clean
# Run database migrations
sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production
-# Clean up assets and cache
-sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production
+# Compile GetText PO files
+sudo -u git -H bundle exec rake gettext:compile RAILS_ENV=production
+
+# Update node dependencies and recompile assets
+sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile RAILS_ENV=production NODE_ENV=production NODE_OPTIONS="--max_old_space_size=4096"
+
+# Clean up cache
+sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production
```
### 4. Install `gitlab-elasticsearch-indexer` (optional) **(STARTER ONLY)**
diff --git a/doc/user/application_security/dependency_scanning/index.md b/doc/user/application_security/dependency_scanning/index.md
index 61666bc00cd..3f13d5983aa 100644
--- a/doc/user/application_security/dependency_scanning/index.md
+++ b/doc/user/application_security/dependency_scanning/index.md
@@ -55,7 +55,7 @@ The following languages and dependency managers are supported.
| Language (package managers) | Supported | Scan tool(s) |
|----------------------------- | --------- | ------------ |
-| Java ([Gradle](https://gradle.org/)) | not currently ([issue](https://gitlab.com/gitlab-org/gitlab/issues/13075 "Dependency Scanning for Gradle" )) | not available |
+| Java ([Gradle](https://gradle.org/)) | yes | [gemnasium](https://gitlab.com/gitlab-org/security-products/gemnasium) |
| Java ([Maven](https://maven.apache.org/)) | yes | [gemnasium](https://gitlab.com/gitlab-org/security-products/gemnasium) |
| JavaScript ([npm](https://www.npmjs.com/), [yarn](https://yarnpkg.com/en/)) | yes | [gemnasium](https://gitlab.com/gitlab-org/security-products/gemnasium), [Retire.js](https://retirejs.github.io/retire.js/) |
| Go ([Golang](https://golang.org/)) | not currently ([issue](https://gitlab.com/gitlab-org/gitlab/issues/7132 "Dependency Scanning for Go")) | not available |