From 4676115f6ab1f964f7008f602ae6ea5ac55ef1d2 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Thu, 19 Dec 2024 17:44:45 -0800 Subject: [PATCH 1/5] random doc fixes --- CONTRIBUTING.md | 36 +++++++++++-------- Makefile | 2 +- docs/attributes-registry/README.md | 5 +-- docs/gen-ai/gen-ai-events.md | 5 --- ...ility.md => semantic-convention-groups.md} | 0 model/README.md | 28 ++++++++++++--- templates/registry/markdown/readme.md.j2 | 5 +-- 7 files changed, 53 insertions(+), 28 deletions(-) rename docs/general/{group-stability.md => semantic-convention-groups.md} (100%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4cfc04991c..a387fb97ac 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -106,6 +106,8 @@ The YAML (model definition) and Markdown (documentation) files are organized in │ │ ├── ....md ├── model │ ├── {root-namespace} +│ │ ├── deprecated +│ │ | ├── registry-deprecated.yaml │ │ ├── events.yaml │ │ ├── metrics.yaml │ │ ├── registry.yaml @@ -126,6 +128,9 @@ HTTP spans are defined in `model/http/spans.yaml`. YAML definitions could be broken down into multiple files. For example, AWS spans are defined in `/model/aws/lambda-spans.yaml` and `/model/aws/sdk-spans.yaml` files. +Deprecated conventions should be placed under `/model/{root-namespace}/deprecated` +folder. + #### Schema files When making changes to existing semantic conventions (attributes, metrics, etc) @@ -137,6 +142,7 @@ For details, please read You can also take examples from past changes inside the `schemas` folder. > [!WARNING] +> > DO NOT add your changes to files inside the `schemas` folder. Always add your > changes to the `schema-next.yaml` file. @@ -167,7 +173,21 @@ When creating new markdown files, you should provide the `linkTitle` attribute. This is used to generate the navigation bar on the website, and will be listed relative to the "parent" document. -### 3. Verify the changes before committing +### 4. Check new convention + +Semantic conventions are validated for name formatting and backward compatibility with last released versions. +Here's [the full list of compatibility checks](./policies/compatibility.rego). + +Removing attributes, metrics, or enum members is not allowed, they should be deprecated instead. +It applies to stable and experimental conventions and prevents semantic conventions auto-generated libraries from introducing breaking changes. + +You can run backward compatibility check (along with other policies) in all yaml files with the following command: + +```bash +make check-policies +``` + +### 5. Verify the changes before committing Before sending a PR with your changes, make sure to run the automated checks: @@ -178,7 +198,7 @@ make check Alternatively, you can run each check individually. Refer to the [Automation](#automation) section for more details. -### 4. Changelog +### 6. Changelog #### When to add a Changelog Entry @@ -341,18 +361,6 @@ To check the validity of links in all markdown files, run the following command: make markdown-link-check ``` -### Version compatibility check - -Semantic conventions are validated for backward compatibility with last released versions. Here's [the full list of compatibility checks](./policies/compatibility.rego). -Removing attributes, metrics, or enum members is not allowed, they should be deprecated instead. -It applies to stable and experimental conventions and prevents semantic conventions auto-generated libraries from introducing breaking changes. - -You can run backward compatibility check (along with other policies) in all yaml files with the following command: - -```bash -make check-policies -``` - ## Updating the referenced specification version 1. Open the `./internal/tools/update_specification_version.sh` script. diff --git a/Makefile b/Makefile index 6f2cf5c809..e4ed069ccc 100644 --- a/Makefile +++ b/Makefile @@ -183,7 +183,7 @@ fix-format: # Run all checks in order of speed / likely failure. # As a last thing, run attribute registry generation and git-diff for differences. .PHONY: check -check: misspell markdownlint check-format markdown-toc compatibility-check markdown-link-check check-policies attribute-registry-generation +check: misspell markdownlint check-format markdown-toc markdown-link-check check-policies attribute-registry-generation git diff --exit-code ':*.md' || (echo 'Generated markdown Table of Contents is out of date, please run "make markdown-toc" and commit the changes in this PR.' && exit 1) @echo "All checks complete" diff --git a/docs/attributes-registry/README.md b/docs/attributes-registry/README.md index 4bfe974911..f8be3b149a 100644 --- a/docs/attributes-registry/README.md +++ b/docs/attributes-registry/README.md @@ -16,7 +16,7 @@ The attributes registry is the place where attributes are defined. An attribute - a `brief` description of the attribute and optionally a longer `note` - example values -Attributes defined in the registry can be used in different semantic conventions. Attributes should be included in this registry before they are used in semantic conventions. Semantic conventions may override all the properties of an attribute except for the `id` and `type` in case it's required for a particular context. In addition, semantic conventions specify the requirement level of an attribute in the corresponding context. +Attributes defined in the registry can be used in different semantic conventions. Attributes should be included in this registry before they are used in semantic conventions. Semantic conventions may override all the properties of an attribute except for the `id`, `type`, and `stability` in case it's required for a particular context. In addition, semantic conventions specify the requirement level of an attribute in the corresponding context. A definition of an attribute in the registry doesn't necessarily imply that the attribute is used in any of the semantic conventions. @@ -24,7 +24,8 @@ If applicable, application developers are encouraged to use existing attributes All registered attributes are listed by namespace in this registry. -> **Warning** +> [!WARNING] +> > The following registry overview is a work in progress. > > Further attribute namespaces are currently being migrated and will appear in this registry soon. diff --git a/docs/gen-ai/gen-ai-events.md b/docs/gen-ai/gen-ai-events.md index cc77890c73..e7fa7c0beb 100644 --- a/docs/gen-ai/gen-ai-events.md +++ b/docs/gen-ai/gen-ai-events.md @@ -25,13 +25,8 @@ linkTitle: Generative AI events GenAI instrumentations MAY capture user inputs sent to the model and responses received from it as [events](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.40.0/specification/logs/api.md#emit-an-event). -<<<<<<< HEAD -> [!NOTE] -> Event API is experimental and not yet available in some languages. Check [spec-compliance matrix](https://github.com/open-telemetry/opentelemetry-specification/blob/main/spec-compliance-matrix.md#events) to see the implementation status in corresponding language. -======= > Note: > Event API is experimental and not yet available in some languages. Check [spec-compliance matrix](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.40.0/spec-compliance-matrix.md#logs) to see the implementation status in corresponding language. ->>>>>>> 75746bc9 (reword) Instrumentations MAY capture inputs and outputs if and only if application has enabled the collection of this data. This is for three primary reasons: diff --git a/docs/general/group-stability.md b/docs/general/semantic-convention-groups.md similarity index 100% rename from docs/general/group-stability.md rename to docs/general/semantic-convention-groups.md diff --git a/model/README.md b/model/README.md index 821423416e..fd1b22e4ea 100644 --- a/model/README.md +++ b/model/README.md @@ -4,8 +4,10 @@ The YAML descriptions of semantic convention contained in this directory are int be used by the various OpenTelemetry language implementations to aid in automatic generation of semantics-related code. -⚠ If you want to read the semantic conventions and not edit them, please see -the generated markdown output in the [docs](../docs/README.md) folder. +> [!NOTE] +> +> If you want to read the semantic conventions and not edit them, please see +> the generated markdown output in the [docs](../docs/README.md) folder. ## Writing semantic conventions @@ -21,18 +23,36 @@ A schema file for VS code is configured in the `/.vscode/settings.json` of this repository, enabling auto-completion and additional checks. Refer to [the generator README](https://github.com/open-telemetry/weaver/blob/main/schemas/semconv-syntax.md) for what extension you need. +When defining semantic conventions, follow [contributing guide](/CONTRIBUTING.md#1-modify-the-yaml-model): + +- If new attributes are necessary, define them in the [attribute registry](/docs/attributes-registry/README.md). + Attributes can only be defined inside groups with `attribute_group` type and with `id` starting with `registry.` prefix. +- Define new spans, metrics, events, resources, and other conventions using appropriate group type. See + [semantic convention groups](/docs/general/semantic-convention-groups.md) for more details. + ## Generating markdown -These YAML files are used by the make target `table-generation` to generate consistently +These YAML files are used by the make targets `attribute-registry-generation` and `table-generation` to generate consistently formatted Markdown tables for all semantic conventions in the specification. Run it from the root of this repository using the command ``` -make table-generation +make attribute-registry-generation table-generation ``` For more information, see the [Weaver](https://github.com/open-telemetry/weaver) as our code generations tool. +## Validating semantic conventions + +Semantic conventions YAML files are validated by `check-policies` make target for backward compatibility, +name formatting, and other policies. + +You can run it with the following command: + +``` +make check-policies +``` + See also: * [Markdown Templates](../templates/registry/markdown) diff --git a/templates/registry/markdown/readme.md.j2 b/templates/registry/markdown/readme.md.j2 index 1767f38b2e..ab36d57be8 100644 --- a/templates/registry/markdown/readme.md.j2 +++ b/templates/registry/markdown/readme.md.j2 @@ -17,7 +17,7 @@ The attributes registry is the place where attributes are defined. An attribute - a `brief` description of the attribute and optionally a longer `note` - example values -Attributes defined in the registry can be used in different semantic conventions. Attributes should be included in this registry before they are used in semantic conventions. Semantic conventions may override all the properties of an attribute except for the `id` and `type` in case it's required for a particular context. In addition, semantic conventions specify the requirement level of an attribute in the corresponding context. +Attributes defined in the registry can be used in different semantic conventions. Attributes should be included in this registry before they are used in semantic conventions. Semantic conventions may override all the properties of an attribute except for the `id`, `type` and `stability` in case it's required for a particular context. In addition, semantic conventions specify the requirement level of an attribute in the corresponding context. A definition of an attribute in the registry doesn't necessarily imply that the attribute is used in any of the semantic conventions. @@ -25,7 +25,8 @@ If applicable, application developers are encouraged to use existing attributes All registered attributes are listed by namespace in this registry. -> **Warning** +> [!WARNING] +> > The following registry overview is a work in progress. > > Further attribute namespaces are currently being migrated and will appear in this registry soon. From 64d20f30d6515af79983958ca5d0c6d421f02b36 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Thu, 19 Dec 2024 17:52:52 -0800 Subject: [PATCH 2/5] up --- docs/attributes-registry/README.md | 6 +++--- docs/attributes-registry/db.md | 2 +- docs/attributes-registry/dns.md | 2 +- templates/registry/markdown/weaver.yaml | 2 ++ 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/attributes-registry/README.md b/docs/attributes-registry/README.md index f8be3b149a..9f40561d47 100644 --- a/docs/attributes-registry/README.md +++ b/docs/attributes-registry/README.md @@ -16,7 +16,7 @@ The attributes registry is the place where attributes are defined. An attribute - a `brief` description of the attribute and optionally a longer `note` - example values -Attributes defined in the registry can be used in different semantic conventions. Attributes should be included in this registry before they are used in semantic conventions. Semantic conventions may override all the properties of an attribute except for the `id`, `type`, and `stability` in case it's required for a particular context. In addition, semantic conventions specify the requirement level of an attribute in the corresponding context. +Attributes defined in the registry can be used in different semantic conventions. Attributes should be included in this registry before they are used in semantic conventions. Semantic conventions may override all the properties of an attribute except for the `id`, `type` and `stability` in case it's required for a particular context. In addition, semantic conventions specify the requirement level of an attribute in the corresponding context. A definition of an attribute in the registry doesn't necessarily imply that the attribute is used in any of the semantic conventions. @@ -46,12 +46,12 @@ Currently, the following namespaces exist: - [Code](code.md) - [Container](container.md) - [CPU](cpu.md) -- [Db](db.md) +- [DB](db.md) - [Deployment](deployment.md) - [Destination](destination.md) - [Device](device.md) - [Disk](disk.md) -- [Dns](dns.md) +- [DNS](dns.md) - [Dotnet](dotnet.md) - [Enduser](enduser.md) - [Error](error.md) diff --git a/docs/attributes-registry/db.md b/docs/attributes-registry/db.md index 381ead2fda..bf50ab2184 100644 --- a/docs/attributes-registry/db.md +++ b/docs/attributes-registry/db.md @@ -4,7 +4,7 @@ -# Db +# DB - [General Database Attributes](#general-database-attributes) - [Cassandra Attributes](#cassandra-attributes) diff --git a/docs/attributes-registry/dns.md b/docs/attributes-registry/dns.md index b694e02b3e..688b652025 100644 --- a/docs/attributes-registry/dns.md +++ b/docs/attributes-registry/dns.md @@ -4,7 +4,7 @@ -# Dns +# DNS ## DNS Attributes diff --git a/templates/registry/markdown/weaver.yaml b/templates/registry/markdown/weaver.yaml index 104823f184..cbe61f30e3 100644 --- a/templates/registry/markdown/weaver.yaml +++ b/templates/registry/markdown/weaver.yaml @@ -14,6 +14,8 @@ acronyms: - CLR - CPU - CSI + - DB + - DNS - DynamoDB - ECS - EKS From afcec3daaab692704e838c979a556ab8ed1b22bf Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Fri, 20 Dec 2024 14:53:57 -0800 Subject: [PATCH 3/5] Update model/README.md Co-authored-by: Trask Stalnaker --- model/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/README.md b/model/README.md index fd1b22e4ea..8affd9de18 100644 --- a/model/README.md +++ b/model/README.md @@ -44,7 +44,7 @@ as our code generations tool. ## Validating semantic conventions -Semantic conventions YAML files are validated by `check-policies` make target for backward compatibility, +Semantic conventions YAML files are validated by the `check-policies` make target for backward compatibility, name formatting, and other policies. You can run it with the following command: From 89fb33636242b8518427b9196ff35f7852c9ea62 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Fri, 20 Dec 2024 14:54:10 -0800 Subject: [PATCH 4/5] Update CONTRIBUTING.md Co-authored-by: Trask Stalnaker --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a387fb97ac..d72027240c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -173,7 +173,7 @@ When creating new markdown files, you should provide the `linkTitle` attribute. This is used to generate the navigation bar on the website, and will be listed relative to the "parent" document. -### 4. Check new convention +### 3. Check new convention Semantic conventions are validated for name formatting and backward compatibility with last released versions. Here's [the full list of compatibility checks](./policies/compatibility.rego). From ace30c1695f7d0c916c4d05e93190d09f9af0bc9 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Fri, 20 Dec 2024 14:58:22 -0800 Subject: [PATCH 5/5] toc --- CONTRIBUTING.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d72027240c..cb4b47db43 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,8 +19,9 @@ requirements and recommendations. - [Schema files](#schema-files) - [2. Update the markdown files](#2-update-the-markdown-files) - [Hugo frontmatter](#hugo-frontmatter) - - [3. Verify the changes before committing](#3-verify-the-changes-before-committing) - - [4. Changelog](#4-changelog) + - [3. Check new convention](#3-check-new-convention) + - [4. Verify the changes before committing](#4-verify-the-changes-before-committing) + - [5. Changelog](#5-changelog) - [When to add a Changelog Entry](#when-to-add-a-changelog-entry) - [Examples](#examples) - [Adding a Changelog Entry](#adding-a-changelog-entry) @@ -31,7 +32,6 @@ requirements and recommendations. - [Markdown style](#markdown-style) - [Misspell check](#misspell-check) - [Markdown link check](#markdown-link-check) - - [Version compatibility check](#version-compatibility-check) - [Updating the referenced specification version](#updating-the-referenced-specification-version) - [Making a Release](#making-a-release) - [Merging existing ECS conventions](#merging-existing-ecs-conventions) @@ -187,7 +187,7 @@ You can run backward compatibility check (along with other policies) in all yaml make check-policies ``` -### 5. Verify the changes before committing +### 4. Verify the changes before committing Before sending a PR with your changes, make sure to run the automated checks: @@ -198,7 +198,7 @@ make check Alternatively, you can run each check individually. Refer to the [Automation](#automation) section for more details. -### 6. Changelog +### 5. Changelog #### When to add a Changelog Entry