Giter Site home page Giter Site logo

flashcatcloud / categraf Goto Github PK

View Code? Open in Web Editor NEW
733.0 21.0 228.0 19.41 MB

one-stop telemetry collector for nightingale

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

License: MIT License

Go 99.22% Makefile 0.05% Dockerfile 0.01% Shell 0.14% Smarty 0.06% Yacc 0.37% Batchfile 0.02% C 0.13%

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

allenz92 avatar arch3754 avatar cataglyphis avatar dependabot[bot] avatar hagic-hhj avatar hctech avatar hel2o avatar kirt-log avatar kongfei605 avatar laiwei avatar lesteryou avatar lishijiang avatar lsy1990 avatar mystery00 avatar nondevops avatar noovertime7 avatar oiooj avatar qiqiaobin avatar realzhuangxinyu avatar resurgence72 avatar tanxiao1990 avatar tianyanli avatar ulricqin avatar wudihechao avatar xiaoziv avatar xmh1011 avatar yangliyl avatar yanye321 avatar ysyneu avatar yuweizzz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

categraf's Issues

请问categraf可以采集自定义指标吗?

categraf或者夜莺可以采集自定义指标吗?
将脚本输出的指标输出到nightingale中去,或者nightingale自己单独可以实现嘛?还是说nightingale只能通过采集器实现

switch_legacy插件流量获取异常

Relevant config.toml

默认

Logs from categraf

18:01:24 switch_legacy_if_speed agent_hostname=VM-4-15-ubuntu ifname=Eth-Trunk66 ip=switch001.sz 0
18:01:24 switch_legacy_if_in agent_hostname=VM-4-15-ubuntu ifname=Eth-Trunk66 ip=switch001.sz 0
18:01:24 switch_legacy_if_out agent_hostname=VM-4-15-ubuntu ifname=Eth-Trunk66 ip=switch001.sz 0

-----------------------同一个配置文件----------------

18:03:31 switch_legacy_if_speed agent_hostname=VM-4-15-ubuntu ifname=Eth-Trunk66 ip=switch001.sz 200000000000
18:03:31 switch_legacy_if_in agent_hostname=VM-4-15-ubuntu ifname=Eth-Trunk66 ip=switch001.sz 8.16581315792e+10
18:03:31 switch_legacy_if_in_speed_percent agent_hostname=VM-4-15-ubuntu ifname=Eth-Trunk66 ip=switch001.sz 40.8290657896
18:03:31 switch_legacy_if_out agent_hostname=VM-4-15-ubuntu ifname=Eth-Trunk66 ip=switch001.sz 1.978573437232e+11
18:03:31 switch_legacy_if_out_speed_percent agent_hostname=VM-4-15-ubuntu ifname=Eth-Trunk66 ip=switch001.sz 98.9286718616

System info

ubuntu

Docker

No response

Steps to reproduce

...

Expected behavior

持续有数值获取

Actual behavior

会突然获得数值为0

Additional info

image

时而正常,时而为0。

交换机型号 华为CE6820

swcollector 发现类似issus gaochao1/swcollector#81

希望添加端口网络流量采集功能

希望添加端口流量采集功能:

目前只有部分收费监控系统才有端口流量统计功能呢:

希望categraf能够采集本机上配置的端口信息,并汇总实时统计网络速率

k8s部署客户端触发空指针。

[root@m1 kubelet.service.d]# kubectl logs -f -n n9e nightingale-categraf-7sz2d
/entrypoint.sh: 5: setcap: not found
Failed to set additional capabilities on /usr/bin/categraf
2022/08/12 01:51:16 main.go:113: I! runner.binarydir: /usr/bin
2022/08/12 01:51:16 main.go:114: I! runner.hostname: m3
2022/08/12 01:51:16 main.go:115: I! runner.fd_limits: (soft=1048576, hard=1048576)
2022/08/12 01:51:16 main.go:116: I! runner.vm_limits: (soft=unlimited, hard=unlimited)
2022/08/12 01:51:16 config.go:33: I! tracing disabled
2022/08/12 01:51:16 agent.go:65: I! agent starting
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x2e587f4]

goroutine 80 [running]:
flashcat.cloud/categraf/api.Start()
/home/runner/work/categraf/categraf/api/server.go:17 +0x34
created by main.main
/home/runner/work/categraf/categraf/main.go:70 +0x171

把mtail的能力内置集成进来

和metrics-agent、logs-agent、trace-agent同级别的存在,支持从日志中提取metrics,直接转发给后端时序库,省的再去部署mtail了

增加公共DNS监控

What would you like to be added:
增加DNS监控,指定某域名通过某DNS服务器解析,检测DNS解析是否异常
Why is this needed:
互联网大部分企业都是用的公共dns在解析(https://www.ip.cn/dns.html),当公共DNS服务异常时,会影响企业的经营业务,故需要做DNS监控。
Describe the solution you'd like
域名列表用户自己填写;
DNS服务器集成主要DNS地址(https://www.ip.cn/dns.html)
可自定义标签;
可设置超时时间(自身程序的超时设置)
Additional context

采集不到h3c S7506E交换机CPU内存数据

Relevant config.toml

[global]
# whether print configs
print_configs = false

# add label(agent_hostname) to series
# "" -> auto detect hostname
# "xx" -> use specified string xx
# "$hostname" -> auto detect hostname
# "$ip" -> auto detect ip
# "$hostname-$ip" -> auto detect hostname and ip to replace the vars
hostname = "$ip"
labels = { instance="192.168.7.13" }
# will not add label(agent_hostname) if true
#omit_hostname = false
omit_hostname = true

# s | ms
precision = "ms"

# global collect interval
interval = 15

# [global.labels]
# region = "shanghai"
# env = "localhost"

[writer_opt]
# default: 2000
batch = 2000
# channel(as queue) size
chan_size = 10000

[[writers]]
url = "http://192.168.7.14:19000/prometheus/v1/write"

# Basic auth username
basic_auth_user = ""

# Basic auth password
basic_auth_pass = ""

# timeout settings, unit: ms
timeout = 5000
dial_timeout = 2500
max_idle_conns_per_host = 100

[http]
enable = true
address = ":9100"
print_access = false
run_mode = "release"

Logs from categraf

2022/09/08 12:32:36 metrics_reader.go:62: D! net : before gather once
2022/09/08 12:32:36 metrics_reader.go:68: D! mem : after gather once, duration: 326.126µs
2022/09/08 12:32:36 metrics_agent.go:90: I! input: netstat started
2022/09/08 12:32:36 metrics_reader.go:62: D! netstat : before gather once
2022/09/08 12:32:36 metrics_reader.go:68: D! net : after gather once, duration: 479.162µs
2022/09/08 12:32:36 nfsclient.go:490: D! using [ /proc/self/mountstats ] for mountstats
2022/09/08 12:32:36 nfsclient.go:177: D! Including all mounts.
2022/09/08 12:32:36 nfsclient.go:187: D! Not excluding any mounts.
2022/09/08 12:32:36 nfsclient.go:197: D! Including all operations.
2022/09/08 12:32:36 nfsclient.go:207: D! Not excluding any operations.
2022/09/08 12:32:36 metrics_agent.go:90: I! input: nfsclient started
2022/09/08 12:32:36 metrics_reader.go:62: D! nfsclient : before gather once
2022/09/08 12:32:36 metrics_reader.go:68: D! nfsclient : after gather once, duration: 125.26µs
2022/09/08 12:32:36 metrics_agent.go:90: I! input: ping started
2022/09/08 12:32:36 metrics_agent.go:90: I! input: processes started
2022/09/08 12:32:36 metrics_reader.go:62: D! ping : before gather once
2022/09/08 12:32:36 metrics_reader.go:62: D! processes : before gather once
2022/09/08 12:32:36 ping.go:118: D! ping... 192.168.100.254
2022/09/08 12:32:36 ping.go:118: D! ping... www.baidu.com
2022/09/08 12:32:36 ping.go:118: D! ping... 192.168.101.10
2022/09/08 12:32:36 ping.go:118: D! ping... 192.168.101.1
2022/09/08 12:32:36 metrics_agent.go:90: I! input: redis started
2022/09/08 12:32:36 metrics_reader.go:62: D! redis : before gather once
2022/09/08 12:32:36 metrics_agent.go:90: I! input: switch_legacy started
2022/09/08 12:32:36 metrics_reader.go:62: D! switch_legacy : before gather once
2022/09/08 12:32:36 switch_legacy.go:147: I! switch total ip count: 3
2022/09/08 12:32:36 metrics_agent.go:90: I! input: system started
2022/09/08 12:32:36 metrics_reader.go:62: D! system : before gather once
2022/09/08 12:32:36 metrics_reader.go:68: D! system : after gather once, duration: 311.838µs
2022/09/08 12:32:36 prometheus_scrape.go:14: I! prometheus scraping disabled!
2022/09/08 12:32:36 agent.go:76: I! agent started
2022/09/08 12:32:36 metrics_reader.go:68: D! redis : after gather once, duration: 6.842633ms
2022/09/08 12:32:36 metrics_reader.go:68: D! netstat : after gather once, duration: 18.233274ms
2022/09/08 12:32:36 metrics_reader.go:68: D! processes : after gather once, duration: 16.092578ms
2022/09/08 12:32:36 metrics_reader.go:68: D! ping : after gather once, duration: 29.403541ms
2022/09/08 12:32:37 switch_legacy.go:624: I! switch alive ip count: 3
2022/09/08 12:32:37 switch_legacy.go:577: D! switch gather ifstat, ip: 192.168.101.1 use: 627.530851ms
2022/09/08 12:32:37 switch_legacy.go:577: D! switch gather ifstat, ip: 192.168.101.10 use: 643.697698ms
2022/09/08 12:32:39 switch_legacy.go:577: D! switch gather ifstat, ip: 192.168.100.254 use: 2.453990835s
2022/09/08 12:32:39 switch_legacy.go:144: I! switch gather use: 2.917739854s
2022/09/08 12:32:39 metrics_reader.go:68: D! switch_legacy : after gather once, duration: 2.917892819s
2022/09/08 12:33:21 metrics_reader.go:68: D! ping : after gather once, duration: 21.465003ms
2022/09/08 12:33:36 metrics_reader.go:62: D! conntrack : before gather once
2022/09/08 12:33:36 metrics_reader.go:62: D! disk : before gather once
2022/09/08 12:33:36 metrics_reader.go:62: D! cpu : before gather once
2022/09/08 12:33:36 metrics_reader.go:68: D! conntrack : after gather once, duration: 168.101µs
2022/09/08 12:33:36 metrics_reader.go:62: D! diskio : before gather once
2022/09/08 12:33:36 metrics_reader.go:68: D! cpu : after gather once, duration: 322.271µs
2022/09/08 12:33:36 metrics_reader.go:68: D! disk : after gather once, duration: 453.359µs
2022/09/08 12:33:36 metrics_reader.go:68: D! diskio : after gather once, duration: 696.276µs
2022/09/08 12:33:36 metrics_reader.go:62: D! kernel : before gather once
2022/09/08 12:33:36 metrics_reader.go:62: D! linux_sysctl_fs : before gather once
2022/09/08 12:33:36 metrics_reader.go:62: D! kernel_vmstat : before gather once
2022/09/08 12:33:36 metrics_reader.go:68: D! kernel : after gather once, duration: 118.445µs
2022/09/08 12:33:36 metrics_reader.go:68: D! linux_sysctl_fs : after gather once, duration: 151.173µs
2022/09/08 12:33:36 metrics_reader.go:68: D! kernel_vmstat : after gather once, duration: 355.734µs
2022/09/08 12:33:36 metrics_reader.go:62: D! nfsclient : before gather once
2022/09/08 12:33:36 metrics_reader.go:62: D! net : before gather once
2022/09/08 12:33:36 metrics_reader.go:62: D! mem : before gather once
2022/09/08 12:33:36 metrics_reader.go:68: D! net : after gather once, duration: 274.67µs
2022/09/08 12:33:36 metrics_reader.go:68: D! nfsclient : after gather once, duration: 180.009µs
2022/09/08 12:33:36 metrics_reader.go:68: D! mem : after gather once, duration: 336.257µs
2022/09/08 12:33:36 metrics_reader.go:62: D! system : before gather once
2022/09/08 12:33:36 metrics_reader.go:68: D! system : after gather once, duration: 276.615µs
2022/09/08 12:33:36 metrics_reader.go:62: D! redis : before gather once
2022/09/08 12:33:36 metrics_reader.go:68: D! redis : after gather once, duration: 3.834116ms
2022/09/08 12:33:36 metrics_reader.go:62: D! netstat : before gather once
2022/09/08 12:33:36 metrics_reader.go:62: D! processes : before gather once
2022/09/08 12:33:36 metrics_reader.go:68: D! processes : after gather once, duration: 14.157143ms
2022/09/08 12:33:36 metrics_reader.go:68: D! netstat : after gather once, duration: 17.629556ms
2022/09/08 12:33:36 metrics_reader.go:62: D! ping : before gather once
2022/09/08 12:33:36 ping.go:118: D! ping... 192.168.100.254
2022/09/08 12:33:36 ping.go:118: D! ping... www.baidu.com
2022/09/08 12:33:36 ping.go:118: D! ping... 192.168.101.10
2022/09/08 12:33:36 ping.go:118: D! ping... 192.168.101.1
2022/09/08 12:33:36 metrics_reader.go:68: D! ping : after gather once, duration: 42.627288ms

System info

centos7.9 x86_64 二进制部署

Docker

No response

Steps to reproduce

1.switch_legacy_cpu_util
2.

{"name":"switch_legacy_cpu_util","instance":"192.168.7.13","ip":"sw-192.168.101.1","region":"wuhan"} 3 3 3 294 3
3.
{"name":"switch_legacy_cpu_util","instance":"192.168.7.13","ip":"sw-192.168.100.254","region":"wuhan"} 0 0 0 0 0

Expected behavior

希望能采集到h3c S7506E交换机CPU内存数据,h3c S5560\S5110是能采集到数据的

Actual behavior

h3c S7506E交换机CPU内存数据为0

Additional info

No response

categraf 支持windows自定义采集指标?exec 配置的时候没有找到文件

报错信息
2022/08/03 14:36:06 exec.go:133: E! exec_command: D:\exec\exec_oracle.bat error: exec: "D:execexec_oracle.bat": file does not exist stderr:

interval = 15
[[instances]]
commands = [
"D:\exec\*.bat"
]
timeout = 5
interval_times = 15

# mesurement,labelkey1=labelval1,labelkey2=labelval2 field1=1.2,field2=2.3

data_format = "influx"

d:\exec\exec_oracle.bat
echo 'filesize,directory="/home/gxslzy/" size=547754993374'

input.kafka 配置多个kafka集群时,会出现cluster label覆盖的情况

Relevant config.toml

[[instances]]
labels = { cluster="clusterA" }

# log level only for kafka exporter
log_level = "error"

# Address (host:port) of Kafka server.
kafka_uris = ["clusterA:9092"]

[[instances]]
# # interval = global.interval * interval_times
# interval_times = 1

# append some labels to metrics
# cluster is a preferred tag with the cluster name. If none is provided, the first of kafka_uris will be used
labels = { cluster="clusterB" }

# log level only for kafka exporter
log_level = "error"

# Address (host:port) of Kafka server.
kafka_uris = ["clusterB:9092"]

Logs from categraf

xxx cluster=clusterB ...
xxx cluster=clusterB ...
xxx cluster=clusterB ...
xxx cluster=clusterB ...

System info

categraf v0.1.12

Docker

No response

Steps to reproduce

  1. 配置kafka.input
  2. ./categraf --test --inputs kafka:kafka 查看输出

Expected behavior

同时能查看clusterA clusterB的topic数据

Actual behavior

实际只有clusterB标签的数据

Additional info

No response

reload error

重载的时候,偶尔会出现中断,进程直接退出

2022/06/28 20:44:42 agent.go:69: I! agent stopping
panic: send on closed channel

goroutine 1 [running]:
flashcat.cloud/categraf/agent.(*Agent).Stop(0xc000143df0?)
/home/runner/work/categraf/categraf/agent/agent.go:73 +0xdf
flashcat.cloud/categraf/agent.(*Agent).Reload(0xc000143e70?)
/home/runner/work/categraf/categraf/agent/agent.go:84 +0x53
main.handleSignal(0xc0002d7020?)
/home/runner/work/categraf/categraf/main.go:94 +0x206
main.runAgent(0x0?)
/home/runner/work/categraf/categraf/main_posix.go:12 +0x28
main.main()
/home/runner/work/categraf/categraf/main.go:69 +0x17d

图表没有数据

您好,我按照相关的配置,但图表却没有相关数据:
image
./categraf --test --inputs mysql:
image
image
image

Rename label "agent_hostname" to "instance"

>> __name__=linux_sysctl_fs_dentry_nr agent_hostname=bj1-test-rc 1655285173489 648331
>> __name__=linux_sysctl_fs_dentry_age_limit agent_hostname=bj1-test-rc 1655285173489 45
>> __name__=linux_sysctl_fs_dentry_want_pages agent_hostname=bj1-test-rc 1655285173489 0
>> __name__=linux_sysctl_fs_aio_nr agent_hostname=bj1-test-rc 1655285173489 512
>> __name__=linux_sysctl_fs_inode_nr agent_hostname=bj1-test-rc 1655285173489 165151
>> __name__=netstat_tcp_fin_wait2 agent_hostname=bj1-test-rc 1655285173574 0
>> __name__=netstat_tcp_time_wait agent_hostname=bj1-test-rc 1655285173574 50
>> __name__=netstat_tcp_close agent_hostname=bj1-test-rc 1655285173574 0
>> __name__=netstat_tcp_close_wait agent_hostname=bj1-test-rc 1655285173574 0
>> __name__=netstat_tcp_established agent_hostname=bj1-test-rc 1655285173574 15
>> __name__=netstat_tcp_syn_sent agent_hostname=bj1-test-rc 1655285173574 0
>> __name__=netstat_tcp_none agent_hostname=bj1-test-rc 1655285173574 11
>> __name__=system_load5 agent_hostname=bj1-test-rc 1655285173495 0.29
>> __name__=processes_blocked agent_hostname=bj1-test-rc 1655285173573 0
>> __name__=processes_stopped agent_hostname=bj1-test-rc 1655285173573 0
>> __name__=system_load15 agent_hostname=bj1-test-rc 1655285173495 0.17
>> __name__=net_bytes_recv agent_hostname=bj1-test-rc interface=eth0 1655285173489 8.1801963651e+10
>> __name__=system_n_cpus agent_hostname=bj1-test-rc 1655285173495 16
>> __name__=mem_vmalloc_total agent_hostname=bj1-test-rc 1655285173488 3.5184372087808e+13
>> __name__=processes_dead agent_hostname=bj1-test-rc 1655285173573 0
>> __name__=processes_idle agent_hostname=bj1-test-rc 1655285173573 0
>> __name__=mem_used_percent agent_hostname=bj1-test-rc 1655285173488 8.817239729771947
>> __name__=processes_zombies agent_hostname=bj1-test-rc 1655285173573 0
>> __name__=mem_active agent_hostname=bj1-test-rc 1655285173488 6.777442304e+09
>> __name__=system_load_norm_1 agent_hostname=bj1-test-rc 1655285173495 0.025625
>> __name__=mem_vmalloc_chunk agent_hostname=bj1-test-rc 1655285173488 3.518429632512e+13
>> __name__=system_load_norm_5 agent_hostname=bj1-test-rc 1655285173495 0.018125
>> __name__=processes_running agent_hostname=bj1-test-rc 1655285173573 0
>> __name__=system_load_norm_15 agent_hostname=bj1-test-rc 1655285173495 0.010625
>> __name__=netstat_tcp_closing agent_hostname=bj1-test-rc 1655285173574 1
>> __name__=netstat_udp_socket agent_hostname=bj1-test-rc 1655285173574 14
>> __name__=netstat_tcp_last_ack agent_hostname=bj1-test-rc 1655285173574 0
>> __name__=netstat_tcp_listen agent_hostname=bj1-test-rc 1655285173574 12
>> __name__=mem_inactive agent_hostname=bj1-test-rc 1655285173488 1.91021056e+09
>> __name__=mem_shared agent_hostname=bj1-test-rc 1655285173488 2.60096e+07
>> __name__=mem_vmalloc_used agent_hostname=bj1-test-rc 1655285173488 6.5728512e+07
>> __name__=mem_total agent_hostname=bj1-test-rc 1655285173488 3.356491776e+10
>> __name__=mem_free agent_hostname=bj1-test-rc 1655285173488 2.4053645312e+10
>> __name__=mem_cached agent_hostname=bj1-test-rc 1655285173488 6.202667008e+09
>> __name__=mem_high_free agent_hostname=bj1-test-rc 1655285173488 0
>> __name__=mem_swap_free agent_hostname=bj1-test-rc 1655285173488 0
>> __name__=mem_write_back_tmp agent_hostname=bj1-test-rc 1655285173488 0
>> __name__=mem_available_percent agent_hostname=bj1-test-rc 1655285173488 89.87629598172447
>> __name__=mem_buffered agent_hostname=bj1-test-rc 1655285173488 3.49106176e+08

涉及到每个指标都会有这个 label, 建议将 agent_hostname 更改为 instance, 可能符合 Prometheus 生态的命名规范,也更简洁,使用更方便。

len("instance") < len("agent_hostname")

oracle plugins build failed on centos6.5

Relevant config.toml

[global]
# whether print configs
print_configs = false

# add label(agent_hostname) to series
# "" -> auto detect hostname
# "xx" -> use specified string xx
# "$hostname" -> auto detect hostname
# "$ip" -> auto detect ip
# "$hostname-$ip" -> auto detect hostname and ip to replace the vars
hostname = ""

# will not add label(agent_hostname) if true
omit_hostname = false

# s | ms
precision = "ms"

# global collect interval
interval = 15

# [global.labels]
# region = "shanghai"
# env = "localhost"

[writer_opt]
# default: 2000
batch = 2000
# channel(as queue) size
chan_size = 10000

[[writers]]
url = "http://127.0.0.1:19000/prometheus/v1/write"

# Basic auth username
basic_auth_user = ""

# Basic auth password
basic_auth_pass = ""

# timeout settings, unit: ms
timeout = 5000
dial_timeout = 2500
max_idle_conns_per_host = 100

[http]
enable = true
address = ":9100"
print_access = false
run_mode = "release"

Logs from categraf

build failed

System info

Linux ECORADB-200-42 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Docker

No response

Steps to reproduce

go build --tags "enterprise"

github.com/godror/godror

cgo: gcc did not produce error at completed:1
on input:

#line 1 "cgo-builtin-prolog"
#include <stddef.h> /* for ptrdiff_t and size_t below */

/* Define intgo when compiling with GCC. */
typedef ptrdiff_t intgo;

#define GO_CGO_GOSTRING_TYPEDEF
typedef struct { const char *p; intgo n; } GoString;
typedef struct { char *p; intgo n; intgo c; } GoBytes;
GoString GoString(char *p);
GoString GoStringN(char *p, int l);
GoBytes GoBytes(void *p, int n);
char *CString(GoString);
void *CBytes(GoBytes);
void *_CMalloc(size_t);

attribute ((unused))
static size_t _GoStringLen(GoString s) { return (size_t)s.n; }

attribute ((unused))
static const char *_GoStringPtr(GoString s) { return s.p; }
#line 8 "/root/go/pkg/mod/github.com/godror/[email protected]/conn.go"

#include <stdlib.h>
#include "dpiImpl.h"

#line 1 "cgo-generated-wrapper"
#line 1 "not-declared"
void __cgo_f_1_1(void) { typeof(CString) *__cgo_undefined__1; }
#line 1 "not-type"
void __cgo_f_1_2(void) { CString *__cgo_undefined__2; }
#line 1 "not-int-const"
void __cgo_f_1_3(void) { enum { __cgo_undefined__3 = (CString)*1 }; }
#line 1 "not-num-const"
void __cgo_f_1_4(void) { static const double __cgo_undefined__4 = (CString); }
#line 1 "not-str-lit"
void __cgo_f_1_5(void) { static const char __cgo_undefined__5[] = (CString); }
#line 2 "not-declared"
void __cgo_f_2_1(void) { typeof(char) *__cgo_undefined__1; }
#line 2 "not-type"
void __cgo_f_2_2(void) { char *__cgo_undefined__2; }
#line 2 "not-int-const"
void __cgo_f_2_3(void) { enum { __cgo_undefined__3 = (char)*1 }; }
#line 2 "not-num-const"
void __cgo_f_2_4(void) { static const double __cgo_undefined__4 = (char); }
#line 2 "not-str-lit"
void __cgo_f_2_5(void) { static const char __cgo_undefined__5[] = (char); }
#line 3 "not-declared"
void __cgo_f_3_1(void) { typeof(dpiConn) *__cgo_undefined__1; }
#line 3 "not-type"
void __cgo_f_3_2(void) { dpiConn *__cgo_undefined__2; }
#line 3 "not-int-const"
void __cgo_f_3_3(void) { enum { __cgo_undefined__3 = (dpiConn)*1 }; }
#line 3 "not-num-const"
void __cgo_f_3_4(void) { static const double __cgo_undefined__4 = (dpiConn); }
#line 3 "not-str-lit"
void __cgo_f_3_5(void) { static const char __cgo_undefined__5[] = (dpiConn); }
#line 4 "not-declared"
void __cgo_f_4_1(void) { typeof(dpiConn_breakExecution) *__cgo_undefined__1; }
#line 4 "not-type"
void __cgo_f_4_2(void) { dpiConn_breakExecution *__cgo_undefined__2; }
#line 4 "not-int-const"
void __cgo_f_4_3(void) { enum { __cgo_undefined__3 = (dpiConn_breakExecution)*1 }; }
#line 4 "not-num-const"
void __cgo_f_4_4(void) { static const double __cgo_undefined__4 = (dpiConn_breakExecution); }
#line 4 "not-str-lit"
void __cgo_f_4_5(void) { static const char __cgo_undefined__5[] = (dpiConn_breakExecution); }
#line 5 "not-declared"
void __cgo_f_5_1(void) { typeof(dpiConn_commit) *__cgo_undefined__1; }
#line 5 "not-type"
void __cgo_f_5_2(void) { dpiConn_commit *__cgo_undefined__2; }
#line 5 "not-int-const"
void __cgo_f_5_3(void) { enum { __cgo_undefined__3 = (dpiConn_commit)*1 }; }
#line 5 "not-num-const"
void __cgo_f_5_4(void) { static const double __cgo_undefined__4 = (dpiConn_commit); }
#line 5 "not-str-lit"
void __cgo_f_5_5(void) { static const char __cgo_undefined__5[] = (dpiConn_commit); }
#line 6 "not-declared"
void __cgo_f_6_1(void) { typeof(dpiConn_getIsHealthy) *__cgo_undefined__1; }
#line 6 "not-type"
void __cgo_f_6_2(void) { dpiConn_getIsHealthy *__cgo_undefined__2; }
#line 6 "not-int-const"
void __cgo_f_6_3(void) { enum { __cgo_undefined__3 = (dpiConn_getIsHealthy)*1 }; }
#line 6 "not-num-const"
void __cgo_f_6_4(void) { static const double __cgo_undefined__4 = (dpiConn_getIsHealthy); }
#line 6 "not-str-lit"
void __cgo_f_6_5(void) { static const char __cgo_undefined__5[] = (dpiConn_getIsHealthy); }
#line 7 "not-declared"
void __cgo_f_7_1(void) { typeof(dpiConn_getServerVersion) *__cgo_undefined__1; }
#line 7 "not-type"
void __cgo_f_7_2(void) { dpiConn_getServerVersion *__cgo_undefined__2; }
#line 7 "not-int-const"
void __cgo_f_7_3(void) { enum { __cgo_undefined__3 = (dpiConn_getServerVersion)*1 }; }
#line 7 "not-num-const"
void __cgo_f_7_4(void) { static const double __cgo_undefined__4 = (dpiConn_getServerVersion); }
#line 7 "not-str-lit"
void __cgo_f_7_5(void) { static const char __cgo_undefined__5[] = (dpiConn_getServerVersion); }
#line 8 "not-declared"
void __cgo_f_8_1(void) { typeof(dpiConn_newVar) *__cgo_undefined__1; }
#line 8 "not-type"
void __cgo_f_8_2(void) { dpiConn_newVar *__cgo_undefined__2; }
#line 8 "not-int-const"
void __cgo_f_8_3(void) { enum { __cgo_undefined__3 = (dpiConn_newVar)*1 }; }
#line 8 "not-num-const"
void __cgo_f_8_4(void) { static const double __cgo_undefined__4 = (dpiConn_newVar); }
#line 8 "not-str-lit"
void __cgo_f_8_5(void) { static const char __cgo_undefined__5[] = (dpiConn_newVar); }
#line 9 "not-declared"
void __cgo_f_9_1(void) { typeof(dpiConn_ping) *__cgo_undefined__1; }
#line 9 "not-type"
void __cgo_f_9_2(void) { dpiConn_ping *__cgo_undefined__2; }
#line 9 "not-int-const"
void __cgo_f_9_3(void) { enum { __cgo_undefined__3 = (dpiConn_ping)*1 }; }
#line 9 "not-num-const"
void __cgo_f_9_4(void) { static const double __cgo_undefined__4 = (dpiConn_ping); }
#line 9 "not-str-lit"
void __cgo_f_9_5(void) { static const char __cgo_undefined__5[] = (dpiConn_ping); }
#line 10 "not-declared"
void __cgo_f_10_1(void) { typeof(dpiConn_prepareStmt) *__cgo_undefined__1; }
#line 10 "not-type"
void __cgo_f_10_2(void) { dpiConn_prepareStmt *__cgo_undefined__2; }
#line 10 "not-int-const"
void __cgo_f_10_3(void) { enum { __cgo_undefined__3 = (dpiConn_prepareStmt)*1 }; }
#line 10 "not-num-const"
void __cgo_f_10_4(void) { static const double __cgo_undefined__4 = (dpiConn_prepareStmt); }
#line 10 "not-str-lit"
void __cgo_f_10_5(void) { static const char __cgo_undefined__5[] = (dpiConn_prepareStmt); }
#line 11 "not-declared"
void __cgo_f_11_1(void) { typeof(dpiConn_release) *__cgo_undefined__1; }
#line 11 "not-type"
void __cgo_f_11_2(void) { dpiConn_release *__cgo_undefined__2; }
#line 11 "not-int-const"
void __cgo_f_11_3(void) { enum { __cgo_undefined__3 = (dpiConn_release)*1 }; }
#line 11 "not-num-const"
void __cgo_f_11_4(void) { static const double __cgo_undefined__4 = (dpiConn_release); }
#line 11 "not-str-lit"
void __cgo_f_11_5(void) { static const char __cgo_undefined__5[] = (dpiConn_release); }
#line 12 "not-declared"
void __cgo_f_12_1(void) { typeof(dpiConn_rollback) *__cgo_undefined__1; }
#line 12 "not-type"
void __cgo_f_12_2(void) { dpiConn_rollback *__cgo_undefined__2; }
#line 12 "not-int-const"
void __cgo_f_12_3(void) { enum { __cgo_undefined__3 = (dpiConn_rollback)*1 }; }
#line 12 "not-num-const"
void __cgo_f_12_4(void) { static const double __cgo_undefined__4 = (dpiConn_rollback); }
#line 12 "not-str-lit"
void __cgo_f_12_5(void) { static const char __cgo_undefined__5[] = (dpiConn_rollback); }
#line 13 "not-declared"
void __cgo_f_13_1(void) { typeof(dpiConn_setAction) *__cgo_undefined__1; }
#line 13 "not-type"
void __cgo_f_13_2(void) { dpiConn_setAction *__cgo_undefined__2; }
#line 13 "not-int-const"
void __cgo_f_13_3(void) { enum { __cgo_undefined__3 = (dpiConn_setAction)*1 }; }
#line 13 "not-num-const"
void __cgo_f_13_4(void) { static const double __cgo_undefined__4 = (dpiConn_setAction); }
#line 13 "not-str-lit"
void __cgo_f_13_5(void) { static const char __cgo_undefined__5[] = (dpiConn_setAction); }
#line 14 "not-declared"
void __cgo_f_14_1(void) { typeof(dpiConn_setCallTimeout) *__cgo_undefined__1; }
#line 14 "not-type"
void __cgo_f_14_2(void) { dpiConn_setCallTimeout *__cgo_undefined__2; }
#line 14 "not-int-const"
void __cgo_f_14_3(void) { enum { __cgo_undefined__3 = (dpiConn_setCallTimeout)*1 }; }
#line 14 "not-num-const"
void __cgo_f_14_4(void) { static const double __cgo_undefined__4 = (dpiConn_setCallTimeout); }
#line 14 "not-str-lit"
void __cgo_f_14_5(void) { static const char __cgo_undefined__5[] = (dpiConn_setCallTimeout); }
#line 15 "not-declared"
void __cgo_f_15_1(void) { typeof(dpiConn_setClientIdentifier) *__cgo_undefined__1; }
#line 15 "not-type"
void __cgo_f_15_2(void) { dpiConn_setClientIdentifier *__cgo_undefined__2; }
#line 15 "not-int-const"
void __cgo_f_15_3(void) { enum { __cgo_undefined__3 = (dpiConn_setClientIdentifier)*1 }; }
#line 15 "not-num-const"
void __cgo_f_15_4(void) { static const double __cgo_undefined__4 = (dpiConn_setClientIdentifier); }
#line 15 "not-str-lit"
void __cgo_f_15_5(void) { static const char __cgo_undefined__5[] = (dpiConn_setClientIdentifier); }
#line 16 "not-declared"
void __cgo_f_16_1(void) { typeof(dpiConn_setClientInfo) *__cgo_undefined__1; }
#line 16 "not-type"
void __cgo_f_16_2(void) { dpiConn_setClientInfo *__cgo_undefined__2; }
#line 16 "not-int-const"
void __cgo_f_16_3(void) { enum { __cgo_undefined__3 = (dpiConn_setClientInfo)*1 }; }
#line 16 "not-num-const"
void __cgo_f_16_4(void) { static const double __cgo_undefined__4 = (dpiConn_setClientInfo); }
#line 16 "not-str-lit"
void __cgo_f_16_5(void) { static const char __cgo_undefined__5[] = (dpiConn_setClientInfo); }
#line 17 "not-declared"
void __cgo_f_17_1(void) { typeof(dpiConn_setDbOp) *__cgo_undefined__1; }
#line 17 "not-type"
void __cgo_f_17_2(void) { dpiConn_setDbOp *__cgo_undefined__2; }
#line 17 "not-int-const"
void __cgo_f_17_3(void) { enum { __cgo_undefined__3 = (dpiConn_setDbOp)*1 }; }
#line 17 "not-num-const"
void __cgo_f_17_4(void) { static const double __cgo_undefined__4 = (dpiConn_setDbOp); }
#line 17 "not-str-lit"
void __cgo_f_17_5(void) { static const char __cgo_undefined__5[] = (dpiConn_setDbOp); }
#line 18 "not-declared"
void __cgo_f_18_1(void) { typeof(dpiConn_setModule) *__cgo_undefined__1; }
#line 18 "not-type"
void __cgo_f_18_2(void) { dpiConn_setModule *__cgo_undefined__2; }
#line 18 "not-int-const"
void __cgo_f_18_3(void) { enum { __cgo_undefined__3 = (dpiConn_setModule)*1 }; }
#line 18 "not-num-const"
void __cgo_f_18_4(void) { static const double __cgo_undefined__4 = (dpiConn_setModule); }
#line 18 "not-str-lit"
void __cgo_f_18_5(void) { static const char __cgo_undefined__5[] = (dpiConn_setModule); }
#line 19 "not-declared"
void __cgo_f_19_1(void) { typeof(dpiConn_shutdownDatabase) *__cgo_undefined__1; }
#line 19 "not-type"
void __cgo_f_19_2(void) { dpiConn_shutdownDatabase *__cgo_undefined__2; }
#line 19 "not-int-const"
void __cgo_f_19_3(void) { enum { __cgo_undefined__3 = (dpiConn_shutdownDatabase)*1 }; }
#line 19 "not-num-const"
void __cgo_f_19_4(void) { static const double __cgo_undefined__4 = (dpiConn_shutdownDatabase); }
#line 19 "not-str-lit"
void __cgo_f_19_5(void) { static const char __cgo_undefined__5[] = (dpiConn_shutdownDatabase); }
#line 20 "not-declared"
void __cgo_f_20_1(void) { typeof(dpiConn_startupDatabase) *__cgo_undefined__1; }
#line 20 "not-type"
void __cgo_f_20_2(void) { dpiConn_startupDatabase *__cgo_undefined__2; }
#line 20 "not-int-const"
void __cgo_f_20_3(void) { enum { __cgo_undefined__3 = (dpiConn_startupDatabase)*1 }; }
#line 20 "not-num-const"
void __cgo_f_20_4(void) { static const double __cgo_undefined__4 = (dpiConn_startupDatabase); }
#line 20 "not-str-lit"
void __cgo_f_20_5(void) { static const char __cgo_undefined__5[] = (dpiConn_startupDatabase); }
#line 21 "not-declared"
void __cgo_f_21_1(void) { typeof(dpiData) *__cgo_undefined__1; }
#line 21 "not-type"
void __cgo_f_21_2(void) { dpiData *__cgo_undefined__2; }
#line 21 "not-int-const"
void __cgo_f_21_3(void) { enum { __cgo_undefined__3 = (dpiData)*1 }; }
#line 21 "not-num-const"
void __cgo_f_21_4(void) { static const double __cgo_undefined__4 = (dpiData); }
#line 21 "not-str-lit"
void __cgo_f_21_5(void) { static const char __cgo_undefined__5[] = (dpiData); }
#line 22 "not-declared"
void __cgo_f_22_1(void) { typeof(dpiNativeTypeNum) *__cgo_undefined__1; }
#line 22 "not-type"
void __cgo_f_22_2(void) { dpiNativeTypeNum *__cgo_undefined__2; }
#line 22 "not-int-const"
void __cgo_f_22_3(void) { enum { __cgo_undefined__3 = (dpiNativeTypeNum)*1 }; }
#line 22 "not-num-const"
void __cgo_f_22_4(void) { static const double __cgo_undefined__4 = (dpiNativeTypeNum); }
#line 22 "not-str-lit"
void __cgo_f_22_5(void) { static const char __cgo_undefined__5[] = (dpiNativeTypeNum); }
#line 23 "not-declared"
void __cgo_f_23_1(void) { typeof(dpiObjectType) *__cgo_undefined__1; }
#line 23 "not-type"
void __cgo_f_23_2(void) { dpiObjectType *__cgo_undefined__2; }
#line 23 "not-int-const"
void __cgo_f_23_3(void) { enum { __cgo_undefined__3 = (dpiObjectType)*1 }; }
#line 23 "not-num-const"
void __cgo_f_23_4(void) { static const double __cgo_undefined__4 = (dpiObjectType); }
#line 23 "not-str-lit"
void __cgo_f_23_5(void) { static const char __cgo_undefined__5[] = (dpiObjectType); }
#line 24 "not-declared"
void __cgo_f_24_1(void) { typeof(dpiOracleTypeNum) *__cgo_undefined__1; }
#line 24 "not-type"
void __cgo_f_24_2(void) { dpiOracleTypeNum *__cgo_undefined__2; }
#line 24 "not-int-const"
void __cgo_f_24_3(void) { enum { __cgo_undefined__3 = (dpiOracleTypeNum)*1 }; }
#line 24 "not-num-const"
void __cgo_f_24_4(void) { static const double __cgo_undefined__4 = (dpiOracleTypeNum); }
#line 24 "not-str-lit"
void __cgo_f_24_5(void) { static const char __cgo_undefined__5[] = (dpiOracleTypeNum); }
#line 25 "not-declared"
void __cgo_f_25_1(void) { typeof(dpiShutdownMode) *__cgo_undefined__1; }
#line 25 "not-type"
void __cgo_f_25_2(void) { dpiShutdownMode *__cgo_undefined__2; }
#line 25 "not-int-const"
void __cgo_f_25_3(void) { enum { __cgo_undefined__3 = (dpiShutdownMode)*1 }; }
#line 25 "not-num-const"
void __cgo_f_25_4(void) { static const double __cgo_undefined__4 = (dpiShutdownMode); }
#line 25 "not-str-lit"
void __cgo_f_25_5(void) { static const char __cgo_undefined__5[] = (dpiShutdownMode); }
#line 26 "not-declared"
void __cgo_f_26_1(void) { typeof(dpiStartupMode) *__cgo_undefined__1; }
#line 26 "not-type"
void __cgo_f_26_2(void) { dpiStartupMode *__cgo_undefined__2; }
#line 26 "not-int-const"
void __cgo_f_26_3(void) { enum { __cgo_undefined__3 = (dpiStartupMode)*1 }; }
#line 26 "not-num-const"
void __cgo_f_26_4(void) { static const double __cgo_undefined__4 = (dpiStartupMode); }
#line 26 "not-str-lit"
void __cgo_f_26_5(void) { static const char __cgo_undefined__5[] = (dpiStartupMode); }
#line 27 "not-declared"
void __cgo_f_27_1(void) { typeof(dpiStmt) *__cgo_undefined__1; }
#line 27 "not-type"
void __cgo_f_27_2(void) { dpiStmt *__cgo_undefined__2; }
#line 27 "not-int-const"
void __cgo_f_27_3(void) { enum { __cgo_undefined__3 = (dpiStmt)*1 }; }
#line 27 "not-num-const"
void __cgo_f_27_4(void) { static const double __cgo_undefined__4 = (dpiStmt); }
#line 27 "not-str-lit"
void __cgo_f_27_5(void) { static const char __cgo_undefined__5[] = (dpiStmt); }
#line 28 "not-declared"
void __cgo_f_28_1(void) { typeof(dpiStmt_getInfo) *__cgo_undefined__1; }
#line 28 "not-type"
void __cgo_f_28_2(void) { dpiStmt_getInfo *__cgo_undefined__2; }
#line 28 "not-int-const"
void __cgo_f_28_3(void) { enum { __cgo_undefined__3 = (dpiStmt_getInfo)*1 }; }
#line 28 "not-num-const"
void __cgo_f_28_4(void) { static const double __cgo_undefined__4 = (dpiStmt_getInfo); }
#line 28 "not-str-lit"
void __cgo_f_28_5(void) { static const char __cgo_undefined__5[] = (dpiStmt_getInfo); }
#line 29 "not-declared"
void __cgo_f_29_1(void) { typeof(dpiVar) *__cgo_undefined__1; }
#line 29 "not-type"
void __cgo_f_29_2(void) { dpiVar *__cgo_undefined__2; }
#line 29 "not-int-const"
void __cgo_f_29_3(void) { enum { __cgo_undefined__3 = (dpiVar)*1 }; }
#line 29 "not-num-const"
void __cgo_f_29_4(void) { static const double __cgo_undefined__4 = (dpiVar); }
#line 29 "not-str-lit"
void __cgo_f_29_5(void) { static const char __cgo_undefined__5[] = (dpiVar); }
#line 30 "not-declared"
void __cgo_f_30_1(void) { typeof(dpiVersionInfo) *__cgo_undefined__1; }
#line 30 "not-type"
void __cgo_f_30_2(void) { dpiVersionInfo *__cgo_undefined__2; }
#line 30 "not-int-const"
void __cgo_f_30_3(void) { enum { __cgo_undefined__3 = (dpiVersionInfo)*1 }; }
#line 30 "not-num-const"
void __cgo_f_30_4(void) { static const double __cgo_undefined__4 = (dpiVersionInfo); }
#line 30 "not-str-lit"
void __cgo_f_30_5(void) { static const char __cgo_undefined__5[] = (dpiVersionInfo); }
#line 31 "not-declared"
void __cgo_f_31_1(void) { typeof(free) *__cgo_undefined__1; }
#line 31 "not-type"
void __cgo_f_31_2(void) { free *__cgo_undefined__2; }
#line 31 "not-int-const"
void __cgo_f_31_3(void) { enum { __cgo_undefined__3 = (free)*1 }; }
#line 31 "not-num-const"
void __cgo_f_31_4(void) { static const double __cgo_undefined__4 = (free); }
#line 31 "not-str-lit"
void __cgo_f_31_5(void) { static const char __cgo_undefined__5[] = (free); }
#line 32 "not-declared"
void __cgo_f_32_1(void) { typeof(int) *__cgo_undefined__1; }
#line 32 "not-type"
void __cgo_f_32_2(void) { int *__cgo_undefined__2; }
#line 32 "not-int-const"
void __cgo_f_32_3(void) { enum { __cgo_undefined__3 = (int)*1 }; }
#line 32 "not-num-const"
void __cgo_f_32_4(void) { static const double __cgo_undefined__4 = (int); }
#line 32 "not-str-lit"
void __cgo_f_32_5(void) { static const char __cgo_undefined__5[] = (int); }
#line 33 "not-declared"
void __cgo_f_33_1(void) { typeof(sizeof(dpiSubscrMessageTable)) *__cgo_undefined__1; }
#line 33 "not-type"
void __cgo_f_33_2(void) { sizeof(dpiSubscrMessageTable) *__cgo_undefined__2; }
#line 33 "not-int-const"
void __cgo_f_33_3(void) { enum { __cgo_undefined__3 = (sizeof(dpiSubscrMessageTable))*1 }; }
#line 33 "not-num-const"
void __cgo_f_33_4(void) { static const double __cgo_undefined__4 = (sizeof(dpiSubscrMessageTable)); }
#line 33 "not-str-lit"
void __cgo_f_33_5(void) { static const char __cgo_undefined__5[] = (sizeof(dpiSubscrMessageTable)); }
#line 34 "not-declared"
void __cgo_f_34_1(void) { typeof(unsigned int) *__cgo_undefined__1; }
#line 34 "not-type"
void __cgo_f_34_2(void) { unsigned int *__cgo_undefined__2; }
#line 34 "not-int-const"
void __cgo_f_34_3(void) { enum { __cgo_undefined__3 = (unsigned int)*1 }; }
#line 34 "not-num-const"
void __cgo_f_34_4(void) { static const double __cgo_undefined__4 = (unsigned int); }
#line 34 "not-str-lit"
void __cgo_f_34_5(void) { static const char __cgo_undefined__5[] = (unsigned int); }
#line 35 "not-declared"
void __cgo_f_35_1(void) { typeof(uint32_t) *__cgo_undefined__1; }
#line 35 "not-type"
void __cgo_f_35_2(void) { uint32_t *__cgo_undefined__2; }
#line 35 "not-int-const"
void __cgo_f_35_3(void) { enum { __cgo_undefined__3 = (uint32_t)*1 }; }
#line 35 "not-num-const"
void __cgo_f_35_4(void) { static const double __cgo_undefined__4 = (uint32_t); }
#line 35 "not-str-lit"
void __cgo_f_35_5(void) { static const char __cgo_undefined__5[] = (uint32_t); }
#line 1 "completed"
int __cgo__1 = __cgo__2;

full error output:
cc1: error: unrecognized command line option "-fno-lto"

Expected behavior

it seems like oracle plugins not compitionable with the centos 6.5

Actual behavior

it seems like oracle plugins not compitionable with the centos 6.5

Additional info

No response

reload error

Relevant config.toml

[global]
# whether print configs
print_configs = false

# add label(agent_hostname) to series
# "" -> auto detect hostname
# "xx" -> use specified string xx
# "$hostname" -> auto detect hostname
# "$ip" -> auto detect ip
# "$hostname-$ip" -> auto detect hostname and ip to replace the vars
hostname = ""

# will not add label(agent_hostname) if true
omit_hostname = false

# s | ms
precision = "ms"

# global collect interval
interval = 15

# [global.labels]
# region = "shanghai"
# env = "localhost"

[writer_opt]
# default: 2000
batch = 2000
# channel(as queue) size
chan_size = 10000

[[writers]]
url = "http://127.0.0.1:19000/prometheus/v1/write"

# Basic auth username
basic_auth_user = ""

# Basic auth password
basic_auth_pass = ""

# timeout settings, unit: ms
timeout = 5000
dial_timeout = 2500
max_idle_conns_per_host = 100

Logs from categraf

日志如下,已开启debug模式  
#!/bin/sh
nohup ./categraf -debug >> run.log 2>&1 &

2022/07/07 15:33:55 main.go:89: I! received signal: hangup
2022/07/07 15:33:55 agent.go:73: I! agent reloading
2022/07/07 15:33:55 agent.go:65: I! agent stopping
panic: send on closed channel

goroutine 1 [running]:
flashcat.cloud/categraf/agent.(*InputReader).Stop(...)
        /home/runner/work/categraf/categraf/agent/metrics_reader.go:45
flashcat.cloud/categraf/agent.(*Agent).stopMetricsAgent(...)
        /home/runner/work/categraf/categraf/agent/metrics_agent.go:90
flashcat.cloud/categraf/agent.(*Agent).Stop(0xc000cf1e38)
        /home/runner/work/categraf/categraf/agent/agent.go:67 +0xe5
flashcat.cloud/categraf/agent.(*Agent).Reload(0xc000cf1d58?)
        /home/runner/work/categraf/categraf/agent/agent.go:74 +0x57
main.handleSignal(0xc000928450?)
        /home/runner/work/categraf/categraf/main.go:94 +0x206
main.runAgent(0x0?)
        /home/runner/work/categraf/categraf/main_posix.go:12 +0x28
main.main()
        /home/runner/work/categraf/categraf/main.go:69 +0x205

System info

./categraf -version v0.1.12-5357da0e95c1f0f3fb65c4c73d09af525ec40725 Linux dcnn2 2.6.32-358.el6.x86_64 #1 SMP Tue Jan 29 11:47:41 EST 2013 x86_64 x86_64 x86_64 GNU/Linux

Docker

No response

Steps to reproduce

1、 kill -HUP 进程ID ,进行重载,偶尔出现以上日志(并非必现),导致categraf直接退出,严重影响监控稳定性
2、之前也提过这个issue,之前还是低版本,此问题一直存在

Expected behavior

正常

Actual behavior

异常退出

Additional info

No response

input.system插件增加已登录用户监控项

What would you like to be added:
input.system插件增加已登录用户监控项

Why is this needed:
已登录用户表示当前主机有多少人已登录,可直接反应当前主机是否被入侵等角度分析

Describe the solution you'd like

Additional context

上报的指标有没有可能兼容 node exporter

目前很多公司在使用原生的 node exporter 来监控公司的业务服务器,指标的名称、类型、标签可能和目前的 categraf 都是不兼容的,很难平滑的迁移到 categraf 上,可能无法复用之前的 rules 和一些配置(dashboard)。

有没有什么比较好的方式让这批用户比较简单的迁移到 categraf 上?

增加内部DNS监控

What would you like to be added:
增加内部DNS监控

Why is this needed:
企业在内部网络交换时,在一些业务场景中(比如内部请求API域名)需用到内部dns(bind、powerdns)做解析,不需要到外部DNS绕一圈再回来。故需要监测内部dns(bind、powerdns)服务是否正常。

Describe the solution you'd like
增加bind服务异常能力
增加powerdns服务异常能力

Additional context

categraf采集redis/disk发现无法写入prometheus

Relevant config.toml

[weblogic@ categraf]$ cat conf/input.disk/disk.toml 
# # collect interval
# interval = 15

# # By default stats will be gathered for all mount points.
# # Set mount_points will restrict the stats to only the specified mount points.
# mount_points = ["/"]

# Ignore mount points by filesystem type.
ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs"]

ignore_mount_points = ["/boot"]

Logs from categraf

[weblogic@ categraf]$ ./categraf -test inputs disk
2022/07/13 17:16:24 main.go:109: I! runner.binarydir: /servyou/n9e/agent/categraf
2022/07/13 17:16:24 main.go:110: I! runner.hostname: 
2022/07/13 17:16:24 main.go:111: I! runner.fd_limits: (soft=65535, hard=65535)
2022/07/13 17:16:24 main.go:112: I! runner.vm_limits: (soft=unlimited, hard=unlimited)
2022/07/13 17:16:24 config.go:33: I! tracing disabled
2022/07/13 17:16:24 agent.go:57: I! agent starting
2022/07/13 17:16:24 metrics_agent.go:60: I! input: disk started
2022/07/13 17:16:24 metrics_agent.go:60: I! input: redis started
2022/07/13 17:16:24 agent.go:61: I! agent started












2022/07/13 17:16:27 writers.go:76: >> count: 7
17:16:27 disk_inodes_total agent_hostname= device=dm-0 fstype=xfs mode=rw path=/ 2.0445184e+07
17:16:27 disk_inodes_free agent_hostname= device=dm-0 fstype=xfs mode=rw path=/ 2.0337309e+07
17:16:27 disk_inodes_used agent_hostname= device=dm-0 fstype=xfs mode=rw path=/ 107875
17:16:27 disk_total agent_hostname= device=dm-0 fstype=xfs mode=rw path=/ 4.1851293696e+10
17:16:27 disk_free agent_hostname= device=dm-0 fstype=xfs mode=rw path=/ 1.8069061632e+10
17:16:27 disk_used agent_hostname= device=dm-0 fstype=xfs mode=rw path=/ 2.3782232064e+10
17:16:27 disk_used_percent agent_hostname= device=dm-0 fstype=xfs mode=rw path=/ 56.825560129036155
2022/07/13 17:16:30 writers.go:76: >> count: 7
17:16:30 disk_inodes_free agent_hostname= device=dm-0 fstype=xfs mode=rw path=/ 2.0337309e+07
17:16:30 disk_inodes_used agent_hostname= device=dm-0 fstype=xfs mode=rw path=/ 107875
17:16:30 disk_total agent_hostname= device=dm-0 fstype=xfs mode=rw path=/ 4.1851293696e+10
17:16:30 disk_free agent_hostname= device=dm-0 fstype=xfs mode=rw path=/ 1.8069061632e+10
17:16:30 disk_used agent_hostname= device=dm-0 fstype=xfs mode=rw path=/ 2.3782232064e+10
17:16:30 disk_used_percent agent_hostname= device=dm-0 fstype=xfs mode=rw path=/ 56.825560129036155
17:16:30 disk_inodes_total agent_hostname= device=dm-0 fstype=xfs mode=rw path=/ 2.0445184e+07
2022/07/13 17:16:33 writers.go:76: >> count: 7
17:16:33 disk_total agent_hostname= device=dm-0 fstype=xfs mode=rw path=/ 4.1851293696e+10
17:16:33 disk_free agent_hostname= device=dm-0 fstype=xfs mode=rw path=/ 1.8069041152e+10
17:16:33 disk_used agent_hostname= device=dm-0 fstype=xfs mode=rw path=/ 2.3782252544e+10
17:16:33 disk_used_percent agent_hostname= device=dm-0 fstype=xfs mode=rw path=/ 56.825609064202055
17:16:33 disk_inodes_total agent_hostname= device=dm-0 fstype=xfs mode=rw path=/ 2.0445184e+07
17:16:33 disk_inodes_free agent_hostname= device=dm-0 fstype=xfs mode=rw path=/ 2.0337309e+07
17:16:33 disk_inodes_used agent_hostname= device=dm-0 fstype=xfs mode=rw path=/ 107875
2022/07/13 17:16:36 writers.go:76: >> count: 7
17:16:36 disk_used_percent agent_hostname= device=dm-0 fstype=xfs mode=rw path=/ 56.825609064202055
17:16:36 disk_inodes_total agent_hostname= device=dm-0 fstype=xfs mode=rw path=/ 2.0445184e+07
17:16:36 disk_inodes_free agent_hostname= device=dm-0 fstype=xfs mode=rw path=/ 2.0337309e+07
17:16:36 disk_inodes_used agent_hostname= device=dm-0 fstype=xfs mode=rw path=/ 107875
17:16:36 disk_total agent_hostname= device=dm-0 fstype=xfs mode=rw path=/ 4.1851293696e+10
17:16:36 disk_free agent_hostname= device=dm-0 fstype=xfs mode=rw path=/ 1.8069041152e+10
17:16:36 disk_used agent_hostname= device=dm-0 fstype=xfs mode=rw path=/ 2.3782252544e+10


[weblogic@ categraf]$ ./categraf  -inputs  disk
2022/07/13 17:18:58 main.go:109: I! runner.binarydir: /servyou/n9e/agent/categraf
2022/07/13 17:18:58 main.go:110: I! runner.hostname: 
2022/07/13 17:18:58 main.go:111: I! runner.fd_limits: (soft=65535, hard=65535)
2022/07/13 17:18:58 main.go:112: I! runner.vm_limits: (soft=unlimited, hard=unlimited)
2022/07/13 17:18:58 config.go:33: I! tracing disabled
2022/07/13 17:18:58 agent.go:57: I! agent starting
2022/07/13 17:18:58 metrics_agent.go:60: I! input: disk started
2022/07/13 17:18:58 agent.go:61: I! agent started

System info

3.10.0-862.11.6.el7.x86_64

Docker

No response

Steps to reproduce

忽略

Expected behavior

采集的指标可以正常写人prometheus

Actual behavior

01、n9e server日志
2022-07-13 17:29:17.899211 WARNING writer/writer.go:43 example timeseries:labels:<name:"name" value:"disk_free" > labels:<name:"ident" value:"" > labels:<name:"path" value:"/" > labels:<name:"device" value:"dm-0" > labels:<name:"fstype" value:"xfs" > labels:<name:"mode" value:"rw" > samples:<value:1.7781137408e+10 timestamp:1657704556 >
2022-07-13 17:29:17.899227 WARNING writer/writer.go:43 example timeseries:labels:<name:"name" value:"disk_total" > labels:<name:"path" value:"/" > labels:<name:"device" value:"dm-0" > labels:<name:"fstype" value:"xfs" > labels:<name:"mode" value:"rw" > labels:<name:"ident" value:"" > samples:<value:4.1851293696e+10 timestamp:1657704556 >
2022-07-13 17:29:17.899271 WARNING writer/writer.go:42 post to http://127.0.0.1:9090/api/v1/write got error: push data with remote write request got status code: 400, response body: out of bounds
2022-07-13 17:29:17.899293 WARNING writer/writer.go:43 example timeseries:labels:<name:"name" value:"disk_used" > labels:<name:"ident" value:"" > labels:<name:"fstype" value:"xfs" > labels:<name:"mode" value:"rw" > labels:<name:"path" value:"/" > labels:<name:"device" value:"dm-0" > samples:<value:2.4070156288e+10 timestamp:1657704556 >
2022-07-13 17:29:17.899272 WARNING writer/writer.go:42 post to http://127.0.0.1:9090/api/v1/write got error: push data with remote write request got status code: 400, response body: out of bounds
2022-07-13 17:29:17.899320 WARNING writer/writer.go:43 example timeseries:labels:<name:"name" value:"disk_inodes_total" > labels:<name:"mode" value:"rw" > labels:<name:"path" value:"/" > labels:<name:"device" value:"dm-0" > labels:<name:"fstype" value:"xfs" > labels:<name:"ident" value:"" > samples:<value:2.0445184e+07 timestamp:1657704556 >
2022-07-13 17:29:17.899356 WARNING writer/writer.go:42 post to http://127.0.0.1:9090/api/v1/write got error: push data with remote write request got status code: 400, response body: out of bounds
2022-07-13 17:29:17.899417 WARNING writer/writer.go:43 example timeseries:labels:<name:"name" value:"disk_inodes_used" > labels:<name:"path" value:"/" > labels:<name:"device" value:"dm-0" > labels:<name:"fstype" value:"xfs" > labels:<name:"mode" value:"rw" > labels:<name:"ident" value:"" > samples:<value:107902 timestamp:1657704556 >

02、prometheus日志
level=error ts=2022-07-13T09:17:02.077Z caller=write_handler.go:53 component=web msg="Out of order sample from remote write" err="out of bounds"
level=error ts=2022-07-13T09:17:02.077Z caller=write_handler.go:53 component=web msg="Out of order sample from remote write" err="out of bounds"
level=error ts=2022-07-13T09:17:02.077Z caller=write_handler.go:53 component=web msg="Out of order sample from remote write" err="out of bounds"
level=error ts=2022-07-13T09:17:02.077Z caller=write_handler.go:53 component=web msg="Out of order sample from remote write" err="out of bounds"
level=error ts=2022-07-13T09:17:02.077Z caller=write_handler.go:53 component=web msg="Out of order sample from remote write" err="out of bounds"

Additional info

[weblogic@ prometheus-2.28.0.linux-amd64]$ ps aux |grep prome
weblogic 17427 1.3 0.3 778368 37220 pts/3 Sl 17:35 0:00 ./prometheus --config.file=./prometheus.yml --storage.tsdb.path=./data --web.enable-lifecycle --enable-feature=remote-write-receiver --query.lookback-delta=2m

redis采集没有收到指标

Relevant config.toml

[root@c7-20-20 input.redis]# pwd
/servyou/categraf-v0.1.12-linux-amd64/conf/input.redis
[root@c7-20-20 input.redis]# cat redis.toml  |egrep -v "^#|^$"
 # collect interval
address = "127.0.0.1:6319"
username = ""
password = "xxx"   ###有密码的
labels = { instance="n9e-10.2.3.4:6379" }

Logs from categraf

[root@c7-20-20 categraf-v0.1.12-linux-amd64]# ./categraf --test  --inputs redis
2022/07/11 09:58:10 main.go:109: I! runner.binarydir: /servyou/categraf-v0.1.12-linux-amd64
2022/07/11 09:58:10 main.go:110: I! runner.hostname: c7-20-20
2022/07/11 09:58:10 main.go:111: I! runner.fd_limits: (soft=1024, hard=4096)
2022/07/11 09:58:10 main.go:112: I! runner.vm_limits: (soft=unlimited, hard=unlimited)
2022/07/11 09:58:10 config.go:33: I! tracing disabled
2022/07/11 09:58:10 agent.go:57: I! agent starting
2022/07/11 09:58:10 agent.go:61: I! agent started

[root@c7-20-20 categraf-v0.1.12-linux-amd64]# ./categraf -version
v0.1.12-5357da0e95c1f0f3fb65c4c73d09af525ec40725

System info

[root@c7-20-20 categraf-v0.1.12-linux-amd64]# uname -r 3.10.0-1160.el7.x86_64

Docker

No response

Steps to reproduce

...

Expected behavior

测试redis采集的metrics

Actual behavior

配置万redis.toml,验证是否采集到相关指标,麻烦在多打印点日志,-debug也没啥日志的

Additional info

No response

refusing to allow a Personal Access Token to create or update workflow `.github/workflows/release.yaml` without `workflow` scope

将修改的代码推送到自己仓库准备提 PR 的时候,遇到了报错,应和 workflows 的配置有关系。

git push oiooj main

Enumerating objects: 37, done.
Counting objects: 100% (31/31), done.
Delta compression using up to 10 threads
Compressing objects: 100% (11/11), done.
Writing objects: 100% (21/21), 3.79 KiB | 554.00 KiB/s, done.
Total 21 (delta 14), reused 17 (delta 10), pack-reused 0
remote: Resolving deltas: 100% (14/14), completed with 7 local objects.
To https://github.com/oiooj/categraf.git
 ! [remote rejected] main -> main (refusing to allow a Personal Access Token to create or update workflow `.github/workflows/release.yaml` without `workflow` scope)
error: failed to push some refs to 'https://github.com/oiooj/categraf.git'

procstat 插件在夜莺上查询不到数据

Relevant config.toml

cat procstat.toml 
# # collect interval
# interval = 15

# [[instances]]
# # executable name (ie, pgrep <search_exec_substring>)
search_exec_substring = "mysqld"

# # pattern as argument for pgrep (ie, pgrep -f <search_cmdline_substring>)
# search_cmdline_substring = "n9e server"

# # windows service name
# search_win_service = ""

# # append some labels for series
labels = { region="cloud", product="n9e" }

# # interval = global.interval * interval_times
# interval_times = 1

# # mode to use when calculating CPU usage. can be one of 'solaris' or 'irix'
mode = "irix"

# sum of threads/fd/io/cpu/mem, min of uptime/limit
gather_total = true

# will append pid as tag
#gather_per_pid = true

gather_more_metrics = [
     "threads",
     "fd",
     "io",
     "uptime",
     "cpu",
     "mem",
     "limit"
 ]

Logs from categraf

[root@jzt categraf-v0.2.1-linux-amd64]# nohup ./categraf &> stdout.log &
[3] 8114
[root@jzt categraf-v0.2.1-linux-amd64]# 
[root@jzt categraf-v0.2.1-linux-amd64]# 
[root@jzt categraf-v0.2.1-linux-amd64]# 
[root@jzt categraf-v0.2.1-linux-amd64]# tail -100f stdout.log 
nohup: ignoring input
2022/07/13 16:58:34 main.go:110: I! runner.binarydir: /root/categraf-v0.2.1-linux-amd64
2022/07/13 16:58:34 main.go:111: I! runner.hostname: jzt
2022/07/13 16:58:34 main.go:112: I! runner.fd_limits: (soft=100001, hard=100002)
2022/07/13 16:58:34 main.go:113: I! runner.vm_limits: (soft=unlimited, hard=unlimited)
2022/07/13 16:58:34 config.go:33: I! tracing disabled
2022/07/13 16:58:34 agent.go:62: I! agent starting
2022/07/13 16:58:34 metrics_agent.go:64: I! input: conntrack started
2022/07/13 16:58:34 metrics_agent.go:64: I! input: cpu started
2022/07/13 16:58:34 metrics_agent.go:64: I! input: disk started
2022/07/13 16:58:34 metrics_agent.go:64: I! input: diskio started
2022/07/13 16:58:34 metrics_agent.go:64: I! input: docker started
2022/07/13 16:58:34 metrics_agent.go:64: I! input: elasticsearch started
2022/07/13 16:58:34 metrics_agent.go:64: I! input: exec started
2022/07/13 16:58:34 metrics_agent.go:64: I! input: http_response started
2022/07/13 16:58:34 metrics_agent.go:64: I! input: kafka started
2022/07/13 16:58:34 metrics_agent.go:64: I! input: kernel started
2022/07/13 16:58:34 metrics_agent.go:64: I! input: kernel_vmstat started
2022/07/13 16:58:34 metrics_agent.go:64: I! input: kubernetes started
2022/07/13 16:58:34 metrics_agent.go:64: I! input: linux_sysctl_fs started
2022/07/13 16:58:34 metrics_agent.go:64: I! input: logstash started
2022/07/13 16:58:34 metrics_agent.go:64: I! input: mem started
2022/07/13 16:59:04 metrics_agent.go:55: E! failed to init input: mongodb error: could not instantiate mongodb lag exporter: cannot connect to mongo: cannot connect to MongoDB: server selection error: server selection timeout, current topology: { Type: Unknown, Servers: [{ Addr: 127.0.0.1:27017, Type: Unknown, Last error: connection() error occurred during connection handshake: dial tcp 127.0.0.1:27017: connect: connection refused }, ] }
2022/07/13 16:59:04 metrics_agent.go:64: I! input: mysql started
2022/07/13 16:59:04 metrics_agent.go:64: I! input: net started
2022/07/13 16:59:04 metrics_agent.go:64: I! input: net_response started
2022/07/13 16:59:04 metrics_agent.go:64: I! input: netstat started
2022/07/13 16:59:04 metrics_agent.go:64: I! input: nginx_upstream_check started
2022/07/13 16:59:04 metrics_agent.go:64: I! input: oracle started
2022/07/13 16:59:04 metrics_agent.go:64: I! input: ping started
2022/07/13 16:59:04 metrics_agent.go:64: I! input: processes started
2022/07/13 16:59:04 metrics_agent.go:64: I! input: prometheus started
2022/07/13 16:59:04 metrics_agent.go:64: I! input: rabbitmq started
2022/07/13 16:59:04 metrics_agent.go:64: I! input: redis started
2022/07/13 16:59:04 metrics_agent.go:64: I! input: redis_sentinel started
2022/07/13 16:59:04 metrics_agent.go:64: I! input: switch_legacy started
2022/07/13 16:59:04 metrics_agent.go:64: I! input: system started
2022/07/13 16:59:04 metrics_agent.go:64: I! input: tomcat started
2022/07/13 16:59:04 metrics_agent.go:64: I! input: zookeeper started
2022/07/13 16:59:04 agent.go:67: I! agent started

System info

v0.2.1

Docker

No response

Steps to reproduce

image
image

Expected behavior

在夜莺上查询不到数据

Actual behavior

在夜莺上查询不到数据

Additional info

No response

switch_legacy自定义OID的数值

想请问下目前目前 switch_legacy自定义OID 得出来的数字能更动后 在推去时序数据库.

比如自定义的OID得出来的数值是 700, 并想要把数字 乘于 0.1。 700 x 0.1 = 70。 之后才推去数据库

switch_legacy invalid memory address or nil pointer dereference 报错

Relevant config.toml

[global]
# whether print configs
print_configs = false

# add label(agent_hostname) to series
# "" -> auto detect hostname
# "xx" -> use specified string xx
# "$hostname" -> auto detect hostname
# "$ip" -> auto detect ip
# "$hostname-$ip" -> auto detect hostname and ip to replace the vars
hostname = ""

# will not add label(agent_hostname) if true
omit_hostname = false

# s | ms
precision = "ms"

# global collect interval
interval = 15

# [global.labels]
# region = "shanghai"
# env = "localhost"

[writer_opt]
# default: 2000
batch = 2000
# channel(as queue) size
chan_size = 10000

[[writers]]
url = "http://127.0.0.1:19000/prometheus/v1/write"

# Basic auth username
basic_auth_user = ""

# Basic auth password
basic_auth_pass = ""

# timeout settings, unit: ms
timeout = 5000
dial_timeout = 2500
max_idle_conns_per_host = 100

Logs from categraf

[root@localhost categraf]# ./categraf -inputs switch_legacy --debug
2022/06/13 20:09:04 main.go:100: I! runner.binarydir: /opt/categraf
2022/06/13 20:09:04 main.go:101: I! runner.hostname: localhost.localdomain
2022/06/13 20:09:04 main.go:102: I! runner.fd_limits: (soft=1024, hard=4096)
2022/06/13 20:09:04 main.go:103: I! runner.vm_limits: (soft=unlimited, hard=unlimited)
2022/06/13 20:09:04 agent.go:59: I! agent starting
2022/06/13 20:09:04 agent.go:128: I! input: switch_legacy started
2022/06/13 20:09:19 switch_legacy.go:160: I! switch total ip count: 50
2022/06/13 20:09:20 switch_legacy.go:622: I! switch alive ip count: 20
2022/06/13 20:09:21 switch_legacy.go:575: D! switch gather ifstat, ip: 172.16.1.21 use: 291.789105ms
2022/06/13 20:09:21 switch_legacy.go:575: D! switch gather ifstat, ip: 172.16.1.12 use: 507.190428ms
2022/06/13 20:09:21 switch_legacy.go:575: D! switch gather ifstat, ip: 172.16.1.20 use: 530.192047ms
2022/06/13 20:09:21 ifstat.go:481: 172.16.1.33 1.3.6.1.2.1.31.1.1.1.6 Error reading from UDP: read udp 192.168.30.196:44281->172.16.1.33:161: read: connection refused

2022/06/13 20:09:21 switch_legacy.go:575: D! switch gather ifstat, ip: 172.16.1.25 use: 531.690995ms
2022/06/13 20:09:21 ifstat.go:481: 172.16.1.33 1.3.6.1.2.1.31.1.1.1.10 Error reading from UDP: read udp 192.168.30.196:40044->172.16.1.33:161: read: connection refused

2022/06/13 20:09:21 ifstat.go:481: 172.16.1.33 1.3.6.1.2.1.31.1.1.1.1 Error reading from UDP: read udp 192.168.30.196:54286->172.16.1.33:161: read: connection refused

2022/06/13 20:09:21 ifstat.go:481: 172.16.1.33 1.3.6.1.2.1.31.1.1.1.15 Error reading from UDP: read udp 192.168.30.196:34306->172.16.1.33:161: read: connection refused

2022/06/13 20:09:21 switch_legacy.go:575: D! switch gather ifstat, ip: 172.16.1.26 use: 737.653433ms
2022/06/13 20:09:21 switch_legacy.go:575: D! switch gather ifstat, ip: 172.16.1.27 use: 740.243693ms
2022/06/13 20:09:21 switch_legacy.go:575: D! switch gather ifstat, ip: 172.16.1.23 use: 739.534897ms
2022/06/13 20:09:21 switch_legacy.go:575: D! switch gather ifstat, ip: 172.16.1.22 use: 753.467539ms
2022/06/13 20:09:21 switch_legacy.go:575: D! switch gather ifstat, ip: 172.16.1.28 use: 766.415817ms
2022/06/13 20:09:21 switch_legacy.go:575: D! switch gather ifstat, ip: 172.16.1.10 use: 780.563246ms
2022/06/13 20:09:21 switch_legacy.go:575: D! switch gather ifstat, ip: 172.16.1.2 use: 790.727224ms
2022/06/13 20:09:21 switch_legacy.go:575: D! switch gather ifstat, ip: 172.16.1.24 use: 837.069319ms
2022/06/13 20:09:21 switch_legacy.go:575: D! switch gather ifstat, ip: 172.16.1.29 use: 879.376911ms
2022/06/13 20:09:21 switch_legacy.go:575: D! switch gather ifstat, ip: 172.16.1.9 use: 945.680532ms
2022/06/13 20:09:21 ifstat.go:481: 172.16.1.33 1.3.6.1.2.1.2.2.1.8 Error reading from UDP: read udp 192.168.30.196:38969->172.16.1.33:161: read: connection refused

2022/06/13 20:09:21 switch_legacy.go:575: D! switch gather ifstat, ip: 172.16.1.33 use: 1.07100339s
2022/06/13 20:09:21 switch_legacy.go:575: D! switch gather ifstat, ip: 172.16.1.1 use: 1.132475892s
2022/06/13 20:09:22 switch_legacy.go:575: D! switch gather ifstat, ip: 172.16.1.16 use: 1.555391329s
2022/06/13 20:09:26 ifstat.go:481: 172.16.1.40 1.3.6.1.2.1.31.1.1.1.6 Error reading from UDP: read udp 192.168.30.196:33697->172.16.1.40:161: i/o timeout

2022/06/13 20:09:26 ifstat.go:481: 172.16.1.41 1.3.6.1.2.1.31.1.1.1.6 Error reading from UDP: read udp 192.168.30.196:39162->172.16.1.41:161: i/o timeout

2022/06/13 20:09:26 ifstat.go:481: 172.16.1.49 1.3.6.1.2.1.31.1.1.1.6 Error reading from UDP: read udp 192.168.30.196:50882->172.16.1.49:161: i/o timeout

2022/06/13 20:09:26 ifstat.go:481: 172.16.1.40 1.3.6.1.2.1.31.1.1.1.10 Error reading from UDP: read udp 192.168.30.196:47804->172.16.1.40:161: i/o timeout

2022/06/13 20:09:26 ifstat.go:481: 172.16.1.41 1.3.6.1.2.1.31.1.1.1.10 Error reading from UDP: read udp 192.168.30.196:57841->172.16.1.41:161: i/o timeout

2022/06/13 20:09:26 ifstat.go:481: 172.16.1.40 1.3.6.1.2.1.31.1.1.1.1 Error reading from UDP: read udp 192.168.30.196:58825->172.16.1.40:161: i/o timeout

2022/06/13 20:09:26 ifstat.go:481: 172.16.1.49 1.3.6.1.2.1.31.1.1.1.10 Error reading from UDP: read udp 192.168.30.196:52002->172.16.1.49:161: i/o timeout

2022/06/13 20:09:26 ifstat.go:481: 172.16.1.49 1.3.6.1.2.1.31.1.1.1.1 Error reading from UDP: read udp 192.168.30.196:46410->172.16.1.49:161: i/o timeout

2022/06/13 20:09:26 ifstat.go:481: 172.16.1.41 1.3.6.1.2.1.31.1.1.1.1 Error reading from UDP: read udp 192.168.30.196:37835->172.16.1.41:161: i/o timeout

2022/06/13 20:09:26 ifstat.go:481: 172.16.1.41 1.3.6.1.2.1.31.1.1.1.15 Error reading from UDP: read udp 192.168.30.196:51284->172.16.1.41:161: i/o timeout

2022/06/13 20:09:26 ifstat.go:481: 172.16.1.49 1.3.6.1.2.1.31.1.1.1.15 Error reading from UDP: read udp 192.168.30.196:59658->172.16.1.49:161: i/o timeout

2022/06/13 20:09:26 ifstat.go:481: 172.16.1.40 1.3.6.1.2.1.31.1.1.1.15 Error reading from UDP: read udp 192.168.30.196:51417->172.16.1.40:161: i/o timeout

2022/06/13 20:09:31 ifstat.go:481: 172.16.1.40 1.3.6.1.2.1.2.2.1.8 Error reading from UDP: read udp 192.168.30.196:35029->172.16.1.40:161: i/o timeout

2022/06/13 20:09:31 switch_legacy.go:575: D! switch gather ifstat, ip: 172.16.1.40 use: 11.016978694s
2022/06/13 20:09:31 ifstat.go:481: 172.16.1.41 1.3.6.1.2.1.2.2.1.8 Error reading from UDP: read udp 192.168.30.196:45716->172.16.1.41:161: i/o timeout

2022/06/13 20:09:31 switch_legacy.go:575: D! switch gather ifstat, ip: 172.16.1.41 use: 11.016114441s
2022/06/13 20:09:31 ifstat.go:481: 172.16.1.49 1.3.6.1.2.1.2.2.1.8 Error reading from UDP: read udp 192.168.30.196:41289->172.16.1.49:161: i/o timeout

2022/06/13 20:09:31 switch_legacy.go:575: D! switch gather ifstat, ip: 172.16.1.49 use: 11.014485164s
2022/06/13 20:09:31 switch_legacy.go:157: I! switch gather use: 12.505793784s
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xbc377d]

goroutine 19 [running]:
flashcat.cloud/categraf/inputs/switch_legacy.(*Instance).gatherFlowMetrics(0xc0003e8c60, {0xc0003a6a80, 0x14, 0x50?}, 0xc00005cc00?)
        /home/runner/work/categraf/categraf/inputs/switch_legacy/switch_legacy.go:327 +0x33d
flashcat.cloud/categraf/inputs/switch_legacy.(*Instance).gatherOnce(0xc0003e8c60, 0x0?)
        /home/runner/work/categraf/categraf/inputs/switch_legacy/switch_legacy.go:167 +0x185
flashcat.cloud/categraf/inputs/switch_legacy.(*Switch).Gather.func1(0x7637a6?, 0x0?)
        /home/runner/work/categraf/categraf/inputs/switch_legacy/switch_legacy.go:77 +0xac
created by flashcat.cloud/categraf/inputs/switch_legacy.(*Switch).Gather
        /home/runner/work/categraf/categraf/inputs/switch_legacy/switch_legacy.go:67 +0x3f

System info

Categraf v0.1.3,Centos7.9.2009

Docker

No response

Steps to reproduce

填写特定段地址报错

Expected behavior

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xbc377d]

Actual behavior

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xbc377d]

Additional info

No response

linux oracle 报错(centos 6.5 x64)

Relevant config.toml

[global]
print_configs = false
hostname = "192.168.1.2"
omit_hostname = false
precision = "ms"
interval = 15

[global.labels]
region = "testdb"
env = "prod"
project_name='kk'
project_bs='ss'

[writer_opt]
batch = 2000
chan_size = 10000

[[writers]]
url = "https://xxx.xxx.com:19000/prometheus/v1/write"
basic_auth_user = "xx"
basic_auth_pass = "xxxxxx"

timeout = 5000
dial_timeout = 2500
max_idle_conns_per_host = 100

Logs from categraf

2022/08/08 19:10:53 main.go:112: I! runner.fd_limits: (soft=1024, hard=4096)
2022/08/08 19:10:53 main.go:113: I! runner.vm_limits: (soft=unlimited, hard=unlimited)
2022/08/08 19:10:53 config.go:33: I! tracing disabled
2022/08/08 19:10:53 agent.go:63: I! agent starting
2022/08/08 19:10:53 metrics_agent.go:95: I! input: conntrack started
2022/08/08 19:10:53 metrics_agent.go:95: I! input: cpu started
2022/08/08 19:10:53 metrics_agent.go:95: I! input: disk started
2022/08/08 19:10:53 metrics_agent.go:95: I! input: diskio started
2022/08/08 19:10:53 metrics_agent.go:95: I! input: kernel started
2022/08/08 19:10:53 metrics_agent.go:95: I! input: kernel_vmstat started
2022/08/08 19:10:53 metrics_agent.go:95: I! input: linux_sysctl_fs started
2022/08/08 19:10:53 metrics_agent.go:95: I! input: mem started
2022/08/08 19:10:53 metrics_agent.go:95: I! input: net started
2022/08/08 19:10:53 metrics_agent.go:95: I! input: netstat started
2022/08/08 19:10:53 metrics_agent.go:40: E! input: oracle not supported

System info

centos 6.5 x64

Docker

No response

Steps to reproduce

  1. go build
  2. cp categraf /opt/categraf/

...

Expected behavior

Actual behavior

Additional info

No response

categraf 能不能支持设置header

grafana labs旗下的产品 都有个多租户的概念,是以http请求头 X-Scope-OrgID 来实现的。
categraf 能不能支持设置header,用于兼容grafana的多租户模式。
目前不支持的情况下,可以采用在 remote write api 前加一层nginx反向代理,然后根据不同的server_name来proxy_set_header不同的值。

夜莺全套安装教程

大佬,能不能出一套全的视频教程,现在查到的资料都是虎头蛇尾的,对于小白很不友好啊。如果可以的话全部使用docker来搭建,配置做一些说明就更好了。非常感谢!

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.