Skip to content
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

pradeepbbl
Copy link
Contributor

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
Copy link
Member

@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
Copy link
Contributor Author

@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
Copy link
Member

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

@pradeepbbl
Copy link
Contributor Author

pradeepbbl commented Feb 20, 2018 via email

	- 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}'
@pradeepbbl pradeepbbl force-pushed the healthcheck_counters branch 3 times, most recently from 1f0135c to 1949502 Compare February 20, 2018 09:48
… '/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
Copy link
Contributor Author

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

Thanks,

@kylebrandt kylebrandt merged commit 6a41655 into bosun-monitor:master Feb 20, 2018
@pradeepbbl pradeepbbl deleted the healthcheck_counters branch February 20, 2018 12:09
dschneller added a commit to Rheinwerk/bosun that referenced this pull request Feb 26, 2018
* 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 pushed a commit to clinta/bosun that referenced this pull request Mar 9, 2018
 - 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
 - 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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants