New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new api endpoint /api/debug/{key} #2222

Merged
merged 2 commits into from Feb 20, 2018

Conversation

Projects
None yet
2 participants
@pradeepbbl
Contributor

pradeepbbl commented Feb 15, 2018

Currently, bosun collects a bunch of runtime debug and performance stats and write it back to OpenTSDB. This endpoint will expose these stats, useful when you are not using Bosun with OpenTSDB.

At present, the endpoint only exposes notification success and failure stats but we can add any other stats in future if required.

Thanks,

@kylebrandt

This comment has been minimized.

Member

kylebrandt commented Feb 18, 2018

@pradeepbbl Thanks for this, can you move them to /api/health instead? Maybe just a notifications object inside the current root object with these counters.

{
   "RuleCheck": true,
   ...
   "Notifications": {
           "PostSent": 123,
           "PostFailed": 1,
           ...
    }
}
@pradeepbbl

This comment has been minimized.

Contributor

pradeepbbl commented Feb 19, 2018

@kylebrandt thanks for the review, made the requested changes do let me know if need any further changes.

{
  "RuleCheck": true,
  "Quiet": false,
  "UptimeSeconds": 53,
  "StartEpoch": 1519035466,
  "Notifications": {
    "PostNotificationsSuccess": 0,
    "PostNotificationsFailed": 0,
    "EmailNotificationsSuccess": 0,
    "EmailNotificationsFailed": 0
  }
}

Thanks,

@kylebrandt

This comment has been minimized.

Member

kylebrandt commented Feb 19, 2018

@pradeepbbl Not sure why the short links commit is in here, rebase on master and force push to your branch maybe?

@pradeepbbl

This comment has been minimized.

Contributor

pradeepbbl commented Feb 20, 2018

Pradeep Mishra added some commits Feb 15, 2018

Pradeep Mishra
Added new api endpoint /api/debug/{key}
	- cmd/bosun/conf/notify.go: Added two new metric 'bosun.post.sent' and 'bosun.post.sent_failed'
	- cmd/bosun/web/web.go: New api api endpoint 'api/debug/{key}' to expose bosun internal debug and performance stats
	- collect/collect.go: Added a new function 'Get', retrun current value of given metric from 'counters'
	- docs/api.md: Update new endpoint 'api/debug/{key}'
Pradeep Mishra
Remove '/api/debug/{key}' api endpoint and move notification stats to…
… '/api/health'

       - cmd/bosun/web/web.go: remove '/api/debug/{key}' route and func 'DebugStats'
       - docs/api.md: remove section 'Debug Endpoints' and updated '/api/health' doc
@pradeepbbl

This comment has been minimized.

Contributor

pradeepbbl commented Feb 20, 2018

@kylebrandt / @captncraig can this merge along with #2217

Thanks,

@kylebrandt kylebrandt merged commit 6a41655 into bosun-monitor:master Feb 20, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@pradeepbbl pradeepbbl deleted the bookingcom:healthcheck_counters branch Feb 20, 2018

dschneller added a commit to Rheinwerk/bosun that referenced this pull request Feb 26, 2018

Merge branch 'master' into ES-TLS
* master:
  cmd/scollector: add systemd physical "predictable" linux net interface names (bosun-monitor#1985)
  cmd/bosun: add notification stats to /api/health (bosun-monitor#2222)
  cmd/bosun: native short links replace google (bosun-monitor#2210)
  docs: update system_configuration docs to reflect RedisDb configuration variable (bosun-monitor#2220)
  cmd/bosun/sched/views.go: added new incident filter `since` (bosun-monitor#2215)
  Bosun complaining about `actionBodyForceClose`, `actionBodyDelayedClose`, `actionBodyCancelClose` intermediately and causing crash with error `couldn't read rules: unknown key actionBodyDelayedClose` after looking at the code cmd/bosun/conf/rule/loaders.go#L442 we found strings.HasSuffix sometime getting matched with 'Close' rather then 'DelayedClose, ForceClose or CancelClose' and later it breaks the switch statement cmd/bosun/conf/rule/loaders.go#L462 due to invalid template type (bosun-monitor#2198)
  Update WMI to support int[] (bosun-monitor#2213)
  Add Scheme option to bosun toml (bosun-monitor#2209)
  Changed load sequence for `macros` to use in the notifications (bosun-monitor#2199)
  Fixed wrong nested ul in unknown notify (bosun-monitor#2208)
  travis: remove slack notification / go 1.9 (bosun-monitor#2203)
  Fix post notification logging (bosun-monitor#2196)

clinta added a commit to clinta/bosun that referenced this pull request Mar 9, 2018

cmd/bosun: add notification stats to /api/health (bosun-monitor#2222)
 - Added new metrics 'bosun.post.sent' and 'bosun.post.sent_failed'
 - collect/collect.go: Added a new function 'Get', to return the current value of given metric from 'counters'

pradeepbbl added a commit to pradeepbbl/bosun that referenced this pull request Mar 21, 2018

cmd/bosun: add notification stats to /api/health (bosun-monitor#2222)
 - Added new metrics 'bosun.post.sent' and 'bosun.post.sent_failed'
 - collect/collect.go: Added a new function 'Get', to return the current value of given metric from 'counters'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment