github.com/mackerelio/mackerel-agent-plugins@v0.89.3/mackerel-plugin-gostats/README.md (about)

     1  mackerel-plugin-gostats
     2  =====================
     3  
     4  gostats custom metrics plugin for mackerel.io agent.
     5  
     6  ## Synopsis
     7  
     8  ```shell
     9  mackerel-plugin-gostats [-host=<host>] [-port=<port>] [-path=<path>] [-scheme=<http|https>] [-uri=<URI>] [-metric-key-prefix=gostats]
    10  ```
    11  
    12  ## Requirements
    13  
    14  This plugin requires [github.com/fukata/golang-stats-api-handler](https://github.com/fukata/golang-stats-api-handler)
    15  Enable `github.com/fukata/golang-stats-api-handler` as below.
    16  
    17  ```
    18  import (
    19      "net/http"
    20      "log"
    21      "github.com/fukata/golang-stats-api-handler"
    22  )
    23  func main() {
    24      http.HandleFunc("/api/stats", stats_api.Handler)
    25      log.Fatal( http.ListenAndServe(":8080", nil) )
    26  }
    27  ```
    28  
    29  ## Example of mackerel-agent.conf
    30  
    31  ```
    32  [plugin.metrics.gostats]
    33  command = "/path/to/mackerel-plugin-gostats -port=8000 -path=/api/stats"
    34  ```