Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ the release.
([#3440](https://github.com/open-telemetry/opentelemetry-demo/pull/3440))
* [telemetry-schema] Move ad attributes into a dedicated schema domain.
([#3454](https://github.com/open-telemetry/opentelemetry-demo/pull/3454))
* [telemetry-schema] Split exchange, feature flag, recommendation, and request
attributes into dedicated schema domains.
([#3482](https://github.com/open-telemetry/opentelemetry-demo/pull/3482))

## 2.2.0

Expand Down
4 changes: 3 additions & 1 deletion src/telemetry-docs/templates/markdown/readme.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ The demo application consists of multiple microservices, each with its own telem

The telemetry schema is organized by:

1. **Logical Attribute Groups** - Semantic domain-focused attribute definitions (ad, misc, order, product, shipping, user)
1. **Logical Attribute Groups** - Semantic domain-focused attribute definitions
(ad, exchange, feature flag, order, product, recommendation, request, shipping,
user)
2. **Service Definitions** - Service-specific attribute references and metric definitions

Each service references logical attribute groups using the `ref` syntax, creating a separation between logical groupings and service-specific usage patterns.
Expand Down
12 changes: 9 additions & 3 deletions src/telemetry-docs/templates/markdown/service.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,20 @@
product
{%- elif attr_name.startswith("demo.ad") -%}
ad
{%- elif attr_name.startswith("user.") or attr_name.startswith("demo.user_context") or attr_name.startswith("session") -%}
{%- elif attr_name.startswith("user.") or attr_name.startswith("demo.user_context") or attr_name.startswith("session") or attr_name.startswith("enduser.") -%}
user
{%- elif attr_name.startswith("demo.order") or attr_name.startswith("demo.cart") or attr_name.startswith("demo.payment") -%}
order
{%- elif attr_name.startswith("demo.shipping") -%}
shipping
{%- else -%}
misc
{%- elif attr_name.startswith("demo.exchange") -%}
exchange
{%- elif attr_name.startswith("demo.feature_flag") -%}
feature_flag
{%- elif attr_name.startswith("demo.recommendation") or attr_name.startswith("recommendation.") -%}
recommendation
{%- elif attr_name.startswith("demo.synthetic_request") -%}
request
{%- endif -%}
{%- endmacro -%}

Expand Down
3 changes: 2 additions & 1 deletion src/telemetry-docs/templates/markdown/weaver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ templates:
file_name: services/{{ ctx.id | snake_case }}.md

# Generate per-registry attribute documentation pages
# Each registry (ad, misc, order, product, shipping, user) gets its own page
# Each registry (ad, exchange, feature flag, order, product, recommendation,
# request, shipping, user) gets its own page
- pattern: registry.md.j2
filter: >
.groups
Expand Down
3 changes: 2 additions & 1 deletion telemetry-schema/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ across the demo services.
The schema is organized into three directories:

- **`attributes/`** - Attribute definitions organized by business domain
(ad, misc, order, product, shipping, user)
(ad, exchange, feature flag, order, product, recommendation, request,
shipping, user)
- **`services/`** - Service-specific attribute references (one file per service)
- **`metrics/`** - Metric definitions (one file per service that produces
metrics)
Expand Down
17 changes: 17 additions & 0 deletions telemetry-schema/attributes/exchange.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

file_format: definition/2
attributes:
- key: demo.exchange.from
type: string
brief: Source currency code
stability: stable
note: The currency code being converted from
examples: ["USD", "EUR", "GBP"]
- key: demo.exchange.to
type: string
brief: Target currency code
stability: stable
note: The currency code being converted to
examples: ["USD", "EUR", "JPY"]
10 changes: 10 additions & 0 deletions telemetry-schema/attributes/feature_flag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

file_format: definition/2
attributes:
- key: demo.feature_flag.recommendation_cache
type: boolean
brief: Whether recommendation caching is enabled
stability: stable
note: Indicates whether the recommendation service has caching enabled for this request (feature flag)
36 changes: 0 additions & 36 deletions telemetry-schema/attributes/misc.yaml

This file was deleted.

10 changes: 10 additions & 0 deletions telemetry-schema/attributes/recommendation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

file_format: definition/2
attributes:
- key: demo.recommendation.cache_hit
type: boolean
brief: Whether the recommendation cache was hit
stability: stable
note: Indicates whether the recommendation was served from cache (true) or computed fresh (false)
14 changes: 14 additions & 0 deletions telemetry-schema/attributes/request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

file_format: definition/2
attributes:
- key: demo.synthetic_request
type: string
brief: Whether the request is synthetic/test traffic
stability: stable
note: >
Indicates whether the request is synthetic traffic generated for testing or monitoring purposes ("true") or real user traffic.
This helps distinguish production traffic from test traffic in observability systems.
Also propagated as synthetic_request baggage.
examples: ["true", "false"]
2 changes: 1 addition & 1 deletion telemetry-schema/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ description: |
not copied from an external source. It reflects the real telemetry instrumentation
in the demo application.

Attributes are organized by service in the attributes/ directory.
Attributes are organized by business domain in the attributes/ directory.
Metrics are organized by service in the metrics/ directory.
dependencies:
- name: otel
Expand Down
Loading