categraf/README.md

81 lines
2.2 KiB
Markdown
Raw Normal View History

2022-05-16 11:58:50 +08:00
# Categraf
2022-07-07 15:40:09 +08:00
[![Release](https://github.com/flashcatcloud/categraf/workflows/Release/badge.svg)](https://github.com/flashcatcloud/categraf/actions?query=workflow%3ARelease)
2022-06-29 14:21:03 +08:00
[![Powered By Flashcat](https://img.shields.io/badge/Powered%20By-Flashcat-red)](https://flashcat.cloud/)
2022-04-14 15:18:49 +08:00
2022-06-24 17:53:45 +08:00
Categraf is a monitoring agent for nightingale / prometheus / m3db / victoriametrics / thanos / influxdb / tdengine.
2022-04-14 15:18:49 +08:00
2022-06-28 17:10:47 +08:00
[![dockeri.co](https://dockeri.co/image/flashcatcloud/categraf)](https://hub.docker.com/r/flashcatcloud/categraf/)
2022-06-24 17:53:45 +08:00
## Links
2022-05-31 06:33:13 +08:00
2022-06-24 17:53:45 +08:00
- [QuickStart](https://www.gitlink.org.cn/flashcat/categraf/wiki/QuickStart)
- [FAQ](https://www.gitlink.org.cn/flashcat/categraf/wiki/FAQ)
- [Github Releases](https://github.com/flashcatcloud/categraf/releases)
- [Gitlink Releases](https://www.gitlink.org.cn/flashcat/categraf/releases)
2022-05-30 13:43:58 +08:00
2022-05-16 11:58:50 +08:00
## Build
2022-04-14 15:18:49 +08:00
```shell
2022-05-16 11:58:50 +08:00
# export GO111MODULE=on
# export GOPROXY=https://goproxy.cn
2022-04-14 15:18:49 +08:00
go build
```
2022-06-13 19:52:13 +08:00
2022-06-24 17:53:45 +08:00
## Pack
2022-06-13 19:52:13 +08:00
```shell
2022-06-24 17:53:45 +08:00
tar zcvf categraf.tar.gz categraf conf
2022-06-13 19:52:13 +08:00
```
2022-04-14 15:18:49 +08:00
2022-06-24 17:53:45 +08:00
## Run
2022-05-16 11:58:50 +08:00
```shell
2022-06-24 17:53:45 +08:00
# test mode: just print metrics to stdout
2022-05-16 11:58:50 +08:00
./categraf --test
2022-06-24 17:53:45 +08:00
# test system and mem plugins
./categraf --test --inputs system:mem
# print usage message
2022-05-16 11:58:50 +08:00
./categraf --help
2022-06-24 17:53:45 +08:00
# 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 &
2022-05-16 11:58:50 +08:00
```
2022-06-24 17:53:45 +08:00
## Deploy categraf as daemonset
2022-06-28 15:49:10 +08:00
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:
2022-04-14 15:18:49 +08:00
```shell
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
2022-04-14 15:18:49 +08:00
```
Notice: k8s/sidecar.yaml is a demo, replace mock with your own image of service.
2022-04-17 11:05:12 +08:00
2022-06-24 17:53:45 +08:00
## Plugin
2022-07-13 15:22:02 +08:00
plugin list: [https://github.com/flashcatcloud/categraf/tree/main/inputs](https://github.com/flashcatcloud/categraf/tree/main/inputs)
2022-05-16 11:58:50 +08:00
2022-05-30 13:43:58 +08:00
2022-05-16 11:58:50 +08:00
## Thanks
2022-07-04 15:37:31 +08:00
Categraf is developed on the basis of Telegraf, Exporters and the OpenTelemetry. Thanks to the great open source community.
2022-06-25 14:13:34 +08:00
## Community
![](doc/laqun.jpeg)