categraf/README.md

92 lines
3.0 KiB
Markdown
Raw Normal View History

2022-08-11 11:57:20 +08:00
## Categraf
<a href="https://github.com/flashcatcloud/categraf">
<img src="doc/categraf.png" alt="categraf, one-stop telemetry collector" width="80" />
</a>
2022-07-19 12:09:05 +08:00
[![Powered By Flashcat](https://img.shields.io/badge/Powered%20By-Flashcat-blueviolet)](https://flashcat.cloud/)
2022-07-19 10:57:13 +08:00
[![Release](https://img.shields.io/github/v/release/flashcatcloud/categraf)](https://github.com/flashcatcloud/categraf/releases/latest)
2022-07-19 10:41:51 +08:00
[![Docker pulls](https://img.shields.io/docker/pulls/flashcatcloud/categraf)](https://hub.docker.com/r/flashcatcloud/categraf/)
2022-07-19 10:57:13 +08:00
[![Starts](https://img.shields.io/github/stars/flashcatcloud/categraf)](https://github.com/flashcatcloud/categraf/stargazers)
[![Forks](https://img.shields.io/github/forks/flashcatcloud/categraf)](https://github.com/flashcatcloud/categraf/fork)
2022-07-19 10:41:51 +08:00
[![Contributors](https://img.shields.io/github/contributors-anon/flashcatcloud/categraf)](https://github.com/flashcatcloud/categraf/graphs/contributors)
2022-08-11 11:57:20 +08:00
[!["License"](https://img.shields.io/badge/license-MIT-blue)](https://github.com/flashcatcloud/categraf/blob/main/LICENSE)
2022-04-14 15:18:49 +08:00
2022-08-11 11:57:20 +08:00
Categraf is one-stop telemetry collector for nightingale / prometheus / m3db / victoriametrics / thanos / influxdb / tdengine.
2022-04-14 15:18:49 +08:00
2022-06-28 17:10:47 +08:00
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, deployment or sidecar
2022-06-24 17:53:45 +08:00
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
## Scrape like prometheus
see detail [here](https://github.com/flashcatcloud/categraf/blob/main/prometheus/README.md)
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)