blob: 8dac3808df7589297ac03e53a09e78048e8e1fe6 [file] [log] [blame]
Giorgi Lekveishviliee15ee22024-03-28 12:35:10 +04001apiVersion: v1
2kind: ConfigMap
3metadata:
4 name: {{ .Release.Name }}-promtail-gerrit-configmap
5 labels:
6 app.kubernetes.io/component: gerrit-replica
7 app.kubernetes.io/instance: {{ .Release.Name }}
8 chart: {{ template "gerrit-replica.chart" . }}
9 heritage: {{ .Release.Service }}
10 release: {{ .Release.Name }}
11 {{- if .Values.additionalLabels }}
12{{ toYaml .Values.additionalLabels | indent 4 }}
13 {{- end }}
14data:
15 promtail.yaml: |-
16 positions:
17 filename: /var/gerrit/logs/promtail-positions.yaml
18
19 client:
20 tls_config:
21 insecure_skip_verify: {{ .Values.promtailSidecar.tls.skipVerify }}
22 {{- if not .Values.promtailSidecar.tls.skipVerify }}
23 ca_file: /etc/promtail/promtail.ca.crt
24 {{- end }}
25 basic_auth:
26 username: {{ .Values.promtailSidecar.loki.user }}
27 password_file: /etc/promtail/promtail.secret
28 scrape_configs:
29 - job_name: gerrit_error
30 static_configs:
31 - targets:
32 - localhost
33 labels:
34 job: gerrit_error
35 __path__: /var/gerrit/logs/error_log.json
36 entry_parser: raw
37 pipeline_stages:
38 - json:
39 expressions:
40 timestamp: '"@timestamp"'
41 message:
42 - template:
43 source: timestamp
44 template: {{`'{{ Replace .Value "," "." 1 }}'`}}
45 - template:
46 source: timestamp
47 template: {{`'{{ Replace .Value "Z" " +0000" 1 }}'`}}
48 - template:
49 source: timestamp
50 template: {{`'{{ Replace .Value "T" " " 1 }}'`}}
51 - timestamp:
52 source: timestamp
53 format: "2006-01-02 15:04:05.999 -0700"
54 - regex:
55 source: message
56 expression: "Gerrit Code Review (?P<gerrit_version>.*) ready"
57 - labels:
58 gerrit_version:
59 - job_name: gerrit_httpd
60 static_configs:
61 - targets:
62 - localhost
63 labels:
64 job: gerrit_httpd
65 __path__: /var/gerrit/logs/httpd_log.json
66 entry_parser: raw
67 pipeline_stages:
68 - json:
69 expressions:
70 timestamp: null
71 - template:
72 source: timestamp
73 template: {{`'{{ Replace .Value "," "." 1 }}'`}}
74 - timestamp:
75 format: 02/Jan/2006:15:04:05.999 -0700
76 source: timestamp
77 - job_name: gerrit_sshd
78 static_configs:
79 - targets:
80 - localhost
81 labels:
82 job: gerrit_sshd
83 __path__: /var/gerrit/logs/sshd_log.json
84 entry_parser: raw
85 pipeline_stages:
86 - json:
87 expressions:
88 timestamp:
89 - template:
90 source: timestamp
91 template: {{`'{{ Replace .Value "," "." 1 }}'`}}
92 - timestamp:
93 source: timestamp
94 format: 2006-01-02 15:04:05.999 -0700