|
| 1 | +# Reconciler Dashboard Module |
| 2 | + |
| 3 | +This module creates a comprehensive dashboard for monitoring a reconciler that combines a workqueue with a reconciler service. It displays metrics from both the workqueue infrastructure (receiver and dispatcher) and the reconciler service itself. |
| 4 | + |
| 5 | +## Usage |
| 6 | + |
| 7 | +```hcl |
| 8 | +module "my-reconciler-dashboard" { |
| 9 | + source = "chainguard-dev/terraform-infra-common//modules/dashboard/reconciler" |
| 10 | +
|
| 11 | + project_id = var.project_id |
| 12 | + name = "my-reconciler" |
| 13 | +
|
| 14 | + # Optional: Override service names if different from defaults |
| 15 | + # service_name = "custom-reconciler-name" # defaults to ${name}-rec |
| 16 | + # workqueue_name = "custom-workqueue-name" # defaults to ${name}-wq |
| 17 | +
|
| 18 | + # Workqueue configuration |
| 19 | + max_retry = 100 |
| 20 | + concurrent_work = 20 |
| 21 | + scope = "global" |
| 22 | +
|
| 23 | + # Optional sections |
| 24 | + sections = { |
| 25 | + github = false |
| 26 | + } |
| 27 | +
|
| 28 | + notification_channels = [var.notification_channel] |
| 29 | +} |
| 30 | +``` |
| 31 | + |
| 32 | +## Features |
| 33 | + |
| 34 | +The dashboard includes: |
| 35 | + |
| 36 | +### Workqueue Metrics |
| 37 | +- **Workqueue State**: Work in progress, queued, added, deduplication rates, completion attempts |
| 38 | +- **Processing Metrics**: Process latency, wait latency, time to completion |
| 39 | +- **Dead Letter Queue**: Failed tasks monitoring |
| 40 | + |
| 41 | +### Reconciler Service Metrics |
| 42 | +- **Error Reporting**: Error tracking and reporting for the reconciler (collapsed by default) |
| 43 | +- **Service Logs**: Reconciler service logs |
| 44 | +- **gRPC Metrics**: RPC rates, latencies, error rates |
| 45 | +- **GitHub API Metrics**: API usage and rate limiting (optional) |
| 46 | +- **Resources**: CPU, memory, and other resource utilization |
| 47 | + |
| 48 | +## Variables |
| 49 | + |
| 50 | +| Name | Description | Default | |
| 51 | +|------|-------------|---------| |
| 52 | +| `project_id` | The GCP project ID | Required | |
| 53 | +| `name` | Base name for the reconciler | Required | |
| 54 | +| `service_name` | Reconciler service name | `${name}-rec` | |
| 55 | +| `workqueue_name` | Workqueue name | `${name}-wq` | |
| 56 | +| `max_retry` | Maximum retry attempts for tasks | `100` | |
| 57 | +| `concurrent_work` | Concurrent work items | `20` | |
| 58 | +| `scope` | Workqueue scope (regional/global) | `global` | |
| 59 | +| `sections` | Optional dashboard sections | See variables.tf | |
| 60 | +| `notification_channels` | Alert notification channels | `[]` | |
| 61 | + |
| 62 | +## Outputs |
| 63 | + |
| 64 | +| Name | Description | |
| 65 | +|------|-------------| |
| 66 | +| `json` | The dashboard JSON configuration | |
| 67 | + |
| 68 | +## Integration with regional-go-reconciler |
| 69 | + |
| 70 | +This dashboard module is designed to work seamlessly with the `regional-go-reconciler` module: |
| 71 | + |
| 72 | +```hcl |
| 73 | +module "my-reconciler" { |
| 74 | + source = "chainguard-dev/terraform-infra-common//modules/regional-go-reconciler" |
| 75 | + # ... configuration ... |
| 76 | +} |
| 77 | +
|
| 78 | +module "my-reconciler-dashboard" { |
| 79 | + source = "chainguard-dev/terraform-infra-common//modules/dashboard/reconciler" |
| 80 | +
|
| 81 | + project_id = var.project_id |
| 82 | + name = "my-reconciler" # Same base name as the reconciler |
| 83 | + max_retry = module.my-reconciler.max-retry |
| 84 | + concurrent_work = module.my-reconciler.concurrent-work |
| 85 | + scope = "global" |
| 86 | +} |
| 87 | +<!-- BEGIN_TF_DOCS --> |
| 88 | +## Requirements |
| 89 | +
|
| 90 | +No requirements. |
| 91 | +
|
| 92 | +## Providers |
| 93 | +
|
| 94 | +No providers. |
| 95 | +
|
| 96 | +## Modules |
| 97 | +
|
| 98 | +| Name | Source | Version | |
| 99 | +|------|--------|---------| |
| 100 | +| <a name="module_alerts"></a> [alerts](#module\_alerts) | ../sections/alerts | n/a | |
| 101 | +| <a name="module_dashboard"></a> [dashboard](#module\_dashboard) | ../ | n/a | |
| 102 | +| <a name="module_errgrp"></a> [errgrp](#module\_errgrp) | ../sections/errgrp | n/a | |
| 103 | +| <a name="module_github"></a> [github](#module\_github) | ../sections/github | n/a | |
| 104 | +| <a name="module_grpc"></a> [grpc](#module\_grpc) | ../sections/grpc | n/a | |
| 105 | +| <a name="module_layout"></a> [layout](#module\_layout) | ../sections/layout | n/a | |
| 106 | +| <a name="module_reconciler-logs"></a> [reconciler-logs](#module\_reconciler-logs) | ../sections/logs | n/a | |
| 107 | +| <a name="module_resources"></a> [resources](#module\_resources) | ../sections/resources | n/a | |
| 108 | +| <a name="module_width"></a> [width](#module\_width) | ../sections/width | n/a | |
| 109 | +| <a name="module_workqueue-state"></a> [workqueue-state](#module\_workqueue-state) | ../sections/workqueue | n/a | |
| 110 | +
|
| 111 | +## Resources |
| 112 | +
|
| 113 | +No resources. |
| 114 | +
|
| 115 | +## Inputs |
| 116 | +
|
| 117 | +| Name | Description | Type | Default | Required | |
| 118 | +|------|-------------|------|---------|:--------:| |
| 119 | +| <a name="input_alerts"></a> [alerts](#input\_alerts) | Map of alert names to alert configurations | <pre>map(object({<br/> displayName = string<br/> documentation = string<br/> userLabels = map(string)<br/> project = string<br/> notificationChannel = string<br/> }))</pre> | `{}` | no | |
| 120 | +| <a name="input_concurrent_work"></a> [concurrent\_work](#input\_concurrent\_work) | The amount of concurrent work the workqueue dispatches | `number` | `20` | no | |
| 121 | +| <a name="input_labels"></a> [labels](#input\_labels) | Additional labels to add to the dashboard | `map(string)` | `{}` | no | |
| 122 | +| <a name="input_max_retry"></a> [max\_retry](#input\_max\_retry) | The maximum number of retry attempts for workqueue tasks | `number` | `100` | no | |
| 123 | +| <a name="input_name"></a> [name](#input\_name) | The name of the reconciler (base name without suffixes) | `string` | n/a | yes | |
| 124 | +| <a name="input_notification_channels"></a> [notification\_channels](#input\_notification\_channels) | List of notification channels for alerts | `list(string)` | `[]` | no | |
| 125 | +| <a name="input_project_id"></a> [project\_id](#input\_project\_id) | The GCP project ID | `string` | n/a | yes | |
| 126 | +| <a name="input_scope"></a> [scope](#input\_scope) | The scope of the workqueue (regional or global) | `string` | `"global"` | no | |
| 127 | +| <a name="input_sections"></a> [sections](#input\_sections) | Configure visibility of optional dashboard sections | <pre>object({<br/> github = optional(bool, false)<br/> })</pre> | `{}` | no | |
| 128 | +| <a name="input_service_name"></a> [service\_name](#input\_service\_name) | The name of the reconciler service (defaults to name-rec) | `string` | `""` | no | |
| 129 | +| <a name="input_workqueue_name"></a> [workqueue\_name](#input\_workqueue\_name) | The name of the workqueue (defaults to name-wq) | `string` | `""` | no | |
| 130 | +
|
| 131 | +## Outputs |
| 132 | +
|
| 133 | +| Name | Description | |
| 134 | +|------|-------------| |
| 135 | +| <a name="output_json"></a> [json](#output\_json) | n/a | |
| 136 | +<!-- END_TF_DOCS --> |
0 commit comments