blob: d17d0386c5ea9c810ad085fac7eb12f1ede0c5b7 [file] [log] [blame]
#@ load("@ytt:data", "data")
#@ for i in range(len(data.values.gerritServers.other)):
---
server:
http_listen_port: 9080
grpc_listen_port: 0
positions:
filename: #@ "{}/positions.yaml".format(data.values.gerritServers.other[i].promtail.storagePath)
clients:
- url: #@ "https://{}/loki/api/v1/push".format(data.values.logging.loki.host)
tls_config:
insecure_skip_verify: #@ data.values.tls.skipVerify
#@ if not data.values.tls.skipVerify:
ca_file: #@ "{}/promtail.ca.crt".format(data.values.gerritServers.other[i].promtail.storagePath)
#@ end
basic_auth:
username: #@ data.values.logging.loki.username
password: #@ data.values.logging.loki.password
scrape_configs:
- job_name: gerrit_error
static_configs:
- targets:
- localhost
labels:
job: gerrit_error
__path__: #@ "{}/error_log.json".format(data.values.gerritServers.other[i].promtail.logPath)
host: #@ data.values.gerritServers.other[i].host
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__: #@ "{}/httpd_log.json".format(data.values.gerritServers.other[i].promtail.logPath)
host: #@ data.values.gerritServers.other[i].host
entry_parser: raw
pipeline_stages:
- json:
expressions:
timestamp:
- template:
source: timestamp
template: '{{ Replace .Value "," "." 1 }}'
- timestamp:
source: timestamp
format: '02/Jan/2006:15:04:05.999 -0700'
- job_name: gerrit_sshd
static_configs:
- targets:
- localhost
labels:
job: gerrit_sshd
__path__: #@ "{}/sshd_log.json".format(data.values.gerritServers.other[i].promtail.logPath)
host: #@ data.values.gerritServers.other[i].host
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
#@ end