当前位置:网站首页>开源一款监控数据采集器,啥都能监控
开源一款监控数据采集器,啥都能监控
2022-06-24 08:11:00 【InfoQ】
简介
- github:https://github.com/flashcatcloud/categraf
- gitlink:https://www.gitlink.org.cn/flashcat/categraf
对比
- 支持 remote_write 写入协议,支持将数据写入 promethues、M3DB、VictoriaMetrics、InfluxDB
- 指标数据只采集数值,不采集字符串,标签维持稳态结构
- 采用 all-in-one 的设计,所有的采集工作用一个 agent 搞定,未来也可以把日志和 trace 的采集纳入 agent
- 纯 Go 代码编写,静态编译依赖少,容易分发,易于安装
- 尽可能落地最佳实践,不需要采集的数据无需采集,针对可能会对时序库造成高基数的问题在采集侧做出处理
- 常用的采集器,不但提供采集能力,还要整理出监控大盘和告警规则,用户可以直接导入使用
- 未来希望作为快猫 SaaS 产品的重要组成部分,引入快猫团队的研发力量持续迭代,当然,希望更多的公司、更多人研发人员参与共建,做成国内最开放、最好用的采集器
安装
go build
测试
conf/input.mysql/mysql.toml
./categraf --test --inputs mysql
conf/input.mysql/mysql.toml
kill -HUP `pidof categraf`
./categraf --help
插件说明
配置说明
[global]
# 启动的时候是否在stdout中打印配置内容
print_configs = false
# 机器名,作为本机的唯一标识,会为时序数据自动附加一个 agent_hostname=$hostname 的标签
# hostname 配置如果为空,自动取本机的机器名
# hostname 配置如果不为空,就使用用户配置的内容作为hostname
# 用户配置的hostname字符串中,可以包含变量,目前支持两个变量,
# $hostname 和 $ip,如果字符串中出现这两个变量,就会自动替换
# $hostname 自动替换为本机机器名,$ip 自动替换为本机IP
# 建议大家使用 --test 做一下测试,看看输出的内容是否符合预期
hostname = ""
# 是否忽略主机名的标签,如果设置为true,时序数据中就不会自动附加agent_hostname=$hostname 的标签
omit_hostname = false
# 时序数据的时间戳使用ms还是s,默认是ms,是因为remote write协议使用ms作为时间戳的单位
precision = "ms"
# 全局采集频率,15秒采集一次
interval = 15
# 全局附加标签,一行一个,这些写的标签会自动附到时序数据上
# [global.labels]
# region = "shanghai"
# env = "localhost"
# 发给后端的时序数据,会先被扔到 categraf 内存队列里,每个采集插件一个队列
# chan_size 定义了队列最大长度
# batch 是每次从队列中取多少条,发送给后端backend
[writer_opt]
# default: 2000
batch = 2000
# channel(as queue) size
chan_size = 10000
# 后端backend配置,在toml中 [[]] 表示数组,所以可以配置多个writer
# 每个writer可以有不同的url,不同的basic auth信息
[[writers]]
url = "http://127.0.0.1:19000/prometheus/v1/write"
# Basic auth username
basic_auth_user = ""
# Basic auth password
basic_auth_pass = ""
# timeout settings, unit: ms
timeout = 5000
dial_timeout = 2500
max_idle_conns_per_host = 100
interval
interval = 60
interval = "60s"
interval = "1m"
- 秒:s
- 分钟:m
- 小时:h
instances
[[]]
[[instances]]
targets = [
"www.baidu.com",
"127.0.0.1",
"10.4.5.6",
"10.4.5.7"
]
[[instances]]
targets = [
"www.baidu.com",
"127.0.0.1"
]
[[instances]]
targets = [
"10.4.5.6",
"10.4.5.7"
]
interval_times
labels
工作计划
- [x] system
- [x] kernel
- [x] kernel_vmstat
- [x] linux_sysctl_fs
- [x] cpu
- [x] mem
- [x] net
- [x] netstat
- [x] disk
- [x] diskio
- [x] ntp
- [x] processes
- [x] exec
- [x] ping
- [x] http_response
- [x] net_response
- [x] procstat
- [x] mysql
- [x] redis
- [x] oracle
- [x] rabbitmq
- [x] prometheus
- [x] tomcat
- [x] nvidia_smi
[[email protected] categraf]# find inputs -name "*.json"
inputs/redis/alerts.json
inputs/redis/dashboard.json
inputs/system/dashboard.json
inputs/system/alerts-linux.json
inputs/oracle/dashboard.json
inputs/ping/alerts.json
inputs/ping/dashboard.json
inputs/ntp/alerts.json
inputs/procstat/alerts.json
inputs/mysql/alerts.json
inputs/mysql/dashboard.json
inputs/tomcat/dashboard.json
inputs/rabbitmq/dashboard.json
inputs/http_response/alerts.json
inputs/http_response/dashboard.json
inputs/net_response/alerts.json
inputs/net_response/dashboard.json
- [ ] k8s solution
- [ ] nginx vts
- [ ] mongodb
- [ ] rocketmq
- [ ] activemq
- [ ] kafka
- [ ] elasticsearch
- [ ] prometheus discovery
- [ ] windows
- [ ] mssql
- [ ] iis
- [ ] weblogic
- [ ] was
- [ ] hadoop
- [ ] ad
- [ ] zookeeper
- [ ] statsd
- [ ] snmp
- [ ] ipmi
- [ ] smartctl
- [ ] logging
- [ ] trace
更多信息
附录
- 作者:龙渊秦五,网络ID:UlricQin,个人主页:https://ulricqin.github.io
- 夜莺:一款云原生监控系统,国产开源,隶属中国计算机学会开源发展委员会,项目主站:https://n9e.github.io/
边栏推荐
- 目标检测系列——Fast R-CNN
- 零基础自学SQL课程 | 相关子查询
- Numpy numpy中的np.c_和np.r_详解
- CF566E-Restoring Map【bitset】
- Pytoch read data set (two modes: typical data set and user-defined data set)
- Niuke network realizes simple calculator function
- Leetcode -- linked list
- 【gdb调试工具】| 如何在多线程、多进程以及正在运行的程序下调试
- Every (), map (), forearch () methods. There are objects in the array
- Vidéo courte recommandée chaque semaine: Soyez sérieux en parlant de "métaunivers"
猜你喜欢
L01_一条SQL查询语句是如何执行的?
Digital cloud released the 2022 white paper on digital operation of global consumers in the beauty industry: global growth solves marketing problems
零基础自学SQL课程 | HAVING子句
解决:jmeter5.5在win11下界面上的字特别小
[Niuke] length of the last word of HJ1 string
[ES6 breakthrough] promise is comparable to native custom encapsulation (10000 words)
支持向量机(SVC,NuSVC,LinearSVC)
当程序员被问会不会修电脑时… | 每日趣闻
Xiaobai needs to learn MySQL - incremental statistical SQL
[bug] @jsonformat has a problem that the date is less than one day when it is used
随机推荐
CDGA|到底怎么才能做好数据治理呢?
P6698-[BalticOI 2020 Day2]病毒【AC自动机,dp,SPFA】
【bug】@JsonFormat 使用时出现日期少一天的问题
2022-06-23: given a nonnegative array, select any number to make the maximum cumulative sum a multiple of 7, and return the maximum cumulative sum. N is larger, to the 5th power of 10. From meituan. 3
In depth analysis of Apache bookkeeper series: Part 3 - reading principle
tp5 使用post接收数组数据时报variable type error: array错误的解决方法
Webrtc series - network transmission 5: select the optimal connection switching
Zero foundation self-study SQL course | sub query
Squid代理服务器应用
读CVPR 2022目标检测论文得到的亿点点启发
Essay - Reflection
Weekly recommended short video: talk about "meta universe" with a serious attitude
Linux (centos7.9) installation and deployment of MySQL Cluster 7.6
深入解析 Apache BookKeeper 系列:第三篇——读取原理
eBanb B1手环刷固件异常中断处理
P6698-[balticoi 2020 day2] virus [AC automata, DP, SPFA]
【输入法】迄今为止,居然有这么多汉字输入法!
What do you mean by waiting for insurance records? Where should I go for filing?
leetcode--链表
12、 Demonstration of all function realization effects