Skip to content

Commit 85a135a

Browse files
committed
push doc updates
1 parent 9b34bcb commit 85a135a

2 files changed

Lines changed: 46 additions & 1 deletion

File tree

ARCHITECTURE.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,21 @@ make run-locally # One-shot
624624
### Monitoring
625625

626626
- **Metrics**: Expose Prometheus metrics from gRPC service
627-
- **Logs**: Structured JSON logging
627+
- **Logs**: Structured JSON logging via `log/slog`
628+
- Machine-readable JSON format for log aggregation tools (Datadog, Splunk, CloudWatch Insights)
629+
- Context-aware logging with typed fields for queryable log data
630+
- Configurable log levels (Info/Debug via `--verbose` flag)
631+
- All components (detectors, inventory sources, EOL providers) use structured logging
632+
- Example log entry:
633+
```json
634+
{
635+
"time": "2024-01-15T10:30:45Z",
636+
"level": "WARN",
637+
"msg": "failed to parse resource from CSV row",
638+
"row_number": 42,
639+
"error": "missing ARN"
640+
}
641+
```
628642
- **Alerts**: Based on RED/YELLOW finding counts
629643
- **Dashboards**: Query gRPC API for real-time data
630644

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ Version Guard is configured via environment variables or CLI flags:
202202
| `TAG_APP_KEYS` | Comma-separated AWS tag keys for app/service | `app,application,service` |
203203
| `TAG_ENV_KEYS` | Comma-separated AWS tag keys for environment | `environment,env` |
204204
| `TAG_BRAND_KEYS` | Comma-separated AWS tag keys for brand/business unit | `brand` |
205+
| `--verbose` / `-v` | Enable debug-level logging | `false` |
205206

206207
**Customizing AWS Tag Keys:**
207208

@@ -217,6 +218,36 @@ export TAG_APP_KEYS="team,squad,application"
217218

218219
The tag keys are tried in order — the first matching tag wins.
219220

221+
**Logging:**
222+
223+
Version Guard uses structured JSON logging via Go's `log/slog` package for production observability:
224+
225+
```bash
226+
# Run with debug-level logging
227+
./bin/version-guard --verbose
228+
229+
# Production mode (info-level logging only)
230+
./bin/version-guard
231+
```
232+
233+
Logs are output in JSON format for easy parsing by log aggregation tools (Datadog, Splunk, CloudWatch Insights):
234+
235+
```json
236+
{
237+
"time": "2024-01-15T10:30:45Z",
238+
"level": "WARN",
239+
"msg": "failed to detect drift for resource",
240+
"resource_id": "arn:aws:rds:us-west-2:123456789012:cluster:my-db",
241+
"error": "version not found in EOL database"
242+
}
243+
```
244+
245+
Benefits:
246+
- Machine-readable structured data with typed fields
247+
- Context-aware logging with trace IDs
248+
- Queryable logs (e.g., filter by `resource_id` or `error`)
249+
- Integrates seamlessly with observability platforms
250+
220251
See `./bin/version-guard --help` for all options.
221252

222253
## 🎨 Classification Policy

0 commit comments

Comments
 (0)