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
feat: added changes to enable tracing in lambdas. (#3554)
This PR addresses the need to enable tracing for the lambdas used in the
runners architecture:
# Highlights:
- This feature enables the tracing in all lambdas which allow to
debug/investigate any issues that arise out of day-to-day use of runners
infrastructure.
- If user decides to add all the features provisioned in the PR, user
should be able to find the complete linked trace between the time a
webhook is triggered with workflow job event to the API gateway endpoint
to the execution of scale up lambda which creates a new runner to
fulfill the need of creating a new runner and also find the relevant
logs linked to the trace in **AWS CloudWatch ServiceLens**. As of
result, user need not navigate to various log groups to find any issue
in any given service.
- Please find the X-ray costing in this
[link](https://aws.amazon.com/xray/pricing/) detailing the cost involved
in enabling this feature.
# Additions:
- [x] Provide an option to enable traces in EC2 bash script which allows
to find and link any issues that may arise out of starting the runner
and find this information linked in the trace created out of this
feature.
# Options:
Use Cloudwatch config agent which now supports to capture traces
([link](https://aws.amazon.com/about-aws/whats-new/2023/08/amazon-cloudwatch-agent-opentelemetry-traces-x-ray/))
can be used to capture traces and link them to the log groups.
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Niek Palm <[email protected]>
@@ -427,6 +428,17 @@ An example log message of the scale-up function:
427
428
}
428
429
}
429
430
```
431
+
## Tracing
432
+
For the distributed architecture of this application it can be difficult to troubleshoot this application.
433
+
We support the option to enable tracing for all the lambda functions created by this application. To enable tracing user can simply provide the `tracing_config` option inside the root module or inner modules.
434
+
435
+
This tracing config generates timelines for following events:
436
+
- Basic lifecycle of lambda function
437
+
- Traces for Github API calls (can be configured by capture_http_requests).
438
+
- Traces for all AWS SDK calls
439
+
440
+
This feature has been disabled by default.
441
+
430
442
431
443
## Debugging
432
444
@@ -543,7 +555,7 @@ We welcome any improvement to the standard module to make the default as secure
543
555
| <aname="input_lambda_s3_bucket"></a> [lambda\_s3\_bucket](#input\_lambda\_s3\_bucket)| S3 bucket from which to specify lambda functions. This is an alternative to providing local files directly. |`string`|`null`| no |
544
556
| <aname="input_lambda_security_group_ids"></a> [lambda\_security\_group\_ids](#input\_lambda\_security\_group\_ids)| List of security group IDs associated with the Lambda function. |`list(string)`|`[]`| no |
545
557
| <aname="input_lambda_subnet_ids"></a> [lambda\_subnet\_ids](#input\_lambda\_subnet\_ids)| List of subnets in which the action runners will be launched, the subnets needs to be subnets in the `vpc_id`. |`list(string)`|`[]`| no |
546
-
| <aname="input_lambda_tracing_mode"></a> [lambda\_tracing\_mode](#input\_lambda\_tracing\_mode)|Enable X-Ray tracing for the lambda functions. |`string`|`null`| no |
558
+
| <aname="input_lambda_tracing_mode"></a> [lambda\_tracing\_mode](#input\_lambda\_tracing\_mode)|DEPRECATED: Replaced by `tracing_config`. |`string`|`null`| no |
547
559
| <aname="input_log_level"></a> [log\_level](#input\_log\_level)| Logging level for lambda logging. Valid values are 'silly', 'trace', 'debug', 'info', 'warn', 'error', 'fatal'. |`string`|`"info"`| no |
548
560
| <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 |
549
561
| <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 |
@@ -593,6 +605,7 @@ We welcome any improvement to the standard module to make the default as secure
593
605
| <aname="input_syncer_lambda_s3_key"></a> [syncer\_lambda\_s3\_key](#input\_syncer\_lambda\_s3\_key)| S3 key for syncer lambda function. Required if using an S3 bucket to specify lambdas. |`string`|`null`| no |
594
606
| <aname="input_syncer_lambda_s3_object_version"></a> [syncer\_lambda\_s3\_object\_version](#input\_syncer\_lambda\_s3\_object\_version)| S3 object version for syncer lambda function. Useful if S3 versioning is enabled on source bucket. |`string`|`null`| no |
595
607
| <aname="input_tags"></a> [tags](#input\_tags)| Map of tags that will be added to created resources. By default resources will be tagged with name and environment. |`map(string)`|`{}`| no |
| <aname="input_userdata_post_install"></a> [userdata\_post\_install](#input\_userdata\_post\_install)| Script to be ran after the GitHub Actions runner is installed on the EC2 instances |`string`|`""`| no |
597
610
| <aname="input_userdata_pre_install"></a> [userdata\_pre\_install](#input\_userdata\_pre\_install)| Script to be ran before the GitHub Actions runner is installed on the EC2 instances |`string`|`""`| no |
598
611
| <aname="input_userdata_template"></a> [userdata\_template](#input\_userdata\_template)| Alternative user-data template, replacing the default template. By providing your own user\_data you have to take care of installing all required software, including the action runner. Variables userdata\_pre/post\_install are ignored. |`string`|`null`| no |
0 commit comments