Skip to content

Commit 87b064d

Browse files
committed
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 - Add Apache license headers to Jinja2 template files - 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/ Note: Claude was used to assist with this change. The author has verified all work.
1 parent 85d8dbd commit 87b064d

31 files changed

Lines changed: 323 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/attribute_macros.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
{#- Copyright The OpenTelemetry Authors -#}
2+
{#- SPDX-License-Identifier: Apache-2.0 -#}
13
{#- Attribute macros for Weaver templates -#}
24

35
{#- Renders the type of an attribute -#}

src/telemetry-docs/templates/markdown/mkdocs_nav.yml.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
{#- Copyright The OpenTelemetry Authors -#}
2+
{#- SPDX-License-Identifier: Apache-2.0 -#}
13
{#- This template generates mkdocs.yml with dynamic navigation -#}
24
{#- It inherits from mkdocs-base.yml for all static configuration -#}
35
{#- Context: ctx.registries (list of {name}), ctx.services (list of {name}) -#}

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
{#- Copyright The OpenTelemetry Authors -#}
2+
{#- SPDX-License-Identifier: Apache-2.0 -#}
13
{#- Home page template - generates README.md for mkdocs -#}
24
{#- Context: Full registry data from Weaver -#}
35

@@ -20,17 +22,17 @@ The demo application consists of multiple microservices, each with its own telem
2022

2123
The telemetry schema is organized by:
2224

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

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

2830
## Schema Files
2931

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
32+
- `telemetry-schema/manifest.yaml` - Registry metadata
33+
- `telemetry-schema/attributes/*.yaml` - Logical attribute group definitions by domain
34+
- `telemetry-schema/services/*.yaml` - Service-specific attribute references
35+
- `telemetry-schema/metrics/*.yaml` - Service-specific metric definitions
3436

3537
## Getting Started
3638

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
{#- Copyright The OpenTelemetry Authors -#}
2+
{#- SPDX-License-Identifier: Apache-2.0 -#}
13
{#- This template is rendered per registry attribute group. -#}
24
{#- Context variables provided by Weaver: -#}
35
{#- - ctx.id: The registry id (e.g., "product", "user") -#}
@@ -11,7 +13,9 @@
1113
# {{ ctx.id | replace("_", " ") | title }} Attributes
1214

1315
{% for group in ctx.groups | sort(attribute="id") %}
16+
{%- if group.brief and not group.brief.startswith("<synthetic") %}
1417
{{ group.brief }}
18+
{%- endif %}
1519

1620
## Quick Reference
1721

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
{#- Copyright The OpenTelemetry Authors -#}
2+
{#- SPDX-License-Identifier: Apache-2.0 -#}
13
{#- This template is rendered per service registry namespace. -#}
24
{#- Context variables provided by Weaver: -#}
35
{#- - ctx.id: The service id (e.g., "recommendation") -#}

src/telemetry-docs/templates/markdown/stability.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
{#- Copyright The OpenTelemetry Authors -#}
2+
{#- SPDX-License-Identifier: Apache-2.0 -#}
13
{#- Stability badge macros for Weaver templates -#}
24
{% macro badge(stability, deprecated) -%}
35
{%- if deprecated %}![Deprecated](https://img.shields.io/badge/-deprecated-red)

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

0 commit comments

Comments
 (0)