Skip to content

Commit 179e94c

Browse files
committed
test: add adapter generated artifacts
1 parent dec1c01 commit 179e94c

8 files changed

Lines changed: 1108 additions & 3 deletions

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ Release outputs include:
212212
- Batch inputs: [examples/traces/normalized.sample.json](examples/traces/normalized.sample.json), [examples/traces/otel.sample.json](examples/traces/otel.sample.json)
213213
- Topology input: [examples/topology/topology-api.sample.yaml](examples/topology/topology-api.sample.yaml)
214214
- Batch outputs: [examples/outputs/bering-model.normalized.sample.json](examples/outputs/bering-model.normalized.sample.json), [examples/outputs/bering-snapshot.normalized.sample.json](examples/outputs/bering-snapshot.normalized.sample.json), [examples/outputs/bering-model.topology-api.sample.json](examples/outputs/bering-model.topology-api.sample.json), [examples/outputs/bering-snapshot.topology-api.sample.json](examples/outputs/bering-snapshot.topology-api.sample.json)
215+
- Adapter-generated outputs: [examples/outputs/bering-model.service-catalog-adapter.sample.json](examples/outputs/bering-model.service-catalog-adapter.sample.json), [examples/outputs/bering-snapshot.service-catalog-adapter.sample.json](examples/outputs/bering-snapshot.service-catalog-adapter.sample.json)
215216
- Runtime config: [configs/serve.sample.yaml](configs/serve.sample.yaml)
216217
- Discovery overlay: [configs/discovery.overlay.sample.yaml](configs/discovery.overlay.sample.yaml)
217218
- Enrichment onboarding: [examples/enrichment](examples/enrichment/README.md)

docs/enrichment-onboarding.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,19 @@ Bering treats traces, overlays, and `topology_api` inputs as different discovery
99
3. Add an overlay for curated metadata that traces cannot infer.
1010
4. Move to `topology_api` when a non-trace system is authoritative for topology, placement, resilience, or endpoint metadata.
1111

12+
## Minimum enrichment checklist
13+
14+
For Sheaft advanced analysis, treat trace-only artifacts as incomplete until the relevant topology includes:
15+
16+
- service `failure_eligible` for services that can be fault targets
17+
- placement groups for zone, cell, rack, node pool, or similar failure domains
18+
- `shared_resource_refs` for queues, databases, caches, brokers, or other shared fate domains
19+
- edge `weight` when traffic split or dependency importance is not uniform
20+
- edge `resilience.request_timeout_ms` and retry policy when timeout or retry-wave behavior matters
21+
- edge `circuit_breaker` metadata when breaker behavior is part of the resilience envelope
22+
- endpoint `method`, `path`, and custom `predicate_ref` for workflow-specific success evaluation
23+
- `policy_scope` when a dependency policy applies only to a source route or operation
24+
1225
## Trace-only baseline
1326

1427
```bash

examples/adapters/service-catalog/README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,18 @@ go run ./examples/adapters/service-catalog \
1010
--out out/adapters/service-catalog/topology-api.json
1111
```
1212

13+
The generated topology sample is checked in as `topology-api.generated.sample.json`.
14+
1315
Run Bering discovery on the generated topology:
1416

1517
```bash
1618
go run ./cmd/bering discover \
17-
--input out/adapters/service-catalog/topology-api.json \
18-
--out out/adapters/service-catalog/bering-model.json \
19-
--snapshot-out out/adapters/service-catalog/bering-snapshot.json \
19+
--input examples/adapters/service-catalog/topology-api.generated.sample.json \
20+
--out examples/outputs/bering-model.service-catalog-adapter.sample.json \
21+
--snapshot-out examples/outputs/bering-snapshot.service-catalog-adapter.sample.json \
2022
--discovered-at 2026-03-03T00:00:00Z
2123
```
2224

25+
The generated model, snapshot, and signal-quality sidecars are checked in under `examples/outputs/`.
26+
2327
The adapter is intentionally plain Go and has no service-catalog dependency. Real adapters should map their source-specific concepts into the same `topology_api` fields shown here: services, placements, shared resources, dependencies, resilience policy, policy scope, and endpoints.
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
{
2+
"source": {
3+
"type": "topology_api",
4+
"ref": "service-catalog://checkout-sample"
5+
},
6+
"services": [
7+
{
8+
"id": "frontend",
9+
"replicas": 2,
10+
"labels": {
11+
"team": "web",
12+
"tier": "edge"
13+
}
14+
},
15+
{
16+
"id": "checkout",
17+
"replicas": 3,
18+
"failure_eligible": true,
19+
"labels": {
20+
"team": "commerce",
21+
"tier": "backend"
22+
},
23+
"placements": [
24+
{
25+
"replicas": 2,
26+
"labels": {
27+
"az": "us-east-1a",
28+
"region": "us-east-1"
29+
}
30+
},
31+
{
32+
"replicas": 1,
33+
"labels": {
34+
"az": "us-east-1b",
35+
"region": "us-east-1"
36+
}
37+
}
38+
],
39+
"shared_resource_refs": [
40+
"kafka-orders",
41+
"payments-db"
42+
]
43+
},
44+
{
45+
"id": "payment",
46+
"replicas": 2,
47+
"failure_eligible": true,
48+
"labels": {
49+
"team": "payments",
50+
"tier": "backend"
51+
}
52+
}
53+
],
54+
"edges": [
55+
{
56+
"id": "frontend|checkout|sync|true",
57+
"from": "frontend",
58+
"to": "checkout",
59+
"kind": "sync",
60+
"blocking": true,
61+
"weight": 0.85,
62+
"resilience": {
63+
"request_timeout_ms": 2000,
64+
"retry": {
65+
"max_attempts": 3
66+
},
67+
"circuit_breaker": {
68+
"enabled": true
69+
}
70+
},
71+
"policy_scope": {
72+
"source_endpoint_id": "frontend:GET /checkout",
73+
"method": "GET",
74+
"source_route": "/checkout"
75+
}
76+
},
77+
{
78+
"id": "checkout|payment|async|false",
79+
"from": "checkout",
80+
"to": "payment",
81+
"kind": "async",
82+
"blocking": false,
83+
"weight": 0.35
84+
}
85+
],
86+
"endpoints": [
87+
{
88+
"entry_service": "frontend",
89+
"method": "GET",
90+
"path": "/checkout",
91+
"predicate_ref": "catalog.frontend.checkout.success",
92+
"weight": 0.7
93+
},
94+
{
95+
"entry_service": "checkout",
96+
"method": "POST",
97+
"path": "/process",
98+
"predicate_ref": "catalog.checkout.process.success",
99+
"weight": 0.6
100+
}
101+
]
102+
}
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
{
2+
"edges": [
3+
{
4+
"blocking": false,
5+
"from": "checkout",
6+
"id": "checkout|payment|async|false",
7+
"kind": "async",
8+
"metadata": {
9+
"weight": 0.35
10+
},
11+
"to": "payment"
12+
},
13+
{
14+
"blocking": true,
15+
"from": "frontend",
16+
"id": "frontend|checkout|sync|true",
17+
"kind": "sync",
18+
"metadata": {
19+
"weight": 0.85
20+
},
21+
"policy_scope": {
22+
"method": "GET",
23+
"source_endpoint_id": "frontend:GET /checkout",
24+
"source_route": "/checkout"
25+
},
26+
"resilience": {
27+
"circuit_breaker": {
28+
"enabled": true
29+
},
30+
"request_timeout_ms": 2000,
31+
"retry": {
32+
"max_attempts": 3
33+
}
34+
},
35+
"to": "checkout"
36+
}
37+
],
38+
"endpoints": [
39+
{
40+
"entry_service": "checkout",
41+
"id": "checkout:POST /process",
42+
"metadata": {
43+
"weight": 0.6
44+
},
45+
"method": "POST",
46+
"path": "/process",
47+
"success_predicate_ref": "catalog.checkout.process.success"
48+
},
49+
{
50+
"entry_service": "frontend",
51+
"id": "frontend:GET /checkout",
52+
"metadata": {
53+
"weight": 0.7
54+
},
55+
"method": "GET",
56+
"path": "/checkout",
57+
"success_predicate_ref": "catalog.frontend.checkout.success"
58+
}
59+
],
60+
"metadata": {
61+
"confidence": 1,
62+
"discovered_at": "2026-03-03T00:00:00Z",
63+
"schema": {
64+
"digest": "sha256:bc9a60736c9e6bda9599243fd68f293b88f42ade65321d8267369a5c3214779a",
65+
"name": "io.mb3r.bering.model",
66+
"uri": "https://mb3r-lab.github.io/Bering/schema/model/v1.1.0/model.schema.json",
67+
"version": "1.1.0"
68+
},
69+
"source_ref": "bering://discover?input=examples%2Fadapters%2Fservice-catalog%2Ftopology-api.generated.sample.json",
70+
"source_type": "bering"
71+
},
72+
"services": [
73+
{
74+
"id": "checkout",
75+
"metadata": {
76+
"failure_eligible": true,
77+
"labels": {
78+
"team": "commerce",
79+
"tier": "backend"
80+
},
81+
"placements": [
82+
{
83+
"labels": {
84+
"az": "us-east-1b",
85+
"region": "us-east-1"
86+
},
87+
"replicas": 1
88+
},
89+
{
90+
"labels": {
91+
"az": "us-east-1a",
92+
"region": "us-east-1"
93+
},
94+
"replicas": 2
95+
}
96+
],
97+
"shared_resource_refs": [
98+
"kafka-orders",
99+
"payments-db"
100+
]
101+
},
102+
"name": "checkout",
103+
"replicas": 3
104+
},
105+
{
106+
"id": "frontend",
107+
"metadata": {
108+
"labels": {
109+
"team": "web",
110+
"tier": "edge"
111+
}
112+
},
113+
"name": "frontend",
114+
"replicas": 2
115+
},
116+
{
117+
"id": "payment",
118+
"metadata": {
119+
"failure_eligible": true,
120+
"labels": {
121+
"team": "payments",
122+
"tier": "backend"
123+
}
124+
},
125+
"name": "payment",
126+
"replicas": 2
127+
}
128+
]
129+
}

0 commit comments

Comments
 (0)