【发布时间】:2022-09-24 04:04:11
【问题描述】:
我使用 helm 安装 loki 和 prometheus。 但是,我想在一个地方替换日志。 我使用: helm show values grafana/loki-stack > loki-stack-values.yml 输出值并得出以下结果:
loki:
enabled: true
isDefault: true
promtail:
enabled: true
config:
lokiAddress: http://{{ .Release.Name }}:3100/loki/api/v1/push
prometheusSpec:
additionalScrapeConfigs:
- match:
selector: \'{name=\"promtail\"}\'
stages:
# The regex stage parses out a level, timestamp, and component. At the end
# of the stage, the values for level, timestamp, and component are only
# set internally for the pipeline. Future stages can use these values and
# decide what to do with them.
- regex:
expression: \'.*level=(?P<level>[a-zA-Z]+).*ts=(?P<timestamp>[T\\d-:.Z]*).*component=(?P<component>[a-zA-Z]+)\'
实际上,一切都会很好。但是我的输出真的很奇怪所以我尝试添加 additionalScrapeConfigs
2022-05-06 18:31:55
{\"log\":\"2022-05-06T18:31:55,003 \\u001b[36mDEBUG\\u001b[m
所以对于这个问题:
如何使用 helm install dlp-dev-loki grafana/loki-stack --values loki-stack-values.yml -n dev。以及 promtail 的其他 scape 配置。
标签: kubernetes kubernetes-helm grafana promtail