blob: 0e6beecb7323405545bb3ec9f7849642eeec1746 [file] [log] [blame]
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-promtail-gerrit-configmap
labels:
app: gerrit-replica
chart: {{ template "gerrit-replica.chart" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
data:
promtail.yaml: |-
positions:
filename: /var/gerrit/logs/promtail-positions.yaml
client:
tls_config:
insecure_skip_verify: {{ .Values.promtailSidecar.tls.skipVerify }}
{{- if not .Values.promtailSidecar.tls.skipVerify }}
ca_file: /etc/promtail/promtail.ca.crt
{{- end }}
basic_auth:
username: {{ .Values.promtailSidecar.loki.user }}
password_file: /etc/promtail/promtail.secret
scrape_configs:
- job_name: gerrit_error
static_configs:
- targets:
- localhost
labels:
job: gerrit_error
__path__: /var/gerrit/logs/error_log.json
entry_parser: raw
pipeline_stages:
- json:
expressions:
timestamp: '"@timestamp"'
message:
- template:
source: timestamp
template: {{`'{{ Replace .Value "," "." 1 }}'`}}
- template:
source: timestamp
template: {{`'{{ Replace .Value "Z" " +0000" 1 }}'`}}
- template:
source: timestamp
template: {{`'{{ Replace .Value "T" " " 1 }}'`}}
- timestamp:
source: timestamp
format: "2006-01-02 15:04:05.999 -0700"
- regex:
source: message
expression: "Gerrit Code Review (?P<gerrit_version>.*) ready"
- labels:
gerrit_version:
- job_name: gerrit_httpd
static_configs:
- targets:
- localhost
labels:
job: gerrit_httpd
__path__: /var/gerrit/logs/httpd_log.json
entry_parser: raw
pipeline_stages:
- json:
expressions:
timestamp: null
- template:
source: timestamp
template: {{`'{{ Replace .Value "," "." 1 }}'`}}
- timestamp:
format: 02/Jan/2006:15:04:05.999 -0700
source: timestamp
- job_name: gerrit_sshd
static_configs:
- targets:
- localhost
labels:
job: gerrit_sshd
__path__: /var/gerrit/logs/sshd_log.json
entry_parser: raw
pipeline_stages:
- json:
expressions:
timestamp:
- template:
source: timestamp
template: {{`'{{ Replace .Value "," "." 1 }}'`}}
- timestamp:
source: timestamp
format: 2006-01-02 15:04:05.999 -0700