Add Sentry configuration to gitlab.yml

This commit is contained in:
sue445 2019-08-31 16:21:28 +09:00 committed by Niclas Mietz
parent 9d8903a523
commit edfe1492e2
4 changed files with 26 additions and 0 deletions

View File

@ -1059,6 +1059,10 @@ Below is the complete list of available options that can be used to customize yo
| `RACK_ATTACK_FINDTIME` | Number of seconds before resetting the per IP auth attempt counter. Defaults to `60`. |
| `RACK_ATTACK_BANTIME` | Number of seconds an IP should be banned after too many auth attempts. Defaults to `3600`. |
| `GITLAB_WORKHORSE_TIMEOUT` | Timeout for gitlab workhorse http proxy. Defaults to `5m0s`. |
| `SENTRY_ENABLED` | Enables Error Reporting and Logging with Sentry. Defaults to `false`. |
| `SENTRY_DSN` | Sentry DSN. No defaults. |
| `SENTRY_CLIENTSIDE_DSN` | Sentry clientside DSN. No defaults. |
| `SENTRY_ENVIRONMENT` | Sentry environment. Defaults to `production`. |
### Docker secrets and configs

View File

@ -310,6 +310,13 @@ production: &base
path: {{GITLAB_REGISTRY_DIR}}
issuer: {{GITLAB_REGISTRY_ISSUER}}
## Error Reporting and Logging with Sentry
sentry:
enabled: {{SENTRY_ENABLED}}
dsn: {{SENTRY_DSN}}
clientside_dsn: {{SENTRY_CLIENTSIDE_DSN}}
environment: '{{SENTRY_ENVIRONMENT}}' # e.g. development, staging, production
#
# 2. GitLab CI settings
# ==========================

View File

@ -475,3 +475,9 @@ GITLAB_MONITORING_IP_WHITELIST=${GITLAB_MONITORING_IP_WHITELIST:-"0.0.0.0/8"}
GITLAB_MONITORING_SIDEKIQ_EXPORTER_ENABLED=${GITLAB_MONITORING_SIDEKIQ_EXPORTER_ENABLED:-true}
GITLAB_MONITORING_SIDEKIQ_EXPORTER_ADDRESS=${GITLAB_MONITORING_SIDEKIQ_EXPORTER_ADDRESS:-"0.0.0.0"}
GITLAB_MONITORING_SIDEKIQ_EXPORTER_PORT=${GITLAB_MONITORING_SIDEKIQ_EXPORTER_PORT:-3807}
## Sentry
SENTRY_ENABLED=${SENTRY_ENABLED:-false}
SENTRY_DSN=${SENTRY_DSN:-}
SENTRY_CLIENTSIDE_DSN=${SENTRY_CLIENTSIDE_DSN:-}
SENTRY_ENVIRONMENT=${SENTRY_ENVIRONMENT:-production}

View File

@ -1111,6 +1111,14 @@ gitlab_configure_pages(){
fi
}
gitlab_configure_sentry(){
echo "Configuring gitlab::sentry..."
update_template ${GITLAB_CONFIG} \
SENTRY_ENABLED \
SENTRY_DSN \
SENTRY_CLIENTSIDE_DSN \
SENTRY_ENVIRONMENT
}
nginx_configure_gitlab_ssl() {
if [[ ${GITLAB_HTTPS} == true && -f ${SSL_CERTIFICATE_PATH} && -f ${SSL_KEY_PATH} && -f ${SSL_DHPARAM_PATH} ]]; then
@ -1592,6 +1600,7 @@ configure_gitlab() {
gitlab_configure_backups
gitlab_configure_registry
gitlab_configure_pages
gitlab_configure_sentry
# remove stale gitlab.socket
rm -rf ${GITLAB_INSTALL_DIR}/tmp/sockets/gitlab.socket