[wip] telegraf (metrics collecting agent)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[wip] telegraf (metrics collecting agent)

Landry Breuil-5
Hi,

here's a wip port for https://github.com/influxdata/telegraf/ - the
agent collecting metrics from influxdata, goes well with influxdb.
it's go so we need to vendor dependencies as usual, and the resulting
binary is 100mb, but it seems it's able to collect basic system
statistics with its default config:

$telegraf -test -debug
2018/11/15 18:53:37 I! Using config file: /etc/telegraf/telegraf.conf
> disk,device=sd0a,fstype=ffs,host=c64.proxmox2,mode=rw,path=/ free=831016960i,inodes_free=152330i,inodes_total=155902i,inodes_used=3572i,total=1053571072i,used=169877504i,used_percent=16.972569047999052 1542304418000000000
> diskio,host=c64.proxmox2,name=sd0 io_time=0i,iops_in_progress=0i,read_bytes=164071115264i,read_time=0i,reads=10460843i,weighted_io_time=0i,write_bytes=232144855040i,write_time=0i,writes=21308001i 1542304418000000000
> mem,host=c64.proxmox2 active=151158784i,available=3260960768i,available_percent=78.62288748633465,buffered=614514688i,cached=0i,commit_limit=0i,committed_as=0i,dirty=0i,free=3140579328i,high_free=0i,high_total=0i,huge_page_size=0i,huge_pages_free=0i,huge_pages_total=0i,inactive=120381440i,low_free=0i,low_total=0i,mapped=0i,page_tables=0i,shared=0i,slab=0i,swap_cached=0i,swap_free=0i,swap_total=0i,total=4147597312i,used=886636544i,used_percent=21.377112513665356,vmalloc_chunk=0i,vmalloc_total=0i,vmalloc_used=0i,wired=4096i,write_back=0i,write_back_tmp=0i 1542304418000000000
> processes,host=c64.proxmox2 blocked=0i,idle=62i,running=3i,sleeping=14i,stopped=0i,total=79i,unknown=0i,zombies=0i 1542304418000000000
> swap,host=c64.proxmox2 free=4298502144i,total=4546478080i,used=247975936i,used_percent=5.454242418782321 1542304418000000000

havent tried it much more but there shouldnt be much to do to actually
finish the port, mostly testing in real life is needed..

feedback welcome.

Landry

telegraf-1.8.3.tgz (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [wip] telegraf (metrics collecting agent)

Landry Breuil-5
On Thu, Nov 15, 2018 at 07:00:30PM +0100, Landry Breuil wrote:
> Hi,
>
> here's a wip port for https://github.com/influxdata/telegraf/ - the
> agent collecting metrics from influxdata, goes well with influxdb.
> it's go so we need to vendor dependencies as usual, and the resulting
> binary is 100mb, but it seems it's able to collect basic system
> statistics with its default config:

Updated to 1.9.0, looking for okays to import.

Note that the 'inputs.system' plugin supposed to collect
loadavg/uptime/process stats blows:

2018-12-07T10:29:03Z E! [telegraf] Error running agent: invalid argument

my wild guess is that go hasnt been updated to cope with all the
'interesting' changes that happened in the kernel wrt process
timekeeping & cpu_spin - so anyone understanding go lowlevel tentacles in the
system is welcome to look into the corresponding code, which is probably
https://github.com/shirou/gopsutil for the consumer part (my guess would
be
https://github.com/shirou/gopsutil/blob/4a180b209f5f494e5923cfce81ea30ba23915877/cpu/cpu_openbsd.go#L19
but ugh) or something in go itself.

Landry

telegraf-1.9.0.tgz (2K) Download Attachment