Closed ojongerius closed 8 years ago
Initial guess; the lack of Read resources.
Random snippets for reference during work
Example metric alert
In [23]: api.Monitor.get('287409')
Out[23]:
{'created_at': 1443599260000,
'id': 287409,
'message': 'Alert on percent of memory being used by ActiveMQ on Bamboo Server {{service_name.name}} @hipchat-Build_Engineering_Alerts',
'multi': True,
'name': '[warning] TF: Bamboo ActiveMQ Memory Percent Usage',
'options': {'escalation_message': u'',
'no_data_timeframe': 0,
'notify_audit': False,
'notify_no_data': True,
'period': 0,
'renotify_interval': 0,
'silenced': {},
'thresholds': {'critical': 0, 'ok': 0, 'warning': 0},
'timeout_h': 0},
'org_id': 27014,
'overall_state': 'OK',
'query': 'min(last_15m):avg:bamboo.server.broker.bamboo.MemoryPercentUsage{*} by {service_name} > 80',
'tags': [],
'type': 'metric alert'}
Example state
"attributes": {
"critical.#": "2",
"critical.notify": "@hipchat-Build_Engineering_Alerts",
"critical.threshold": "90",
"id": "287409__287417",
"keys.#": "1",
"keys.0": "service_name",
"message": "Alert on percent of memory being used by ActiveMQ on Bamboo Server {{service_name.name}}",
"metric": "bamboo.server.broker.bamboo.MemoryPercentUsage",
"name": "TF: Bamboo ActiveMQ Memory Percent Usage",
"notify_no_data": "true",
"operator": "\u003e",
"space_aggr": "avg",
"tags.#": "1",
"tags.0": "*",
"time_aggr": "min",
"time_window": "last_15m",
"warning.#": "2",
"warning.notify": "@hipchat-Build_Engineering_Alerts",
"warning.threshold": "80"
API structs
type Monitor struct {
Id int `json:"id"`
Type string `json:"type"`
Query string `json:"query"`
Name string `json:"name"`
Message string `json:"message"`
Options Options `json:"options"`
type Options struct {
NoDataTimeframe int `json:"no_data_timeframe"`
NotifyAudit bool `json:"notify_audit"`
NotifyNoData bool `json:"notify_no_data"`
Period int `json:"period"`
RenotifyInterval int `json:"renotify_interval"`
Silenced map[string]string `json:"silenced"`
TimeoutH int `json:"timeout_h"`
EscalationMessage string `json:"escalation_message"`
Thresholds ThresholdCount `json:"thresholds"`
No longer an issue.
Example running planning mode 2 add 2 resources shows the intention to change 33 resources, which is the sum of the existing checks: