proagents 1.6.17 → 1.6.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +169 -0
- package/COMMANDS.md +595 -0
- package/README.md +13 -23
- package/package.json +2 -7
- package/.proagents/ai-models/README.md +0 -141
- package/.proagents/ai-models/cost-management.md +0 -362
- package/.proagents/ai-models/fallbacks.md +0 -342
- package/.proagents/ai-models/model-config.md +0 -318
- package/.proagents/ai-models/task-routing.md +0 -503
- package/.proagents/ai-training/README.md +0 -155
- package/.proagents/ai-training/continuous-learning.md +0 -413
- package/.proagents/ai-training/domain-knowledge.md +0 -378
- package/.proagents/ai-training/pattern-learning.md +0 -455
- package/.proagents/ai-training/training-data.md +0 -337
- package/.proagents/ai-training/user-preferences.md +0 -346
- package/.proagents/approval-workflows/README.md +0 -146
- package/.proagents/approval-workflows/approval-config.md +0 -332
- package/.proagents/approval-workflows/approval-stages.md +0 -503
- package/.proagents/approval-workflows/emergency-bypass.md +0 -351
- package/.proagents/approval-workflows/examples.md +0 -859
- package/.proagents/approval-workflows/notifications.md +0 -320
- package/.proagents/compliance/README.md +0 -206
- package/.proagents/compliance/access-control.md +0 -310
- package/.proagents/compliance/audit-logging.md +0 -444
- package/.proagents/compliance/compliance-frameworks.md +0 -429
- package/.proagents/compliance/reports.md +0 -491
- package/.proagents/compliance/retention-policies.md +0 -454
- package/.proagents/config-versioning/README.md +0 -120
- package/.proagents/config-versioning/changelog.md +0 -300
- package/.proagents/config-versioning/rollback.md +0 -283
- package/.proagents/config-versioning/versioning.md +0 -330
- package/.proagents/contract-testing/README.md +0 -223
- package/.proagents/contract-testing/contract-testing.md +0 -614
- package/.proagents/contract-testing/pact-integration.md +0 -507
- package/.proagents/contract-testing/schema-validation.md +0 -565
- package/.proagents/dependency-management/README.md +0 -140
- package/.proagents/dependency-management/automation.md +0 -363
- package/.proagents/dependency-management/compatibility.md +0 -319
- package/.proagents/dependency-management/security-scanning.md +0 -413
- package/.proagents/dependency-management/update-policies.md +0 -374
- package/.proagents/disaster-recovery/README.md +0 -247
- package/.proagents/disaster-recovery/automation.md +0 -366
- package/.proagents/disaster-recovery/backup-recovery.md +0 -571
- package/.proagents/disaster-recovery/incident-response.md +0 -565
- package/.proagents/disaster-recovery/rollback-procedures.md +0 -499
- package/.proagents/disaster-recovery/runbooks.md +0 -603
- package/.proagents/disaster-recovery/scenarios.md +0 -892
- package/.proagents/disaster-recovery/testing.md +0 -438
- package/.proagents/environments/README.md +0 -244
- package/.proagents/environments/configuration.md +0 -437
- package/.proagents/environments/promotion.md +0 -434
- package/.proagents/environments/setup.md +0 -420
- package/.proagents/examples/README.md +0 -55
- package/.proagents/examples/backend-nodejs/README.md +0 -188
- package/.proagents/examples/backend-nodejs/complete-conversation.md +0 -601
- package/.proagents/examples/backend-nodejs/proagents.config.yaml +0 -415
- package/.proagents/examples/backend-nodejs/workflow-example.md +0 -909
- package/.proagents/examples/fullstack-nextjs/README.md +0 -155
- package/.proagents/examples/fullstack-nextjs/complete-conversation.md +0 -604
- package/.proagents/examples/fullstack-nextjs/proagents.config.yaml +0 -287
- package/.proagents/examples/fullstack-nextjs/workflow-example.md +0 -553
- package/.proagents/examples/mobile-react-native/README.md +0 -171
- package/.proagents/examples/mobile-react-native/complete-conversation.md +0 -825
- package/.proagents/examples/mobile-react-native/proagents.config.yaml +0 -330
- package/.proagents/examples/mobile-react-native/workflow-example.md +0 -723
- package/.proagents/examples/web-frontend-react/README.md +0 -125
- package/.proagents/examples/web-frontend-react/complete-conversation.md +0 -556
- package/.proagents/examples/web-frontend-react/proagents.config.yaml +0 -183
- package/.proagents/examples/web-frontend-react/workflow-example.md +0 -603
- package/.proagents/existing-projects/README.md +0 -65
- package/.proagents/existing-projects/challenges.md +0 -861
- package/.proagents/existing-projects/coexistence-mode.md +0 -483
- package/.proagents/existing-projects/compatibility-assessment.md +0 -541
- package/.proagents/existing-projects/gradual-adoption.md +0 -515
- package/.proagents/existing-projects/migration-strategies.md +0 -788
- package/.proagents/existing-projects/pattern-reconciliation.md +0 -489
- package/.proagents/existing-projects/team-onboarding.md +0 -617
- package/.proagents/existing-projects/technical-debt-handling.md +0 -644
- package/.proagents/feature-flags/README.md +0 -263
- package/.proagents/feature-flags/ab-testing.md +0 -413
- package/.proagents/feature-flags/configuration.md +0 -420
- package/.proagents/feature-flags/kill-switches.md +0 -444
- package/.proagents/feature-flags/rollout-strategies.md +0 -392
- package/.proagents/history.log +0 -12
- package/.proagents/i18n/README.md +0 -133
- package/.proagents/i18n/extraction.md +0 -433
- package/.proagents/i18n/tms-integration.md +0 -332
- package/.proagents/i18n/translation-workflow.md +0 -413
- package/.proagents/i18n/validation.md +0 -355
- package/.proagents/logging/README.md +0 -276
- package/.proagents/logging/aggregation.md +0 -475
- package/.proagents/logging/log-levels.md +0 -376
- package/.proagents/logging/sensitive-data.md +0 -423
- package/.proagents/logging/structured-logging.md +0 -406
- package/.proagents/metrics/README.md +0 -69
- package/.proagents/metrics/code-quality-kpis.md +0 -461
- package/.proagents/metrics/deployment-metrics.md +0 -517
- package/.proagents/metrics/developer-productivity.md +0 -368
- package/.proagents/metrics/learning-effectiveness.md +0 -478
- package/.proagents/migrations/README.md +0 -77
- package/.proagents/migrations/from-claude-projects.md +0 -313
- package/.proagents/migrations/from-cursor-rules.md +0 -345
- package/.proagents/migrations/from-custom-workflows.md +0 -410
- package/.proagents/monitoring/README.md +0 -308
- package/.proagents/monitoring/alerting.md +0 -449
- package/.proagents/monitoring/dashboards.md +0 -454
- package/.proagents/monitoring/health-checks.md +0 -436
- package/.proagents/monitoring/metrics.md +0 -434
- package/.proagents/multi-project/README.md +0 -170
- package/.proagents/multi-project/coordinated-deploy.md +0 -510
- package/.proagents/multi-project/cross-project-deps.md +0 -395
- package/.proagents/multi-project/unified-changelog.md +0 -477
- package/.proagents/multi-project/walkthroughs/monorepo-setup.md +0 -787
- package/.proagents/multi-project/workspace-config.md +0 -408
- package/.proagents/notifications/README.md +0 -151
- package/.proagents/notifications/channels.md +0 -457
- package/.proagents/notifications/preferences.md +0 -415
- package/.proagents/notifications/routing.md +0 -449
- package/.proagents/notifications/scheduling.md +0 -425
- package/.proagents/notifications/templates.md +0 -446
- package/.proagents/offline-mode/README.md +0 -145
- package/.proagents/offline-mode/caching.md +0 -344
- package/.proagents/offline-mode/offline-operations.md +0 -312
- package/.proagents/offline-mode/queue-specifications.md +0 -679
- package/.proagents/offline-mode/sync.md +0 -475
- package/.proagents/parallel-features/README.md +0 -85
- package/.proagents/parallel-features/conflict-detection.md +0 -226
- package/.proagents/parallel-features/dependency-management.md +0 -392
- package/.proagents/parallel-features/merge-coordination.md +0 -506
- package/.proagents/parallel-features/tracking-system.md +0 -416
- package/.proagents/performance/README.md +0 -59
- package/.proagents/performance/bundle-analysis.md +0 -375
- package/.proagents/performance/load-testing.md +0 -563
- package/.proagents/performance/runtime-metrics.md +0 -489
- package/.proagents/performance/web-vitals.md +0 -425
- package/.proagents/plugins/README.md +0 -139
- package/.proagents/plugins/creating-plugins.md +0 -504
- package/.proagents/plugins/plugin-api.md +0 -467
- package/.proagents/plugins/plugin-registry.md +0 -276
- package/.proagents/reporting/README.md +0 -158
- package/.proagents/reporting/dashboards.md +0 -366
- package/.proagents/reporting/exports.md +0 -524
- package/.proagents/reporting/quality-metrics.md +0 -385
- package/.proagents/reporting/templates/README.md +0 -56
- package/.proagents/reporting/templates/dashboard-config.json +0 -187
- package/.proagents/reporting/templates/metrics-queries.md +0 -427
- package/.proagents/reporting/templates/react-dashboard.tsx +0 -544
- package/.proagents/reporting/templates/widgets.md +0 -451
- package/.proagents/reporting/velocity-metrics.md +0 -340
- package/.proagents/reverse-engineering/README.md +0 -151
- package/.proagents/reverse-engineering/architecture-extraction.md +0 -325
- package/.proagents/reverse-engineering/code-analysis.md +0 -377
- package/.proagents/reverse-engineering/dependency-mapping.md +0 -567
- package/.proagents/reverse-engineering/diagram-generation.md +0 -586
- package/.proagents/reverse-engineering/documentation-generation.md +0 -468
- package/.proagents/reverse-engineering/pattern-detection.md +0 -569
- package/.proagents/reverse-engineering/quality-assessment.md +0 -733
- package/.proagents/secrets/README.md +0 -278
- package/.proagents/secrets/access-control.md +0 -443
- package/.proagents/secrets/rotation.md +0 -403
- package/.proagents/secrets/scanning.md +0 -487
- package/.proagents/secrets/storage.md +0 -394
- package/.proagents/webhooks/README.md +0 -126
- package/.proagents/webhooks/endpoints.md +0 -298
- package/.proagents/webhooks/events.md +0 -316
- package/.proagents/webhooks/payloads.md +0 -325
- package/.proagents/webhooks/reliability.md +0 -363
- package/.proagents/webhooks/security.md +0 -380
|
@@ -1,475 +0,0 @@
|
|
|
1
|
-
# Log Aggregation
|
|
2
|
-
|
|
3
|
-
Centralizing logs from multiple sources for unified analysis.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Architecture Overview
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
|
|
11
|
-
│ Service A │ │ Service B │ │ Service C │
|
|
12
|
-
└──────┬──────┘ └──────┬──────┘ └──────┬──────┘
|
|
13
|
-
│ │ │
|
|
14
|
-
▼ ▼ ▼
|
|
15
|
-
┌─────────────────────────────────────────────────┐
|
|
16
|
-
│ Log Shipper (Fluentd/Vector) │
|
|
17
|
-
└──────────────────────┬──────────────────────────┘
|
|
18
|
-
│
|
|
19
|
-
▼
|
|
20
|
-
┌─────────────────────────────────────────────────┐
|
|
21
|
-
│ Log Storage (Elasticsearch) │
|
|
22
|
-
└──────────────────────┬──────────────────────────┘
|
|
23
|
-
│
|
|
24
|
-
▼
|
|
25
|
-
┌─────────────────────────────────────────────────┐
|
|
26
|
-
│ Visualization (Kibana/Grafana) │
|
|
27
|
-
└─────────────────────────────────────────────────┘
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
## Shipper Configuration
|
|
33
|
-
|
|
34
|
-
### Fluentd
|
|
35
|
-
|
|
36
|
-
```yaml
|
|
37
|
-
# proagents.config.yaml
|
|
38
|
-
logging:
|
|
39
|
-
aggregation:
|
|
40
|
-
shipper: "fluentd"
|
|
41
|
-
|
|
42
|
-
fluentd:
|
|
43
|
-
# Input sources
|
|
44
|
-
sources:
|
|
45
|
-
- type: "tail"
|
|
46
|
-
path: "/var/log/app/*.log"
|
|
47
|
-
tag: "app.*"
|
|
48
|
-
format: "json"
|
|
49
|
-
|
|
50
|
-
- type: "forward"
|
|
51
|
-
port: 24224
|
|
52
|
-
tag: "docker.*"
|
|
53
|
-
|
|
54
|
-
# Processing
|
|
55
|
-
filters:
|
|
56
|
-
- match: "**"
|
|
57
|
-
type: "record_transformer"
|
|
58
|
-
record:
|
|
59
|
-
hostname: "#{Socket.gethostname}"
|
|
60
|
-
environment: "production"
|
|
61
|
-
|
|
62
|
-
# Output
|
|
63
|
-
output:
|
|
64
|
-
type: "elasticsearch"
|
|
65
|
-
host: "${ES_HOST}"
|
|
66
|
-
port: 9200
|
|
67
|
-
index_name: "logs"
|
|
68
|
-
type_name: "_doc"
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### Vector
|
|
72
|
-
|
|
73
|
-
```yaml
|
|
74
|
-
logging:
|
|
75
|
-
aggregation:
|
|
76
|
-
shipper: "vector"
|
|
77
|
-
|
|
78
|
-
vector:
|
|
79
|
-
# Sources
|
|
80
|
-
sources:
|
|
81
|
-
app_logs:
|
|
82
|
-
type: "file"
|
|
83
|
-
include:
|
|
84
|
-
- "/var/log/app/*.log"
|
|
85
|
-
read_from: "beginning"
|
|
86
|
-
|
|
87
|
-
docker_logs:
|
|
88
|
-
type: "docker_logs"
|
|
89
|
-
|
|
90
|
-
# Transforms
|
|
91
|
-
transforms:
|
|
92
|
-
parse_json:
|
|
93
|
-
type: "remap"
|
|
94
|
-
inputs: ["app_logs"]
|
|
95
|
-
source: |
|
|
96
|
-
. = parse_json!(.message)
|
|
97
|
-
|
|
98
|
-
add_metadata:
|
|
99
|
-
type: "remap"
|
|
100
|
-
inputs: ["parse_json"]
|
|
101
|
-
source: |
|
|
102
|
-
.environment = "production"
|
|
103
|
-
.service = "my-app"
|
|
104
|
-
|
|
105
|
-
# Sinks
|
|
106
|
-
sinks:
|
|
107
|
-
elasticsearch:
|
|
108
|
-
type: "elasticsearch"
|
|
109
|
-
inputs: ["add_metadata"]
|
|
110
|
-
endpoints: ["${ES_ENDPOINT}"]
|
|
111
|
-
index: "logs-%Y-%m-%d"
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
### Filebeat
|
|
115
|
-
|
|
116
|
-
```yaml
|
|
117
|
-
logging:
|
|
118
|
-
aggregation:
|
|
119
|
-
shipper: "filebeat"
|
|
120
|
-
|
|
121
|
-
filebeat:
|
|
122
|
-
inputs:
|
|
123
|
-
- type: log
|
|
124
|
-
enabled: true
|
|
125
|
-
paths:
|
|
126
|
-
- /var/log/app/*.log
|
|
127
|
-
json:
|
|
128
|
-
keys_under_root: true
|
|
129
|
-
add_error_key: true
|
|
130
|
-
|
|
131
|
-
processors:
|
|
132
|
-
- add_host_metadata: ~
|
|
133
|
-
- add_cloud_metadata: ~
|
|
134
|
-
- add_docker_metadata: ~
|
|
135
|
-
|
|
136
|
-
output:
|
|
137
|
-
elasticsearch:
|
|
138
|
-
hosts: ["${ES_HOST}:9200"]
|
|
139
|
-
index: "logs-%{+yyyy.MM.dd}"
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
---
|
|
143
|
-
|
|
144
|
-
## Storage Configuration
|
|
145
|
-
|
|
146
|
-
### Elasticsearch
|
|
147
|
-
|
|
148
|
-
```yaml
|
|
149
|
-
logging:
|
|
150
|
-
aggregation:
|
|
151
|
-
storage: "elasticsearch"
|
|
152
|
-
|
|
153
|
-
elasticsearch:
|
|
154
|
-
# Cluster configuration
|
|
155
|
-
cluster:
|
|
156
|
-
hosts:
|
|
157
|
-
- "es-node-1:9200"
|
|
158
|
-
- "es-node-2:9200"
|
|
159
|
-
- "es-node-3:9200"
|
|
160
|
-
|
|
161
|
-
# Index settings
|
|
162
|
-
index:
|
|
163
|
-
prefix: "logs"
|
|
164
|
-
date_format: "%Y.%m.%d"
|
|
165
|
-
shards: 3
|
|
166
|
-
replicas: 1
|
|
167
|
-
|
|
168
|
-
# Index lifecycle management
|
|
169
|
-
ilm:
|
|
170
|
-
enabled: true
|
|
171
|
-
policy:
|
|
172
|
-
hot:
|
|
173
|
-
max_age: "7d"
|
|
174
|
-
max_size: "50gb"
|
|
175
|
-
warm:
|
|
176
|
-
min_age: "7d"
|
|
177
|
-
shrink:
|
|
178
|
-
number_of_shards: 1
|
|
179
|
-
cold:
|
|
180
|
-
min_age: "30d"
|
|
181
|
-
delete:
|
|
182
|
-
min_age: "90d"
|
|
183
|
-
|
|
184
|
-
# Template
|
|
185
|
-
template:
|
|
186
|
-
mappings:
|
|
187
|
-
dynamic_templates:
|
|
188
|
-
- strings:
|
|
189
|
-
match_mapping_type: "string"
|
|
190
|
-
mapping:
|
|
191
|
-
type: "keyword"
|
|
192
|
-
ignore_above: 1024
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
### Loki
|
|
196
|
-
|
|
197
|
-
```yaml
|
|
198
|
-
logging:
|
|
199
|
-
aggregation:
|
|
200
|
-
storage: "loki"
|
|
201
|
-
|
|
202
|
-
loki:
|
|
203
|
-
url: "http://loki:3100"
|
|
204
|
-
|
|
205
|
-
# Labels
|
|
206
|
-
labels:
|
|
207
|
-
job: "app-logs"
|
|
208
|
-
environment: "production"
|
|
209
|
-
|
|
210
|
-
# Tenant
|
|
211
|
-
tenant_id: "default"
|
|
212
|
-
|
|
213
|
-
# Retention
|
|
214
|
-
retention:
|
|
215
|
-
period: "720h" # 30 days
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
---
|
|
219
|
-
|
|
220
|
-
## Cloud Services
|
|
221
|
-
|
|
222
|
-
### AWS CloudWatch
|
|
223
|
-
|
|
224
|
-
```yaml
|
|
225
|
-
logging:
|
|
226
|
-
aggregation:
|
|
227
|
-
provider: "aws"
|
|
228
|
-
|
|
229
|
-
cloudwatch:
|
|
230
|
-
region: "us-east-1"
|
|
231
|
-
log_group: "/app/production"
|
|
232
|
-
|
|
233
|
-
# Log streams
|
|
234
|
-
stream_prefix: "${SERVICE_NAME}"
|
|
235
|
-
|
|
236
|
-
# Retention
|
|
237
|
-
retention_days: 30
|
|
238
|
-
|
|
239
|
-
# Metric filters
|
|
240
|
-
metric_filters:
|
|
241
|
-
- name: "ErrorCount"
|
|
242
|
-
pattern: '{ $.level = "error" }'
|
|
243
|
-
metric:
|
|
244
|
-
namespace: "App/Logs"
|
|
245
|
-
name: "ErrorCount"
|
|
246
|
-
value: 1
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
### Google Cloud Logging
|
|
250
|
-
|
|
251
|
-
```yaml
|
|
252
|
-
logging:
|
|
253
|
-
aggregation:
|
|
254
|
-
provider: "gcp"
|
|
255
|
-
|
|
256
|
-
cloud_logging:
|
|
257
|
-
project_id: "${GCP_PROJECT_ID}"
|
|
258
|
-
|
|
259
|
-
# Log name
|
|
260
|
-
log_name: "app-logs"
|
|
261
|
-
|
|
262
|
-
# Resource
|
|
263
|
-
resource:
|
|
264
|
-
type: "gce_instance"
|
|
265
|
-
labels:
|
|
266
|
-
project_id: "${GCP_PROJECT_ID}"
|
|
267
|
-
zone: "${GCP_ZONE}"
|
|
268
|
-
instance_id: "${INSTANCE_ID}"
|
|
269
|
-
|
|
270
|
-
# Exclusions
|
|
271
|
-
exclusions:
|
|
272
|
-
- name: "health-checks"
|
|
273
|
-
filter: 'httpRequest.requestUrl="/health"'
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
### Azure Monitor
|
|
277
|
-
|
|
278
|
-
```yaml
|
|
279
|
-
logging:
|
|
280
|
-
aggregation:
|
|
281
|
-
provider: "azure"
|
|
282
|
-
|
|
283
|
-
azure_monitor:
|
|
284
|
-
workspace_id: "${WORKSPACE_ID}"
|
|
285
|
-
shared_key: "${SHARED_KEY}"
|
|
286
|
-
|
|
287
|
-
# Custom log type
|
|
288
|
-
log_type: "AppLogs"
|
|
289
|
-
|
|
290
|
-
# Time field
|
|
291
|
-
time_field: "@timestamp"
|
|
292
|
-
```
|
|
293
|
-
|
|
294
|
-
---
|
|
295
|
-
|
|
296
|
-
## Log Processing
|
|
297
|
-
|
|
298
|
-
### Parsing Rules
|
|
299
|
-
|
|
300
|
-
```yaml
|
|
301
|
-
logging:
|
|
302
|
-
aggregation:
|
|
303
|
-
processing:
|
|
304
|
-
parsing:
|
|
305
|
-
# JSON parsing
|
|
306
|
-
json:
|
|
307
|
-
enabled: true
|
|
308
|
-
keys_under_root: true
|
|
309
|
-
|
|
310
|
-
# Grok patterns
|
|
311
|
-
grok:
|
|
312
|
-
patterns:
|
|
313
|
-
CUSTOM_LOG: '%{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:level} %{GREEDYDATA:message}'
|
|
314
|
-
|
|
315
|
-
# Multiline
|
|
316
|
-
multiline:
|
|
317
|
-
pattern: '^\d{4}-\d{2}-\d{2}'
|
|
318
|
-
negate: true
|
|
319
|
-
match: "after"
|
|
320
|
-
```
|
|
321
|
-
|
|
322
|
-
### Enrichment
|
|
323
|
-
|
|
324
|
-
```yaml
|
|
325
|
-
logging:
|
|
326
|
-
aggregation:
|
|
327
|
-
processing:
|
|
328
|
-
enrichment:
|
|
329
|
-
# Add geo data
|
|
330
|
-
geoip:
|
|
331
|
-
enabled: true
|
|
332
|
-
source_field: "client_ip"
|
|
333
|
-
target_field: "geo"
|
|
334
|
-
|
|
335
|
-
# Add user agent parsing
|
|
336
|
-
user_agent:
|
|
337
|
-
enabled: true
|
|
338
|
-
source_field: "http.user_agent"
|
|
339
|
-
target_field: "user_agent"
|
|
340
|
-
|
|
341
|
-
# DNS lookup
|
|
342
|
-
dns:
|
|
343
|
-
enabled: false # Can be slow
|
|
344
|
-
```
|
|
345
|
-
|
|
346
|
-
### Filtering
|
|
347
|
-
|
|
348
|
-
```yaml
|
|
349
|
-
logging:
|
|
350
|
-
aggregation:
|
|
351
|
-
processing:
|
|
352
|
-
filtering:
|
|
353
|
-
# Drop health checks
|
|
354
|
-
drop:
|
|
355
|
-
- condition: 'http.path == "/health"'
|
|
356
|
-
- condition: 'http.path == "/metrics"'
|
|
357
|
-
|
|
358
|
-
# Sample verbose logs
|
|
359
|
-
sample:
|
|
360
|
-
- condition: 'level == "debug"'
|
|
361
|
-
rate: 0.1 # Keep 10%
|
|
362
|
-
|
|
363
|
-
# Redact sensitive data
|
|
364
|
-
redact:
|
|
365
|
-
- field: "user.email"
|
|
366
|
-
pattern: '(?<=.{3}).(?=.*@)'
|
|
367
|
-
replacement: "*"
|
|
368
|
-
```
|
|
369
|
-
|
|
370
|
-
---
|
|
371
|
-
|
|
372
|
-
## Querying & Analysis
|
|
373
|
-
|
|
374
|
-
### Query Examples
|
|
375
|
-
|
|
376
|
-
```yaml
|
|
377
|
-
# Kibana / Elasticsearch queries
|
|
378
|
-
logging:
|
|
379
|
-
queries:
|
|
380
|
-
examples:
|
|
381
|
-
# Errors in last hour
|
|
382
|
-
recent_errors: |
|
|
383
|
-
level:error AND @timestamp:[now-1h TO now]
|
|
384
|
-
|
|
385
|
-
# Specific user activity
|
|
386
|
-
user_activity: |
|
|
387
|
-
user.id:"user-123" AND event.type:*
|
|
388
|
-
|
|
389
|
-
# Slow requests
|
|
390
|
-
slow_requests: |
|
|
391
|
-
http.duration_ms:>1000
|
|
392
|
-
|
|
393
|
-
# Error trends
|
|
394
|
-
error_trends: |
|
|
395
|
-
level:error | stats count() by service.name
|
|
396
|
-
```
|
|
397
|
-
|
|
398
|
-
### Saved Searches
|
|
399
|
-
|
|
400
|
-
```yaml
|
|
401
|
-
logging:
|
|
402
|
-
aggregation:
|
|
403
|
-
saved_searches:
|
|
404
|
-
- name: "Production Errors"
|
|
405
|
-
query: "level:error AND environment:production"
|
|
406
|
-
columns: ["@timestamp", "service.name", "message", "error.message"]
|
|
407
|
-
sort: [{"@timestamp": "desc"}]
|
|
408
|
-
|
|
409
|
-
- name: "Auth Failures"
|
|
410
|
-
query: 'event.type:"auth.failure"'
|
|
411
|
-
columns: ["@timestamp", "user.email", "error.message", "geo.country"]
|
|
412
|
-
```
|
|
413
|
-
|
|
414
|
-
---
|
|
415
|
-
|
|
416
|
-
## Alerting
|
|
417
|
-
|
|
418
|
-
### Alert Rules
|
|
419
|
-
|
|
420
|
-
```yaml
|
|
421
|
-
logging:
|
|
422
|
-
aggregation:
|
|
423
|
-
alerts:
|
|
424
|
-
- name: "High Error Rate"
|
|
425
|
-
query: "level:error"
|
|
426
|
-
condition:
|
|
427
|
-
type: "count"
|
|
428
|
-
threshold: 100
|
|
429
|
-
window: "5m"
|
|
430
|
-
actions:
|
|
431
|
-
- type: "slack"
|
|
432
|
-
channel: "#alerts"
|
|
433
|
-
- type: "pagerduty"
|
|
434
|
-
severity: "critical"
|
|
435
|
-
|
|
436
|
-
- name: "Security Event"
|
|
437
|
-
query: 'event.category:"security"'
|
|
438
|
-
condition:
|
|
439
|
-
type: "any"
|
|
440
|
-
actions:
|
|
441
|
-
- type: "email"
|
|
442
|
-
to: ["security@company.com"]
|
|
443
|
-
```
|
|
444
|
-
|
|
445
|
-
---
|
|
446
|
-
|
|
447
|
-
## Commands
|
|
448
|
-
|
|
449
|
-
```bash
|
|
450
|
-
# Query logs
|
|
451
|
-
proagents logs query --filter 'level:error' --last 1h
|
|
452
|
-
|
|
453
|
-
# Stream logs
|
|
454
|
-
proagents logs stream --filter 'service.name:api'
|
|
455
|
-
|
|
456
|
-
# Export logs
|
|
457
|
-
proagents logs export --from 2024-01-01 --to 2024-01-02 --output logs.json
|
|
458
|
-
|
|
459
|
-
# Check aggregation health
|
|
460
|
-
proagents logs health
|
|
461
|
-
|
|
462
|
-
# View storage stats
|
|
463
|
-
proagents logs stats
|
|
464
|
-
```
|
|
465
|
-
|
|
466
|
-
---
|
|
467
|
-
|
|
468
|
-
## Best Practices
|
|
469
|
-
|
|
470
|
-
1. **Structured First**: Use JSON logging from the source
|
|
471
|
-
2. **Add Metadata**: Include service, version, environment
|
|
472
|
-
3. **Index Strategy**: Plan your index naming and lifecycle
|
|
473
|
-
4. **Retention Policy**: Define how long to keep logs
|
|
474
|
-
5. **Sampling**: Sample verbose logs to reduce costs
|
|
475
|
-
6. **Alerting**: Set up alerts for critical patterns
|