prometheus监控

https://prometheus-grafana-test.xinyan.tech/d/1bI4P-xiz/k8s-rancherv2-cluster-monitoring-via-prometheus?orgId=1&refresh=1m

用途

  • k8s标配的监控系统,自带很多监控、告警插件
  • 统计pod、container的 CPU、内存、网络带宽等基础数据

image-20200727200551671

Prometheus 对比 ELK

概述

  • Prometheus用GO语言实现,指标统计
  • Elasticsearch用Java语言实现,倒排索引主要做数据检索

CPU对比

image-20200727202315806

内存对比

image-20200727202417376

自定义上报指标

https://prometheus-test.xinyan.tech/targets

image-20200727201830669

PushGate

统一上报到PushGate,export给prometheus

配置:

https://etcd-dev.xinyan.tech/etcdkeeper/

    "pushgateway": {
        "url": "http://pushgateway.monitoring:9091/",
        "interval": 12,
        "enable": true
    }

初始化:

xprometheus.PushGateway()

关闭:

    service.Init(
        micro.AfterStop(func() error {
            return xprometheus.Close()
        }),
    )
Copyright © xinyan all right reserved,powered by Gitbook该文件修订时间: 2020-07-29 10:10:27

results matching ""

    No results matching ""