首页 > 其他分享 >每天一点基础K8S--prometheus基础

每天一点基础K8S--prometheus基础

时间:2023-02-18 23:33:05浏览次数:40  
标签:-- series metric server instance prometheus time K8S

prometheus基础

1、简介

1、开源的系统监控和告警系统
Prometheus is an open-source systems monitoring and alerting toolkit

官网:https://prometheus.io/docs/introduction/overview/

2、prometheus架构图

285ed50038f10c9da280570c1604f6d6.png

简单理解一下,prometheus架构中主要包括:prometheus server、exporter、pushgateway、alertmanager、grafana

其中,prometheus server主要包括:
  1、retrieval,负载在活跃的target主机上主机相应数据;
  2、tsdb,存储采集的信息;
  3、http server,接受查询的模块;

3、主要特征

1、以时间为序列的,以度量名称和相应的key-value构建的多维度数据模型;
a multi-dimensional data model with time series data identified by metric name and key/value pairs

2、promQL语言灵活;
PromQL, a flexible query language to leverage this dimensionality

3、可以依靠本地本地存储实现;
no reliance on distributed storage; single server nodes are autonomous

4、依靠HTTP协议,通过pull的方式时间序列上的变化;
time series collection happens via a pull model over HTTP

5、可以通过pushgateway实现数据采集;
pushing time series is supported via an intermediary gateway

6、可以通过服务发现或者静态配置来发现目标target;
targets are discovered via service discovery or static configuration

7、图形界面多样化;
multiple modes of graphing and dashboarding support

4、基本概念

4.1、数据模型(data model)
#以时间序列为基础,同一条数据流需要有相同的度量值(metric)和相同的标签(labels)
Prometheus fundamentally stores all data as time series: streams of timestamped values belonging to the same metric and the same set of labeled dimensions. 

# 那么,时间戳 + metric + label = 样本

# natotion语法
<metric name>{<label name>=<label value>, ...}
4.2、度量类型/数据类型(metric type)
# counter 计数器
# 累积的数值,只能增加,或者重置为0,常用于统计服务器请求总数、任务完成数等;
A counter is a cumulative metric that represents a single monotonically increasing counter whose value can only increase or be reset to zero on restart. For example, you can use a counter to represent the number of requests served, tasks completed, or errors.


# gauge 测量器
# 可增可减,常用于监控温度、内存、CPU使用情况;
A gauge is a metric that represents a single numerical value that can arbitrarily go up and down.


# Histogram 柱状图
# 统计、计算桶内的的样本情况
A histogram samples observations (usually things like request durations or response sizes) and counts them in configurable buckets.


# summary 统计图
# 与柱状图类似,可用于统计总数,
Similar to a histogram, a summary samples observations (usually things like request durations and response sizes). While it also provides a total count of observations and a sum of all observed values, it calculates configurable quantiles over a sliding time window.
4.3、jobs and instances
# 实例,instance
# 在prometheus环境中,可以被查询请求的一个端点均可称为一个instance。
# 为某一需求而采集的instance集合称为jobs,
In Prometheus terms, an endpoint you can scrape is called an instance, usually corresponding to a single process. A collection of instances with the same purpose, a process replicated for scalability or reliability for example, is called a job.
For example, an API server job with four replicated instances:

job: api-server
instance 1: 1.2.3.4:5670
instance 2: 1.2.3.4:5671
instance 3: 5.6.7.8:5670
instance 4: 5.6.7.8:5671

5、prometheus的配置文件

配置文件可以查看官网:https://prometheus.io/docs/prometheus/latest/configuration/configuration/

标签:--,series,metric,server,instance,prometheus,time,K8S
From: https://www.cnblogs.com/woshinidaye123/p/17133953.html

相关文章

  • 基于simulink的PN码相关峰同步仿真
    1.算法描述发射机和接收机采用高精确度和高稳定度的时钟频率源,以保证频率和相位的稳定性。但在实际应用中,存在许多事先无法估计的不确定因素,如收发时钟不稳定、发射时刻不......
  • 【LeeCode】344. 反转字符串
    【题目描述】编写一个函数,其作用是将输入的字符串反转过来。输入字符串以字符数组 ​​s​​ 的形式给出。不要给另外的数组分配额外的空间,你必须​​原地​​修改输入数......
  • 信道估计算法误码率仿真,对比不同导频长度,对比不同信道估计算法包括CS-OMP,LS,MMSE
    1.算法描述所谓信道估计,就是从接收数据中将假定的某个信道模型的模型参数出来的过程。如果信道是线性的话,那么信道估计就是对系统冲激响应进行估计。CS-OMP正则正交匹......
  • etcd学习笔记-组件架构
    etcd项目结构其中核心模块etcdserver,lease,mvcc,raft整体架构客户端层包括clientv3和etcdctl等客户端,用户通过命令行或者客户端通过restfulapi降低了etcd客户端的使用复杂......
  • m基于多用户MIMO系统的分布式可重构注水算法的matlab仿真
    1.算法描述在单用户MIMO场景中,空间复用技术能够带来高数据速率的传输,但是也需要一些前提条件,比如发射端的预编码或者接收端的信道估计与信号检测。然而,在大多数的通信系统......
  • 一笔画图形的判断方式
    一、笔画的概念1、一笔画是讨论某图形是否可以一笔画出。图形中任何端点根据所连接线条数被分为奇点、偶点。只有所有点为偶点的图形和只有两个奇点的图形一定可以一笔画......
  • win11关闭"显示更多选项"
    如果要禁用Win11右键菜单中的显示更多选项,那么我们应该先尝试更改“文件资源管理器”选项,另外需要注意的一点是,此方法还会同时将其他内容还原到旧的Win10样式。步骤1、......
  • Springboot启动报错:Correct the classpath of your application so that it contains
    报错信息:***************************APPLICATIONFAILEDTOSTART***************************Description:Anattemptwasmadetocallamethodthatdoesnotexist......
  • C# - sqlserver in 参数化传值
    用exec('+sql语句+')的形式,其中in判断条件全部写到参数中。sql=@"exec('SELECTSWH.Date,SWH.Shift,SWH.FunctionUnit,SWH.ShiftAttendance,SWH.[ShiftTotalWorking......
  • 【2023-02-14】夫妻真相
    20:00要善于珍惜爱情,年代愈久,愈要加倍珍惜。爱情不是月光下的散步,也不是长凳上的叹息。爱情中会有冯波和雨雪,因为一辈子要生活在一起!爱情正像一首好歌,可是编一首好歌却不......