You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/configuration.md
+18-4
Original file line number
Diff line number
Diff line change
@@ -215,21 +215,35 @@ In case the setup does not work as intended, trace the events through this seque
215
215
216
216
### Termination watcher
217
217
218
-
This feature is in early stage and therefore disabled by default.
218
+
This feature is in early stage and therefore disabled by default. To enable the watcher set `instance_termination_watcher.enable = true`.
219
219
220
-
The termination watcher is currently watching for spot termination notifications. The module is only taken events into account for instances tagged with `ghr:environment` by default when deployment the module as part of one of the main modules (root or multi-runner). The module can also be deployed stand-alone, in that case the tag filter needs to be tunned.
220
+
The termination watcher is currently watching for spot terminations. The module is only taken events into account for instances tagged with `ghr:environment` by default when deployment the module as part of one of the main modules (root or multi-runner). The module can also be deployed stand-alone, in that case the tag filter needs to be tunned.
221
+
222
+
### Termination notification
223
+
224
+
The watcher is listening for spot termination warnings and create a log message and optionally a metric. The watcher is disabled by default. The feature is enabled once the watcher is enabled, the feature can be disabled explicit by setting `instance_termination_watcher.features.enable_spot_termination_handler = false`.
221
225
222
226
- Logs: The module will log all termination notifications. For each warning it will look up instance details and log the environment, instance type and time the instance is running. As well some other details.
223
227
- Metrics: Metrics are disabled by default, this to avoid costs. Once enabled a metric will be created for each warning with at least dimensions for the environment and instance type. THe metric name space can be configured via the variables. The metric name used is `SpotInterruptionWarning`.
224
228
225
-
#### Log example
229
+
### Termination handler
230
+
231
+
!!! warning
232
+
This feature will only work once the CloudTrail is enabled.
233
+
234
+
The termination handler is listening for spot terminations by capture the `BidEvictedEvent` via CloudTrail. The handler will log and optionally create a metric for each termination. The intend is to enhance the logic to inform the user about the termination via the GitHub Job or Workflow run. The feature is disabled by default. The feature is enabled once the watcher is enabled, the feature can be disabled explicit by setting `instance_termination_watcher.features.enable_spot_termination_handler = false`.
235
+
236
+
- Logs: The module will log all termination notifications. For each warning it will look up instance details and log the environment, instance type and time the instance is running. As well some other details.
237
+
- Metrics: Metrics are disabled by default, this to avoid costs. Once enabled a metric will be created for each termination with at least dimensions for the environment and instance type. THe metric name space can be configured via the variables. The metric name used is `SpotTermination`.
238
+
239
+
### Log example (both warnings and terminations)
226
240
227
241
Below an example of the the log messages created.
228
242
229
243
```
230
244
{
231
245
"level": "INFO",
232
-
"message": "Received spot notification warning:",
246
+
"message": "Received spot notification for ${metricName}",
0 commit comments