Skip to content

iqoption/ginmm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GIN Monitoring Middlewares

It is middleware for send metrics about API to Telegraf

Message format

raw-api-requests-updates,request_name=GET-/api/v1/info,response_name=GET-/api/v1/info,error_code=200 timing=3 1498226123268
raw-api-requests-updates,request_name=GET-/api/v1/info,response_name=GET-/api/v1/info,error_code=200 timing=4 1498226123648

Usage

    mm := ginmm.NewMetricMiddleware(MetricParams{
        Service:         "updates",
        UdpAddres:       "localhost:12345",
        FlushBufferSize: DEFAULT_BUFFER_SIZE,
        FlushTimeout:    DEFAULT_FLUSH_TIMEOUT,
    })
    
    // Creates a router without any middleware by default
    r := gin.New()
    
    // Setup global middleware
    r.Use(mm.Middleware())
    // ...

About

GIN Monitoring Middlewares

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages