Skip to content

Commit b03cd0a

Browse files
Jordan-Williams2Jordan-Williams2
authored andcommitted
feat: expose Sysdig agent mode as configurable input variable
Add agent_mode variable to allow users to configure the operational mode of the Sysdig agent. This addresses GitHub issue #263 where users need to set the agent to 'troubleshooting' mode to access additional metrics. The agent_mode variable accepts: - 'monitor': Standard monitoring mode - 'monitor_light': Lightweight monitoring mode - 'troubleshooting': Enhanced mode with additional metrics like HTTP request metrics (sysdig_container_net_http_url_request_count, sysdig_container_net_http_url_request_time, sysdig_container_net_http_url_error_count) - null: Use the agent's default mode (default value) Changes: - Add agent_mode string variable with validation in variables.tf - Configure feature mode in agent.sysdig.settings in main.tf - Add agent_mode to fully-configurable solution - Update ibm_catalog.json with new variable entry - Auto-generate documentation via pre-commit hooks Fixes issue #263
1 parent 5fdb393 commit b03cd0a

File tree

6 files changed

+29
-0
lines changed

6 files changed

+29
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ No modules.
114114
| <a name="input_agent_image_tag_digest"></a> [agent\_image\_tag\_digest](#input\_agent\_image\_tag\_digest) | The image tag or digest of agent image to use. If using digest, it must be in the format of `X.Y.Z@sha256:xxxxx`. | `string` | `"14.2.5@sha256:64b9d77bbd1bb22f97a74198144dcfea62bb5cee7629091252694e9040058035"` | no |
115115
| <a name="input_agent_limits_cpu"></a> [agent\_limits\_cpu](#input\_agent\_limits\_cpu) | Specify CPU resource limits for the agent. For more info, see https://cloud.ibm.com/docs/monitoring?topic=monitoring-resource_requirements | `string` | `"1"` | no |
116116
| <a name="input_agent_limits_memory"></a> [agent\_limits\_memory](#input\_agent\_limits\_memory) | Specify memory resource limits for the agent. For more info, see https://cloud.ibm.com/docs/monitoring?topic=monitoring-resource_requirements | `string` | `"1024Mi"` | no |
117+
| <a name="input_agent_mode"></a> [agent\_mode](#input\_agent\_mode) | The operational mode for the Sysdig agent. Valid values are 'monitor', 'monitor\_light', 'troubleshooting', or null. The 'troubleshooting' mode enables additional metrics that are useful for debugging, such as HTTP request metrics (sysdig\_container\_net\_http\_url\_request\_count, sysdig\_container\_net\_http\_url\_request\_time, sysdig\_container\_net\_http\_url\_error\_count). Set to null to use the agent's default mode. | `string` | `null` | no |
117118
| <a name="input_agent_requests_cpu"></a> [agent\_requests\_cpu](#input\_agent\_requests\_cpu) | Specify CPU resource requests for the agent. For more info, see https://cloud.ibm.com/docs/monitoring?topic=monitoring-resource_requirements | `string` | `"1"` | no |
118119
| <a name="input_agent_requests_memory"></a> [agent\_requests\_memory](#input\_agent\_requests\_memory) | Specify memory resource requests for the agent. For more info, see https://cloud.ibm.com/docs/monitoring?topic=monitoring-resource_requirements | `string` | `"1024Mi"` | no |
119120
| <a name="input_agent_tags"></a> [agent\_tags](#input\_agent\_tags) | Map of tags to associate to the agent. For example, {"environment": "production"}. NOTE: Use the `add_cluster_name` boolean variable to add the cluster name as a tag. | `map(string)` | `{}` | no |

ibm_catalog.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,9 @@
354354
{
355355
"key": "enable_jmx"
356356
},
357+
{
358+
"key": "agent_mode"
359+
},
357360
{
358361
"key": "use_private_endpoint"
359362
},

main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,10 @@ resource "helm_release" "cloud_monitoring_agent" {
213213
"app_checks_enabled": ${var.enable_app_checks}
214214
"jmx":
215215
"enabled": ${var.enable_jmx}
216+
%{if var.agent_mode != null~}
217+
"feature":
218+
"mode": ${var.agent_mode}
219+
%{endif~}
216220
"sysdig_api_endpoint": ${local.api_host}
217221
"blacklisted_ports":
218222
%{for port in var.blacklisted_ports~}

solutions/fully-configurable/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ module "monitoring_agent" {
6767
enable_kspm_analyzer = var.enable_kspm_analyzer
6868
enable_app_checks = var.enable_app_checks
6969
enable_jmx = var.enable_jmx
70+
agent_mode = var.agent_mode
7071
cluster_shield_deploy = var.cluster_shield_deploy
7172
cluster_shield_image_tag_digest = var.cluster_shield_image_tag_digest
7273
cluster_shield_image_repository = var.cluster_shield_image_repository

solutions/fully-configurable/variables.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,16 @@ variable "enable_jmx" {
364364
default = true
365365
}
366366

367+
variable "agent_mode" {
368+
type = string
369+
description = "The operational mode for the Sysdig agent. Valid values are 'monitor', 'monitor_light', 'troubleshooting', or null. The 'troubleshooting' mode enables additional metrics that are useful for debugging, such as HTTP request metrics (sysdig_container_net_http_url_request_count, sysdig_container_net_http_url_request_time, sysdig_container_net_http_url_error_count). Set to null to use the agent's default mode."
370+
default = null
371+
validation {
372+
condition = var.agent_mode == null ? true : contains(["monitor", "monitor_light", "troubleshooting"], var.agent_mode)
373+
error_message = "agent_mode must be one of 'monitor', 'monitor_light', 'troubleshooting', or null."
374+
}
375+
}
376+
367377
variable "cluster_shield_deploy" {
368378
type = bool
369379
description = "Deploy the Cluster Shield component to provide runtime detection and policy enforcement for Kubernetes workloads. If enabled, a Kubernetes Deployment will be deployed to your cluster using helm."

variables.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,16 @@ variable "enable_jmx" {
369369
default = true
370370
}
371371

372+
variable "agent_mode" {
373+
type = string
374+
description = "The operational mode for the Sysdig agent. Valid values are 'monitor', 'monitor_light', 'troubleshooting', or null. The 'troubleshooting' mode enables additional metrics that are useful for debugging, such as HTTP request metrics (sysdig_container_net_http_url_request_count, sysdig_container_net_http_url_request_time, sysdig_container_net_http_url_error_count). Set to null to use the agent's default mode."
375+
default = null
376+
validation {
377+
condition = var.agent_mode == null ? true : contains(["monitor", "monitor_light", "troubleshooting"], var.agent_mode)
378+
error_message = "agent_mode must be one of 'monitor', 'monitor_light', 'troubleshooting', or null."
379+
}
380+
}
381+
372382
variable "cluster_shield_deploy" {
373383
type = bool
374384
description = "Deploy the Cluster Shield component to provide runtime detection and policy enforcement for Kubernetes workloads. If enabled, a Kubernetes Deployment will be deployed to your cluster using helm."

0 commit comments

Comments
 (0)