From 63b072e56c878c8317578ff412da2e9ab5202fff Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Tue, 17 Mar 2026 12:37:35 -0700 Subject: [PATCH 1/4] Add doc about schemas --- .github/workflows/ci.yml | 52 +- Cargo.lock | 1 + crates/weaver_resolved_schema/src/lib.rs | 2 +- crates/weaver_resolved_schema/src/v2/mod.rs | 2 + crates/weaver_version/Cargo.toml | 1 + crates/weaver_version/src/v2/mod.rs | 18 +- schemas/semconv-schemas.md | 374 +++++ schemas/semconv.diff.v2.json | 224 +++ schemas/semconv.materialized.v2.json | 1586 +++++++++++++++++++ src/registry/json_schema.rs | 4 +- src/serve/handlers.rs | 6 +- ui/src/components/AppLayout.tsx | 8 +- ui/src/routes/schema.tsx | 6 +- 13 files changed, 2248 insertions(+), 36 deletions(-) create mode 100644 schemas/semconv-schemas.md create mode 100644 schemas/semconv.diff.v2.json create mode 100644 schemas/semconv.materialized.v2.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b6b8a291f..5fef5f788 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -298,34 +298,42 @@ jobs: run: | cargo run -- --quiet registry json-schema -j semconv-definition-v2 -o /tmp/semconv.schema.v2.json cargo run -- --quiet registry json-schema -j resolved-registry-v2 -o /tmp/semconv.resolved.v2.json + cargo run -- --quiet registry json-schema -j materialized-registry-v2 -o /tmp/semconv.materialized.v2.json + cargo run -- --quiet registry json-schema -j diff-v2 -o /tmp/semconv.diff.v2.json cargo run -- --quiet registry json-schema -j policy-finding -o /tmp/policy.finding.json + cargo run -- --quiet registry json-schema -j publication-manifest-v2 -o /tmp/publication-manifest.v2.json + cargo run -- --quiet registry json-schema -j definition-manifest-v2 -o /tmp/definition-manifest.v2.json - name: Check generated files are up-to-date run: | failed=0 - if ! diff -q docs/usage.md /tmp/usage.md > /dev/null 2>&1; then - echo "docs/usage.md is out of date. Run 'cargo run -- --quiet markdown-help > docs/usage.md' to regenerate it." - diff docs/usage.md /tmp/usage.md - failed=1 - fi - - if ! diff -q schemas/semconv.schema.v2.json /tmp/semconv.schema.v2.json > /dev/null 2>&1; then - echo "schemas/semconv.schema.v2.json is out of date. Run 'cargo run -- --quiet registry json-schema -j semconv-definition-v2 -o ./schemas/semconv.schema.v2.json' to regenerate it." - diff schemas/semconv.schema.v2.json /tmp/semconv.schema.v2.json - failed=1 - fi + check_file() { + local repo_file="$1" + local tmp_file="$2" + local regen_cmd="$3" + if ! diff -q "$repo_file" "$tmp_file" > /dev/null 2>&1; then + echo "$repo_file is out of date. Run '$regen_cmd' to regenerate it." + diff "$repo_file" "$tmp_file" + failed=1 + fi + } - if ! diff -q schemas/semconv.resolved.v2.json /tmp/semconv.resolved.v2.json > /dev/null 2>&1; then - echo "schemas/semconv.resolved.v2.json is out of date. Run 'cargo run -- --quiet registry json-schema -j resolved-registry-v2 -o ./schemas/semconv.resolved.v2.json' to regenerate it." - diff schemas/semconv.resolved.v2.json /tmp/semconv.resolved.v2.json - failed=1 - fi - - if ! diff -q schemas/policy.finding.json /tmp/policy.finding.json > /dev/null 2>&1; then - echo "schemas/policy.finding.json is out of date. Run 'cargo run -- --quiet registry json-schema -j policy-finding -o ./schemas/policy.finding.json' to regenerate it." - diff schemas/policy.finding.json /tmp/policy.finding.json - failed=1 - fi + check_file docs/usage.md /tmp/usage.md \ + "cargo run -- --quiet markdown-help > docs/usage.md" + check_file schemas/semconv.schema.v2.json /tmp/semconv.schema.v2.json \ + "cargo run -- --quiet registry json-schema -j semconv-definition-v2 -o ./schemas/semconv.schema.v2.json" + check_file schemas/semconv.resolved.v2.json /tmp/semconv.resolved.v2.json \ + "cargo run -- --quiet registry json-schema -j resolved-registry-v2 -o ./schemas/semconv.resolved.v2.json" + check_file schemas/policy.finding.json /tmp/policy.finding.json \ + "cargo run -- --quiet registry json-schema -j policy-finding -o ./schemas/policy.finding.json" + check_file schemas/semconv.materialized.v2.json /tmp/semconv.materialized.v2.json \ + "cargo run -- --quiet registry json-schema -j materialized-registry-v2 -o ./schemas/semconv.materialized.v2.json" + check_file schemas/semconv.diff.v2.json /tmp/semconv.diff.v2.json \ + "cargo run -- --quiet registry json-schema -j diff-v2 -o ./schemas/semconv.diff.v2.json" + check_file schemas/publication-manifest.v2.json /tmp/publication-manifest.v2.json \ + "cargo run -- --quiet registry json-schema -j publication-manifest-v2 -o ./schemas/publication-manifest.v2.json" + check_file schemas/definition-manifest.v2.json /tmp/definition-manifest.v2.json \ + "cargo run -- --quiet registry json-schema -j definition-manifest-v2 -o ./schemas/definition-manifest.v2.json" exit $failed coverage: diff --git a/Cargo.lock b/Cargo.lock index 2b297e4de..cc3e4305f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6038,6 +6038,7 @@ dependencies = [ "serde", "serde_yaml", "thiserror 2.0.18", + "weaver_semconv", ] [[package]] diff --git a/crates/weaver_resolved_schema/src/lib.rs b/crates/weaver_resolved_schema/src/lib.rs index b97f7b6df..606bd1287 100644 --- a/crates/weaver_resolved_schema/src/lib.rs +++ b/crates/weaver_resolved_schema/src/lib.rs @@ -39,7 +39,7 @@ pub const OTEL_REGISTRY_ID: &str = "OTEL"; /// Version string denoting V1 resolved schema. pub(crate) const V1_RESOLVED_FILE_FORMAT: &str = "resolved/1.0.0"; -/// Version string dentoing V2 resolved scehma. +/// Version string denoting V2 resolved schema. pub(crate) const V2_RESOLVED_FILE_FORMAT: &str = "resolved/2.0.0"; /// A Resolved Telemetry Schema. diff --git a/crates/weaver_resolved_schema/src/v2/mod.rs b/crates/weaver_resolved_schema/src/v2/mod.rs index 5e0df20b3..25be5215f 100644 --- a/crates/weaver_resolved_schema/src/v2/mod.rs +++ b/crates/weaver_resolved_schema/src/v2/mod.rs @@ -74,6 +74,8 @@ impl ResolvedTelemetrySchema { pub fn diff(&self, baseline_schema: &ResolvedTelemetrySchema) -> SchemaChanges { // TODO - get manifests SchemaChanges { + head_schema_url: self.schema_url.clone(), + baseline_schema_url: baseline_schema.schema_url.clone(), registry: self.registry_diff(baseline_schema), } } diff --git a/crates/weaver_version/Cargo.toml b/crates/weaver_version/Cargo.toml index 59161ad97..d0173e752 100644 --- a/crates/weaver_version/Cargo.toml +++ b/crates/weaver_version/Cargo.toml @@ -18,3 +18,4 @@ thiserror.workspace = true schemars.workspace = true semver = {version = "1.0.27", features = ["serde"]} +weaver_semconv = { path = "../weaver_semconv" } diff --git a/crates/weaver_version/src/v2/mod.rs b/crates/weaver_version/src/v2/mod.rs index 59af6f26a..53ea9fa80 100644 --- a/crates/weaver_version/src/v2/mod.rs +++ b/crates/weaver_version/src/v2/mod.rs @@ -2,18 +2,33 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; +use weaver_semconv::schema_url::SchemaUrl; // V2 Leverages the same nomenclature for diff as V1. pub use crate::schema_changes::SchemaItemChange; /// A summary of schema changes between two versions of a schema. -#[derive(Debug, Default, Serialize, Deserialize, JsonSchema)] +#[derive(Debug, Serialize, Deserialize, JsonSchema)] #[serde(rename_all = "snake_case")] pub struct SchemaChanges { + /// Schema URL of the head (newer) schema. + pub head_schema_url: SchemaUrl, + /// Schema URL of the baseline (older) schema. + pub baseline_schema_url: SchemaUrl, /// Changes to the registry. pub registry: RegistryChanges, } +impl Default for SchemaChanges { + fn default() -> Self { + Self { + head_schema_url: SchemaUrl::new_unknown(), + baseline_schema_url: SchemaUrl::new_unknown(), + registry: RegistryChanges::default(), + } + } +} + /// A summary of changes to the registry of signals and attributes. #[derive(Debug, Default, Serialize, Deserialize, JsonSchema)] #[serde(rename_all = "snake_case")] @@ -31,6 +46,7 @@ pub struct RegistryChanges { /// Changes across the registry of spans. pub span_changes: Vec, } + impl RegistryChanges { /// Returns true if there are no changes in the schema. /// Otherwise, it returns false. diff --git a/schemas/semconv-schemas.md b/schemas/semconv-schemas.md new file mode 100644 index 000000000..4d4d172e3 --- /dev/null +++ b/schemas/semconv-schemas.md @@ -0,0 +1,374 @@ +# Semantic Conventions Schemas + +**Status**: [Alpha][DocumentStatus] + + + +- [Semantic Conventions Schemas](#semantic-conventions-schemas) + - [Authoring schemas](#authoring-schemas) + - [Definition manifest](#definition-manifest) + - [Definition schema](#definition-schema) + - [Publication schemas](#publication-schemas) + - [Publication manifest](#publication-manifest) + - [Resolved schema](#resolved-schema) + - [Resolved schema properties](#resolved-schema-properties) + - [Other schemas](#other-schemas) + - [Materialized resolved schema](#materialized-resolved-schema) + - [Materialized schema properties](#materialized-schema-properties) + - [Diff schema](#diff-schema) + - [Common types](#common-types) + - [Requirement level](#requirement-level) + - [Common signal and attribute properties](#common-signal-and-attribute-properties) + + + +> [!WARNING] +> This document describes the v2 Semantic Conventions YAML model, +> which is under active development. + +This document describes schemas that govern the lifecycle of semantic conventions, +organized by how they are used: + +- [**Authoring schemas**](#authoring-schemas) — used when writing and developing a registry +- [**Publication schemas**](#publication-schemas) — produced when packaging a registry for distribution +- [**Other schemas**](#other-schemas) — consumed by weaver commands internally, not distributed as files + +## Authoring schemas + +### Definition manifest + +The *definition manifest* is a YAML file that describes a registry under development — its identity, +stability, and dependencies on other registries. It is the starting point for any registry project. +See the [definition manifest JSON schema](/schemas/definition-manifest.v2.json) for the full reference. + +Properties: + +- **schema_url**: Schema URL that uniquely identifies this registry and its version. Must follow the + OTel schema URL format: `http[s]://server[:port]/path/`. +- **stability**: Stability level of the registry (optional, defaults to `development`). + One of: `development`, `alpha`, `beta`, `release_candidate`, `stable`. +- **description**: Markdown description of the registry (optional). +- **dependencies**: Registries this registry builds on (optional). Currently at most one dependency + is supported. Each dependency has: + - `schema_url`: Schema URL of the dependency registry (required) + - `registry_path`: Path to the dependency's files (optional). When omitted, + the dependency is resolved by its `schema_url` alone. Can be: + - A local directory or archive (`.zip`, `.tar.gz`) + - A remote archive URL + - A Git repository URL + +For example, a definition manifest for a registry that extends OTel semantic conventions: + +```yaml +schema_url: https://acme.com/schemas/my-registry/1.0.0 +stability: development +description: My custom registry. +dependencies: +- schema_url: https://opentelemetry.io/schemas/1.{future}.0 +``` + +### Definition schema + +The *definition* schema is used to write conventions. Conventions can be defined in multiple files. The +syntax is focused on avoiding duplication, maximizing consistency, and easing authoring. +See the [definition schema syntax](/schemas/semconv-syntax.v2.md) for details and examples, +and the [JSON schema](/schemas/semconv.schema.v2.json) for the full reference. + +For example, the definition schema might look like this: + +```yaml +file_format: "definition/2" +attributes: +- key: my.operation.name + type: string + stability: development + brief: My service operation name as defined in this Open API spec + examples: ["get_object", "create_collection"] +... +metrics: +- name: my.client.operation.duration + stability: stable + instrument: histogram + unit: s + attributes: + - ref: my.operation.name + - ref_group: my.operation.server.attributes + - ref: error.type +``` + + + +## Publication schemas + +Produced by [`weaver registry package`](/docs/usage.md#weaver-registry-package). + +### Publication manifest + +The *publication manifest* is produced by `weaver registry package` alongside the resolved schema. +Together they form a self-contained, distributable registry artifact. The publication manifest is the +stricter counterpart of the definition manifest — it requires a resolved schema to be present and +records its location. +See the [publication manifest JSON schema](/schemas/publication-manifest.v2.json) for the full reference. + +Properties: + +- **file_format**: `"manifest/2.0.0"` +- **schema_url**: Schema URL that uniquely identifies this registry and its version. +- **resolved_schema_uri**: URI pointing to the resolved schema file included in the package. +- **stability**: Stability level of the registry (optional, defaults to `development`). +- **description**: Description of the registry (optional). +- **dependencies**: Same structure as in the [definition manifest](#definition-manifest). + +For example, the publication manifest produced from the definition manifest above: + +```yaml +file_format: "manifest/2.0.0" +schema_url: https://acme.com/schemas/my-registry/1.0.0 +resolved_schema_uri: https://acme.com/schemas/my-registry/1.0.0/resolved.yaml +stability: development +description: My custom registry +dependencies: +- schema_url: https://opentelemetry.io/schemas/1.{future}.0 +``` + +### Resolved schema + +The *resolved* schema is a single file produced from a set of definition schemas. It contains all +registry signals and refinements in a single, self-contained file. It is optimized for +distribution and in-memory representation. + +The *resolved* schema is produced by `weaver registry package` alongside the publication manifest. +See the [resolved JSON schema](/schemas/semconv.resolved.v2.json) for the full reference. + +The resolved version of the metric above would look like this: + +```yaml +# returned from https://acme.com/schemas/my-registry/1.0.0/resolved.yaml +file_format: "resolved/2.0.0" +schema_url: https://opentelemetry.io/schemas/semconv/1.{future}.0 +attribute_catalog: +... +- key: my.operation.name + type: string + stability: development + brief: My service operation name as defined in this Open API spec + examples: ["get_object", "create_collection"] +... +registry: + attributes: + - 888 # index of `server.address` in attribute_catalog + - 1042 # index of `my.operation.name` in attribute_catalog + ... + metrics: + - name: my.client.operation.duration + instrument: histogram + unit: s + attributes: + - base: 1042 # index of `my.operation.name` + requirement_level: required + - base: 888 # index of `server.address` + requirement_level: recommended + ... +refinements: + metrics: + - name: my.client.operation.duration + instrument: histogram + unit: s + attributes: + - base: 1042 + requirement_level: required + ... +``` + +Attribute references are indexes into the `attribute_catalog` array, paired with per-signal properties such as `requirement_level`. + +#### Resolved schema properties + +- **file_format**: `"resolved/2.0.0"` +- **schema_url**: The Schema URL where this registry is or will be published +- **attribute_catalog**: All attribute definitions. May include duplicate entries for the same key when + refinements override attribute properties. Each entry has: + - `key`: Attribute key + - `type`: Attribute type — primitive, array, template, or enum with members + - `examples`: Example values (optional) + - [Common properties](#common-signal-and-attribute-properties) + - Note: `requirement_level` is *not* a catalog property — it is defined per signal on each attribute reference. +- **registry**: All signal and attribute definitions + - **attributes**: Indexes into `attribute_catalog` for original attribute definitions. No duplicates. + - **attribute_groups**: Public attribute groups + - `id`: Unique identifier + - `attributes`: Attribute indexes (into `attribute_catalog`) + - [Common properties](#common-signal-and-attribute-properties) + - **metrics**: Metric signal definitions + - `name`: Unique metric name + - `instrument`: Instrument type (`counter`, `gauge`, `histogram`, `updowncounter`) + - `unit`: Measurement unit + - `attributes`: Attribute references (optional) + - `base`: Index into `attribute_catalog` + - `requirement_level`: See [Requirement level](#requirement-level) + - `entity_associations`: Associated entity types (optional) + - [Common properties](#common-signal-and-attribute-properties) + - **spans**: Span signal definitions + - `type`: Unique span type identifier + - `name`: Object with a `note` field describing how the span name should be constructed + - `kind`: Span kind (`client`, `server`, `internal`, `producer`, `consumer`) + - `attributes`: Attribute references (optional) + - `base`: Index into `attribute_catalog` + - `requirement_level`: See [Requirement level](#requirement-level) + - `sampling_relevant`: Whether this attribute must be available at span start (optional) + - `entity_associations`: Associated entity types (optional) + - [Common properties](#common-signal-and-attribute-properties) + - **events**: Event signal definitions + - `name`: Unique event name + - `attributes`: Attribute references (optional) + - `base`: Index into `attribute_catalog` + - `requirement_level`: See [Requirement level](#requirement-level) + - `entity_associations`: Associated entity types (optional) + - [Common properties](#common-signal-and-attribute-properties) + - **entities**: Entity (resource) signal definitions + - `type`: Unique entity type + - `identity`: Attribute references for the attributes that uniquely identify an entity instance (required) + - `base`: Index into `attribute_catalog` + - `requirement_level`: See [Requirement level](#requirement-level) + - `description`: Attribute references for non-identifying descriptive attributes (optional) + - `base`: Index into `attribute_catalog` + - `requirement_level`: See [Requirement level](#requirement-level) + - [Common properties](#common-signal-and-attribute-properties) +- **refinements**: Signal refinements that extend base signals for specific implementations. + Each refinement is a fully-resolved variant of a base signal. + - **spans**: Span refinements — `id` plus all span properties + - **metrics**: Metric refinements — `id` plus all metric properties + - **events**: Event refinements — `id` plus all event properties + +## Other schemas + +These schemas are not distributed as files — they are constructed in memory by weaver commands and +passed to jq filters, templates, and Rego policies. + +### Materialized resolved schema + +The *materialized resolved* schema, or *materialized* for short, is based on the *resolved* schema. +It expands all attribute indexes into full attribute definitions, making it self-contained for code +generation, documentation, and telemetry validation. + +> [!NOTE] +> The *forge* schema in the weaver codebase is an alias for the materialized schema. + +See the [materialized JSON schema](/schemas/semconv.materialized.v2.json) for the full reference. + +[`weaver registry generate`](/docs/usage.md#weaver-registry-generate), +[`weaver registry update-markdown`](/docs/usage.md#weaver-registry-update-markdown), and +[`weaver registry live-check`](/docs/usage.md#weaver-registry-live-check) +pass data conforming to this schema to jq filters, templates, and Rego policies. + +The materialized version of the same metric would look like: + +```yaml +schema_url: https://opentelemetry.io/schemas/semconv/1.{future}.0 +registry: + attributes: + ... + - key: my.operation.name + type: string + stability: development + brief: My service operation name as defined in this Open API spec + examples: ["get_object", "create_collection"] + ... + metrics: + - name: my.client.operation.duration + instrument: histogram + unit: s + attributes: + - key: my.operation.name # index replaced by full attribute definition + type: string + brief: My service operation name as defined in this Open API spec + stability: development + examples: ["get_object", "create_collection"] + requirement_level: required + - key: server.address + type: string + brief: Server domain name or IP address + examples: ["foo-us-west-prod.my.com"] + requirement_level: recommended + ... +refinements: + metrics: + - name: my.client.operation.duration + instrument: histogram + unit: s + attributes: + - key: my.operation.name # fully expanded + type: string + brief: My service operation name as defined in this Open API spec + stability: development + examples: ["get_object", "create_collection"] + requirement_level: required + ... +``` + +#### Materialized schema properties + +- **schema_url**: The Schema URL where this registry is or will be published +- **registry**: Same structure as in the *resolved* schema, but all attribute references are replaced + by complete attribute definitions. This applies to all signal types (metrics, spans, events, entities) + and to `attribute_groups`. +- **refinements**: Same structure as in the *resolved* schema, but attribute references are fully expanded. + +### Diff schema + +The *diff* schema represents changes between two versions of a semantic convention registry. +It is produced by [`weaver registry diff`](/docs/usage.md#weaver-registry-diff). If templates are +provided, the data is passed to the jq filter in the weaver config file; otherwise the command +output follows this schema directly. + +See the [diff JSON schema](/schemas/semconv.diff.v2.json) for the full reference. + +Top-level properties: + +- **head_schema_url**: Schema URL of the head (newer) registry +- **baseline_schema_url**: Schema URL of the baseline (older) registry +- **registry**: Change arrays for each telemetry type: + `attribute_changes`, `attribute_group_changes`, `metric_changes`, `span_changes`, `event_changes`, `entity_changes` + +Each change array contains objects with a `type` discriminator and type-specific fields: + +| `type` | Additional fields | Description | +| --- | --- | --- | +| `"added"` | `name` | Object added in the head registry | +| `"removed"` | `name` | Object removed from the head registry | +| `"renamed"` | `old_name`, `new_name`, `note` | Object renamed between versions | +| `"obsoleted"` | `name`, `note` | Object discontinued without a replacement | +| `"uncategorized"` | `name`, `note` | Change that doesn't fit other categories | +| `"updated"` | *(none)* | Placeholder for field-level updates (future use) | + +`name` is the identifier of the affected object — attribute key, metric name, entity type, event name, span type, or attribute group id. + +## Common types + +### Requirement level + +`requirement_level` appears on every attribute reference in the resolved and materialized schemas. +It is either a simple string or an object carrying an explanation: + +| Value | Meaning | +| --- | --- | +| `"required"` | Always required | +| `"recommended"` | Recommended by default | +| `"opt_in"` | Not collected by default | +| `{"conditionally_required": ""}` | Required when the condition holds | +| `{"recommended": ""}` | Recommended, with explicit rationale | +| `{"opt_in": ""}` | Opt-in, with explicit rationale | + +### Common signal and attribute properties + +All signals (metrics, spans, events, entities, attribute groups) and catalog attributes share these properties: + +| Property | Required | Description | +| --- | --- | --- | +| `brief` | yes | Short description | +| `stability` | yes | Stability level | +| `note` | no | Extended description | +| `deprecated` | no | Deprecation notice and migration guidance | +| `annotations` | no | Arbitrary key-value metadata | + +[DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status diff --git a/schemas/semconv.diff.v2.json b/schemas/semconv.diff.v2.json new file mode 100644 index 000000000..9e0f0df56 --- /dev/null +++ b/schemas/semconv.diff.v2.json @@ -0,0 +1,224 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "SchemaChanges", + "description": "A summary of schema changes between two versions of a schema.", + "type": "object", + "properties": { + "baseline_schema_url": { + "description": "Schema URL of the baseline (older) schema.", + "$ref": "#/$defs/SchemaUrl" + }, + "head_schema_url": { + "description": "Schema URL of the head (newer) schema.", + "$ref": "#/$defs/SchemaUrl" + }, + "registry": { + "description": "Changes to the registry.", + "$ref": "#/$defs/RegistryChanges" + } + }, + "required": [ + "head_schema_url", + "baseline_schema_url", + "registry" + ], + "$defs": { + "RegistryChanges": { + "description": "A summary of changes to the registry of signals and attributes.", + "type": "object", + "properties": { + "attribute_changes": { + "description": "Changes across the registry of attributes.", + "type": "array", + "items": { + "$ref": "#/$defs/SchemaItemChange" + } + }, + "attribute_group_changes": { + "description": "Changes across the registry of attribute groups.", + "type": "array", + "items": { + "$ref": "#/$defs/SchemaItemChange" + } + }, + "entity_changes": { + "description": "Changes across the registry of entities.", + "type": "array", + "items": { + "$ref": "#/$defs/SchemaItemChange" + } + }, + "event_changes": { + "description": "Changes across the registry of events.", + "type": "array", + "items": { + "$ref": "#/$defs/SchemaItemChange" + } + }, + "metric_changes": { + "description": "Changes across the registry of metrics.", + "type": "array", + "items": { + "$ref": "#/$defs/SchemaItemChange" + } + }, + "span_changes": { + "description": "Changes across the registry of spans.", + "type": "array", + "items": { + "$ref": "#/$defs/SchemaItemChange" + } + } + }, + "required": [ + "attribute_changes", + "attribute_group_changes", + "entity_changes", + "event_changes", + "metric_changes", + "span_changes" + ] + }, + "SchemaItemChange": { + "description": "Represents the different types of changes that can occur between\ntwo versions of a schema. This covers changes such as adding, removing,\nrenaming, and deprecating telemetry objects (attributes, metrics, etc.).", + "oneOf": [ + { + "description": "A top-level telemetry object (e.g., attribute, metric, etc.) was added to the head registry.", + "type": "object", + "properties": { + "name": { + "description": "The name of the added telemetry object.", + "type": "string" + }, + "type": { + "type": "string", + "const": "added" + } + }, + "required": [ + "type", + "name" + ] + }, + { + "description": "A top-level telemetry object from the baseline registry was renamed in the head registry.", + "type": "object", + "properties": { + "new_name": { + "description": "The new name of the telemetry object that has been renamed.", + "type": "string" + }, + "note": { + "description": "A note providing further context.", + "type": "string" + }, + "old_name": { + "description": "The old name of the telemetry object that has been renamed.", + "type": "string" + }, + "type": { + "type": "string", + "const": "renamed" + } + }, + "required": [ + "type", + "old_name", + "new_name", + "note" + ] + }, + { + "description": "One or more fields in a top-level telemetry object have been updated in the head registry.\nNote: This is a placeholder for future use.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "updated" + } + }, + "required": [ + "type" + ] + }, + { + "description": "A top-level telemetry object that is now discontinued without a valid replacement in the\nhead registry.", + "type": "object", + "properties": { + "name": { + "description": "The name of the obsoleted telemetry object.", + "type": "string" + }, + "note": { + "description": "A deprecation note providing further context.", + "type": "string" + }, + "type": { + "type": "string", + "const": "obsoleted" + } + }, + "required": [ + "type", + "name", + "note" + ] + }, + { + "description": "A placeholder for complex or unclear schema changes that do not fit into existing types.\nThis type serves as a fallback when no specific category applies, with the expectation that\nsome of these changes will be reclassified into more precise schema types in the future.", + "type": "object", + "properties": { + "name": { + "description": "The name of the uncategorized telemetry object.", + "type": "string" + }, + "note": { + "description": "A note providing further context.", + "type": "string" + }, + "type": { + "type": "string", + "const": "uncategorized" + } + }, + "required": [ + "type", + "name", + "note" + ] + }, + { + "description": "A top-level telemetry object from the baseline registry was removed in the head registry.", + "type": "object", + "properties": { + "name": { + "description": "The name of the removed telemetry object.", + "type": "string" + }, + "type": { + "type": "string", + "const": "removed" + } + }, + "required": [ + "type", + "name" + ] + } + ] + }, + "SchemaUrl": { + "description": "Represents the schema URL of a registry, which serves as a unique identifier for the registry\nalong with its version.", + "type": "object", + "properties": { + "url": { + "description": "The schema URL string.", + "type": "string" + } + }, + "required": [ + "url" + ] + } + } +} \ No newline at end of file diff --git a/schemas/semconv.materialized.v2.json b/schemas/semconv.materialized.v2.json new file mode 100644 index 000000000..9e6887c8f --- /dev/null +++ b/schemas/semconv.materialized.v2.json @@ -0,0 +1,1586 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "ForgeResolvedRegistry", + "description": "A resolved semantic convention registry used in the context of the template and policy\nengines.\n\nThis includes all registrys fully fleshed out and ready for codegen.", + "type": "object", + "properties": { + "refinements": { + "description": "The set of refinments defined in this registry.", + "$ref": "#/$defs/Refinements" + }, + "registry": { + "description": "The signals defined in this registry.", + "$ref": "#/$defs/Registry" + }, + "schema_url": { + "description": "The semantic convention registry url.", + "$ref": "#/$defs/SchemaUrl" + } + }, + "additionalProperties": false, + "required": [ + "schema_url", + "registry", + "refinements" + ], + "$defs": { + "Attribute": { + "description": "The definition of an Attribute.", + "type": "object", + "properties": { + "annotations": { + "description": "Annotations for the attribute or signal.", + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/YamlValue" + } + }, + "brief": { + "description": "A brief description of the attribute or signal.", + "type": "string" + }, + "deprecated": { + "description": "Specifies if the semantic convention is deprecated. The string\nprovided as description MUST specify why it's deprecated and/or what\nto use instead. See also stability.", + "anyOf": [ + { + "$ref": "#/$defs/Deprecated" + }, + { + "type": "null" + } + ] + }, + "examples": { + "description": "Sequence of example values for the attribute or single example\nvalue. They are required only for string and string array\nattributes. Example values must be of the same type of the\nattribute. If only a single example is provided, it can directly\nbe reported without encapsulating it into a sequence/dictionary.", + "anyOf": [ + { + "$ref": "#/$defs/Examples" + }, + { + "type": "null" + } + ] + }, + "key": { + "description": "String that uniquely identifies the attribute.", + "type": "string" + }, + "note": { + "description": "A more elaborate description of the attribute or signal.\nIt defaults to an empty string.", + "type": "string" + }, + "stability": { + "description": "Specifies the stability of the attribute or signal.", + "$ref": "#/$defs/Stability" + }, + "type": { + "description": "Either a string literal denoting the type as a primitive or an\narray type, a template type or an enum definition.", + "$ref": "#/$defs/AttributeType" + } + }, + "additionalProperties": false, + "required": [ + "key", + "type", + "brief", + "stability" + ] + }, + "AttributeGroup": { + "description": "Public attribute group.", + "type": "object", + "properties": { + "annotations": { + "description": "Annotations for the attribute or signal.", + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/YamlValue" + } + }, + "attributes": { + "description": "List of attributes.", + "type": "array", + "items": { + "$ref": "#/$defs/Attribute" + } + }, + "brief": { + "description": "A brief description of the attribute or signal.", + "type": "string" + }, + "deprecated": { + "description": "Specifies if the semantic convention is deprecated. The string\nprovided as description MUST specify why it's deprecated and/or what\nto use instead. See also stability.", + "anyOf": [ + { + "$ref": "#/$defs/Deprecated" + }, + { + "type": "null" + } + ] + }, + "id": { + "description": "The name of the attribute group, must be unique.", + "$ref": "#/$defs/SignalId" + }, + "note": { + "description": "A more elaborate description of the attribute or signal.\nIt defaults to an empty string.", + "type": "string" + }, + "stability": { + "description": "Specifies the stability of the attribute or signal.", + "$ref": "#/$defs/Stability" + } + }, + "additionalProperties": false, + "required": [ + "id", + "attributes", + "brief", + "stability" + ] + }, + "AttributeType": { + "description": "The different types of attributes (specification).", + "anyOf": [ + { + "description": "Primitive or array type.", + "$ref": "#/$defs/PrimitiveOrArrayTypeSpec" + }, + { + "description": "A template type.", + "$ref": "#/$defs/TemplateTypeSpec" + }, + { + "description": "An enum definition type.", + "type": "object", + "properties": { + "members": { + "description": "List of enum entries.", + "type": "array", + "items": { + "$ref": "#/$defs/EnumEntriesSpec" + } + } + }, + "required": [ + "members" + ] + } + ] + }, + "BasicRequirementLevelSpec": { + "description": "The different types of basic requirement levels.", + "oneOf": [ + { + "description": "A required requirement level.", + "type": "string", + "const": "required" + }, + { + "description": "An optional requirement level.", + "type": "string", + "const": "recommended" + }, + { + "description": "An opt-in requirement level.", + "type": "string", + "const": "opt_in" + } + ] + }, + "Deprecated": { + "description": "The different ways to deprecate an attribute, a metric, ...", + "oneOf": [ + { + "description": "The telemetry object containing the deprecated field has been renamed to an\nexisting or a new telemetry object.", + "type": "object", + "properties": { + "note": { + "description": "The note to provide more context about the deprecation.", + "type": "string" + }, + "reason": { + "type": "string", + "const": "renamed" + }, + "renamed_to": { + "description": "The new name of the telemetry object.", + "type": "string" + } + }, + "required": [ + "reason", + "renamed_to", + "note" + ] + }, + { + "description": "The telemetry object containing the deprecated field has been obsoleted\nbecause it no longer exists and has no valid replacement.\n\nThe `brief` field should contain the reason why the field has been obsoleted.", + "type": "object", + "properties": { + "note": { + "description": "The note to provide more context about the deprecation.", + "type": "string" + }, + "reason": { + "type": "string", + "const": "obsoleted" + } + }, + "required": [ + "reason", + "note" + ] + }, + { + "description": "The telemetry object containing the deprecated field has been deprecated for\ncomplex reasons (split, merge, ...) which are currently not precisely defined\nin the supported deprecation reasons.\n\nThe `brief` field should contain the reason for this uncategorized deprecation.", + "type": "object", + "properties": { + "note": { + "description": "The note to provide more context about the deprecation.", + "type": "string" + }, + "reason": { + "type": "string", + "const": "uncategorized" + } + }, + "required": [ + "reason", + "note" + ] + }, + { + "description": "This variant is used to capture old, unstructured deprecated \"string\".\nUsed for backward-compatibility only.", + "type": "object", + "properties": { + "note": { + "description": "The note to provide more context about the deprecation.", + "type": "string" + }, + "reason": { + "type": "string", + "const": "unspecified" + } + }, + "required": [ + "reason", + "note" + ] + } + ] + }, + "Entity": { + "description": "The definition of an entity signal.", + "type": "object", + "properties": { + "annotations": { + "description": "Annotations for the attribute or signal.", + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/YamlValue" + } + }, + "brief": { + "description": "A brief description of the attribute or signal.", + "type": "string" + }, + "deprecated": { + "description": "Specifies if the semantic convention is deprecated. The string\nprovided as description MUST specify why it's deprecated and/or what\nto use instead. See also stability.", + "anyOf": [ + { + "$ref": "#/$defs/Deprecated" + }, + { + "type": "null" + } + ] + }, + "description": { + "description": "List of attributes that describe to this entity.", + "type": "array", + "items": { + "$ref": "#/$defs/EntityAttribute" + } + }, + "identity": { + "description": "List of attributes that identify this entity.", + "type": "array", + "items": { + "$ref": "#/$defs/EntityAttribute" + } + }, + "note": { + "description": "A more elaborate description of the attribute or signal.\nIt defaults to an empty string.", + "type": "string" + }, + "stability": { + "description": "Specifies the stability of the attribute or signal.", + "$ref": "#/$defs/Stability" + }, + "type": { + "description": "The type of the entity.", + "$ref": "#/$defs/SignalId" + } + }, + "additionalProperties": false, + "required": [ + "type", + "brief", + "stability" + ] + }, + "EntityAttribute": { + "description": "A special type of reference to attributes that remembers entity-specific information.", + "type": "object", + "properties": { + "annotations": { + "description": "Annotations for the attribute or signal.", + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/YamlValue" + } + }, + "brief": { + "description": "A brief description of the attribute or signal.", + "type": "string" + }, + "deprecated": { + "description": "Specifies if the semantic convention is deprecated. The string\nprovided as description MUST specify why it's deprecated and/or what\nto use instead. See also stability.", + "anyOf": [ + { + "$ref": "#/$defs/Deprecated" + }, + { + "type": "null" + } + ] + }, + "examples": { + "description": "Sequence of example values for the attribute or single example\nvalue. They are required only for string and string array\nattributes. Example values must be of the same type of the\nattribute. If only a single example is provided, it can directly\nbe reported without encapsulating it into a sequence/dictionary.", + "anyOf": [ + { + "$ref": "#/$defs/Examples" + }, + { + "type": "null" + } + ] + }, + "key": { + "description": "String that uniquely identifies the attribute.", + "type": "string" + }, + "note": { + "description": "A more elaborate description of the attribute or signal.\nIt defaults to an empty string.", + "type": "string" + }, + "requirement_level": { + "description": "Specifies if the attribute is mandatory. Can be \"required\",\n\"conditionally_required\", \"recommended\" or \"opt_in\". When omitted,\nthe attribute is \"recommended\". When set to\n\"conditionally_required\", the string provided as `condition`` MUST\nspecify the conditions under which the attribute is required.", + "$ref": "#/$defs/RequirementLevel" + }, + "stability": { + "description": "Specifies the stability of the attribute or signal.", + "$ref": "#/$defs/Stability" + }, + "type": { + "description": "Either a string literal denoting the type as a primitive or an\narray type, a template type or an enum definition.", + "$ref": "#/$defs/AttributeType" + } + }, + "additionalProperties": false, + "required": [ + "key", + "type", + "brief", + "stability", + "requirement_level" + ] + }, + "EnumEntriesSpec": { + "description": "Possible enum entries.", + "type": "object", + "properties": { + "annotations": { + "description": "Annotations for the member.", + "type": [ + "object", + "null" + ], + "additionalProperties": { + "$ref": "#/$defs/YamlValue" + } + }, + "brief": { + "description": "Brief description of the enum entry value.\nIt defaults to the value of id.", + "type": [ + "string", + "null" + ] + }, + "deprecated": { + "description": "Deprecation note.", + "anyOf": [ + { + "$ref": "#/$defs/Deprecated" + }, + { + "type": "null" + } + ] + }, + "id": { + "description": "String that uniquely identifies the enum entry.", + "type": "string" + }, + "note": { + "description": "Longer description.\nIt defaults to an empty string.", + "type": [ + "string", + "null" + ] + }, + "stability": { + "description": "Stability of this enum value.", + "anyOf": [ + { + "$ref": "#/$defs/Stability" + }, + { + "type": "null" + } + ] + }, + "value": { + "description": "String, int, or boolean; value of the enum entry.", + "$ref": "#/$defs/ValueSpec" + } + }, + "additionalProperties": false, + "required": [ + "id", + "value" + ] + }, + "Event": { + "description": "The definition of an event signal.", + "type": "object", + "properties": { + "annotations": { + "description": "Annotations for the attribute or signal.", + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/YamlValue" + } + }, + "attributes": { + "description": "List of attributes that belong to this event.", + "type": "array", + "items": { + "$ref": "#/$defs/EventAttribute" + } + }, + "brief": { + "description": "A brief description of the attribute or signal.", + "type": "string" + }, + "deprecated": { + "description": "Specifies if the semantic convention is deprecated. The string\nprovided as description MUST specify why it's deprecated and/or what\nto use instead. See also stability.", + "anyOf": [ + { + "$ref": "#/$defs/Deprecated" + }, + { + "type": "null" + } + ] + }, + "entity_associations": { + "description": "Which resources this event should be associated with.\n\nThis list is an \"any of\" list, where a event may be associated with one or more entities, but should\nbe associated with at least one in this list.", + "type": "array", + "items": { + "type": "string" + } + }, + "name": { + "description": "The name of the event.", + "$ref": "#/$defs/SignalId" + }, + "note": { + "description": "A more elaborate description of the attribute or signal.\nIt defaults to an empty string.", + "type": "string" + }, + "stability": { + "description": "Specifies the stability of the attribute or signal.", + "$ref": "#/$defs/Stability" + } + }, + "additionalProperties": false, + "required": [ + "name", + "brief", + "stability" + ] + }, + "EventAttribute": { + "description": "A special type of reference to attributes that remembers event-specicific information.", + "type": "object", + "properties": { + "annotations": { + "description": "Annotations for the attribute or signal.", + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/YamlValue" + } + }, + "brief": { + "description": "A brief description of the attribute or signal.", + "type": "string" + }, + "deprecated": { + "description": "Specifies if the semantic convention is deprecated. The string\nprovided as description MUST specify why it's deprecated and/or what\nto use instead. See also stability.", + "anyOf": [ + { + "$ref": "#/$defs/Deprecated" + }, + { + "type": "null" + } + ] + }, + "examples": { + "description": "Sequence of example values for the attribute or single example\nvalue. They are required only for string and string array\nattributes. Example values must be of the same type of the\nattribute. If only a single example is provided, it can directly\nbe reported without encapsulating it into a sequence/dictionary.", + "anyOf": [ + { + "$ref": "#/$defs/Examples" + }, + { + "type": "null" + } + ] + }, + "key": { + "description": "String that uniquely identifies the attribute.", + "type": "string" + }, + "note": { + "description": "A more elaborate description of the attribute or signal.\nIt defaults to an empty string.", + "type": "string" + }, + "requirement_level": { + "description": "Specifies if the attribute is mandatory. Can be \"required\",\n\"conditionally_required\", \"recommended\" or \"opt_in\". When omitted,\nthe attribute is \"recommended\". When set to\n\"conditionally_required\", the string provided as `condition` MUST\nspecify the conditions under which the attribute is required.", + "$ref": "#/$defs/RequirementLevel" + }, + "stability": { + "description": "Specifies the stability of the attribute or signal.", + "$ref": "#/$defs/Stability" + }, + "type": { + "description": "Either a string literal denoting the type as a primitive or an\narray type, a template type or an enum definition.", + "$ref": "#/$defs/AttributeType" + } + }, + "additionalProperties": false, + "required": [ + "key", + "type", + "brief", + "stability", + "requirement_level" + ] + }, + "EventRefinement": { + "description": "A refinement of an event signal, for use in code generation or specific library application.\n\nA refinement represents a \"view\" of an Event that is highly optimised for a particular implementation.\ne.g. for HTTP events, there may be a refinement that provides only the necessary information for dealing with Java's HTTP\nclient library, and drops optional or extraneous information from the underlying http event.", + "type": "object", + "properties": { + "annotations": { + "description": "Annotations for the attribute or signal.", + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/YamlValue" + } + }, + "attributes": { + "description": "List of attributes that belong to this event.", + "type": "array", + "items": { + "$ref": "#/$defs/EventAttribute" + } + }, + "brief": { + "description": "A brief description of the attribute or signal.", + "type": "string" + }, + "deprecated": { + "description": "Specifies if the semantic convention is deprecated. The string\nprovided as description MUST specify why it's deprecated and/or what\nto use instead. See also stability.", + "anyOf": [ + { + "$ref": "#/$defs/Deprecated" + }, + { + "type": "null" + } + ] + }, + "entity_associations": { + "description": "Which resources this event should be associated with.\n\nThis list is an \"any of\" list, where a event may be associated with one or more entities, but should\nbe associated with at least one in this list.", + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "description": "The identity of the refinement.", + "$ref": "#/$defs/SignalId" + }, + "name": { + "description": "The name of the event.", + "$ref": "#/$defs/SignalId" + }, + "note": { + "description": "A more elaborate description of the attribute or signal.\nIt defaults to an empty string.", + "type": "string" + }, + "stability": { + "description": "Specifies the stability of the attribute or signal.", + "$ref": "#/$defs/Stability" + } + }, + "required": [ + "id", + "name", + "brief", + "stability" + ] + }, + "Examples": { + "description": "The different types of examples.", + "anyOf": [ + { + "description": "A boolean example.", + "type": "boolean" + }, + { + "description": "A integer example.", + "type": "integer", + "format": "int64" + }, + { + "description": "A double example.", + "type": "number", + "format": "double" + }, + { + "description": "A string example.", + "type": "string" + }, + { + "description": "A any example.", + "$ref": "#/$defs/ValueSpec" + }, + { + "description": "A array of integers example.", + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + { + "description": "A array of doubles example.", + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + { + "description": "A array of bools example.", + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "description": "A array of strings example.", + "type": "array", + "items": { + "type": "string" + } + }, + { + "description": "A array of anys example.", + "type": "array", + "items": { + "$ref": "#/$defs/ValueSpec" + } + }, + { + "description": "List of arrays of integers example.", + "type": "array", + "items": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + } + }, + { + "description": "List of arrays of doubles example.", + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + } + }, + { + "description": "List of arrays of bools example.", + "type": "array", + "items": { + "type": "array", + "items": { + "type": "boolean" + } + } + }, + { + "description": "List of arrays of strings example.", + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + } + ] + }, + "InstrumentSpec": { + "description": "The type of the metric.", + "oneOf": [ + { + "description": "An up-down counter metric.", + "type": "string", + "const": "updowncounter" + }, + { + "description": "A counter metric.", + "type": "string", + "const": "counter" + }, + { + "description": "A gauge metric.", + "type": "string", + "const": "gauge" + }, + { + "description": "A histogram metric.", + "type": "string", + "const": "histogram" + } + ] + }, + "Metric": { + "description": "The definition of a metric signal.", + "type": "object", + "properties": { + "annotations": { + "description": "Annotations for the attribute or signal.", + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/YamlValue" + } + }, + "attributes": { + "description": "List of attributes that should be included on this metric.", + "type": "array", + "items": { + "$ref": "#/$defs/MetricAttribute" + } + }, + "brief": { + "description": "A brief description of the attribute or signal.", + "type": "string" + }, + "deprecated": { + "description": "Specifies if the semantic convention is deprecated. The string\nprovided as description MUST specify why it's deprecated and/or what\nto use instead. See also stability.", + "anyOf": [ + { + "$ref": "#/$defs/Deprecated" + }, + { + "type": "null" + } + ] + }, + "entity_associations": { + "description": "Which resources this metric should be associated with.\n\nThis list is an \"any of\" list, where a metric may be associated with one or more entities, but should\nbe associated with at least one in this list.", + "type": "array", + "items": { + "type": "string" + } + }, + "instrument": { + "description": "The instrument type that should be used to record the metric. Note that\nthe semantic conventions must be written using the names of the\nsynchronous instrument types (counter, gauge, updowncounter and\nhistogram).\nFor more details: [Metrics semantic conventions - Instrument types](https://github.com/open-telemetry/opentelemetry-specification/tree/main/specification/metrics/semantic_conventions#instrument-types).", + "$ref": "#/$defs/InstrumentSpec" + }, + "name": { + "description": "The name of the metric.", + "$ref": "#/$defs/SignalId" + }, + "note": { + "description": "A more elaborate description of the attribute or signal.\nIt defaults to an empty string.", + "type": "string" + }, + "stability": { + "description": "Specifies the stability of the attribute or signal.", + "$ref": "#/$defs/Stability" + }, + "unit": { + "description": "The unit in which the metric is measured, which should adhere to the\n[guidelines](https://github.com/open-telemetry/opentelemetry-specification/tree/main/specification/metrics/semantic_conventions#instrument-units).", + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "instrument", + "unit", + "brief", + "stability" + ] + }, + "MetricAttribute": { + "description": "A special type of reference to attributes that remembers metric-specific information.", + "type": "object", + "properties": { + "annotations": { + "description": "Annotations for the attribute or signal.", + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/YamlValue" + } + }, + "brief": { + "description": "A brief description of the attribute or signal.", + "type": "string" + }, + "deprecated": { + "description": "Specifies if the semantic convention is deprecated. The string\nprovided as description MUST specify why it's deprecated and/or what\nto use instead. See also stability.", + "anyOf": [ + { + "$ref": "#/$defs/Deprecated" + }, + { + "type": "null" + } + ] + }, + "examples": { + "description": "Sequence of example values for the attribute or single example\nvalue. They are required only for string and string array\nattributes. Example values must be of the same type of the\nattribute. If only a single example is provided, it can directly\nbe reported without encapsulating it into a sequence/dictionary.", + "anyOf": [ + { + "$ref": "#/$defs/Examples" + }, + { + "type": "null" + } + ] + }, + "key": { + "description": "String that uniquely identifies the attribute.", + "type": "string" + }, + "note": { + "description": "A more elaborate description of the attribute or signal.\nIt defaults to an empty string.", + "type": "string" + }, + "requirement_level": { + "description": "Specifies if the attribute is mandatory. Can be \"required\",\n\"conditionally_required\", \"recommended\" or \"opt_in\". When omitted,\nthe attribute is \"recommended\". When set to\n\"conditionally_required\", the string provided as `condition`` MUST\nspecify the conditions under which the attribute is required.\n\nNote: For attributes that are \"recommended\" or \"opt-in\" - not all metric source will\ncreate timeseries with these attributes, but for any given timeseries instance, the attributes that *were* present\nshould *remain* present. That is - a metric timeseries cannot drop attributes during its lifetime.", + "$ref": "#/$defs/RequirementLevel" + }, + "stability": { + "description": "Specifies the stability of the attribute or signal.", + "$ref": "#/$defs/Stability" + }, + "type": { + "description": "Either a string literal denoting the type as a primitive or an\narray type, a template type or an enum definition.", + "$ref": "#/$defs/AttributeType" + } + }, + "additionalProperties": false, + "required": [ + "key", + "type", + "brief", + "stability", + "requirement_level" + ] + }, + "MetricRefinement": { + "description": "A refinement of a metric signal, for use in code-gen or specific library application.\n\nA refinement represents a \"view\" of a Metric that is highly optimised for a particular implementation.\ne.g. for HTTP metrics, there may be a refinement that provides only the necessary information for dealing with Java's HTTP\nclient library, and drops optional or extraneous information from the underlying http metric.", + "type": "object", + "properties": { + "annotations": { + "description": "Annotations for the attribute or signal.", + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/YamlValue" + } + }, + "attributes": { + "description": "List of attributes that should be included on this metric.", + "type": "array", + "items": { + "$ref": "#/$defs/MetricAttribute" + } + }, + "brief": { + "description": "A brief description of the attribute or signal.", + "type": "string" + }, + "deprecated": { + "description": "Specifies if the semantic convention is deprecated. The string\nprovided as description MUST specify why it's deprecated and/or what\nto use instead. See also stability.", + "anyOf": [ + { + "$ref": "#/$defs/Deprecated" + }, + { + "type": "null" + } + ] + }, + "entity_associations": { + "description": "Which resources this metric should be associated with.\n\nThis list is an \"any of\" list, where a metric may be associated with one or more entities, but should\nbe associated with at least one in this list.", + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "description": "The identity of the refinement.", + "$ref": "#/$defs/SignalId" + }, + "instrument": { + "description": "The instrument type that should be used to record the metric. Note that\nthe semantic conventions must be written using the names of the\nsynchronous instrument types (counter, gauge, updowncounter and\nhistogram).\nFor more details: [Metrics semantic conventions - Instrument types](https://github.com/open-telemetry/opentelemetry-specification/tree/main/specification/metrics/semantic_conventions#instrument-types).", + "$ref": "#/$defs/InstrumentSpec" + }, + "name": { + "description": "The name of the metric.", + "$ref": "#/$defs/SignalId" + }, + "note": { + "description": "A more elaborate description of the attribute or signal.\nIt defaults to an empty string.", + "type": "string" + }, + "stability": { + "description": "Specifies the stability of the attribute or signal.", + "$ref": "#/$defs/Stability" + }, + "unit": { + "description": "The unit in which the metric is measured, which should adhere to the\n[guidelines](https://github.com/open-telemetry/opentelemetry-specification/tree/main/specification/metrics/semantic_conventions#instrument-units).", + "type": "string" + } + }, + "required": [ + "id", + "name", + "instrument", + "unit", + "brief", + "stability" + ] + }, + "PrimitiveOrArrayTypeSpec": { + "description": "Primitive or array types.", + "oneOf": [ + { + "description": "A boolean attribute.", + "type": "string", + "const": "boolean" + }, + { + "description": "A integer attribute (signed 64 bit integer).", + "type": "string", + "const": "int" + }, + { + "description": "A double attribute (double precision floating point (IEEE 754-1985)).", + "type": "string", + "const": "double" + }, + { + "description": "A string attribute.", + "type": "string", + "const": "string" + }, + { + "description": "An any type attribute (accepts any valid value).", + "type": "string", + "const": "any" + }, + { + "description": "An array of strings attribute.", + "type": "string", + "const": "string[]" + }, + { + "description": "An array of integer attribute.", + "type": "string", + "const": "int[]" + }, + { + "description": "An array of double attribute.", + "type": "string", + "const": "double[]" + }, + { + "description": "An array of boolean attribute.", + "type": "string", + "const": "boolean[]" + } + ] + }, + "Refinements": { + "description": "The set of all refinements for a semantic convention registry.\n\nA refinement is a specialization of a signal for a particular purpose,\ne.g. creating a MySQL specific instance of a database span for the purpose\nof codegeneration for MySQL.", + "type": "object", + "properties": { + "events": { + "description": "The event refinements defined.", + "type": "array", + "items": { + "$ref": "#/$defs/EventRefinement" + } + }, + "metrics": { + "description": "The metric refinements defined.", + "type": "array", + "items": { + "$ref": "#/$defs/MetricRefinement" + } + }, + "spans": { + "description": "The span refinements defined.", + "type": "array", + "items": { + "$ref": "#/$defs/SpanRefinement" + } + } + }, + "additionalProperties": false, + "required": [ + "metrics", + "spans", + "events" + ] + }, + "Registry": { + "description": "The set of all defined signals for a given semantic convention registry.", + "type": "object", + "properties": { + "attribute_groups": { + "description": "The public attribute groups in this registry.", + "type": "array", + "items": { + "$ref": "#/$defs/AttributeGroup" + } + }, + "attributes": { + "description": "The raw attributes in this registry.", + "type": "array", + "items": { + "$ref": "#/$defs/Attribute" + } + }, + "entities": { + "description": "The entity signals defined.", + "type": "array", + "items": { + "$ref": "#/$defs/Entity" + } + }, + "events": { + "description": "The event signals defined.", + "type": "array", + "items": { + "$ref": "#/$defs/Event" + } + }, + "metrics": { + "description": "The metric signals defined.", + "type": "array", + "items": { + "$ref": "#/$defs/Metric" + } + }, + "spans": { + "description": "The span signals defined.", + "type": "array", + "items": { + "$ref": "#/$defs/Span" + } + } + }, + "additionalProperties": false, + "required": [ + "attributes", + "attribute_groups", + "metrics", + "spans", + "events", + "entities" + ] + }, + "RequirementLevel": { + "description": "The different requirement level specifications.", + "anyOf": [ + { + "description": "A basic requirement level.", + "$ref": "#/$defs/BasicRequirementLevelSpec" + }, + { + "description": "A conditional requirement level.", + "type": "object", + "properties": { + "conditionally_required": { + "description": "The description of the condition.", + "type": "string" + } + }, + "required": [ + "conditionally_required" + ] + }, + { + "description": "A recommended requirement level.", + "type": "object", + "properties": { + "recommended": { + "description": "The description of the recommendation.", + "type": "string" + } + }, + "required": [ + "recommended" + ] + }, + { + "description": "An opt in requirement level.", + "type": "object", + "properties": { + "opt_in": { + "description": "The description of the recommendation.", + "type": "string" + } + }, + "required": [ + "opt_in" + ] + } + ] + }, + "SchemaUrl": { + "description": "Represents the schema URL of a registry, which serves as a unique identifier for the registry\nalong with its version.", + "type": "object", + "properties": { + "url": { + "description": "The schema URL string.", + "type": "string" + } + }, + "required": [ + "url" + ] + }, + "SignalId": { + "description": "An identifier for a signal. Should be `.` separated namespaces and names.", + "type": "string" + }, + "Span": { + "description": "The definition of a span signal.", + "type": "object", + "properties": { + "annotations": { + "description": "Annotations for the attribute or signal.", + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/YamlValue" + } + }, + "attributes": { + "description": "List of attributes that should be included on this span.", + "type": "array", + "items": { + "$ref": "#/$defs/SpanAttribute" + } + }, + "brief": { + "description": "A brief description of the attribute or signal.", + "type": "string" + }, + "deprecated": { + "description": "Specifies if the semantic convention is deprecated. The string\nprovided as description MUST specify why it's deprecated and/or what\nto use instead. See also stability.", + "anyOf": [ + { + "$ref": "#/$defs/Deprecated" + }, + { + "type": "null" + } + ] + }, + "entity_associations": { + "description": "Which resources this span should be associated with.\n\nThis list is an \"any of\" list, where a span may be associated with one or more entities, but should\nbe associated with at least one in this list.", + "type": "array", + "items": { + "type": "string" + } + }, + "kind": { + "description": "Specifies the kind of the span.", + "$ref": "#/$defs/SpanKindSpec" + }, + "name": { + "description": "The name pattern for the span.", + "$ref": "#/$defs/SpanName" + }, + "note": { + "description": "A more elaborate description of the attribute or signal.\nIt defaults to an empty string.", + "type": "string" + }, + "stability": { + "description": "Specifies the stability of the attribute or signal.", + "$ref": "#/$defs/Stability" + }, + "type": { + "description": "The type of the Span. This denotes the identity\nof the \"shape\" of this span, and must be unique.", + "$ref": "#/$defs/SignalId" + } + }, + "additionalProperties": false, + "required": [ + "type", + "kind", + "name", + "brief", + "stability" + ] + }, + "SpanAttribute": { + "description": "A special type of reference to attributes that remembers span-specicific information.", + "type": "object", + "properties": { + "annotations": { + "description": "Annotations for the attribute or signal.", + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/YamlValue" + } + }, + "brief": { + "description": "A brief description of the attribute or signal.", + "type": "string" + }, + "deprecated": { + "description": "Specifies if the semantic convention is deprecated. The string\nprovided as description MUST specify why it's deprecated and/or what\nto use instead. See also stability.", + "anyOf": [ + { + "$ref": "#/$defs/Deprecated" + }, + { + "type": "null" + } + ] + }, + "examples": { + "description": "Sequence of example values for the attribute or single example\nvalue. They are required only for string and string array\nattributes. Example values must be of the same type of the\nattribute. If only a single example is provided, it can directly\nbe reported without encapsulating it into a sequence/dictionary.", + "anyOf": [ + { + "$ref": "#/$defs/Examples" + }, + { + "type": "null" + } + ] + }, + "key": { + "description": "String that uniquely identifies the attribute.", + "type": "string" + }, + "note": { + "description": "A more elaborate description of the attribute or signal.\nIt defaults to an empty string.", + "type": "string" + }, + "requirement_level": { + "description": "Specifies if the attribute is mandatory. Can be \"required\",\n\"conditionally_required\", \"recommended\" or \"opt_in\". When omitted,\nthe attribute is \"recommended\". When set to\n\"conditionally_required\", the string provided as `condition` MUST\nspecify the conditions under which the attribute is required.", + "$ref": "#/$defs/RequirementLevel" + }, + "sampling_relevant": { + "description": "Specifies if the attribute is (especially) relevant for sampling\nand thus should be set at span start. It defaults to false.", + "type": [ + "boolean", + "null" + ] + }, + "stability": { + "description": "Specifies the stability of the attribute or signal.", + "$ref": "#/$defs/Stability" + }, + "type": { + "description": "Either a string literal denoting the type as a primitive or an\narray type, a template type or an enum definition.", + "$ref": "#/$defs/AttributeType" + } + }, + "additionalProperties": false, + "required": [ + "key", + "type", + "brief", + "stability", + "requirement_level" + ] + }, + "SpanKindSpec": { + "description": "The span kind.", + "oneOf": [ + { + "description": "An internal span.", + "type": "string", + "const": "internal" + }, + { + "description": "A client span.", + "type": "string", + "const": "client" + }, + { + "description": "A server span.", + "type": "string", + "const": "server" + }, + { + "description": "A producer span.", + "type": "string", + "const": "producer" + }, + { + "description": "A consumer span.", + "type": "string", + "const": "consumer" + } + ] + }, + "SpanName": { + "description": "Specification of the span name.", + "type": "object", + "properties": { + "note": { + "description": "Required description of how a span name should be created.", + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "note" + ] + }, + "SpanRefinement": { + "description": "A refinement of a span signal, for use in code-gen or specific library application.\n\nA refinement represents a \"view\" of a Span that is highly optimised for a particular implementation.\ne.g. for HTTP spans, there may be a refinement that provides only the necessary information for dealing with Java's HTTP\nclient library, and drops optional or extraneous information from the underlying http span.", + "type": "object", + "properties": { + "annotations": { + "description": "Annotations for the attribute or signal.", + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/YamlValue" + } + }, + "attributes": { + "description": "List of attributes that should be included on this span.", + "type": "array", + "items": { + "$ref": "#/$defs/SpanAttribute" + } + }, + "brief": { + "description": "A brief description of the attribute or signal.", + "type": "string" + }, + "deprecated": { + "description": "Specifies if the semantic convention is deprecated. The string\nprovided as description MUST specify why it's deprecated and/or what\nto use instead. See also stability.", + "anyOf": [ + { + "$ref": "#/$defs/Deprecated" + }, + { + "type": "null" + } + ] + }, + "entity_associations": { + "description": "Which resources this span should be associated with.\n\nThis list is an \"any of\" list, where a span may be associated with one or more entities, but should\nbe associated with at least one in this list.", + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "description": "The identity of the refinement.", + "$ref": "#/$defs/SignalId" + }, + "kind": { + "description": "Specifies the kind of the span.", + "$ref": "#/$defs/SpanKindSpec" + }, + "name": { + "description": "The name pattern for the span.", + "$ref": "#/$defs/SpanName" + }, + "note": { + "description": "A more elaborate description of the attribute or signal.\nIt defaults to an empty string.", + "type": "string" + }, + "stability": { + "description": "Specifies the stability of the attribute or signal.", + "$ref": "#/$defs/Stability" + }, + "type": { + "description": "The type of the Span. This denotes the identity\nof the \"shape\" of this span, and must be unique.", + "$ref": "#/$defs/SignalId" + } + }, + "required": [ + "id", + "type", + "kind", + "name", + "brief", + "stability" + ] + }, + "Stability": { + "description": "The level of stability for a definition. Defined in [OTEP-232](https://github.com/open-telemetry/oteps/blob/main/text/0232-maturity-of-otel.md)", + "oneOf": [ + { + "description": "A deprecated definition.", + "type": "string", + "const": "deprecated", + "deprecated": true + }, + { + "description": "A stable definition.", + "type": "string", + "const": "stable" + }, + { + "description": "A definition in development. Formally known as experimental.", + "type": "string", + "const": "development" + }, + { + "description": "An alpha definition.", + "type": "string", + "const": "alpha" + }, + { + "description": "A beta definition.", + "type": "string", + "const": "beta" + }, + { + "description": "A release candidate definition.", + "type": "string", + "const": "release_candidate" + } + ] + }, + "TemplateTypeSpec": { + "description": "Template types.", + "oneOf": [ + { + "description": "A boolean attribute.", + "type": "string", + "const": "template[boolean]" + }, + { + "description": "A integer attribute.", + "type": "string", + "const": "template[int]" + }, + { + "description": "A double attribute.", + "type": "string", + "const": "template[double]" + }, + { + "description": "A string attribute.", + "type": "string", + "const": "template[string]" + }, + { + "description": "A any attribute.", + "type": "string", + "const": "template[any]" + }, + { + "description": "An array of strings attribute.", + "type": "string", + "const": "template[string[]]" + }, + { + "description": "An array of integer attribute.", + "type": "string", + "const": "template[int[]]" + }, + { + "description": "An array of double attribute.", + "type": "string", + "const": "template[double[]]" + }, + { + "description": "An array of boolean attribute.", + "type": "string", + "const": "template[boolean[]]" + } + ] + }, + "ValueSpec": { + "description": "The different types of values.", + "anyOf": [ + { + "description": "A integer value.", + "type": "integer", + "format": "int64" + }, + { + "description": "A double value.", + "type": "number", + "format": "double" + }, + { + "description": "A string value.", + "type": "string" + }, + { + "description": "A boolean value.", + "type": "boolean" + } + ] + }, + "YamlValue": { + "type": [ + "null", + "boolean", + "object", + "array", + "number", + "string" + ] + } + } +} \ No newline at end of file diff --git a/src/registry/json_schema.rs b/src/registry/json_schema.rs index 48b2da899..a2f269006 100644 --- a/src/registry/json_schema.rs +++ b/src/registry/json_schema.rs @@ -42,7 +42,7 @@ pub enum JsonSchemaType { /// The JSON schema of the V2 resolved registry. ResolvedRegistryV2, /// The JSON schema we send to Rego / Jinja. - ForgeRegistryV2, + MaterializedRegistryV2, /// The JSON schema of the diff Diff, /// The JSON schema of the diff V2 @@ -65,7 +65,7 @@ pub(crate) fn command(args: &RegistryJsonSchemaArgs) -> Result { schema_for!(weaver_resolved_schema::v2::ResolvedTelemetrySchema) } - JsonSchemaType::ForgeRegistryV2 => { + JsonSchemaType::MaterializedRegistryV2 => { schema_for!(weaver_forge::v2::registry::ForgeResolvedRegistry) } JsonSchemaType::Diff => schema_for!(weaver_version::schema_changes::SchemaChanges), diff --git a/src/serve/handlers.rs b/src/serve/handlers.rs index 806329373..63998cb68 100644 --- a/src/serve/handlers.rs +++ b/src/serve/handlers.rs @@ -37,7 +37,7 @@ pub async fn health() -> StatusCode { get, path = "/api/v1/schema/{name}", params( - ("name" = String, Path, description = "Schema name (ForgeRegistryV2, SemconvDefinitionV2, or LiveCheckSample)") + ("name" = String, Path, description = "Schema name (MaterializedRegistryV2, SemconvDefinitionV2, or LiveCheckSample)") ), responses( (status = 200, description = "Requested schema", content_type = "application/json"), @@ -49,14 +49,14 @@ pub async fn get_schema(Path(name): Path) -> impl IntoResponse { let name = name.trim_start_matches('/'); let schema = match name { - "ForgeRegistryV2" => schema_for!(weaver_forge::v2::registry::ForgeResolvedRegistry), + "MaterializedRegistryV2" => schema_for!(weaver_forge::v2::registry::ForgeResolvedRegistry), "SemconvDefinitionV2" => schema_for!(weaver_semconv::v2::SemConvSpecV2), "LiveCheckSample" => schema_for!(weaver_live_check::Sample), _ => { return ( StatusCode::NOT_FOUND, [(axum::http::header::CONTENT_TYPE, "application/json")], - json!({"error": format!("Schema '{}' not found. Available schemas: ForgeRegistryV2, SemconvDefinitionV2, LiveCheckSample", name)}).to_string(), + json!({"error": format!("Schema '{}' not found. Available schemas: MaterializedRegistryV2, SemconvDefinitionV2, LiveCheckSample", name)}).to_string(), ).into_response(); } }; diff --git a/ui/src/components/AppLayout.tsx b/ui/src/components/AppLayout.tsx index 8bfdc3e37..ca26415a7 100644 --- a/ui/src/components/AppLayout.tsx +++ b/ui/src/components/AppLayout.tsx @@ -29,7 +29,7 @@ export function AppLayout() { const activeSchema = (() => { if (!isActive('/schema')) return null const schemaParam = new URLSearchParams(location.search).get('schema') - return schemaParam || 'ForgeRegistryV2' + return schemaParam || 'MaterializedRegistryV2' })() const closeSidebar = () => { @@ -157,14 +157,14 @@ export function AppLayout() {
  • diff --git a/ui/src/routes/schema.tsx b/ui/src/routes/schema.tsx index 130bdb90b..17b30c6a8 100644 --- a/ui/src/routes/schema.tsx +++ b/ui/src/routes/schema.tsx @@ -32,7 +32,7 @@ function Schema() { setLoading(true) setError(null) - const schemaParam = search.schema || 'ForgeRegistryV2' + const schemaParam = search.schema || 'MaterializedRegistryV2' try { const data = await getSchema(schemaParam) @@ -70,7 +70,7 @@ function Schema() { search: (prev: SchemaSearch) => ({ ...prev, type: name, - schema: prev.schema || 'ForgeRegistryV2' + schema: prev.schema || 'MaterializedRegistryV2' }) }) } @@ -81,7 +81,7 @@ function Schema() { search: (prev: SchemaSearch) => ({ ...prev, type: 'root', - schema: prev.schema || 'ForgeRegistryV2' + schema: prev.schema || 'MaterializedRegistryV2' }) }) } From 923a480919ed8e49b7c5d7235d560621439345af Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Tue, 17 Mar 2026 12:44:43 -0700 Subject: [PATCH 2/4] lint --- CHANGELOG.md | 2 ++ src/registry/diff.rs | 1 + 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f174831ff..7a614f409 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. # Unreleased +- Publish and document missing JSON schemas. Add `head_schema_url`/`baseline_schema_url` to diff v2. ([#1106](https://github.com/open-telemetry/weaver/pull/1106) by @lmolkova) + # [0.22.1] - 2026-03-13 - Fix: Update release workflow for pnpm migration (use pnpm lockfile instead of npm lockfile). ([#1289](https://github.com/open-telemetry/weaver/pull/1289) by @jerbly) diff --git a/src/registry/diff.rs b/src/registry/diff.rs index 1d424430b..f799b7592 100644 --- a/src/registry/diff.rs +++ b/src/registry/diff.rs @@ -47,6 +47,7 @@ pub struct RegistryDiffArgs { pub(crate) diagnostic: DiagnosticArgs, } +#[allow(clippy::large_enum_variant)] enum VersionedDiff { V1(crate::weaver::Diff), V2(crate::weaver::DiffV2), From 41aeb91f5fc6802176e9f18e365715e168791b75 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Wed, 18 Mar 2026 07:07:15 -0700 Subject: [PATCH 3/4] lint --- crates/weaver_version/src/v2/mod.rs | 14 ++++++++++++++ docs/usage.md | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/crates/weaver_version/src/v2/mod.rs b/crates/weaver_version/src/v2/mod.rs index 53ea9fa80..c09c668e8 100644 --- a/crates/weaver_version/src/v2/mod.rs +++ b/crates/weaver_version/src/v2/mod.rs @@ -69,3 +69,17 @@ impl SchemaChanges { self.registry.is_empty() } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_schema_changes_default() { + let changes = SchemaChanges::default(); + assert_eq!(changes.head_schema_url, SchemaUrl::new_unknown()); + assert_eq!(changes.baseline_schema_url, SchemaUrl::new_unknown()); + assert!(changes.registry.is_empty()); + assert!(changes.is_empty()); + } +} diff --git a/docs/usage.md b/docs/usage.md index 1d5def6dc..8629c7872 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -341,7 +341,7 @@ The produced JSON Schema can be used to generate documentation of the resolved r The JSON schema of the V2 definition - `resolved-registry-v2`: The JSON schema of the V2 resolved registry - - `forge-registry-v2`: + - `materialized-registry-v2`: The JSON schema we send to Rego / Jinja - `diff`: The JSON schema of the diff From 60fd86b31ccdfe753650be805309c03d7559d063 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Fri, 3 Apr 2026 09:24:59 -0700 Subject: [PATCH 4/4] remove unnecessay change + clippy --- src/registry/diff.rs | 6 ------ src/weaver.rs | 4 ++++ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/registry/diff.rs b/src/registry/diff.rs index a6dc72748..bdce4a416 100644 --- a/src/registry/diff.rs +++ b/src/registry/diff.rs @@ -47,12 +47,6 @@ pub struct RegistryDiffArgs { pub(crate) diagnostic: DiagnosticArgs, } -#[allow(clippy::large_enum_variant)] -enum VersionedDiff { - V1(crate::weaver::Diff), - V2(crate::weaver::DiffV2), -} - /// Generate a diff between two versions of a semantic convention registry. pub(crate) fn command(args: &RegistryDiffArgs) -> Result { let mut diag_msgs = DiagnosticMessages::empty(); diff --git a/src/weaver.rs b/src/weaver.rs index 236cfa2fb..67713c2a9 100644 --- a/src/weaver.rs +++ b/src/weaver.rs @@ -212,6 +212,10 @@ impl Resolved { } } +#[allow( + clippy::large_enum_variant, + reason = "We plan to remove the variant in the future, and want DiffV2 (largest) to remain on stack." +)] pub enum DiffResult { V1(Diff), V2(DiffV2),