@documentation-robotics/cli 0.2.0 → 0.3.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/README.md +36 -2
- package/dist/analysis/relationship-classifier.js +2 -9
- package/dist/analysis/relationship-classifier.js.map +2 -2
- package/dist/analyzers/call-graph-utils.js +2 -2
- package/dist/analyzers/call-graph-utils.js.map +2 -2
- package/dist/analyzers/cards/build.js +171 -0
- package/dist/analyzers/cards/build.js.map +7 -0
- package/dist/analyzers/cards/classify.js +42 -0
- package/dist/analyzers/cards/classify.js.map +7 -0
- package/dist/analyzers/cards/edge-index.js +44 -0
- package/dist/analyzers/cards/edge-index.js.map +7 -0
- package/dist/analyzers/cards/facts.js +46 -0
- package/dist/analyzers/cards/facts.js.map +7 -0
- package/dist/analyzers/cards/graph.js +42 -0
- package/dist/analyzers/cards/graph.js.map +7 -0
- package/dist/analyzers/cards/index.js +8 -0
- package/dist/analyzers/cards/index.js.map +7 -0
- package/dist/analyzers/cards/tier0.js +18 -0
- package/dist/analyzers/cards/tier0.js.map +7 -0
- package/dist/analyzers/cards/types.js +1 -0
- package/dist/analyzers/cards/types.js.map +7 -0
- package/dist/analyzers/cbm-analyzer.js +195 -171
- package/dist/analyzers/cbm-analyzer.js.map +2 -2
- package/dist/analyzers/cbm-responses.js +336 -0
- package/dist/analyzers/cbm-responses.js.map +7 -0
- package/dist/analyzers/edge-relationships.js +45 -0
- package/dist/analyzers/edge-relationships.js.map +7 -0
- package/dist/analyzers/mapping-loader.js +9 -0
- package/dist/analyzers/mapping-loader.js.map +2 -2
- package/dist/analyzers/tier0-rules.js +153 -0
- package/dist/analyzers/tier0-rules.js.map +7 -0
- package/dist/analyzers/types.js.map +1 -1
- package/dist/audit/relationships/ai/prompts.js +10 -10
- package/dist/audit/relationships/ai/prompts.js.map +2 -2
- package/dist/audit/relationships/analysis/layer-templates.js +52 -52
- package/dist/audit/relationships/analysis/layer-templates.js.map +1 -1
- package/dist/cli.js +12 -2
- package/dist/cli.js.map +2 -2
- package/dist/coding-agents/default-permissions.js +31 -1
- package/dist/coding-agents/default-permissions.js.map +2 -2
- package/dist/coding-agents/drbot-mcp.js +167 -0
- package/dist/coding-agents/drbot-mcp.js.map +7 -0
- package/dist/commands/add.js +3 -2
- package/dist/commands/add.js.map +2 -2
- package/dist/commands/analyzer.js +117 -14
- package/dist/commands/analyzer.js.map +2 -2
- package/dist/commands/changeset-verify.js +55 -0
- package/dist/commands/changeset-verify.js.map +7 -0
- package/dist/commands/changeset.js +43 -22
- package/dist/commands/changeset.js.map +2 -2
- package/dist/commands/delete.js +10 -4
- package/dist/commands/delete.js.map +2 -2
- package/dist/commands/farm.js +176 -60
- package/dist/commands/farm.js.map +2 -2
- package/dist/commands/mcp.js +19 -4
- package/dist/commands/mcp.js.map +2 -2
- package/dist/commands/relationship.js +207 -26
- package/dist/commands/relationship.js.map +2 -2
- package/dist/commands/update.js +42 -23
- package/dist/commands/update.js.map +2 -2
- package/dist/commands/upgrade.js +99 -11
- package/dist/commands/upgrade.js.map +3 -3
- package/dist/commands/version.js +1 -1
- package/dist/commands/visualize.js +4 -3
- package/dist/commands/visualize.js.map +2 -2
- package/dist/core/catalog-migration.js +33 -0
- package/dist/core/catalog-migration.js.map +7 -0
- package/dist/core/changeset-analysis.js +421 -0
- package/dist/core/changeset-analysis.js.map +7 -0
- package/dist/core/changeset-base-index.js +153 -0
- package/dist/core/changeset-base-index.js.map +7 -0
- package/dist/core/changeset-brief-delta.js +102 -0
- package/dist/core/changeset-brief-delta.js.map +7 -0
- package/dist/core/changeset-graph.js +281 -0
- package/dist/core/changeset-graph.js.map +7 -0
- package/dist/core/changeset-only-guard.js +32 -0
- package/dist/core/changeset-only-guard.js.map +7 -0
- package/dist/core/changeset-summary.js +68 -0
- package/dist/core/changeset-summary.js.map +7 -0
- package/dist/core/changeset-validator.js +66 -20
- package/dist/core/changeset-validator.js.map +2 -2
- package/dist/core/changeset-verify.js +518 -0
- package/dist/core/changeset-verify.js.map +7 -0
- package/dist/core/changeset.js +56 -9
- package/dist/core/changeset.js.map +2 -2
- package/dist/core/element-type-migration.js +145 -0
- package/dist/core/element-type-migration.js.map +7 -0
- package/dist/core/farm-manifest.js +12 -6
- package/dist/core/farm-manifest.js.map +2 -2
- package/dist/core/farm-sync-engine.js +1 -1
- package/dist/core/farm-sync-engine.js.map +2 -2
- package/dist/core/farm-sync-state.js +10 -2
- package/dist/core/farm-sync-state.js.map +2 -2
- package/dist/core/migration-registry.js +75 -46
- package/dist/core/migration-registry.js.map +2 -2
- package/dist/core/model-upgrade.js +102 -0
- package/dist/core/model-upgrade.js.map +7 -0
- package/dist/core/model.js +82 -30
- package/dist/core/model.js.map +2 -2
- package/dist/core/mutation-handler.js +71 -6
- package/dist/core/mutation-handler.js.map +2 -2
- package/dist/core/relationship-migration-table.js +6639 -0
- package/dist/core/relationship-migration-table.js.map +7 -0
- package/dist/core/relationship-migration.js +272 -0
- package/dist/core/relationship-migration.js.map +7 -0
- package/dist/core/relationship-prune.js +49 -0
- package/dist/core/relationship-prune.js.map +7 -0
- package/dist/core/relationship-staging.js +68 -0
- package/dist/core/relationship-staging.js.map +7 -0
- package/dist/core/relationships.js +26 -4
- package/dist/core/relationships.js.map +2 -2
- package/dist/core/report-data-model.js +7 -13
- package/dist/core/report-data-model.js.map +2 -2
- package/dist/core/staged-changeset-storage.js +64 -17
- package/dist/core/staged-changeset-storage.js.map +2 -2
- package/dist/core/staged-source-reference.js +28 -0
- package/dist/core/staged-source-reference.js.map +7 -0
- package/dist/core/staging-area.js +83 -18
- package/dist/core/staging-area.js.map +2 -2
- package/dist/core/virtual-projection.js +13 -5
- package/dist/core/virtual-projection.js.map +2 -2
- package/dist/export/archimate-exporter.js +1 -0
- package/dist/export/archimate-exporter.js.map +2 -2
- package/dist/generated/compiled-validators.js +2 -2
- package/dist/generated/compiled-validators.js.map +2 -2
- package/dist/generated/layer-registry.js +16 -16
- package/dist/generated/layer-registry.js.map +2 -2
- package/dist/generated/node-types.js +186 -168
- package/dist/generated/node-types.js.map +2 -2
- package/dist/generated/relationship-index.js +2236 -7790
- package/dist/generated/relationship-index.js.map +2 -2
- package/dist/integrations/claude_code/agents/dr-architect.md +16 -3
- package/dist/integrations/claude_code/agents/dr-extractor.md +1 -1
- package/dist/integrations/claude_code/commands/dr-analyzer.md +565 -0
- package/dist/integrations/claude_code/commands/dr-map.md +13 -0
- package/dist/integrations/claude_code/commands/dr-plan.md +40 -0
- package/dist/integrations/claude_code/commands/dr-relate.md +106 -96
- package/dist/integrations/claude_code/commands/dr-verify.md +45 -2
- package/dist/integrations/claude_code/docs/END_TO_END_WALKTHROUGH.md +14 -0
- package/dist/integrations/claude_code/docs/MCP_SERVER.md +26 -2
- package/dist/integrations/claude_code/docs/QUICK_START.md +37 -8
- package/dist/integrations/claude_code/docs/README.md +48 -1
- package/dist/integrations/claude_code/skills/dr_01_motivation_layer/SKILL.md +93 -72
- package/dist/integrations/claude_code/skills/dr_02_business_layer/SKILL.md +163 -126
- package/dist/integrations/claude_code/skills/dr_03_product_layer/SKILL.md +161 -126
- package/dist/integrations/claude_code/skills/dr_04_security_layer/SKILL.md +153 -133
- package/dist/integrations/claude_code/skills/dr_05_application_layer/SKILL.md +129 -100
- package/dist/integrations/claude_code/skills/dr_06_technology_layer/SKILL.md +111 -94
- package/dist/integrations/claude_code/skills/dr_07_api_layer/SKILL.md +143 -157
- package/dist/integrations/claude_code/skills/dr_08_data_model_layer/SKILL.md +117 -33
- package/dist/integrations/claude_code/skills/dr_09_dataset_layer/SKILL.md +74 -25
- package/dist/integrations/claude_code/skills/dr_10_ux_layer/SKILL.md +88 -12
- package/dist/integrations/claude_code/skills/dr_11_navigation_layer/SKILL.md +83 -24
- package/dist/integrations/claude_code/skills/dr_12_apm_layer/SKILL.md +57 -12
- package/dist/integrations/claude_code/skills/dr_13_testing_layer/SKILL.md +92 -15
- package/dist/integrations/claude_code/skills/dr_change_planning/SKILL.md +119 -0
- package/dist/integrations/claude_code/skills/dr_changeset_reviewer/SKILL.md +3 -0
- package/dist/integrations/claude_code/skills/dr_engineering_guide/SKILL.md +1 -1
- package/dist/integrations/github_copilot/agents/dr-architect.md +1 -1
- package/dist/integrations/github_copilot/skills/dr_01_motivation_layer/SKILL.md +182 -102
- package/dist/integrations/github_copilot/skills/dr_02_business_layer/SKILL.md +266 -148
- package/dist/integrations/github_copilot/skills/dr_03_product_layer/SKILL.md +547 -86
- package/dist/integrations/github_copilot/skills/dr_04_security_layer/SKILL.md +164 -169
- package/dist/integrations/github_copilot/skills/dr_05_application_layer/SKILL.md +420 -150
- package/dist/integrations/github_copilot/skills/dr_06_technology_layer/SKILL.md +331 -138
- package/dist/integrations/github_copilot/skills/dr_07_api_layer/SKILL.md +265 -201
- package/dist/integrations/github_copilot/skills/dr_08_data_model_layer/SKILL.md +181 -58
- package/dist/integrations/github_copilot/skills/dr_09_dataset_layer/SKILL.md +209 -57
- package/dist/integrations/github_copilot/skills/dr_10_ux_layer/SKILL.md +277 -112
- package/dist/integrations/github_copilot/skills/dr_11_navigation_layer/SKILL.md +219 -70
- package/dist/integrations/github_copilot/skills/dr_12_apm_layer/SKILL.md +189 -105
- package/dist/integrations/github_copilot/skills/dr_13_testing_layer/SKILL.md +222 -102
- package/dist/integrations/github_copilot/skills/dr_change_planning/SKILL.md +119 -0
- package/dist/integrations/github_copilot/skills/dr_changeset_reviewer/SKILL.md +3 -0
- package/dist/integrations/hash-utils.js.map +2 -2
- package/dist/mcp/api-key-manager.js +14 -1
- package/dist/mcp/api-key-manager.js.map +2 -2
- package/dist/mcp/changeset-only.js +34 -0
- package/dist/mcp/changeset-only.js.map +7 -0
- package/dist/mcp/tool-registry.js +19 -3
- package/dist/mcp/tool-registry.js.map +2 -2
- package/dist/mcp/tools/changeset-analysis-tools.js +78 -0
- package/dist/mcp/tools/changeset-analysis-tools.js.map +7 -0
- package/dist/mcp/tools/changeset-editing.js +184 -0
- package/dist/mcp/tools/changeset-editing.js.map +7 -0
- package/dist/mcp/tools/changeset-lifecycle.js +83 -0
- package/dist/mcp/tools/changeset-lifecycle.js.map +7 -0
- package/dist/mcp/tools/changeset-shared.js +31 -0
- package/dist/mcp/tools/changeset-shared.js.map +7 -0
- package/dist/mcp/tools/changeset-show.js +17 -1
- package/dist/mcp/tools/changeset-show.js.map +2 -2
- package/dist/mcp/tools/changeset-verify.js +43 -0
- package/dist/mcp/tools/changeset-verify.js.map +7 -0
- package/dist/mcp/tools/index.js +19 -1
- package/dist/mcp/tools/index.js.map +2 -2
- package/dist/mcp/tools/model-add.js +6 -5
- package/dist/mcp/tools/model-add.js.map +2 -2
- package/dist/mcp/tools/model-delete.js +2 -2
- package/dist/mcp/tools/model-delete.js.map +2 -2
- package/dist/mcp/tools/model-search.js +14 -0
- package/dist/mcp/tools/model-search.js.map +2 -2
- package/dist/mcp/tools/model-show.js +29 -2
- package/dist/mcp/tools/model-show.js.map +2 -2
- package/dist/mcp/tools/model-trace.js +93 -30
- package/dist/mcp/tools/model-trace.js.map +2 -2
- package/dist/mcp/tools/model-update.js +35 -19
- package/dist/mcp/tools/model-update.js.map +2 -2
- package/dist/mcp/tools/relationship-tools.js +98 -0
- package/dist/mcp/tools/relationship-tools.js.map +7 -0
- package/dist/mcp/tools/shared.js +25 -2
- package/dist/mcp/tools/shared.js.map +2 -2
- package/dist/mcp/tools/spec-type.js +90 -0
- package/dist/mcp/tools/spec-type.js.map +7 -0
- package/dist/schemas/bundled/analyzers/cbm.json +1186 -68
- package/dist/schemas/bundled/analyzers/manifest.json +2 -2
- package/dist/schemas/bundled/api.json +1029 -1658
- package/dist/schemas/bundled/apm.json +499 -734
- package/dist/schemas/bundled/application.json +735 -371
- package/dist/schemas/bundled/base.json +3 -220
- package/dist/schemas/bundled/business.json +452 -366
- package/dist/schemas/bundled/data-model.json +395 -411
- package/dist/schemas/bundled/data-store.json +334 -558
- package/dist/schemas/bundled/manifest.json +18 -18
- package/dist/schemas/bundled/motivation.json +349 -368
- package/dist/schemas/bundled/navigation.json +415 -731
- package/dist/schemas/bundled/product.json +325 -159
- package/dist/schemas/bundled/security.json +864 -1232
- package/dist/schemas/bundled/technology.json +574 -703
- package/dist/schemas/bundled/testing.json +718 -1643
- package/dist/schemas/bundled/ux.json +739 -1352
- package/dist/server/schemas.js +8 -0
- package/dist/server/schemas.js.map +2 -2
- package/dist/server/server.js +218 -34
- package/dist/server/server.js.map +2 -2
- package/dist/server-entry.js +2 -1
- package/dist/server-entry.js.map +2 -2
- package/dist/telemetry/index.js +1 -1
- package/dist/utils/ansi-suppressor.js +6 -8
- package/dist/utils/ansi-suppressor.js.map +2 -2
- package/dist/utils/attribute-patch.js +41 -0
- package/dist/utils/attribute-patch.js.map +7 -0
- package/dist/utils/error-hints.js +29 -0
- package/dist/utils/error-hints.js.map +7 -0
- package/dist/utils/errors.js +9 -3
- package/dist/utils/errors.js.map +2 -2
- package/dist/utils/project-paths.js +26 -1
- package/dist/utils/project-paths.js.map +2 -2
- package/dist/utils/source-reference.js +14 -12
- package/dist/utils/source-reference.js.map +2 -2
- package/dist/utils/spec-version.js +2 -2
- package/dist/utils/spec-version.js.map +1 -1
- package/dist/validators/composed-reference-validator.js +5 -27
- package/dist/validators/composed-reference-validator.js.map +2 -2
- package/dist/validators/reference-validator.js +0 -7
- package/dist/validators/reference-validator.js.map +2 -2
- package/dist/validators/relationship-schema-validator.js +3 -3
- package/dist/validators/relationship-schema-validator.js.map +2 -2
- package/dist/validators/schema-validator.js +27 -9
- package/dist/validators/schema-validator.js.map +2 -2
- package/dist/validators/types.js.map +1 -1
- package/dist/viewer/README.md +6 -6
- package/dist/viewer/assets/main-CxzcuU_o.js +84 -0
- package/dist/viewer/assets/main-j-7ULYpm.css +1 -0
- package/dist/viewer/index.html +2 -2
- package/dist/viewer/manifest.json +10 -10
- package/dist/viewer/version.json +1 -1
- package/package.json +2 -1
- package/dist/viewer/assets/main-B7AOQXXX.js +0 -81
- package/dist/viewer/assets/main-vdrFrG7q.css +0 -1
|
@@ -13,13 +13,13 @@ triggers:
|
|
|
13
13
|
"OpenTelemetry",
|
|
14
14
|
"telemetry"
|
|
15
15
|
]
|
|
16
|
-
version: 0.8.
|
|
16
|
+
version: 0.8.3
|
|
17
17
|
---
|
|
18
18
|
|
|
19
19
|
# APM Layer Skill
|
|
20
20
|
|
|
21
21
|
**Layer Number:** 11
|
|
22
|
-
**Specification:** Metadata Model Spec v0.8.
|
|
22
|
+
**Specification:** Metadata Model Spec v0.8.3
|
|
23
23
|
**Purpose:** Defines observability using OpenTelemetry 1.0+, specifying traces, metrics, logs, and instrumentation.
|
|
24
24
|
|
|
25
25
|
---
|
|
@@ -33,7 +33,7 @@ The APM Layer captures **application performance monitoring**:
|
|
|
33
33
|
- **LOGS** - Structured logging
|
|
34
34
|
- **INSTRUMENTATION** - Code instrumentation configuration
|
|
35
35
|
- **RESOURCES** - Telemetry resource attributes
|
|
36
|
-
- **
|
|
36
|
+
- **ALERTING** - Alert rules and monitoring dashboards
|
|
37
37
|
|
|
38
38
|
This layer uses **OpenTelemetry 1.0+** (industry standard for observability).
|
|
39
39
|
|
|
@@ -41,29 +41,93 @@ This layer uses **OpenTelemetry 1.0+** (industry standard for observability).
|
|
|
41
41
|
|
|
42
42
|
---
|
|
43
43
|
|
|
44
|
+
## Pre-Extraction Verification
|
|
45
|
+
|
|
46
|
+
Before extracting APM elements, verify what level of observability the codebase ACTUALLY implements. Do not model aspirational instrumentation.
|
|
47
|
+
|
|
48
|
+
### Step 1: Check for OTel SDK
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
grep "@opentelemetry" package.json
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**If NO OTel SDK found:**
|
|
55
|
+
|
|
56
|
+
- Do NOT add `MetricInstrument`, `Span`, `TraceConfiguration`, or `ExporterConfig` elements as if they are implemented
|
|
57
|
+
- ONLY model what exists: browser console logging (`LogConfiguration`), UI-displayed metrics (describe in element description that export is absent)
|
|
58
|
+
- Mark all elements `provenance: inferred` and add a note in the description: "Metric concept identified; no OTel export implemented."
|
|
59
|
+
|
|
60
|
+
**If OTel SDK IS found:**
|
|
61
|
+
|
|
62
|
+
- Proceed with full extraction of all APM types
|
|
63
|
+
|
|
64
|
+
### Step 2: Identify what observability actually exists
|
|
65
|
+
|
|
66
|
+
Even without OTel, codebases may have:
|
|
67
|
+
|
|
68
|
+
- Browser console error logging → `apm.logconfiguration`
|
|
69
|
+
- UI-visible token/usage counters → `apm.metricinstrument` (with note: display-only, not exported)
|
|
70
|
+
- Error tracking utilities → `apm.instrumentationconfig` (type: manual)
|
|
71
|
+
- In-memory state tracking → `apm.metricinstrument` (inferred, note: in-memory only)
|
|
72
|
+
|
|
73
|
+
### In-UI Observability vs. OTel Instrumentation
|
|
74
|
+
|
|
75
|
+
| Pattern | Model as | provenance |
|
|
76
|
+
| ------------------------------- | ----------------------------------------- | ---------- |
|
|
77
|
+
| `console.error()` logging | `logconfiguration` | extracted |
|
|
78
|
+
| UI badge showing token count | `metricinstrument` (note: display-only) | inferred |
|
|
79
|
+
| Store tracks reconnection count | `metricinstrument` (note: in-memory only) | inferred |
|
|
80
|
+
| `opentelemetry.createCounter()` | `metricinstrument` | extracted |
|
|
81
|
+
| Prometheus export endpoint | `exporterconfig` | extracted |
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
44
85
|
## Entity Types
|
|
45
86
|
|
|
46
87
|
> **CLI Introspection:** Run `dr schema types apm` for the authoritative, always-current list of node types.
|
|
47
88
|
> Run `dr schema node <type-id>` for full attribute details on any type.
|
|
48
89
|
|
|
49
|
-
### Core APM Entities (
|
|
50
|
-
|
|
51
|
-
| Entity Type
|
|
52
|
-
|
|
|
53
|
-
| **
|
|
54
|
-
| **
|
|
55
|
-
| **
|
|
56
|
-
| **
|
|
57
|
-
| **MetricConfiguration**
|
|
58
|
-
| **
|
|
59
|
-
| **
|
|
60
|
-
| **
|
|
61
|
-
| **
|
|
62
|
-
| **Resource**
|
|
63
|
-
| **
|
|
64
|
-
| **
|
|
65
|
-
| **
|
|
66
|
-
| **
|
|
90
|
+
### Core APM Entities (15 entities)
|
|
91
|
+
|
|
92
|
+
| Entity Type | Description |
|
|
93
|
+
| ------------------------- | ----------------------------------------------------------------- |
|
|
94
|
+
| **TraceConfiguration** | Distributed tracing configuration |
|
|
95
|
+
| **Span** | Unit of work in distributed trace |
|
|
96
|
+
| **SpanEvent** | Timestamped event within span |
|
|
97
|
+
| **SpanLink** | Link between spans from different traces |
|
|
98
|
+
| **MetricConfiguration** | Metrics collection configuration |
|
|
99
|
+
| **MetricInstrument** | Specific metric instrument (Counter, Gauge, Histogram, etc.) |
|
|
100
|
+
| **LogConfiguration** | Structured logging configuration |
|
|
101
|
+
| **LogRecord** | Individual log record |
|
|
102
|
+
| **LogProcessor** | Log processing pipeline step (simple, batch, custom) |
|
|
103
|
+
| **Resource** | Telemetry resource attributes |
|
|
104
|
+
| **InstrumentationScope** | Scope of instrumentation |
|
|
105
|
+
| **InstrumentationConfig** | Code instrumentation configuration (library, auto/manual type) |
|
|
106
|
+
| **ExporterConfig** | Telemetry exporter configuration (OTLP, Jaeger, Prometheus, etc.) |
|
|
107
|
+
| **Alert** | Alert rule with severity, condition, and notification channels |
|
|
108
|
+
| **Dashboard** | Monitoring dashboard definition (Grafana, Datadog, etc.) |
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Type Decision Tree
|
|
113
|
+
|
|
114
|
+
Use this decision tree **before assigning a type** to any APM element.
|
|
115
|
+
|
|
116
|
+
- Is this an alert rule with severity and condition? → `apm.alert`
|
|
117
|
+
- Is this a monitoring dashboard definition (Grafana, Datadog, etc.)? → `apm.dashboard`
|
|
118
|
+
- Is this an exporter configuration (OTLP, Jaeger, Prometheus endpoint)? → `apm.exporterconfig`
|
|
119
|
+
- Is this a code instrumentation configuration (library name, auto/manual)? → `apm.instrumentationconfig`
|
|
120
|
+
- Is this the instrumentation scope (library version, schema URL)? → `apm.instrumentationscope`
|
|
121
|
+
- Is this logging pipeline configuration (service name, minimum severity)? → `apm.logconfiguration`
|
|
122
|
+
- Is this a log processor step (batch, simple, custom)? → `apm.logprocessor`
|
|
123
|
+
- Is this an individual structured log record with body and severity? → `apm.logrecord`
|
|
124
|
+
- Is this a metrics collection configuration (export interval, cardinality limit)? → `apm.metricconfiguration`
|
|
125
|
+
- Is this a specific metric instrument (counter, gauge, histogram, observable)? → `apm.metricinstrument`
|
|
126
|
+
- Is this a telemetry resource (service name, deployment environment attributes)? → `apm.resource`
|
|
127
|
+
- Is this a unit of work/operation in a distributed trace? → `apm.span`
|
|
128
|
+
- Is this an event that occurred within a span? → `apm.spanevent`
|
|
129
|
+
- Is this a link between spans from different traces? → `apm.spanlink`
|
|
130
|
+
- Is this distributed tracing configuration (sampler type, propagators)? → `apm.traceconfiguration`
|
|
67
131
|
|
|
68
132
|
---
|
|
69
133
|
|
|
@@ -79,20 +143,65 @@ Activate when the user:
|
|
|
79
143
|
|
|
80
144
|
---
|
|
81
145
|
|
|
82
|
-
##
|
|
83
|
-
|
|
84
|
-
|
|
146
|
+
## Intra-Layer Relationships
|
|
147
|
+
|
|
148
|
+
A resource aggregates the instrumentation scopes running in it, and a scope aggregates the spans,
|
|
149
|
+
metric instruments and log records emitted under it. Providers (trace, metric, log configurations)
|
|
150
|
+
depend on their resource and aggregate processors and exporters. Each signal flows through its own
|
|
151
|
+
processors to exporters; signals are correlated by `references`. Only signals and instrumentation
|
|
152
|
+
configurations `monitors` elements in other layers; alerts and dashboards monitor signals.
|
|
153
|
+
|
|
154
|
+
| Source Type | Predicate | Target Type | Example |
|
|
155
|
+
| --------------------- | ---------- | -------------------- | ---------------------------------------------------------------- |
|
|
156
|
+
| Span | composes | SpanEvent | "Process Order" composes "Payment Authorized" |
|
|
157
|
+
| Span | aggregates | SpanLink | "Process Order Batch" aggregates "Link To Enqueue Trace" |
|
|
158
|
+
| SpanLink | references | Span | "Link To Enqueue Trace" references "Enqueue Order" |
|
|
159
|
+
| Span | references | Span | "Charge Card" references "Process Order" (parent span) |
|
|
160
|
+
| Resource | aggregates | InstrumentationScope | "order-service Resource" aggregates "orders-tracer" |
|
|
161
|
+
| Span | flows-to | ExporterConfig | "Process Order" flows-to "OTLP Trace Exporter" |
|
|
162
|
+
| InstrumentationScope | aggregates | LogRecord | "orders-logger" aggregates "Payment Error Log" |
|
|
163
|
+
| MetricInstrument | flows-to | ExporterConfig | "order_rate" flows-to "Prometheus Exporter" |
|
|
164
|
+
| LogRecord | references | Span | "Payment Error Log" references "Charge Card" |
|
|
165
|
+
| LogRecord | flows-to | LogProcessor | "Payment Error Log" flows-to "PII Redaction Processor" |
|
|
166
|
+
| LogProcessor | flows-to | ExporterConfig | "PII Redaction Processor" flows-to "OTLP Log Exporter" |
|
|
167
|
+
| InstrumentationScope | aggregates | Span | "orders-tracer" aggregates "Process Order" |
|
|
168
|
+
| InstrumentationScope | aggregates | MetricInstrument | "orders-meter" aggregates "order_rate" |
|
|
169
|
+
| InstrumentationConfig | references | InstrumentationScope | "Node Auto-Instrumentation" references "express instrumentation" |
|
|
170
|
+
| TraceConfiguration | depends-on | Resource | "Order Service Tracing" depends-on "order-service Resource" |
|
|
171
|
+
| MetricConfiguration | aggregates | MetricInstrument | "Order Service Metrics" aggregates "order_rate" |
|
|
172
|
+
| LogConfiguration | aggregates | LogProcessor | "Order Service Logging" aggregates "PII Redaction Processor" |
|
|
173
|
+
| Alert | monitors | MetricInstrument | "High Order Error Rate" monitors "order_errors_total" |
|
|
174
|
+
| Dashboard | monitors | MetricInstrument | "Order Operations Dashboard" monitors "order_rate" |
|
|
175
|
+
| Dashboard | references | Alert | "Order Operations Dashboard" references "High Order Error Rate" |
|
|
85
176
|
|
|
86
|
-
|
|
87
|
-
- `business-metrics` → Business Layer (business KPIs)
|
|
88
|
-
|
|
89
|
-
**Incoming (Other Layers → APM):**
|
|
177
|
+
---
|
|
90
178
|
|
|
91
|
-
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
179
|
+
## Cross-Layer References
|
|
180
|
+
|
|
181
|
+
### Outgoing References (APM → Other Layers)
|
|
182
|
+
|
|
183
|
+
| Source Type | Predicate | Target Type | Example |
|
|
184
|
+
| --------------------- | ---------------- | ---------------------------------- | -------------------------------------------------------------- |
|
|
185
|
+
| Span | monitors | `application.applicationservice` | "Process Order" monitors "Order Service" |
|
|
186
|
+
| Span | monitors | `api.operation` | "POST /orders" span monitors "Create Order" |
|
|
187
|
+
| Span | monitors | `navigation.route` | "Route Change" monitors "Checkout Route" |
|
|
188
|
+
| Span | monitors | `data-store.collection` | "Insert Order" monitors "orders table" |
|
|
189
|
+
| MetricInstrument | monitors | `api.operation` | "http_server_duration" monitors "Create Order" |
|
|
190
|
+
| MetricInstrument | monitors | `business.businessprocess` | "order_rate" monitors "Order Fulfillment" |
|
|
191
|
+
| MetricInstrument | monitors | `data-store.database` | "db_pool_connections" monitors "Orders Database" |
|
|
192
|
+
| MetricInstrument | measures-outcome | `motivation.outcome` | "order_rate" measures "Higher Order Throughput" |
|
|
193
|
+
| MetricInstrument | satisfies | `motivation.requirement` | "http_server_duration" satisfies "p95 Latency Under 300ms" |
|
|
194
|
+
| Resource | maps-to | `application.applicationcomponent` | "order-service Resource" maps-to "Order Service Component" |
|
|
195
|
+
| Resource | references | `technology.node` | "order-service Resource" references "EKS Production Cluster" |
|
|
196
|
+
| InstrumentationConfig | monitors | `application.applicationcomponent` | "Node Auto-Instrumentation" monitors "Order Service Component" |
|
|
197
|
+
| LogConfiguration | satisfies | `security.auditconfig` | "Order Service Logging" satisfies "Order Audit Logging" |
|
|
198
|
+
|
|
199
|
+
### Incoming References (Other Layers → APM)
|
|
200
|
+
|
|
201
|
+
| Source Type | Predicate | Target Type | Example |
|
|
202
|
+
| -------------------------------- | ---------- | ------------------ | -------------------------------------------------- |
|
|
203
|
+
| `application.applicationservice` | references | TraceConfiguration | "Order Service" references "Order Service Tracing" |
|
|
204
|
+
| `testing.testcasesketch` | tests | MetricInstrument | "Order Counter Increments" tests "order_rate" |
|
|
96
205
|
|
|
97
206
|
---
|
|
98
207
|
|
|
@@ -113,22 +222,22 @@ Activate when the user:
|
|
|
113
222
|
|
|
114
223
|
```bash
|
|
115
224
|
# Add span
|
|
116
|
-
dr add apm span
|
|
225
|
+
dr add apm span "Process Order"
|
|
117
226
|
|
|
118
|
-
# Add metric
|
|
119
|
-
dr add apm
|
|
227
|
+
# Add metric instrument
|
|
228
|
+
dr add apm metricinstrument "order_rate" --description "Order processing rate counter"
|
|
120
229
|
|
|
121
230
|
# Add log record
|
|
122
|
-
dr add apm
|
|
231
|
+
dr add apm logrecord "Error Log"
|
|
123
232
|
|
|
124
233
|
# List APM elements
|
|
125
|
-
dr list apm span
|
|
234
|
+
dr list apm --type span
|
|
126
235
|
|
|
127
236
|
# Validate APM layer
|
|
128
|
-
dr validate --
|
|
237
|
+
dr validate --layers apm
|
|
129
238
|
|
|
130
239
|
# Export APM configuration
|
|
131
|
-
dr export --
|
|
240
|
+
dr export markdown --layers apm
|
|
132
241
|
```
|
|
133
242
|
|
|
134
243
|
---
|
|
@@ -140,28 +249,21 @@ id: apm.span.process-order
|
|
|
140
249
|
name: "Process Order Span"
|
|
141
250
|
type: span
|
|
142
251
|
properties:
|
|
252
|
+
traceId: "4bf92f3577b34da6a3ce929d0e0e4736"
|
|
253
|
+
spanId: "00f067aa0ba902b7"
|
|
254
|
+
traceState: ""
|
|
255
|
+
parentSpanId: "b9c7c989f97918e1"
|
|
143
256
|
spanKind: INTERNAL
|
|
144
|
-
|
|
257
|
+
startTimeUnixNano: "1544712660000000000"
|
|
258
|
+
endTimeUnixNano: "1544712661000000000"
|
|
259
|
+
droppedAttributesCount: 0
|
|
260
|
+
droppedEventsCount: 0
|
|
261
|
+
droppedLinksCount: 0
|
|
262
|
+
statusCode: OK
|
|
145
263
|
attributes:
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
type: double
|
|
150
|
-
- key: customer.id
|
|
151
|
-
type: string
|
|
152
|
-
events:
|
|
153
|
-
- name: order_validated
|
|
154
|
-
timestamp: relative
|
|
155
|
-
- name: payment_processed
|
|
156
|
-
timestamp: relative
|
|
157
|
-
- name: inventory_reserved
|
|
158
|
-
timestamp: relative
|
|
159
|
-
instrumented-service: application.service.order-processing
|
|
160
|
-
business-metrics:
|
|
161
|
-
- apm.metric.orders-processed
|
|
162
|
-
- apm.metric.order-processing-time
|
|
163
|
-
sla-target-latency: 500ms
|
|
164
|
-
sla-target-availability: 99.9%
|
|
264
|
+
order.id: "ord-12345"
|
|
265
|
+
order.total: 99.99
|
|
266
|
+
customer.id: "cust-67890"
|
|
165
267
|
```
|
|
166
268
|
|
|
167
269
|
---
|
|
@@ -169,58 +271,40 @@ properties:
|
|
|
169
271
|
## Example: Business Metrics
|
|
170
272
|
|
|
171
273
|
```yaml
|
|
172
|
-
id: apm.
|
|
274
|
+
id: apm.metricinstrument.order-rate
|
|
173
275
|
name: "Order Rate Metric"
|
|
174
|
-
type:
|
|
276
|
+
type: metricinstrument
|
|
175
277
|
properties:
|
|
176
|
-
|
|
278
|
+
type: Counter
|
|
177
279
|
unit: orders
|
|
178
|
-
description: "Number of orders processed"
|
|
179
|
-
|
|
180
|
-
- key: order.type
|
|
181
|
-
type: string
|
|
182
|
-
values: [standard, express, subscription]
|
|
183
|
-
- key: payment.method
|
|
184
|
-
type: string
|
|
185
|
-
values: [credit_card, paypal, bank_transfer]
|
|
186
|
-
business-context:
|
|
187
|
-
kpi: true
|
|
188
|
-
dashboard: revenue-dashboard
|
|
189
|
-
alerts:
|
|
190
|
-
- threshold: 100
|
|
191
|
-
condition: less-than
|
|
192
|
-
severity: warning
|
|
193
|
-
message: "Order rate below threshold"
|
|
280
|
+
description: "Number of orders processed per minute"
|
|
281
|
+
enabled: true
|
|
194
282
|
```
|
|
195
283
|
|
|
196
284
|
---
|
|
197
285
|
|
|
198
|
-
##
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
type: histogram
|
|
221
|
-
description: "Time since last update"
|
|
222
|
-
target: 24h
|
|
223
|
-
```
|
|
286
|
+
## Coverage Completeness Checklist
|
|
287
|
+
|
|
288
|
+
Before declaring APM layer extraction complete, verify each type was considered:
|
|
289
|
+
|
|
290
|
+
- [ ] `apm.alert` — Alert rule with severity and notification channels
|
|
291
|
+
- [ ] `apm.dashboard` — Monitoring dashboard (Grafana, Datadog, etc.)
|
|
292
|
+
- [ ] `apm.exporterconfig` — Telemetry exporter configuration (OTLP, Prometheus, etc.)
|
|
293
|
+
- [ ] `apm.instrumentationconfig` — Code instrumentation configuration
|
|
294
|
+
- [ ] `apm.instrumentationscope` — Instrumentation scope (library version and schema URL)
|
|
295
|
+
- [ ] `apm.logconfiguration` — Logging configuration per service
|
|
296
|
+
- [ ] `apm.logprocessor` — Log processing pipeline step
|
|
297
|
+
- [ ] `apm.logrecord` — Individual structured log record
|
|
298
|
+
- [ ] `apm.metricconfiguration` — Metrics collection configuration per service
|
|
299
|
+
- [ ] `apm.metricinstrument` — Specific metric instrument (Counter, Gauge, Histogram, etc.)
|
|
300
|
+
- [ ] `apm.resource` — Telemetry resource attributes (service name, environment)
|
|
301
|
+
- [ ] `apm.span` — Unit of work in a distributed trace
|
|
302
|
+
- [ ] `apm.spanevent` — Timestamped event within a span
|
|
303
|
+
- [ ] `apm.spanlink` — Link between spans from different traces
|
|
304
|
+
- [ ] `apm.traceconfiguration` — Distributed tracing configuration
|
|
305
|
+
|
|
306
|
+
If any type has ZERO elements, explicitly decide:
|
|
307
|
+
"This type doesn't apply to this codebase" with reasoning.
|
|
224
308
|
|
|
225
309
|
---
|
|
226
310
|
|