Skip to content

Commit d12a4d8

Browse files
Copilotlquerel
andcommitted
Restore useful sections and update example to use Company A scenario
Co-authored-by: lquerel <657994+lquerel@users.noreply.github.com>
1 parent 0cc50af commit d12a4d8

File tree

1 file changed

+70
-16
lines changed

1 file changed

+70
-16
lines changed

docs/multi-registry.md

Lines changed: 70 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ repository_url: https://github.com/open-telemetry/semantic-conventions
6565
resolved_schema_url: https://opentelemetry.io/schemas/1.42.0/resolved_schema.yaml
6666
```
6767

68-
**Vendor Registry** (`acme_registry/registry_manifest.yaml`):
68+
**Company A Shared Registry** (`company_a_registry/registry_manifest.yaml`):
6969
```yaml
70-
name: acme
71-
description: Acme vendor-specific definitions
70+
name: company-a-shared
71+
description: Company A shared telemetry definitions
7272
version: 0.1.0
73-
repository_url: https://acme.com/schemas/
73+
repository_url: https://company-a.example.com/schemas/
7474
dependencies:
7575
- name: otel
7676
registry_path: https://opentelemetry.io/schemas/1.42.0
@@ -79,18 +79,18 @@ dependencies:
7979
**Application Registry** (`app_registry/registry_manifest.yaml`):
8080
```yaml
8181
name: app
82-
description: Application-specific telemetry
82+
description: Application-specific telemetry for Company A
8383
version: 0.1.0
84-
repository_url: https://app.com/schemas/
84+
repository_url: https://app.company-a.example.com/schemas/
8585
dependencies:
86-
- name: acme
87-
registry_path: ../acme_registry
86+
- name: company-a-shared
87+
registry_path: ../company_a_registry
8888
```
8989

9090
In this setup:
91-
- The `app` registry depends on `acme`
92-
- The `acme` registry depends on `otel`
93-
- The `app` registry can use definitions from both `acme` and `otel` (transitive dependencies are supported)
91+
- The `app` registry depends on `company-a-shared`
92+
- The `company-a-shared` registry depends on `otel`
93+
- The `app` registry can use definitions from both `company-a-shared` and `otel` (transitive dependencies are supported)
9494

9595
## Using Imports
9696

@@ -206,7 +206,18 @@ weaver registry resolve model/
206206
weaver registry resolve --include-unreferenced model/
207207
```
208208

209-
Use `--include-unreferenced` when exploring dependencies or generating comprehensive documentation. Use the default mode for production schemas to keep them minimal.
209+
### When to Use Each Mode
210+
211+
**Use default mode (without flag)** when:
212+
- You want a minimal schema with only used definitions
213+
- You're generating code and want to avoid unused definitions
214+
- You want to reduce the size of your resolved schema
215+
216+
**Use `--include-unreferenced`** when:
217+
- You need complete visibility into all available definitions
218+
- You're exploring or documenting what's available in dependencies
219+
- You're building tooling that needs to know about all possible definitions
220+
- You want to generate comprehensive documentation
210221

211222
## Working with OpenTelemetry Semantic Conventions
212223

@@ -244,11 +255,54 @@ spans:
244255

245256
## Common Use Cases
246257

247-
**Vendor Extensions**: Cloud providers can extend OTel with vendor-specific attributes
258+
### Use Case 1: Vendor Extensions
259+
260+
A cloud provider can extend OTel definitions with vendor-specific attributes:
261+
262+
```yaml
263+
# vendor_registry/registry_manifest.yaml
264+
name: cloud-vendor
265+
version: 1.0.0
266+
repository_url: https://vendor.cloud/schemas/
267+
dependencies:
268+
- name: otel
269+
registry_path: https://github.com/open-telemetry/semantic-conventions/archive/refs/tags/v1.37.0.zip[model]
270+
```
271+
272+
```yaml
273+
# vendor_registry/extensions.yaml
274+
version: "2"
275+
attributes:
276+
- key: cloud.vendor.region
277+
type: string
278+
brief: Vendor-specific region identifier
279+
```
280+
281+
### Use Case 2: Application-Specific Metrics
248282

249-
**Application-Specific Telemetry**: Applications can import and use specific metrics/events from OTel while adding custom definitions
283+
Applications can import specific metrics they use:
284+
285+
```yaml
286+
# app/model/app_metrics.yaml
287+
version: "2"
288+
imports:
289+
metrics:
290+
- http.server.*
291+
- db.client.*
250292
251-
**Testing**: Create isolated test registries for validating instrumentation
293+
attributes:
294+
- key: app.custom.field
295+
type: string
296+
brief: Custom application field
297+
298+
metrics:
299+
- name: app.requests.total
300+
instrument: counter
301+
unit: "1"
302+
attributes:
303+
- ref: http.request.method # From imported http metrics
304+
- ref: app.custom.field # Custom attribute
305+
```
252306

253307
## Best Practices
254308

@@ -300,7 +354,7 @@ Common registry commands:
300354
weaver registry resolve <registry-path>
301355
302356
# Generate code from a registry
303-
weaver registry generate <registry-path> <template>
357+
weaver registry generate [--include-unreferenced] <registry-path> <template>
304358
305359
# Validate a registry
306360
weaver registry check <registry-path>

0 commit comments

Comments
 (0)