Skip to content

Commit f318067

Browse files
martinjtclaude
andcommitted
Upgrade Weaver to v0.22.1 and migrate schemas to v2 format
- Bump otel/weaver Docker image from v0.21.2 to v0.22.1 - Rename registry_manifest.yaml to manifest.yaml (v0.22 deprecation) - Migrate attribute files to v2 schema (file_format: definition/2) - Migrate service files to v2 attribute_groups with visibility - Update jq filters in weaver.yaml for new resolved registry ID format - Fix readme.md.j2 to reflect actual schema file structure - Add TELEMETRY_DOCS_HOST/PORT env vars to docker-compose.minimal.yml - Update mkdocs site_url to localhost:8080/telemetry/ Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 85d8dbd commit f318067

27 files changed

Lines changed: 311 additions & 320 deletions

docker-compose.minimal.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,8 @@ services:
290290
- FLAGD_PORT
291291
- FLAGD_UI_HOST
292292
- FLAGD_UI_PORT
293+
- TELEMETRY_DOCS_HOST
294+
- TELEMETRY_DOCS_PORT
293295
depends_on:
294296
frontend:
295297
condition: service_started

src/telemetry-docs/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Two-stage build: Generate service-centric Markdown with Weaver, then serve with mkdocs
55

66
# Stage 1: Generate Markdown files from telemetry schema using Weaver
7-
FROM docker.io/otel/weaver:v0.21.2 AS registry-builder
7+
FROM docker.io/otel/weaver:v0.22.1 AS registry-builder
88

99
WORKDIR /workspace
1010

src/telemetry-docs/mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
site_name: OpenTelemetry Demo Telemetry Schema
55
site_description: Semantic conventions and telemetry schema for the OpenTelemetry Demo application
66
site_author: OpenTelemetry Demo Contributors
7-
site_url: https://opentelemetry-demo.example.com/telemetry/
7+
site_url: http://localhost:8080/telemetry/
88

99
theme:
1010
name: material

src/telemetry-docs/templates/markdown/readme.md.j2

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ The demo application consists of multiple microservices, each with its own telem
2020

2121
The telemetry schema is organized by:
2222

23-
1. **Logical Attribute Groups** - Semantic domain-focused attribute definitions in `common.yaml`
24-
2. **Service Registries** - Service-specific attribute and metric definitions
23+
1. **Logical Attribute Groups** - Semantic domain-focused attribute definitions (product, user, order, shipping, misc)
24+
2. **Service Definitions** - Service-specific attribute references and metric definitions
2525

2626
Each service references logical attribute groups using the `ref` syntax, creating a separation between logical groupings and service-specific usage patterns.
2727

2828
## Schema Files
2929

30-
- `telemetry-schema/registry_manifest.yaml` - Registry metadata
31-
- `telemetry-schema/attributes/common.yaml` - Logical attribute group definitions
32-
- `telemetry-schema/attributes/{service}.yaml` - Service-specific attribute registries
33-
- `telemetry-schema/metrics/{service}.yaml` - Service-specific metric definitions
30+
- `telemetry-schema/manifest.yaml` - Registry metadata
31+
- `telemetry-schema/attributes/*.yaml` - Logical attribute group definitions by domain
32+
- `telemetry-schema/services/*.yaml` - Service-specific attribute references
33+
- `telemetry-schema/metrics/*.yaml` - Service-specific metric definitions
3434

3535
## Getting Started
3636

src/telemetry-docs/templates/markdown/registry.md.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
# {{ ctx.id | replace("_", " ") | title }} Attributes
1212

1313
{% for group in ctx.groups | sort(attribute="id") %}
14+
{%- if group.brief and not group.brief.startswith("<synthetic") %}
1415
{{ group.brief }}
16+
{%- endif %}
1517

1618
## Quick Reference
1719

src/telemetry-docs/templates/markdown/weaver.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ templates:
2323
- pattern: mkdocs_nav.yml.j2
2424
filter: >
2525
{
26-
registries: [.groups[] | select(.type == "attribute_group" and (.id | startswith("registry."))) | {name: (.id | split(".") | .[1]), id: .id}] | unique_by(.name) | sort_by(.name),
26+
registries: [.groups[] | select(.type == "attribute_group" and (.id | startswith("registry."))) | {name: (.id | split(".") | last), id: .id}] | unique_by(.name) | sort_by(.name),
2727
services: ([.groups[] | select(.type == "attribute_group" and (.id | startswith("service."))) | {name: (.id | split(".")| .[1])}] + [.groups[] |
2828
select(.type == "metric" and (.id | startswith("metric."))) | {name: (.id | split(".")[1])}]) | unique_by(.name) | sort_by(.name)
2929
}
@@ -61,8 +61,8 @@ templates:
6161
.groups
6262
| map(select(.type == "attribute_group"))
6363
| map(select(.id | startswith("registry.")))
64-
| group_by(.id | split(".") | .[1])
65-
| map({id: .[0].id | split(".") | .[1], groups: .})
64+
| group_by(.id | split(".") | last)
65+
| map({id: .[0].id | split(".") | last, groups: .})
6666
application_mode: each
6767
file_name: attributes/{{ ctx.id | snake_case }}.md
6868

Lines changed: 38 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,42 @@
11
# Copyright The OpenTelemetry Authors
22
# SPDX-License-Identifier: Apache-2.0
33

4-
groups:
5-
- id: registry.misc
6-
type: attribute_group
7-
brief: Miscellaneous cross-cutting attributes
4+
file_format: definition/2
5+
attributes:
6+
- key: app.synthetic_request
7+
type: string
8+
brief: Whether the request is synthetic/test traffic
89
stability: stable
9-
attributes:
10-
- id: app.synthetic_request
11-
type: string
12-
brief: Whether the request is synthetic/test traffic
13-
stability: stable
14-
note: >
15-
Indicates whether the request is synthetic traffic generated for testing or monitoring purposes ("true") or real user traffic.
16-
This helps distinguish production traffic from test traffic in observability systems.
17-
Also propagated as synthetic_request baggage.
18-
examples: ["true", "false"]
19-
- id: app.recommendation.cache_enabled
20-
type: boolean
21-
brief: Whether recommendation caching is enabled
22-
stability: stable
23-
note: Indicates whether the recommendation service has caching enabled for this request (feature flag)
24-
- id: app.cache_hit
25-
type: boolean
26-
brief: Whether the recommendation cache was hit
27-
stability: stable
28-
note: Indicates whether the recommendation was served from cache (true) or computed fresh (false)
29-
- id: app.email.recipient
30-
type: string
31-
brief: Email recipient address
32-
stability: stable
33-
note: The email address of the recipient for whom the email is being sent. This is typically used for order confirmation emails and other transactional communications.
34-
examples: ["customer@example.com", "user@domain.org"]
35-
- id: app.currency.conversion.from
36-
type: string
37-
brief: Source currency code
38-
stability: stable
39-
note: The currency code being converted from
40-
examples: ["USD", "EUR", "GBP"]
41-
- id: app.currency.conversion.to
42-
type: string
43-
brief: Target currency code
44-
stability: stable
45-
note: The currency code being converted to
46-
examples: ["USD", "EUR", "JPY"]
10+
note: >
11+
Indicates whether the request is synthetic traffic generated for testing or monitoring purposes ("true") or real user traffic.
12+
This helps distinguish production traffic from test traffic in observability systems.
13+
Also propagated as synthetic_request baggage.
14+
examples: ["true", "false"]
15+
- key: app.recommendation.cache_enabled
16+
type: boolean
17+
brief: Whether recommendation caching is enabled
18+
stability: stable
19+
note: Indicates whether the recommendation service has caching enabled for this request (feature flag)
20+
- key: app.cache_hit
21+
type: boolean
22+
brief: Whether the recommendation cache was hit
23+
stability: stable
24+
note: Indicates whether the recommendation was served from cache (true) or computed fresh (false)
25+
- key: app.email.recipient
26+
type: string
27+
brief: Email recipient address
28+
stability: stable
29+
note: The email address of the recipient for whom the email is being sent. This is typically used for order confirmation emails and other transactional communications.
30+
examples: ["customer@example.com", "user@domain.org"]
31+
- key: app.currency.conversion.from
32+
type: string
33+
brief: Source currency code
34+
stability: stable
35+
note: The currency code being converted from
36+
examples: ["USD", "EUR", "GBP"]
37+
- key: app.currency.conversion.to
38+
type: string
39+
brief: Target currency code
40+
stability: stable
41+
note: The currency code being converted to
42+
examples: ["USD", "EUR", "JPY"]
Lines changed: 54 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,57 @@
11
# Copyright The OpenTelemetry Authors
22
# SPDX-License-Identifier: Apache-2.0
33

4-
groups:
5-
- id: registry.order
6-
type: attribute_group
7-
brief: Order, cart, and payment-related attributes
8-
stability: stable
9-
attributes:
10-
- id: app.order.id
11-
type: string
12-
brief: Order identifier
13-
stability: stable
14-
note: The unique identifier for an order
15-
examples: ["order-123", "ORD-456789"]
16-
- id: app.order.amount
17-
type: double
18-
brief: Total order amount
19-
stability: stable
20-
note: The total monetary amount of the order
21-
examples: [99.99, 150.50]
22-
- id: app.order.items.count
23-
type: int
24-
brief: Number of items in order
25-
stability: stable
26-
note: The count of distinct items in the order
27-
examples: [1, 5, 10]
28-
- id: app.cart.items.count
29-
type: int
30-
brief: Number of items in cart
31-
stability: stable
32-
note: The count of items currently in the shopping cart
33-
examples: [0, 3, 7]
34-
- id: app.payment.amount
35-
type: string
36-
brief: Payment amount
37-
stability: stable
38-
note: The monetary amount being charged
39-
examples: ["29.99", "99.95", "150.00"]
40-
- id: app.payment.card_type
41-
type: string
42-
brief: Credit card type
43-
stability: stable
44-
note: The type of credit card being used for payment
45-
examples: ["visa", "mastercard", "amex"]
46-
- id: app.payment.card_valid
47-
type: boolean
48-
brief: Card validation status
49-
stability: stable
50-
note: Whether the card passed validation checks
51-
- id: app.payment.charged
52-
type: boolean
53-
brief: Whether payment was successfully charged
54-
stability: stable
55-
note: Indicates whether the payment transaction was successfully charged to the customer's payment method (true) or not charged (false). For synthetic requests, this is set to false.
56-
- id: app.payment.transaction.id
57-
type: string
58-
brief: Payment transaction identifier
59-
stability: stable
60-
note: Unique identifier for the payment transaction
61-
examples: ["txn-abc123", "PAY-456789"]
4+
file_format: definition/2
5+
attributes:
6+
- key: app.order.id
7+
type: string
8+
brief: Order identifier
9+
stability: stable
10+
note: The unique identifier for an order
11+
examples: ["order-123", "ORD-456789"]
12+
- key: app.order.amount
13+
type: double
14+
brief: Total order amount
15+
stability: stable
16+
note: The total monetary amount of the order
17+
examples: [99.99, 150.50]
18+
- key: app.order.items.count
19+
type: int
20+
brief: Number of items in order
21+
stability: stable
22+
note: The count of distinct items in the order
23+
examples: [1, 5, 10]
24+
- key: app.cart.items.count
25+
type: int
26+
brief: Number of items in cart
27+
stability: stable
28+
note: The count of items currently in the shopping cart
29+
examples: [0, 3, 7]
30+
- key: app.payment.amount
31+
type: string
32+
brief: Payment amount
33+
stability: stable
34+
note: The monetary amount being charged
35+
examples: ["29.99", "99.95", "150.00"]
36+
- key: app.payment.card_type
37+
type: string
38+
brief: Credit card type
39+
stability: stable
40+
note: The type of credit card being used for payment
41+
examples: ["visa", "mastercard", "amex"]
42+
- key: app.payment.card_valid
43+
type: boolean
44+
brief: Card validation status
45+
stability: stable
46+
note: Whether the card passed validation checks
47+
- key: app.payment.charged
48+
type: boolean
49+
brief: Whether payment was successfully charged
50+
stability: stable
51+
note: Indicates whether the payment transaction was successfully charged to the customer's payment method (true) or not charged (false). For synthetic requests, this is set to false.
52+
- key: app.payment.transaction.id
53+
type: string
54+
brief: Payment transaction identifier
55+
stability: stable
56+
note: Unique identifier for the payment transaction
57+
examples: ["txn-abc123", "PAY-456789"]

0 commit comments

Comments
 (0)