项目作者: tingold

项目描述 :
SignalFx Middleware for Gin
高级语言: Go
项目地址: git://github.com/tingold/gin-signalfx.git
创建时间: 2018-05-30T19:13:29Z
项目社区:https://github.com/tingold/gin-signalfx

开源协议:MIT License

下载


gin-signalfx

SignalFx Middleware for Gin

Go Report Card
License: MIT

Configuration: simply provide the SignalFx token and (optionally) the service name when configuring the middleware. The hostname will also get added to the metadata, along with the service name .

Super simple usage:

  1. import ( github.com/tingold/gin-signalfx/middleware
  2. github.com/gin-gonic/gin
  3. )
  4. g := gin.New()
  5. g.Use(SignalFx(Config{SignalFXKey:"INSERT KEY HERE", ServiceName: "YOUR GIN SERVICE"}))
  6. //start gin normally
  7. ...

Upon starting the server you should start to see metrics appear in your SignalFx dashboard

Metrics

All Gin specific metrics can be found by searching for gin.* in SignalFx

The following metrics will be reported:

  • Counts for each of the HTTP verbs in the format of gin.request.{verb}
  • Hits (e.g requests)
  • Errors: response codes > 399
  • Response times
  • Request / Response Sizes

The following Go runtime metrics are populated (which should be self explanatory):

  1. Alloc
  2. BuckHashSys
  3. Frees
  4. GCSys
  5. GOMAXPROCS
  6. HeapAlloc
  7. HeapIdle
  8. HeapInuse
  9. HeapObjects
  10. HeapReleased
  11. HeapSys
  12. LastGC
  13. Lookups
  14. Mallocs
  15. MCacheInuse
  16. MCacheSys
  17. MSpanInuse
  18. MSpanSys
  19. NextGC
  20. num_cgo_call
  21. num_cpu
  22. num_goroutine
  23. NumGC
  24. OtherSys
  25. PauseTotalNs
  26. process.uptime.ns
  27. StackInuse
  28. StackSys
  29. Sys
  30. TotalAlloc