rackerlabs/otter — pull request #468 by cyli (2013-11-19 05:55:46+00:00)
Title: Log convergence events up (ready for review)

Upon `obey_config_change` and `maybe_execute_scaling_policy`

This isn't exactly neat. In fact, the convergence log may unfortunately show up a couple milliseconds before the policy execution/config change/force delete request log. Not sure yet (haven't gotten to the request logs - figured the convergence log was more important.

But we'll hopefully be moving to a for real convergence model soon.

By merging https://github.com/rackerlabs/otter/pull/466 and using the script from https://github.com/rackerlabs/otter/pull/462, I got the following:

- from creating a group with a min-entity of 1
2013-11-19_05:45:41.41019
{
"is_error": false,
"event_type": "convergence.scale_up",
"level": 6,
"tenant_id": "851153",
"_message": "Starting 1 new servers to satisfy desired capacity",
"convergence_delta": 1,
"scaling_group_id": "0e3cdf03-4263-47b7-8541-dc0dff40d0db",
"desired_capacity": 1,
"version": "1.0",
"timestamp": 1384839941.410106,
"pending_capacity": 1,
"audit_log": true
}

- from force-deleting the previous group
2013-11-19_05:46:05.15274
{
"is_error": false,
"event_type": "convergence.scale_down",
"level": 6,
"tenant_id": "851153",
"_message": "Deleting 1 servers to satisfy desired capacity",
"convergence_delta": -1,
"scaling_group_id": "0e3cdf03-4263-47b7-8541-dc0dff40d0db",
"desired_capacity": 0,
"version": "1.0",
"timestamp": 1384839965.152643,
"pending_capacity": 0,
"audit_log": true
}

- from executing a scale up after creating a group
2013-11-19_05:48:12.64187
{
"is_error": false,
"event_type": "convergence.scale_up",
"level": 6,
"tenant_id": "851153",
"_message": "Starting 1 new servers to satisfy desired capacity",
"convergence_delta": 1,
"scaling_group_id": "46937273-cca5-41f8-a7aa-351258d22785",
"desired_capacity": 1,
"version": "1.0",
"timestamp": 1384840092.641651,
"pending_capacity": 1,
"policy_id": "2baa52b0-4408-48e9-b5a4-adadab048c6b",
"audit_log": true
}

Todo:
- [] remove policy id from the policy execution convergence messages