filename: ./logs/loki_positions.yaml ignore_invalid_yaml: true clients: #定义Loki服务的地址 - url: http://127.0.0.1:3100/loki/api/v1/push scrape_configs: - job_name: service_log file_sd_configs: #定义抓取的日志,通过文件实现服务发现 - files: - ./config/*.yaml refresh_interval: 1m E...
scrape_configs: # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config. - job_name: 'prometheus' # metrics_path defaults to '/metrics' # scheme defaults to 'http'. static_configs: file_sd_configs: - files: - targets/prometheus-*.yaml refres...
position_config指明promtail的配置文件在什么地方生成,重启的时候会读取一些信息s scrape_config配置一些常用的抓取策略 我们主要配置的地方,就是scrape_config。它又分为几种常见的抓取方式,比如 journal_config syslog_config relabel_config static_config file_sd_config kubernetes_sd_config 对于我们来说,最常使用的...
# {app="ad-direct-msv",filename="/var/log/pods/stg_ad-direct-msv-20201116143649-2355d8c-777d74c8b-pqvzn_3e121e4d-16f9-4257-8e35-b05137d60443/ad-direct-msv/0.log"} # # 2. 写文件 log: # {app="ad-direct-msv",filename="/data0/log-data/ad-direct-msv/stg/ad-direct-msv-20...
file_sd_config kubernetes_sd_config 对于我们来说,最常使用的就是static_config,比如指定业务的某个日志文件。这部分的描述很长,具体可以参考github文档。 代码语言:javascript 复制 https://github.com/grafana/loki/blob/master/docs/clients/promtail/configuration.md ...
schema_config: configs: - from: 2020-10-24 store: boltdb-shipper object_store: filesystem schema: v11 index: prefix: index_ period: 24h##报警地址ruler: alertmanager_url: http://localhost:9093#启用Redis缓存配置auth_enabled:falseserver: ...
object_store: filesystem schema: v11 store: boltdb-shipper server: http_listen_port:3100storage_config: boltdb_shipper: active_index_directory:/data/loki/boltdb-shipper-active cache_location:/data/loki/boltdb-shipper-cache cache_ttl: 24h
{}# 所有发送给Loki的日志添加静态标签timeout:10s # 等待服务器响应请求的最大时间positions:filename:/run/promtail/positions.yamlserver:http_listen_port:3101target_config:sync_period:10sscrape_configs:-job_name:kubernetes-pods-namepipeline_stages:-docker:{}kubernetes_sd_configs:-role:podrelabel_...
Every log file matching that regular expression will be scrapped under that target. To summarize, the above `/etc/promtail/dpkg-apt.yaml` showcase YAML format of file_sd_config discovery file. The JSON format can be seen [here](https://grafana.com/docs/loki/latest/send-data/promtail/...
"-config.file=/etc/promtail/promtail.yaml", "-client.url=http://loki.loki.svc:3100/api/prom/push" ], "env": [ { "name":"HOSTNAME", "valueFrom": { "fieldRef": { "apiVersion":"v1", "fieldPath":"spec.nodeName" } }