1 Star 7 Fork 3

Ulric Qin / categraf

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Categraf

categraf - one-stop telemetry collector


Categraf 是一款 All-in-One 的开源的 telemetry 数据采集器,支持指标、日志采集;支持 Tracing 数据的收集;支持物理机、虚拟机、交换机、容器、K8s、多种中间件/数据库的数据采集,支持混合云架构、云原生架构、多云架构。汇聚领域最佳实践,开箱即用。

❇️ 我们推荐你使用快猫星云旗下的 Flashduty 作为 OnCall 值班平台,Flashduty 支持告警聚合、降噪、认领、升级、排班,让告警的触达既高效,又确保告警处理不遗漏、件件有回响。

flashduty

❇️ 我们推荐你使用 Categraf 作为采集器,搭配 夜莺Nightingale 快速构建统一的可观测体系。

categraf-with-nightingale

功能和特点

  1. 支持指标、日志的数据采集
  2. 支持 Tracing 数据的收集
  3. 支持 remote_write 写入协议,支持将数据写入 Promethues、M3DB、VictoriaMetrics、InfluxDB
  4. 指标数据只采集数值,不采集字符串,标签维持稳态结构
  5. 采用 All-in-One 的设计,所有的采集工作用一个 agent 搞定
  6. 纯 Go 代码编写,静态编译依赖少,容易分发,易于安装
  7. 尽可能落地最佳实践,不需要采集的数据无需采集,针对可能会对时序库造成高基数的问题在采集侧做出处理
  8. 常用的采集器,不但提供采集能力,还要整理出监控大盘和告警规则,用户可以直接导入使用

文档

从源代码编译

# export GO111MODULE=on
# export GOPROXY=https://goproxy.cn

go build
tar zcvf categraf.tar.gz categraf conf

Note: 对于mac os x 用户,请使用 gun-tar 工具打包

brew install gnu-tar
gtar zcvf categraf.tar.gz categraf conf

否则会出现以下报错:

F! failed to init config: failed to load configs of dir: ./conf err:toml: line 1: files cannot contain NULL bytes; probably using UTF-16; TOML files must be UTF-8

运行

# test mode: just print metrics to stdout
./categraf --test

# test system and mem plugins
./categraf --test --inputs system:mem

# print usage message
./categraf --help

# run
./categraf

# run with specified config directory
./categraf --configs /path/to/conf-directory

# only enable system and mem plugins
./categraf --inputs system:mem

# use nohup to start categraf
nohup ./categraf &> stdout.log &

部署在K8s

Categraf 可以以 daemonset, deployment 或者 sidecar 的形式运行在K8s中。

edit k8s/daemonset.yaml, replace NSERVER_SERVICE_WITH_PORT with service ip:port of nserver in your cluster, replace CATEGRAF_NAMESPACE with namespace value, then run:

kubectl apply -n monitoring -f k8s/daemonset.yaml # collect metrics, metrics/cadvisor of node
kubectl apply -n monitoring -f k8s/sidecar.yaml # collect service metrics
kubectl apply -n monitoring -f k8s/deployment.yaml #collect apiserver coredns etc

Notice: k8s/sidecar.yaml is a demo, replace mock with your own image of service.

使用Categraf无缝代替Prometheus抓取数据

see detail here

插件

plugin list and document: https://github.com/flashcatcloud/categraf/tree/main/inputs

致谢

Categraf is developed on the basis of Telegraf, Exporters and the OpenTelemetry. Thanks to the great open source community.

加入我们的微信群组

The MIT License (MIT) Copyright (c) 2022-now Flashcat Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

Categraf is a monitoring agent for nightingale / prometheus / m3db / victoriametrics / thanos / influxdb / tdengine. 展开 收起
Go 等 5 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Go
1
https://gitee.com/cnperl/categraf.git
git@gitee.com:cnperl/categraf.git
cnperl
categraf
categraf
main

搜索帮助