Skip to content

Instantly share code, notes, and snippets.

@tembleking
Created October 5, 2018 22:44
Show Gist options
  • Save tembleking/8acd095f29f860fc2267f8b392ddb8a0 to your computer and use it in GitHub Desktop.
Save tembleking/8acd095f29f860fc2267f8b392ddb8a0 to your computer and use it in GitHub Desktop.
Golang Expvar Config YAML
- name: go-expvar
check_module: go_expvar
pattern:
comm: go-expvar
conf:
expvar_url: "http://localhost:8080/debug/vars" # automatically match url using the listening port
# Add custom metrics if you want
metrics:
- path: system.numberOfSeconds
type: gauge # gauge or rate
alias: go_expvar.system.numberOfSeconds
- path: system.lastLoad
type: gauge
alias: go_expvar.system.lastLoad
- path: system.numberOfLoginsPerUser/.* # You can use / to get inside the map and use .* to match any record inside
type: gauge
- path: system.allLoad/.*
type: gauge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment