From ec5f0cfe8e9b6363f59202e03217c86352406fc1 Mon Sep 17 00:00:00 2001 From: Ankit Bhatnagar Date: Sat, 25 Jun 2022 21:54:21 +0200 Subject: [PATCH] feat(errortracking): Introduce ability to configure error tracking backends on Gitlab Observability component --- .../charts/webservice/templates/deployment.yaml | 1 + charts/gitlab/templates/_errortracking.tpl | 12 ++++++++++++ doc/charts/globals.md | 15 +++++++++++++++ values.yaml | 5 +++++ 4 files changed, 33 insertions(+) create mode 100644 charts/gitlab/templates/_errortracking.tpl diff --git a/charts/gitlab/charts/webservice/templates/deployment.yaml b/charts/gitlab/charts/webservice/templates/deployment.yaml index 954bc0fc7a..00f0b8722e 100644 --- a/charts/gitlab/charts/webservice/templates/deployment.yaml +++ b/charts/gitlab/charts/webservice/templates/deployment.yaml @@ -243,6 +243,7 @@ spec: - name: GITLAB_TRACING_URL value: {{ $.Values.global.tracing.urlTemplate | quote }} {{- end }} + {{- include "gitlab.errortracking.env" $ | nindent 12 }} - name: WORKHORSE_ARCHIVE_CACHE_DISABLED value: "true" {{- include "webservice.extraEnv" (dict "global" $.Values.global "local" .) | nindent 12 }} diff --git a/charts/gitlab/templates/_errortracking.tpl b/charts/gitlab/templates/_errortracking.tpl new file mode 100644 index 0000000000..961fa808a1 --- /dev/null +++ b/charts/gitlab/templates/_errortracking.tpl @@ -0,0 +1,12 @@ +{{/* ######### Error Tracking template */}} + +{{- define "gitlab.errortracking.env" -}} +{{- if .Values.global.errortracking.apiUrl }} +- name: ERROR_TRACKING_API_URL + value: {{ .Values.global.errortracking.apiUrl | quote }} +{{- end -}} +{{- if .Values.global.errortracking.sharedSecret }} +- name: ERROR_TRACKING_SHARED_SECRET + value: {{ .Values.global.errortracking.sharedSecret | quote }} +{{- end -}} +{{- end -}} diff --git a/doc/charts/globals.md b/doc/charts/globals.md index 9618cf9769..fe0097d5dd 100644 --- a/doc/charts/globals.md +++ b/doc/charts/globals.md @@ -34,6 +34,7 @@ for more information on how the global variables work. - [Service Accounts](#service-accounts) - [Annotations](#annotations) - [Tracing](#tracing) +- [Error Tracking](#error-tracking) - [extraEnv](#extraenv) - [extraEnvFrom](#extraenvfrom) - [OAuth](#configure-oauth-settings) @@ -1990,6 +1991,20 @@ global: - `global.tracing.connection.string` is used to configure where tracing spans would be sent. You can read more about that in [GitLab tracing documentation](https://docs.gitlab.com/ee/development/distributed_tracing.html) - `global.tracing.urlTemplate` is used as a template for tracing info URL rendering in GitLab performance bar. +## Error Tracking + +Gitlab Helm charts support error tracking, and you can configure it with: + +```yaml +global: + errortracking: + apiUrl: 'http://localhost:8080' + sharedSecret: 'some_shared_secret' +``` + +- `global.errortracking.apiUrl` is used to configure our error tracking backend. +- `global.errortracking.sharedSecret` is used to configure authentication for the error tracking service. + ## extraEnv `extraEnv` allows you to expose additional environment variables in all containers in the pods diff --git a/values.yaml b/values.yaml index b4724f4319..bfe8178381 100644 --- a/values.yaml +++ b/values.yaml @@ -695,6 +695,11 @@ global: string: "" urlTemplate: "" + ## https://docs.gitlab.com/charts/charts/globals/#error-tracking + errortracking: + apiUrl: "" + sharedSecret: "" + ## https://docs.gitlab.com/charts/charts/globals extraEnv: {} # SOME_KEY: some_value -- GitLab