New to mtail and need basic help

44 views
Skip to first unread message

Saveetha Rudramoorthy

unread,
Aug 30, 2019, 1:37:10 AM8/30/19
to mtail-users
Hi,

 I have following sample statistics which need to be injected into Prometheus. 

"Connection_errors_tcpwrap": 0,
"Connections": 234,
"Delayed_insert_threads": 0,
"Innodb_buffer_pool_dump_status": "Dumping",
"Innodb_buffer_pool_load_status": "Buffer",
"Innodb_buffer_pool_resize_status": "",
"Innodb_buffer_pool_pages_data": 1802,
"Innodb_buffer_pool_bytes_data": 29523968

 I need entire statistics to be sent in the same form to Prometheus. Ex: "Connections": 234, "Delayed_insert_threads": 0 etc. 

 Can mtail be used for this scenario? If yes, what could be my program look like? Also, What would be the approach to scrap few other elements from other files? Will i be able to run multiple programs?

thanks and regards,
saveetha

Jamie Wilkinson

unread,
Aug 30, 2019, 8:00:58 AM8/30/19
to Saveetha Rudramoorthy, mtail-users
Do these statistics get appended to a log file continuously?  If yes, then mtail would be useful.  If it's JSON that's just being overwritten every time, I think this tool might be better: https://github.com/shiroyagicorp/prometheus-json-exporter

Do you know the names of all the stats or are they likely to change?  If yes they never change, then mtail will work for you.

Yes, you can run multiple programs in one mtail.  But right now every program reads every file so you can get some weird behaviour sometimes, though there's a way to avoid that.

A simple mtail program would look like:

```
counter Connections

/"Connections": (\d+),/ {
  Connections = $1
}
```
and repeat for the other stat names.

--
You received this message because you are subscribed to the Google Groups "mtail-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mtail-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mtail-users/6c84256d-6776-4dbe-a593-85c3db93fc96%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages