gerrit-monitoring/promtail/promtailLocalConfig.yaml
Thomas Draebing 3b4005a047 Sort monitoring and logging components into sub-maps in the config
This is done in preparation to allow multiple logging stacks.

Change-Id: I950200805ec01851bfdf6ccc3a5243893a947616
2020-05-27 16:30:33 +02:00

93 lines
2.6 KiB
YAML

#@ 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