@senad-d/observme 0.1.0
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/.env.example +57 -0
- package/CHANGELOG.md +52 -0
- package/LICENSE +21 -0
- package/ObservMe-Production-Docs/00-README.md +79 -0
- package/ObservMe-Production-Docs/01-requirements-and-scope.md +207 -0
- package/ObservMe-Production-Docs/02-reference-architecture.md +306 -0
- package/ObservMe-Production-Docs/03-pi-event-and-session-model.md +266 -0
- package/ObservMe-Production-Docs/04-telemetry-semantic-conventions.md +722 -0
- package/ObservMe-Production-Docs/05-otel-pipeline-and-collector.md +355 -0
- package/ObservMe-Production-Docs/06-security-privacy-redaction.md +294 -0
- package/ObservMe-Production-Docs/07-extension-implementation-blueprint.md +447 -0
- package/ObservMe-Production-Docs/08-query-grafana-integration.md +276 -0
- package/ObservMe-Production-Docs/09-dashboards-alerts-slos.md +640 -0
- package/ObservMe-Production-Docs/10-testing-release-operations.md +319 -0
- package/ObservMe-Production-Docs/11-deployment-runbooks.md +203 -0
- package/ObservMe-Production-Docs/12-configuration-reference.md +337 -0
- package/ObservMe-Production-Docs/13-source-notes.md +33 -0
- package/ObservMe-Production-Docs/pi-session-format.md +427 -0
- package/README.md +356 -0
- package/SECURITY.md +45 -0
- package/dashboards/observme-agent-node-graphs.json +250 -0
- package/dashboards/observme-agents.json +1880 -0
- package/dashboards/observme-alerts.yaml +113 -0
- package/dashboards/observme-branches-compactions.json +1042 -0
- package/dashboards/observme-cost.json +1254 -0
- package/dashboards/observme-errors.json +1659 -0
- package/dashboards/observme-export-health.json +1802 -0
- package/dashboards/observme-latency.json +1494 -0
- package/dashboards/observme-llm-conversations.json +730 -0
- package/dashboards/observme-logs-llm.json +644 -0
- package/dashboards/observme-models.json +933 -0
- package/dashboards/observme-overview.json +2129 -0
- package/dashboards/observme-slo-health.json +737 -0
- package/dashboards/observme-slos.yaml +56 -0
- package/dashboards/observme-tools.json +902 -0
- package/dashboards/observme-trace-journey.json +1793 -0
- package/docs/STRUCTURE.md +49 -0
- package/docs/agent-subagent-observability-requirements.md +997 -0
- package/docs/compatibility-matrix.md +39 -0
- package/docs/configuration-tui-design-standard.md +767 -0
- package/docs/configuration.md +38 -0
- package/docs/review-validation.md +115 -0
- package/docs/validation-flow.md +117 -0
- package/examples/collector.yaml +123 -0
- package/examples/observme.yaml +131 -0
- package/img/demo.gif +0 -0
- package/img/icon.svg +47 -0
- package/package.json +103 -0
- package/src/commands/obs-agents-runtime.ts +150 -0
- package/src/commands/obs-agents.ts +491 -0
- package/src/commands/obs-args.ts +63 -0
- package/src/commands/obs-backfill.ts +1334 -0
- package/src/commands/obs-command-support.ts +43 -0
- package/src/commands/obs-cost.ts +228 -0
- package/src/commands/obs-diagnostics.ts +22 -0
- package/src/commands/obs-errors.ts +156 -0
- package/src/commands/obs-health.ts +301 -0
- package/src/commands/obs-link.ts +90 -0
- package/src/commands/obs-logs.ts +194 -0
- package/src/commands/obs-loki-summary.ts +184 -0
- package/src/commands/obs-session.ts +259 -0
- package/src/commands/obs-status.ts +359 -0
- package/src/commands/obs-tools.ts +274 -0
- package/src/commands/obs-trace.ts +411 -0
- package/src/commands/obs.ts +211 -0
- package/src/config/bootstrap-project-config.ts +300 -0
- package/src/config/defaults.ts +143 -0
- package/src/config/load-config.ts +631 -0
- package/src/config/project-paths.ts +61 -0
- package/src/config/schema.ts +405 -0
- package/src/config/validate.ts +456 -0
- package/src/constants.ts +4 -0
- package/src/diagnostics/sanitize.ts +6 -0
- package/src/extension.ts +38 -0
- package/src/otel/logs.ts +160 -0
- package/src/otel/metrics.ts +165 -0
- package/src/otel/otlp-endpoint.ts +10 -0
- package/src/otel/sdk.ts +114 -0
- package/src/otel/shutdown.ts +102 -0
- package/src/otel/traces.ts +166 -0
- package/src/pi/agent-lineage.ts +378 -0
- package/src/pi/agent-tree-tracker.ts +258 -0
- package/src/pi/event-handlers/agent-turn.ts +155 -0
- package/src/pi/event-handlers/lifecycle.ts +642 -0
- package/src/pi/event-handlers/llm.ts +115 -0
- package/src/pi/event-handlers/session-events.ts +159 -0
- package/src/pi/event-handlers/tool-bash.ts +275 -0
- package/src/pi/handler-internals.ts +2154 -0
- package/src/pi/handler-runtime.ts +633 -0
- package/src/pi/handler-types.ts +261 -0
- package/src/pi/handlers.ts +75 -0
- package/src/pi/subagent-spawn.ts +975 -0
- package/src/pi/subagent-types.ts +29 -0
- package/src/privacy/content-capture.ts +104 -0
- package/src/privacy/hash.ts +93 -0
- package/src/privacy/redact.ts +619 -0
- package/src/privacy/secret-patterns.ts +185 -0
- package/src/privacy/truncate.ts +69 -0
- package/src/query/grafana-readiness.ts +164 -0
- package/src/query/grafana-transport.ts +481 -0
- package/src/query/grafana.ts +371 -0
- package/src/query/loki.ts +332 -0
- package/src/query/prometheus.ts +388 -0
- package/src/query/tempo.ts +332 -0
- package/src/safety/sensitive-input.ts +208 -0
- package/src/semconv/attributes.ts +279 -0
- package/src/semconv/metrics.ts +146 -0
- package/src/semconv/spans.ts +19 -0
- package/src/semconv/values.ts +13 -0
- package/src/util/bounded-map.ts +97 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
# ObservMe Testing, Release, and Operations
|
|
2
|
+
|
|
3
|
+
## 1. Test Strategy
|
|
4
|
+
|
|
5
|
+
ObservMe must be tested at five levels:
|
|
6
|
+
|
|
7
|
+
1. Unit tests
|
|
8
|
+
2. Contract tests against Pi event payloads
|
|
9
|
+
3. Integration tests with OTEL Collector
|
|
10
|
+
4. Backend tests with Grafana stack
|
|
11
|
+
5. Chaos and failure tests
|
|
12
|
+
|
|
13
|
+
## 2. Unit Tests
|
|
14
|
+
|
|
15
|
+
Required areas:
|
|
16
|
+
|
|
17
|
+
- Config loading and precedence
|
|
18
|
+
- Redaction patterns
|
|
19
|
+
- Hashing stability
|
|
20
|
+
- Truncation behavior
|
|
21
|
+
- Attribute mapping
|
|
22
|
+
- Metric label cardinality checks
|
|
23
|
+
- Span registry eviction
|
|
24
|
+
- Agent lineage ID generation and propagation
|
|
25
|
+
- Safe handler error isolation
|
|
26
|
+
|
|
27
|
+
## 3. Event Mapping Tests
|
|
28
|
+
|
|
29
|
+
Use JSON fixtures for Pi session entries and extension event payloads:
|
|
30
|
+
|
|
31
|
+
```text
|
|
32
|
+
test/fixtures/session-user-message.json
|
|
33
|
+
test/fixtures/session-assistant-usage.json
|
|
34
|
+
test/fixtures/session-assistant-usage-reasoning-cache.json
|
|
35
|
+
test/fixtures/tool-result-error.json
|
|
36
|
+
test/fixtures/bash-execution.json
|
|
37
|
+
test/fixtures/compaction.json
|
|
38
|
+
test/fixtures/branch-summary.json
|
|
39
|
+
test/fixtures/events/session-start.json
|
|
40
|
+
test/fixtures/events/agent-start-end.json
|
|
41
|
+
test/fixtures/events/turn-start-end.json
|
|
42
|
+
test/fixtures/events/message-end-assistant.json
|
|
43
|
+
test/fixtures/events/tool-execution-start-end.json
|
|
44
|
+
test/fixtures/events/session-compact.json
|
|
45
|
+
test/fixtures/events/session-tree.json
|
|
46
|
+
test/fixtures/events/subagent-spawn.json
|
|
47
|
+
test/fixtures/events/agent-wait-join.json
|
|
48
|
+
test/fixtures/events/orphan-agent.json
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Assertions:
|
|
52
|
+
|
|
53
|
+
- Correct span name or documented GenAI-compatible provider span name
|
|
54
|
+
- Correct `pi.*`, `observme.*`, and applicable `gen_ai.*` attributes
|
|
55
|
+
- No forbidden metric labels, including workflow IDs, session IDs, or agent IDs
|
|
56
|
+
- Agent-run spans are parented under session spans, and turn spans under agent-run spans when available
|
|
57
|
+
- Subagent spawn telemetry carries workflow/parent/root/depth attributes and trace context when configured
|
|
58
|
+
- Agent wait/join telemetry exposes child status and critical-path timing without high-cardinality metric labels
|
|
59
|
+
- Orphan-agent and trace-context propagation failure metrics/logs are emitted when lineage is missing or malformed
|
|
60
|
+
- Optional content absent by default
|
|
61
|
+
- Redacted content when capture enabled
|
|
62
|
+
|
|
63
|
+
## 4. Redaction Tests
|
|
64
|
+
|
|
65
|
+
Test cases must include:
|
|
66
|
+
|
|
67
|
+
- AWS keys
|
|
68
|
+
- GitHub tokens
|
|
69
|
+
- bearer tokens
|
|
70
|
+
- OpenAI-like keys
|
|
71
|
+
- Anthropic-like keys
|
|
72
|
+
- Slack tokens
|
|
73
|
+
- password assignments
|
|
74
|
+
- private key blocks
|
|
75
|
+
- environment variable dumps
|
|
76
|
+
- filesystem paths
|
|
77
|
+
- URL credentials
|
|
78
|
+
|
|
79
|
+
Example assertion:
|
|
80
|
+
|
|
81
|
+
```text
|
|
82
|
+
Input: Authorization: <Bearer abcdefghijklmnopqrstuvwxyz123456>
|
|
83
|
+
Output: Authorization: [REDACTED:bearer:<hash>]
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## 5. Collector Integration Tests
|
|
87
|
+
|
|
88
|
+
Run Collector with debug exporter:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
docker run --rm \
|
|
92
|
+
-p 4317:4317 \
|
|
93
|
+
-p 4318:4318 \
|
|
94
|
+
-v "$PWD/test/collector-debug.yaml:/etc/otelcol/config.yaml" \
|
|
95
|
+
otel/opentelemetry-collector:latest
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
The core Collector image is sufficient for this debug config. Test production configs with the exact target distribution, for example Collector Contrib or Grafana Alloy when using `prometheusremotewrite`, `tail_sampling`, or other contrib-only components.
|
|
99
|
+
|
|
100
|
+
Test:
|
|
101
|
+
|
|
102
|
+
- Traces arrive
|
|
103
|
+
- Metrics arrive
|
|
104
|
+
- Logs arrive
|
|
105
|
+
- Attributes are present
|
|
106
|
+
- Content capture defaults are respected
|
|
107
|
+
|
|
108
|
+
## 6. Grafana Stack Integration Tests
|
|
109
|
+
|
|
110
|
+
Use Docker Compose with:
|
|
111
|
+
|
|
112
|
+
- Collector
|
|
113
|
+
- Tempo
|
|
114
|
+
- Loki
|
|
115
|
+
- Prometheus or Mimir
|
|
116
|
+
- Grafana
|
|
117
|
+
|
|
118
|
+
Tests:
|
|
119
|
+
|
|
120
|
+
- Tempo trace query by trace id
|
|
121
|
+
- Tempo or Loki query by `pi.agent.id` / `pi.agent.parent_id` for lineage
|
|
122
|
+
- Loki log query by session id
|
|
123
|
+
- Prometheus metric query for token totals
|
|
124
|
+
- Grafana dashboard import validates
|
|
125
|
+
|
|
126
|
+
## 7. Failure Tests
|
|
127
|
+
|
|
128
|
+
### Collector Down
|
|
129
|
+
|
|
130
|
+
Expected:
|
|
131
|
+
|
|
132
|
+
- Pi continues.
|
|
133
|
+
- ObservMe increments drop/export error metrics if possible.
|
|
134
|
+
- No unhandled exception.
|
|
135
|
+
|
|
136
|
+
### Collector Slow
|
|
137
|
+
|
|
138
|
+
Expected:
|
|
139
|
+
|
|
140
|
+
- Export timeout triggers.
|
|
141
|
+
- Handler latency remains below budget.
|
|
142
|
+
|
|
143
|
+
### Subagent Without Propagated Context
|
|
144
|
+
|
|
145
|
+
Expected:
|
|
146
|
+
|
|
147
|
+
- Child agent still starts and exports telemetry.
|
|
148
|
+
- Child telemetry includes `pi.workflow.id`, `pi.agent.parent_id`, and `pi.agent.root_id` if provided by environment.
|
|
149
|
+
- If no parent context is available, child is marked as root or orphan according to config.
|
|
150
|
+
- `observme_trace_context_propagation_failures_total` or `observme_orphan_agents_total` increments as appropriate.
|
|
151
|
+
- No high-cardinality workflow IDs or agent IDs are emitted as metric labels.
|
|
152
|
+
|
|
153
|
+
### Runaway Fan-Out or Depth
|
|
154
|
+
|
|
155
|
+
Expected:
|
|
156
|
+
|
|
157
|
+
- Pi continues unless a separate policy extension blocks execution.
|
|
158
|
+
- Fan-out/depth metrics update (`observme_agent_fanout_count`, `observme_agent_tree_depth`).
|
|
159
|
+
- Alerts can fire from dashboard/alert rules.
|
|
160
|
+
- No high-cardinality workflow/parent/child IDs are emitted as metric labels.
|
|
161
|
+
|
|
162
|
+
### Queue Full
|
|
163
|
+
|
|
164
|
+
Expected:
|
|
165
|
+
|
|
166
|
+
- Telemetry drops.
|
|
167
|
+
- Drop counter increments.
|
|
168
|
+
- Memory remains bounded.
|
|
169
|
+
|
|
170
|
+
### Redaction Exception
|
|
171
|
+
|
|
172
|
+
Expected:
|
|
173
|
+
|
|
174
|
+
- Field is dropped.
|
|
175
|
+
- Redaction failure metric increments.
|
|
176
|
+
- No raw value exported.
|
|
177
|
+
|
|
178
|
+
## 8. Performance Tests
|
|
179
|
+
|
|
180
|
+
Synthetic workload:
|
|
181
|
+
|
|
182
|
+
```text
|
|
183
|
+
100 sessions
|
|
184
|
+
1,000 turns/session
|
|
185
|
+
5 tool calls/turn
|
|
186
|
+
2 LLM calls/turn
|
|
187
|
+
1 subagent spawn every 20 turns
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Required measurements:
|
|
191
|
+
|
|
192
|
+
- handler duration p50/p95/p99
|
|
193
|
+
- memory growth
|
|
194
|
+
- dropped telemetry count
|
|
195
|
+
- export batch sizes
|
|
196
|
+
- CPU overhead
|
|
197
|
+
|
|
198
|
+
Targets:
|
|
199
|
+
|
|
200
|
+
```text
|
|
201
|
+
handler p95 < 10ms
|
|
202
|
+
handler p99 < 25ms
|
|
203
|
+
steady memory < configured limit
|
|
204
|
+
no unbounded maps
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## 9. Cardinality Tests
|
|
208
|
+
|
|
209
|
+
Ensure metrics do not include:
|
|
210
|
+
|
|
211
|
+
- workflow id
|
|
212
|
+
- session id
|
|
213
|
+
- agent id
|
|
214
|
+
- parent agent id
|
|
215
|
+
- child agent id
|
|
216
|
+
- agent run id
|
|
217
|
+
- spawn id
|
|
218
|
+
- spawn tool call id
|
|
219
|
+
- trace id
|
|
220
|
+
- span id
|
|
221
|
+
- entry id
|
|
222
|
+
- raw path
|
|
223
|
+
- raw command
|
|
224
|
+
- raw prompt
|
|
225
|
+
- raw error
|
|
226
|
+
|
|
227
|
+
Reject or sanitize dynamically generated labels.
|
|
228
|
+
|
|
229
|
+
## 10. Release Process
|
|
230
|
+
|
|
231
|
+
1. Update version.
|
|
232
|
+
2. Run unit tests.
|
|
233
|
+
3. Run integration tests.
|
|
234
|
+
4. Run redaction corpus tests.
|
|
235
|
+
5. Run dashboard JSON validation.
|
|
236
|
+
6. Run Collector config validation.
|
|
237
|
+
7. Generate changelog.
|
|
238
|
+
8. Publish package/artifact.
|
|
239
|
+
9. Tag release.
|
|
240
|
+
|
|
241
|
+
## 11. Compatibility Matrix
|
|
242
|
+
|
|
243
|
+
Maintain a tested matrix:
|
|
244
|
+
|
|
245
|
+
```text
|
|
246
|
+
Pi version
|
|
247
|
+
Node.js version
|
|
248
|
+
OpenTelemetry JS package set
|
|
249
|
+
Collector distribution and version
|
|
250
|
+
Tempo version
|
|
251
|
+
Loki version
|
|
252
|
+
Prometheus/Mimir version
|
|
253
|
+
Grafana version
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
## 12. Operational Metrics for ObservMe Itself
|
|
257
|
+
|
|
258
|
+
ObservMe must emit self-observability metrics:
|
|
259
|
+
|
|
260
|
+
```text
|
|
261
|
+
observme_events_observed_total
|
|
262
|
+
observme_handler_errors_total
|
|
263
|
+
observme_handler_duration_ms
|
|
264
|
+
observme_telemetry_dropped_total
|
|
265
|
+
observme_export_errors_total
|
|
266
|
+
observme_redaction_failures_total
|
|
267
|
+
observme_active_spans
|
|
268
|
+
observme_active_agents
|
|
269
|
+
observme_workflows_started_total
|
|
270
|
+
observme_workflows_completed_total
|
|
271
|
+
observme_workflow_errors_total
|
|
272
|
+
observme_workflow_duration_ms
|
|
273
|
+
observme_agent_runs_total
|
|
274
|
+
observme_subagents_spawned_total
|
|
275
|
+
observme_subagent_spawn_failures_total
|
|
276
|
+
observme_orphan_agents_total
|
|
277
|
+
observme_trace_context_propagation_failures_total
|
|
278
|
+
observme_child_agent_failures_total
|
|
279
|
+
observme_agent_fanout_count
|
|
280
|
+
observme_agent_tree_depth
|
|
281
|
+
observme_agent_tree_width
|
|
282
|
+
observme_agent_wait_duration_ms
|
|
283
|
+
observme_agent_join_duration_ms
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
## 13. Export Health operational contract
|
|
287
|
+
|
|
288
|
+
The Export Health dashboard is considered operationally useful when it proves both healthy liveness and induced failure visibility without changing a user's working local setup.
|
|
289
|
+
|
|
290
|
+
Healthy local validation:
|
|
291
|
+
|
|
292
|
+
- Keep the existing trusted-project setup and configured local OTLP endpoint; do not change `/obs status`, `/obs health`, Grafana auth/profile, or local debug capture settings to satisfy this contract.
|
|
293
|
+
- Generate representative Pi handler activity and verify `observme_events_observed_total` increases.
|
|
294
|
+
- Verify failure-only stat panels display `0` when no matching series exists for telemetry drops, redaction failures, export failures, or handler failures.
|
|
295
|
+
- Treat empty Loki tables for `telemetry.dropped`, `redaction.failed`, `export.failed`, and `trace_context.propagation_failed` as healthy when no matching failure was induced.
|
|
296
|
+
|
|
297
|
+
Induced failure validation:
|
|
298
|
+
|
|
299
|
+
- Queue-full or bounded-registry eviction increments `observme_telemetry_dropped_total` with bounded `reason` labels and emits a `telemetry.dropped` log.
|
|
300
|
+
- Redaction exceptions increment `observme_redaction_failures_total` with bounded `operation`/`error_class` labels and emit a `redaction.failed` log without raw content.
|
|
301
|
+
- Export failures increment `observme_export_errors_total` with bounded `reason`/`error_class` labels and emit existing `export.failed` logs.
|
|
302
|
+
- Subagent trace-context propagation failures increment the documented counter and emit `trace_context.propagation_failed` logs.
|
|
303
|
+
- Active span pressure is visible through `observme_active_spans` by bounded `operation`; normal completion, eviction, and shutdown must not leave negative or leaked gauge values.
|
|
304
|
+
|
|
305
|
+
Label validation for Export Health metrics is limited to `operation`, `reason`, `error_class`, and `status` where needed. Session IDs, workflow IDs, agent IDs, trace/span IDs, entry IDs, raw prompts, raw paths, raw commands, and raw error messages remain span/log attributes or are omitted; they are never metric labels.
|
|
306
|
+
|
|
307
|
+
## 14. Support Procedure
|
|
308
|
+
|
|
309
|
+
When troubleshooting:
|
|
310
|
+
|
|
311
|
+
1. Run `/obs status`.
|
|
312
|
+
2. Run `/obs health`.
|
|
313
|
+
3. Run `/obs agents` when troubleshooting workflow, parent/subagent lineage, fan-out, depth, or orphan agents.
|
|
314
|
+
4. Check Collector health endpoint.
|
|
315
|
+
5. Check Collector logs.
|
|
316
|
+
6. Query `observme_export_errors_total`.
|
|
317
|
+
7. Query Loki for `event_name="export.failed"` (or equivalent normalized structured metadata).
|
|
318
|
+
8. Temporarily enable debug exporter in Collector.
|
|
319
|
+
9. Never enable raw content capture in production without approval.
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
# ObservMe Deployment Runbooks
|
|
2
|
+
|
|
3
|
+
## 1. Local Debug Runbook
|
|
4
|
+
|
|
5
|
+
### Start Collector
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
cat > collector-debug.yaml <<'YAML'
|
|
9
|
+
receivers:
|
|
10
|
+
otlp:
|
|
11
|
+
protocols:
|
|
12
|
+
grpc:
|
|
13
|
+
endpoint: 0.0.0.0:4317
|
|
14
|
+
http:
|
|
15
|
+
endpoint: 0.0.0.0:4318
|
|
16
|
+
exporters:
|
|
17
|
+
debug:
|
|
18
|
+
verbosity: detailed
|
|
19
|
+
processors:
|
|
20
|
+
batch: {}
|
|
21
|
+
service:
|
|
22
|
+
pipelines:
|
|
23
|
+
traces:
|
|
24
|
+
receivers: [otlp]
|
|
25
|
+
processors: [batch]
|
|
26
|
+
exporters: [debug]
|
|
27
|
+
metrics:
|
|
28
|
+
receivers: [otlp]
|
|
29
|
+
processors: [batch]
|
|
30
|
+
exporters: [debug]
|
|
31
|
+
logs:
|
|
32
|
+
receivers: [otlp]
|
|
33
|
+
processors: [batch]
|
|
34
|
+
exporters: [debug]
|
|
35
|
+
YAML
|
|
36
|
+
|
|
37
|
+
docker run --rm -p 4317:4317 -p 4318:4318 \
|
|
38
|
+
-v "$PWD/collector-debug.yaml:/etc/otelcol/config.yaml" \
|
|
39
|
+
otel/opentelemetry-collector:latest
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
This debug config uses only core Collector components. Production configs that use `prometheusremotewrite`, `tail_sampling`, or other contrib components must run a distribution that includes those components.
|
|
43
|
+
|
|
44
|
+
### Configure ObservMe
|
|
45
|
+
|
|
46
|
+
```yaml
|
|
47
|
+
otlp:
|
|
48
|
+
endpoint: http://localhost:4318 # ObservMe base endpoint; SDK exporters use /v1/traces, /v1/metrics, /v1/logs
|
|
49
|
+
protocol: http/protobuf
|
|
50
|
+
traces:
|
|
51
|
+
enabled: true
|
|
52
|
+
metrics:
|
|
53
|
+
enabled: true
|
|
54
|
+
logs:
|
|
55
|
+
enabled: true
|
|
56
|
+
capture:
|
|
57
|
+
prompts: false
|
|
58
|
+
responses: false
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Validate
|
|
62
|
+
|
|
63
|
+
Run Pi with ObservMe loaded and execute:
|
|
64
|
+
|
|
65
|
+
```text
|
|
66
|
+
/obs status
|
|
67
|
+
/obs health
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## 2. Docker Compose LGTM Runbook
|
|
71
|
+
|
|
72
|
+
Services:
|
|
73
|
+
|
|
74
|
+
- otel-collector
|
|
75
|
+
- tempo
|
|
76
|
+
- loki
|
|
77
|
+
- prometheus
|
|
78
|
+
- grafana
|
|
79
|
+
|
|
80
|
+
Recommended ports:
|
|
81
|
+
|
|
82
|
+
```text
|
|
83
|
+
4317 collector OTLP gRPC
|
|
84
|
+
4318 collector OTLP HTTP
|
|
85
|
+
3000 grafana
|
|
86
|
+
3100 loki
|
|
87
|
+
3200 tempo
|
|
88
|
+
9090 prometheus
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## 3. CI Agent Runbook
|
|
92
|
+
|
|
93
|
+
CI agents are short lived. Use one of:
|
|
94
|
+
|
|
95
|
+
### Option A: Direct to central Collector
|
|
96
|
+
|
|
97
|
+
```text
|
|
98
|
+
Pi CI job -> central collector
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Simplest. Requires network availability and credentials.
|
|
102
|
+
|
|
103
|
+
### Option B: Sidecar Collector
|
|
104
|
+
|
|
105
|
+
```text
|
|
106
|
+
Pi CI job -> sidecar collector -> central collector
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Best for high-volume jobs because Pi hands off telemetry locally.
|
|
110
|
+
|
|
111
|
+
Shutdown steps:
|
|
112
|
+
|
|
113
|
+
1. Parent Pi passes trace context, `OBSERVME_WORKFLOW_ID`, and `OBSERVME_PARENT_AGENT_ID`/`OBSERVME_ROOT_AGENT_ID` to any child Pi processes it launches.
|
|
114
|
+
2. Pi exits.
|
|
115
|
+
3. ObservMe flushes with timeout.
|
|
116
|
+
4. Sidecar collector drains with timeout.
|
|
117
|
+
5. CI job ends.
|
|
118
|
+
|
|
119
|
+
## 4. Production Configuration Checklist
|
|
120
|
+
|
|
121
|
+
- [ ] OTLP endpoint uses TLS or private network.
|
|
122
|
+
- [ ] Authentication configured.
|
|
123
|
+
- [ ] Prompts disabled by default.
|
|
124
|
+
- [ ] Responses disabled by default.
|
|
125
|
+
- [ ] Tool arguments disabled by default.
|
|
126
|
+
- [ ] Redaction enabled.
|
|
127
|
+
- [ ] Metric labels audited for cardinality.
|
|
128
|
+
- [ ] Agent IDs, session IDs, trace IDs, and spawn IDs are not metric labels.
|
|
129
|
+
- [ ] Workflow/subagent lineage propagation is enabled where subagents are used.
|
|
130
|
+
- [ ] Workflow/agent-tree alerts are tuned for expected max depth, fan-out, active-agent count, and cost budget.
|
|
131
|
+
- [ ] Collector distribution contains every configured component.
|
|
132
|
+
- [ ] Collector memory limiter enabled.
|
|
133
|
+
- [ ] Collector batch processor enabled.
|
|
134
|
+
- [ ] Loki structured metadata enabled when required by the deployed Loki version.
|
|
135
|
+
- [ ] Prometheus OTLP receiver enabled with `--web.enable-otlp-receiver` if sending directly to Prometheus.
|
|
136
|
+
- [ ] Backend retention configured.
|
|
137
|
+
- [ ] Dashboards imported.
|
|
138
|
+
- [ ] Alerts enabled.
|
|
139
|
+
- [ ] `/obs health` succeeds.
|
|
140
|
+
- [ ] `/obs agents` shows expected workflow/root/subagent lineage, depth, fan-out, active-child count, and orphan count when subagents are enabled.
|
|
141
|
+
|
|
142
|
+
## 5. Common Incidents
|
|
143
|
+
|
|
144
|
+
### No Traces in Tempo
|
|
145
|
+
|
|
146
|
+
Check:
|
|
147
|
+
|
|
148
|
+
1. `/obs status` traces enabled
|
|
149
|
+
2. Collector receives traces
|
|
150
|
+
3. Collector trace pipeline exports to Tempo
|
|
151
|
+
4. Tempo OTLP endpoint reachable
|
|
152
|
+
5. Grafana Tempo datasource configured
|
|
153
|
+
|
|
154
|
+
### No Logs in Loki
|
|
155
|
+
|
|
156
|
+
Check:
|
|
157
|
+
|
|
158
|
+
1. Logs enabled in ObservMe
|
|
159
|
+
2. Collector logs pipeline configured
|
|
160
|
+
3. Loki accepts the OTLP endpoint (`/otlp` for Collector `otlphttp` exporter)
|
|
161
|
+
4. Structured metadata enabled if required
|
|
162
|
+
5. Queries use normalized attribute names such as `event_name` and `pi_session_id`
|
|
163
|
+
6. Label cardinality within limits
|
|
164
|
+
|
|
165
|
+
### No Metrics in Prometheus
|
|
166
|
+
|
|
167
|
+
Check:
|
|
168
|
+
|
|
169
|
+
1. Metrics enabled in ObservMe
|
|
170
|
+
2. Collector metrics pipeline configured
|
|
171
|
+
3. Prometheus OTLP receiver enabled (`--web.enable-otlp-receiver`) and exporter endpoint set to base `/api/v1/otlp` or explicit signal URL `/api/v1/otlp/v1/metrics`, or scrape endpoint configured
|
|
172
|
+
4. Metric names visible
|
|
173
|
+
5. Resource attributes not unexpectedly dropped
|
|
174
|
+
|
|
175
|
+
### Subagents Not Linked to Parent
|
|
176
|
+
|
|
177
|
+
Check:
|
|
178
|
+
|
|
179
|
+
1. Parent runtime creates `pi.agent.spawn` spans.
|
|
180
|
+
2. Child process receives `traceparent`/`tracestate` or parent trace/span fallback attributes.
|
|
181
|
+
3. Child process receives `OBSERVME_WORKFLOW_ID`, `OBSERVME_PARENT_AGENT_ID`, `OBSERVME_ROOT_AGENT_ID`, and `OBSERVME_AGENT_DEPTH`.
|
|
182
|
+
4. Queries use normalized attribute names such as `pi_workflow_id`, `pi_agent_id`, `pi_agent_parent_id`, and `pi_agent_root_id`.
|
|
183
|
+
5. Collector/Loki configuration has not promoted high-cardinality workflow IDs or agent IDs to index labels unless explicitly accepted.
|
|
184
|
+
|
|
185
|
+
### High Telemetry Drops
|
|
186
|
+
|
|
187
|
+
Actions:
|
|
188
|
+
|
|
189
|
+
1. Increase collector capacity.
|
|
190
|
+
2. Increase SDK queue within memory budget.
|
|
191
|
+
3. Reduce content capture.
|
|
192
|
+
4. Add sampling.
|
|
193
|
+
5. Increase batch size.
|
|
194
|
+
|
|
195
|
+
### Sensitive Data Found
|
|
196
|
+
|
|
197
|
+
Actions:
|
|
198
|
+
|
|
199
|
+
1. Disable capture immediately.
|
|
200
|
+
2. Rotate exposed secrets.
|
|
201
|
+
3. Reduce backend retention or delete data according to backend process.
|
|
202
|
+
4. Add redaction test case.
|
|
203
|
+
5. Release hotfix.
|