flashcatcloud / categraf

one-stop telemetry collector for nightingale
https://flashcat.cloud/docs/
MIT License
799 stars 239 forks source link

Categraf支持像thanos /api/v1/receive接口写入数据吗? #687

Open noovertime7 opened 10 months ago

noovertime7 commented 10 months ago

What would you like to be added: Categraf支持像thanos /api/v1/receive接口写入数据 Why is this needed: Categraf支持像thanos /api/v1/receive接口写入数据 Describe the solution you'd like categraf支持远程推送至 Prometheus RemoteWrite ,但是我们使用的是thanos,是否支持thanos的接口呢 Additional context

noovertime7 commented 10 months ago

我尝试使用categraf写入thanos receiver接口,得到了以下错误

2023/10/17 09:49:00 writer.go:66: W! post to https://thanos-devops.tj-it.com.cn/api/v1/receive got error: push data with remote write request got status code: 409, response body: 8 errors: forwarding request to endpoint thanos-receiver-10.thanos-receiver:10901: rpc error: code = AlreadyExists desc = store locally for endpoint thanos-receiver-10.thanos-receiver:10901: add 54 series: out of order labels; forwarding request to endpoint thanos-receiver-11.thanos-receiver:10901: rpc error: code = AlreadyExists desc = store locally for endpoint thanos-receiver-11.thanos-receiver:10901: add 77 series: out of order labels; forwarding request to endpoint thanos-receiver-5.thanos-receiver:10901: rpc error: code = AlreadyExists desc = store locally for endpoint thanos-receiver-5.thanos-receiver:10901: add 80 series: out of order labels; forwarding request to endpoint thanos-receiver-6.thanos-receiver:10901: rpc error: code = AlreadyExists desc = store locally for endpoint thanos-receiver-6.thanos-receiver:10901: add 61 series: out of order labels; forwarding request to endpoint thanos-receiver-7.thanos-receiver:10901: rpc error: code = AlreadyExists desc = store locally for endpoint thanos-receiver-7.thanos-receiver:10901: add 76 series: out of order labels; forwarding request to endpoint thanos-receiver-8.thanos-receiver:10901: rpc error: code = AlreadyExists desc = store locally for endpoint thanos-receiver-8.thanos-receiver:10901: 2 errors: add 1 series: label set contains a label with empty name or value; add 68 series: out of order labels; forwarding request to endpoint thanos-receiver-9.thanos-receiver:10901: rpc error: code = AlreadyExists desc = store locally for endpoint thanos-receiver-9.thanos-receiver:10901: add 80 series: out of order labels; store locally for endpoint thanos-receiver-4.thanos-receiver:10901: 2 errors: add 1 series: label set contains a label with empty name or value; add 73 series: out of order labels
zzmark commented 4 months ago

开启 http ,配置端口后,有这几个接口可以推入数据

POST /api/push/opentsdb
POST /api/push/openfalcon
POST /api/push/remotewrite
POST /api/push/pushgateway

其中 remotewrite 是 prometheus remote_write 报文协议

noovertime7 commented 4 months ago

我想使用categraf向thanos发送数据,而不是prometheus

zzmark commented 4 months ago

我想使用categraf向thanos发送数据,而不是prometheus

categraf 的 writers 向上写入也是 remove_write 协议,并且 categraf 可以配置多个 writers

试试这个