Giter Site home page Giter Site logo

yuyihan666 / categraf Goto Github PK

View Code? Open in Web Editor NEW

This project forked from flashcatcloud/categraf

0.0 0.0 0.0 15.52 MB

one-stop telemetry collector for nightingale

Home Page: https://flashcat.cloud/docs/

License: MIT License

Shell 0.19% Go 98.85% Makefile 0.08% HTML 0.15% Smarty 0.10% Batchfile 0.03% Yacc 0.60% Dockerfile 0.01%

categraf's Introduction

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.

categraf's People

Contributors

kongfei605 avatar ulricqin avatar xiaoziv avatar lsy1990 avatar dependabot[bot] avatar tanxiao1990 avatar nondevops avatar lesteryou avatar ysyneu avatar tianyanli avatar laiwei avatar realzhuangxinyu avatar resurgence72 avatar hagic-hhj avatar hctech avatar hel2o avatar cataglyphis avatar allenz92 avatar kirt-log avatar yanye321 avatar yangliyl avatar mystery00 avatar qiqiaobin avatar lishijiang avatar oiooj avatar e421083458 avatar 710leo avatar mamh2021 avatar yuweizzz avatar leeworker avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.