mi
github.com/akhenakh/martini-influxdb
go get github.com/akhenakh/martini-influxdb
mi

github.com/akhenakh/martini-influxdb

Martini logger to influxDB

by Fabrice Aneche

v0.0.0-20141027174030-8aaa194ec5c8 (see all)License:MIT
go get github.com/akhenakh/martini-influxdb
Readme

martini-influxdb

A simple Martini logger to influxDB

Use it in place of the Martini logger:

// initialize influxdb
conf := &influxdb.ClientConfig{
    Host:     "lecaire.nobugware.com:8086",
    Username: "root",
    Password: "totoin",
    Database: "four",
}
client, err := influxdb.NewClient(conf)
if err != nil {
    log.Fatal(err)
}
m.Use(influxlogger.Logger(client))

Then query for code as status code, duration, url and method

SELECT duration FROM resp_time WHERE code = 200

Note: This is using the REST api on every requests which is probably not what you want on heavy traffic but fun enough to play with InfluxDB on small project.

Note: Remember, you should forget Martini see http://blog.codegangsta.io/blog/2014/05/19/my-thoughts-on-martini/

demo

GitHub Stars

11

LAST COMMIT

8yrs ago

MAINTAINERS

0

CONTRIBUTORS

2

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
v0.0.0-20141027174030-8aaa194ec5c8
1yr ago
No alternatives found
No tutorials found
Add a tutorial