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
{{ message }}
This repository was archived by the owner on Jan 16, 2025. It is now read-only.
feat: Add metric to track GitHub app rate limit (#4088)
## Description
This PR adds an optional metric to keep track of the remaining rate
limit for teh GItHub app.
## Notes
- Refactored the metric configuration to align the metric configuration
usages in all submodules. All changed are only impacting experimental
features. Which means non breaking.
- Refactored nameing gh-auth package, see separate commit.
---------
Co-authored-by: forest-pr|bot <forest-pr[bot]@users.noreply.github.com>
Co-authored-by: Stuart Pearson <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+4-3
Original file line number
Diff line number
Diff line change
@@ -147,7 +147,7 @@ Talk to the forestkeepers in the `runners-channel` on Slack.
147
147
| <aname="input_enable_jit_config"></a> [enable\_jit\_config](#input\_enable\_jit\_config)| Overwrite the default behavior for JIT configuration. By default JIT configuration is enabled for ephemeral runners and disabled for non-ephemeral runners. In case of GHES check first if the JIT config API is avaialbe. In case you upgradeing from 3.x to 4.x you can set `enable_jit_config` to `false` to avoid a breaking change when having your own AMI. |`bool`|`null`| no |
148
148
| <aname="input_enable_job_queued_check"></a> [enable\_job\_queued\_check](#input\_enable\_job\_queued\_check)| Only scale if the job event received by the scale up lambda is in the queued state. By default enabled for non ephemeral runners and disabled for ephemeral. Set this variable to overwrite the default behavior. |`bool`|`null`| no |
149
149
| <aname="input_enable_managed_runner_security_group"></a> [enable\_managed\_runner\_security\_group](#input\_enable\_managed\_runner\_security\_group)| Enables creation of the default managed security group. Unmanaged security groups can be specified via `runner_additional_security_group_ids`. |`bool`|`true`| no |
150
-
| <aname="input_enable_metrics_control_plane"></a> [enable\_metrics\_control\_plane](#input\_enable\_metrics\_control\_plane)| (Experimental) Enable or disable the metrics for the module. Feature can change or renamed without a major release. |`bool`|`false`| no |
150
+
| <aname="input_enable_metrics_control_plane"></a> [enable\_metrics\_control\_plane](#input\_enable\_metrics\_control\_plane)| (Experimental) Enable or disable the metrics for the module. Feature can change or renamed without a major release. |`bool`|`null`| no |
151
151
| <aname="input_enable_organization_runners"></a> [enable\_organization\_runners](#input\_enable\_organization\_runners)| Register runners to organization, instead of repo level |`bool`|`false`| no |
152
152
| <aname="input_enable_runner_binaries_syncer"></a> [enable\_runner\_binaries\_syncer](#input\_enable\_runner\_binaries\_syncer)| Option to disable the lambda to sync GitHub runner distribution, useful when using a pre-build AMI. |`bool`|`true`| no |
153
153
| <aname="input_enable_runner_detailed_monitoring"></a> [enable\_runner\_detailed\_monitoring](#input\_enable\_runner\_detailed\_monitoring)| Should detailed monitoring be enabled for the runner. Set this to true if you want to use detailed monitoring. See https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-cloudwatch-new.html for details. |`bool`|`false`| no |
@@ -165,7 +165,7 @@ Talk to the forestkeepers in the `runners-channel` on Slack.
165
165
| <aname="input_instance_max_spot_price"></a> [instance\_max\_spot\_price](#input\_instance\_max\_spot\_price)| Max price price for spot instances per hour. This variable will be passed to the create fleet as max spot price for the fleet. |`string`|`null`| no |
166
166
| <aname="input_instance_profile_path"></a> [instance\_profile\_path](#input\_instance\_profile\_path)| The path that will be added to the instance\_profile, if not set the environment name will be used. |`string`|`null`| no |
167
167
| <aname="input_instance_target_capacity_type"></a> [instance\_target\_capacity\_type](#input\_instance\_target\_capacity\_type)| Default lifecycle used for runner instances, can be either `spot` or `on-demand`. |`string`|`"spot"`| no |
168
-
| <a name="input_instance_termination_watcher"></a> [instance\_termination\_watcher](#input\_instance\_termination\_watcher) | Configuration for the instance termination watcher. This feature is Beta, changes will not trigger a major release as long in beta.<br><br>`enable`: Enable or disable the spot termination watcher.<br>`enable_metrics`: Enable or disable the metrics for the spot termination watcher.<br>`memory_size`: Memory size linit in MB of the lambda.<br>`s3_key`: S3 key for syncer lambda function. Required if using S3 bucket to specify lambdas.<br>`s3_object_version`: S3 object version for syncer lambda function. Useful if S3 versioning is enabled on source bucket.<br>`timeout`: Time out of the lambda in seconds.<br>`zip`: File location of the lambda zip file. | <pre>object({<br> enable = optional(bool, false)<br> enable_metric = optional(object({<br> spot_warning = optional(bool, false)<br> }))<br> memory_size = optional(number, null)<br> s3_key = optional(string, null)<br> s3_object_version = optional(string, null)<br> timeout = optional(number, null)<br> zip = optional(string, null)<br> })</pre> | `{}` | no |
168
+
| <a name="input_instance_termination_watcher"></a> [instance\_termination\_watcher](#input\_instance\_termination\_watcher) | Configuration for the instance termination watcher. This feature is Beta, changes will not trigger a major release as long in beta.<br><br>`enable`: Enable or disable the spot termination watcher.<br>`memory_size`: Memory size linit in MB of the lambda.<br>`s3_key`: S3 key for syncer lambda function. Required if using S3 bucket to specify lambdas.<br>`s3_object_version`: S3 object version for syncer lambda function. Useful if S3 versioning is enabled on source bucket.<br>`timeout`: Time out of the lambda in seconds.<br>`zip`: File location of the lambda zip file. | <pre>object({<br> enable = optional(bool, false)<br> enable_metric = optional(string, null) # deprectaed<br> memory_size = optional(number, null)<br> s3_key = optional(string, null)<br> s3_object_version = optional(string, null)<br> timeout = optional(number, null)<br> zip = optional(string, null)<br> })</pre> | `{}` | no |
169
169
| <aname="input_instance_types"></a> [instance\_types](#input\_instance\_types)| List of instance types for the action runner. Defaults are based on runner\_os (al2023 for linux and Windows Server Core for win). |`list(string)`| <pre>[<br> "m5.large",<br> "c5.large"<br>]</pre> | no |
170
170
| <aname="input_job_queue_retention_in_seconds"></a> [job\_queue\_retention\_in\_seconds](#input\_job\_queue\_retention\_in\_seconds)| The number of seconds the job is held in the queue before it is purged. |`number`|`86400`| no |
171
171
| <a name="input_job_retry"></a> [job\_retry](#input\_job\_retry) | Experimental! Can be removed / changed without trigger a major release.Configure job retries. The configuration enables job retries (for ephemeral runners). After creating the insances a message will be published to a job retry queue. The job retry check lambda is checking after a delay if the job is queued. If not the message will be published again on the scale-up (build queue). Using this feature can impact the reate limit of the GitHub app.<br><br>`enable`: Enable or disable the job retry feature.<br>`delay_in_seconds`: The delay in seconds before the job retry check lambda will check the job status.<br>`delay_backoff`: The backoff factor for the delay.<br>`lambda_memory_size`: Memory size limit in MB for the job retry check lambda.<br>`lambda_timeout`: Time out of the job retry check lambda in seconds.<br>`max_attempts`: The maximum number of attempts to retry the job. | <pre>object({<br> enable = optional(bool, false)<br> delay_in_seconds = optional(number, 300)<br> delay_backoff = optional(number, 2)<br> lambda_memory_size = optional(number, 256)<br> lambda_timeout = optional(number, 30)<br> max_attempts = optional(number, 1)<br> })</pre> | `{}` | no |
@@ -183,7 +183,8 @@ Talk to the forestkeepers in the `runners-channel` on Slack.
183
183
| <aname="input_logging_kms_key_id"></a> [logging\_kms\_key\_id](#input\_logging\_kms\_key\_id)| Specifies the kms key id to encrypt the logs with. |`string`|`null`| no |
184
184
| <aname="input_logging_retention_in_days"></a> [logging\_retention\_in\_days](#input\_logging\_retention\_in\_days)| Specifies the number of days you want to retain log events for the lambda log group. Possible values are: 0, 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, and 3653. |`number`|`180`| no |
185
185
| <aname="input_matcher_config_parameter_store_tier"></a> [matcher\_config\_parameter\_store\_tier](#input\_matcher\_config\_parameter\_store\_tier)| The tier of the parameter store for the matcher configuration. Valid values are `Standard`, and `Advanced`. |`string`|`"Standard"`| no |
186
-
| <aname="input_metrics_namespace"></a> [metrics\_namespace](#input\_metrics\_namespace)| The namespace for the metrics created by the module. Merics will only be created if explicit enabled. |`string`|`"GitHub Runners"`| no |
186
+
| <aname="input_metrics"></a> [metrics](#input\_metrics)| Configuration for metrics created by the module, by default disabled to avoid additional costs. When metrics are enable all metrics are created unless explicit configured otherwise. | <pre>object({<br> enable = optional(bool, false)<br> namespace = optional(string, "GitHub Runners")<br> metric = optional(object({<br> enable_github_app_rate_limit = optional(bool, true)<br> enable_job_retry = optional(bool, true)<br> enable_spot_termination_warning = optional(bool, true)<br> }), {})<br> })</pre> |`{}`| no |
187
+
| <aname="input_metrics_namespace"></a> [metrics\_namespace](#input\_metrics\_namespace)| The namespace for the metrics created by the module. Merics will only be created if explicit enabled. |`string`|`null`| no |
187
188
| <aname="input_minimum_running_time_in_minutes"></a> [minimum\_running\_time\_in\_minutes](#input\_minimum\_running\_time\_in\_minutes)| The time an ec2 action runner should be running at minimum before terminated, if not busy. |`number`|`null`| no |
188
189
| <aname="input_pool_config"></a> [pool\_config](#input\_pool\_config)| The configuration for updating the pool. The `pool_size` to adjust to by the events triggered by the `schedule_expression`. For example you can configure a cron expression for weekdays to adjust the pool to 10 and another expression for the weekend to adjust the pool to 1. Use `schedule_expression_timezone` to override the schedule time zone (defaults to UTC). | <pre>list(object({<br> schedule_expression = string<br> schedule_expression_timezone = optional(string)<br> size = number<br> }))</pre> |`[]`| no |
189
190
| <aname="input_pool_lambda_memory_size"></a> [pool\_lambda\_memory\_size](#input\_pool\_lambda\_memory\_size)| Memory size limit for scale-up lambda. |`number`|`512`| no |
Copy file name to clipboardExpand all lines: docs/configuration.md
+9
Original file line number
Diff line number
Diff line change
@@ -191,6 +191,15 @@ This feature has been disabled by default.
191
191
192
192
The watcher will act on all spot termination notificatins and log all onses relevant to the runner module. Therefor we suggest to only deploy the watcher once. You can either deploy the watcher by enabling in one of your deployments or deploy the watcher as a stand alone module.
193
193
194
+
## Metrics
195
+
196
+
The module supports metrics (experimental feature) to monitor the system. The metrics are disabled by default. To enable the metrics set `metrics.enable = true`. If set to true, all module managed metrics are used, you can configure the one by one via the `metrics` object. The metrics are created in the namespace `GitHub Runners`.
197
+
198
+
### Supported metrics
199
+
200
+
-**GitHubAppRateLimitRemaining**: Remaining rate limit for the GitHub App.
201
+
-**JobRetry**: Number of job retries, only relevant when job retry is enabled.
202
+
-**SpotInterruptionWarning**: Number of spot interruption warnings received by the termination watcher, only relevant when the termination watcher is enabled.
0 commit comments