Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/akhenakh/martini-influxdb
Martini logger to influxDB
https://github.com/akhenakh/martini-influxdb
Last synced: 24 days ago
JSON representation
Martini logger to influxDB
- Host: GitHub
- URL: https://github.com/akhenakh/martini-influxdb
- Owner: akhenakh
- License: mit
- Created: 2014-04-20T00:19:59.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-10-27T17:40:31.000Z (about 10 years ago)
- Last Synced: 2024-06-20T12:24:54.722Z (5 months ago)
- Language: Go
- Size: 207 KB
- Stars: 11
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
martini-influxdb
================A simple Martini logger to influxDB
Use it in place of the Martini logger:
```golang
// 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`
```sql
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](https://github.com/akhenakh/martini-influxdb/raw/master/img/graph.png)