美文网首页
Promtail、Loki、Grafana、Prometheus

Promtail、Loki、Grafana、Prometheus

作者: michael_jia | 来源:发表于2021-11-02 21:28 被阅读0次

Loki: like Prometheus, but for logs.

A Loki-based logging stack consists of 3 components:

  • promtail is the agent, responsible for gathering logs and sending them to Loki.
  • loki is the main server, responsible for storing logs and processing queries.
  • Grafana for querying and displaying the logs.

Loki Explorer

Log browser: {filename="/data/promtail/logs/authservice-ms.log"} |= "MF0A171130770809F5"

Promtail

Promtail is an agent which ships the contents of local logs to a private Grafana Loki instance or Grafana Cloud. It is usually deployed to every machine that has applications needed to be monitored.
It primarily:
• Discovers targets
• Attaches labels to log streams
• Pushes them to the Loki instance.
  • Promtail scrape_configs;
    • job_name:在 UI 显示。
    • static_configs:A static_configs allows specifying a list of targets and a common label set for them. It is the canonical way to specify static targets in a scrape configuration.
  • Promtail static_configs;
    Promtail 示例

Prometheus

Rules

  • Recording rules:记录。
  • promtool check rules /path/to/example.rules.yml 检查文件配置语法是否正确

Portainer

Loki

Loki is a horizontally-scalable, highly-available, multi-tenant log aggregation system inspired by Prometheus.

  • LogQL: Log Query Language.

LogQL is Loki’s PromQL-inspired query language. Queries act as if they are a distributed grep to aggregate log sources. LogQL uses labels and operators for filtering.

相关文章

网友评论

      本文标题:Promtail、Loki、Grafana、Prometheus

      本文链接:https://www.haomeiwen.com/subject/lrmfzltx.html