All Projects β†’ amalfra β†’ gin-statsd

amalfra / gin-statsd

Licence: MIT license
A Gin middleware for reporting to statsd daemon

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to gin-statsd

Datadog Go
go dogstatsd client library for datadog
Stars: ✭ 238 (+621.21%)
Mutual labels:  statsd
fastify-metrics
πŸ“Š Fastify plugin that integrates metrics collection and dispatch to statsd
Stars: ✭ 62 (+87.88%)
Mutual labels:  statsd
grafana-stack
Tiny docker images for graphite, grafana and statsdly
Stars: ✭ 28 (-15.15%)
Mutual labels:  statsd
httpsign
Signing HTTP Messages Middleware
Stars: ✭ 54 (+63.64%)
Mutual labels:  gin-middleware
ecs-container-exporter
AWS ECS side car that exports ECS container level docker stats metrics to Prometheus as well as publish it via Statsd.
Stars: ✭ 22 (-33.33%)
Mutual labels:  statsd
ginhelper
gin framework helper
Stars: ✭ 16 (-51.52%)
Mutual labels:  gin-middleware
Redis Timeseries
Future development of redis-timeseries is at github.com/RedisLabsModules/redis-timeseries.
Stars: ✭ 197 (+496.97%)
Mutual labels:  statsd
paStash
pastaΚƒ'Κƒ = Spaghetti I/O Event Data Processing, Interpolation, Correlation and beyond 🍝
Stars: ✭ 89 (+169.7%)
Mutual labels:  statsd
perfmetrics
A library for sending software performance metrics from Python libraries and apps to statsd.
Stars: ✭ 26 (-21.21%)
Mutual labels:  statsd
glouton
Monitoring agent for servers, containers, and applications πŸ”¬
Stars: ✭ 19 (-42.42%)
Mutual labels:  statsd
requestid
Request ID middleware for Gin Framework
Stars: ✭ 115 (+248.48%)
Mutual labels:  gin-middleware
statsd.cr
A statsd client library for Crystal.
Stars: ✭ 32 (-3.03%)
Mutual labels:  statsd
logging
mod: zap logging in golang
Stars: ✭ 44 (+33.33%)
Mutual labels:  gin-middleware
Netdata
Real-time performance monitoring, done right! https://www.netdata.cloud
Stars: ✭ 57,056 (+172796.97%)
Mutual labels:  statsd
rust-statsd
Statsd client implemented in Rust
Stars: ✭ 50 (+51.52%)
Mutual labels:  statsd
Statix
Fast and reliable Elixir client for StatsD-compatible servers
Stars: ✭ 228 (+590.91%)
Mutual labels:  statsd
go-gin-logrus
Gin Web Framework for using Logrus as the Gin logger with Tracing middleware
Stars: ✭ 38 (+15.15%)
Mutual labels:  gin-middleware
souin
An HTTP cache system, RFC compliant, compatible with @TykTechnologies, @traefik, @caddyserver, @go-chi, @bnkamalesh, @beego, @devfeel, @labstack, @gofiber, @go-goyave, @gin-gonic, @zalando, @zeromicro, @nginx and @apache
Stars: ✭ 269 (+715.15%)
Mutual labels:  gin-middleware
graphite-client
Windows (.NET) library and tools for feeding data into Graphite and statsD.
Stars: ✭ 85 (+157.58%)
Mutual labels:  statsd
monitored
A utility for monitoring services πŸ”
Stars: ✭ 37 (+12.12%)
Mutual labels:  statsd

gin-statsd

GitHub release Build Status GoDoc Go Report Card

A Gin middleware for reporting to statsd daemon.

Installation

You can download the middleware using

go get github.com/amalfra/gin-statsd/v2

Usage

Next, import the package

import (
  statsdMiddleware "github.com/amalfra/gin-statsd/v2/middleware"
)
  1. Attach middleware to all routes
  r := gin.New()
  r.Use(statsdMiddleware.New(statsdMiddleware.Options{}))

or

  1. Attach middleware to specific route
  r := gin.New()
  r.GET("/", statsdMiddleware.New(statsdMiddleware.Options{}), func(c *gin.Context) {})

By default, the middleware will send status_code and response_time stats. All stats are namespaced under statsdKey key by default. This can be configured using options.

Configuring using Options

The middleware allows configuring using Options struct. The struct with config should be passed when initializing with New method. Supported configurations are:

  • Host - statsd daemon's host; defaults to 127.0.0.1
  • Port - statsd daemon's port; defaults to 8125
  • RequestKey - the namespace for stats; defaults to statsdKey

Configuring namespace:

  r := gin.New()
  r.Use(statsdMiddleware.New(statsdMiddleware.Options{RequestKey: "myNamespace"}))

Configuring statsd host and port:

  r := gin.New()
  r.Use(statsdMiddleware.New(statsdMiddleware.Options{Host: "myhost.statsd", Port: 8089}))

Development

Questions, problems or suggestions? Please post them on the issue tracker.

You can contribute changes by forking the project and submitting a pull request. Feel free to contribute 😍

UNDER MIT LICENSE

The MIT License (MIT)

Copyright (c) 2018 Amal Francis

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].