From 9f4e780d40af73c37a9024e1399804345f3a2917 Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Thu, 11 May 2023 08:47:28 -0400 Subject: [PATCH 1/8] Add github action checks on markdown/schema changes. --- .github/WORKFLOWS/checks.yml | 98 ++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 .github/WORKFLOWS/checks.yml diff --git a/.github/WORKFLOWS/checks.yml b/.github/WORKFLOWS/checks.yml new file mode 100644 index 0000000000..df8d785371 --- /dev/null +++ b/.github/WORKFLOWS/checks.yml @@ -0,0 +1,98 @@ +name: Checks + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + markdownlint: + runs-on: ubuntu-latest + steps: + - name: check out code + uses: actions/checkout@v2 + + - name: install dependencies + run: npm install + + - name: run markdownlint + run: make markdownlint + + yamllint: + runs-on: ubuntu-latest + steps: + - name: check out code + uses: actions/checkout@v2 + + - uses: actions/setup-python@v2 + + - name: install yamllint + run: make install-yamllint + + - name: run yamllint + run: yamllint . -f github + + markdown-link-check: + runs-on: ubuntu-latest + steps: + - name: check out code + uses: actions/checkout@v2 + + - name: install dependencies + run: npm install + + - name: run markdown-link-check + run: make markdown-link-check + + markdown-toc-check: + runs-on: ubuntu-latest + steps: + - name: check out code + uses: actions/checkout@v2 + + - name: install dependencies + run: npm install + + - name: run markdown-toc + run: make markdown-toc + + - name: validate markdown-toc + run: 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) + + misspell: + runs-on: ubuntu-latest + steps: + - name: check out code + uses: actions/checkout@v2 + + - name: run misspell + run: make misspell + + docfx: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: 6.0.x + + - name: install docfx + run: dotnet tool update -g docfx --version "3.0.0-*" --add-source https://docfx.pkgs.visualstudio.com/docfx/_packaging/docs-public-packages/nuget/v3/index.json + + - name: run docfx + run: docfx build --dry-run + + semantic-conventions: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: verify semantic convention tables + run: make table-check + + schemas-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: verify schemas + run: make schema-check From 3c8f59d724d7e7b3d1411050537ef03bb63b2d64 Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Thu, 11 May 2023 08:48:58 -0400 Subject: [PATCH 2/8] lower case workflows. --- .github/{WORKFLOWS => workflows}/checks.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{WORKFLOWS => workflows}/checks.yml (100%) diff --git a/.github/WORKFLOWS/checks.yml b/.github/workflows/checks.yml similarity index 100% rename from .github/WORKFLOWS/checks.yml rename to .github/workflows/checks.yml From 959269adc74f7db4fa9d8d4e2330a3f304f4efbb Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Thu, 11 May 2023 09:37:10 -0400 Subject: [PATCH 3/8] Fix broken links and markdownlint errors. --- CONTRIBUTING.md | 2 -- README.md | 1 - semantic_conventions/README.md | 6 +++--- specification/document-status.md | 3 +++ specification/logs/semantic_conventions/exceptions.md | 8 ++++---- 5 files changed, 10 insertions(+), 10 deletions(-) create mode 100644 specification/document-status.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7fc9ee636b..987de7212c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -114,5 +114,3 @@ To quickly fix typos, use ```bash make misspell-correction ``` - - diff --git a/README.md b/README.md index 86907e7a59..146b91f7a0 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,6 @@ The documentation currently resides in the previous folders, e.g. - [Metrics](specification/metrics/semantic_conventions/README.md) - [Logs](specification/logs/semantic_conventions/README.md) - ## TODOs - [ ] Set up github actions diff --git a/semantic_conventions/README.md b/semantic_conventions/README.md index 9968884142..ab7bf25ef2 100644 --- a/semantic_conventions/README.md +++ b/semantic_conventions/README.md @@ -15,9 +15,9 @@ i.e.: ## Writing semantic conventions Semantic conventions for the spec MUST adhere to the -[attribute naming](../specification/common/attribute-naming.md), -[attribute requirement level](../specification/common/attribute-requirement-level.md), -and [metric requirement level](../specification/metrics/metric-requirement-level.md) conventions. +[attribute naming](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/attribute-naming.md), +[attribute requirement level](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/attribute-requirement-level.md), +and [metric requirement level](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/metric-requirement-level.md) conventions. Refer to the [syntax](https://github.com/open-telemetry/build-tools/tree/v0.17.0/semantic-conventions/syntax.md) for how to write the YAML files for semantic conventions and what the YAML properties mean. diff --git a/specification/document-status.md b/specification/document-status.md new file mode 100644 index 0000000000..5e2f0ebea2 --- /dev/null +++ b/specification/document-status.md @@ -0,0 +1,3 @@ +# Document Status + +Semantic Conventions follows the [Specification document status conventions](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/document-status.md). \ No newline at end of file diff --git a/specification/logs/semantic_conventions/exceptions.md b/specification/logs/semantic_conventions/exceptions.md index f40d44cb89..b2762c9331 100644 --- a/specification/logs/semantic_conventions/exceptions.md +++ b/specification/logs/semantic_conventions/exceptions.md @@ -3,8 +3,8 @@ **Status**: [Experimental](../../document-status.md) This document defines semantic conventions for recording exceptions on -[logs](../bridge-api.md#emit-a-logrecord) and [events](../event-api.md#emit-event) -emitted through the [Logger API](../bridge-api.md#logger). +[logs](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/bridge-api.md#emit-a-logrecord) and [events](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/event-api.md#emit-event) +emitted through the [Logger API](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/bridge-api.md#logger). @@ -17,7 +17,7 @@ emitted through the [Logger API](../bridge-api.md#logger). ## Recording an Exception Exceptions SHOULD be recorded as attributes on the -[LogRecord](../data-model.md#log-and-event-record-definition) passed to the [Logger](../bridge-api.md#logger) emit +[LogRecord](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#log-and-event-record-definition) passed to the [Logger](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/bridge-api.md#logger) emit operations. Exceptions MAY be recorded on "logs" or "events" depending on the context. @@ -29,7 +29,7 @@ the language runtime. ## Attributes The table below indicates which attributes should be added to the -[LogRecord](../data-model.md#log-and-event-record-definition) and their types. +[LogRecord](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#log-and-event-record-definition) and their types. | Attribute | Type | Description | Examples | Requirement Level | From 0233bf46ed601808667bd2b1b47d80f683125c40 Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Thu, 11 May 2023 11:47:49 -0400 Subject: [PATCH 4/8] Fix links up to the logs/metrics/resources directories. --- .../logs/semantic_conventions/README.md | 2 +- .../semantic_conventions/feature-flags.md | 8 ++-- .../logs/semantic_conventions/media.md | 2 +- .../metrics/metric-requirement-level.md | 42 +++++++++++++++++++ .../metrics/semantic_conventions/README.md | 4 +- .../semantic_conventions/http-metrics.md | 8 ++-- .../runtime-environment-metrics.md | 2 +- .../resource/semantic_conventions/README.md | 8 ++-- .../trace/semantic_conventions/http.md | 16 +++---- 9 files changed, 67 insertions(+), 25 deletions(-) create mode 100644 specification/metrics/metric-requirement-level.md diff --git a/specification/logs/semantic_conventions/README.md b/specification/logs/semantic_conventions/README.md index 4df36b9331..cb74238933 100644 --- a/specification/logs/semantic_conventions/README.md +++ b/specification/logs/semantic_conventions/README.md @@ -12,5 +12,5 @@ The following semantic conventions for events are defined: * [Events](events.md): Semantic attributes that must be used to represent Events using log data model. Apart from semantic conventions for logs, [traces](../../trace/semantic_conventions/README.md), and [metrics](../../metrics/semantic_conventions/README.md), -OpenTelemetry also defines the concept of overarching [Resources](../../resource/sdk.md) with their own +OpenTelemetry also defines the concept of overarching [Resources](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/sdk.md) with their own [Resource Semantic Conventions](../../resource/semantic_conventions/README.md). diff --git a/specification/logs/semantic_conventions/feature-flags.md b/specification/logs/semantic_conventions/feature-flags.md index 25c62b58e9..c700d2e8b2 100644 --- a/specification/logs/semantic_conventions/feature-flags.md +++ b/specification/logs/semantic_conventions/feature-flags.md @@ -3,8 +3,8 @@ **Status**: [Experimental](../../document-status.md) This document defines semantic conventions for recording feature flag evaluations as -a [log record](../data-model.md#log-and-event-record-definition) emitted through the -[Logger API](../bridge-api.md#emit-a-logrecord). +a [log record](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#log-and-event-record-definition) emitted through the +[Logger API](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/bridge-api.md#emit-a-logrecord). This is useful when a flag is evaluated outside of a transaction context such as when the application loads or on a timer. To record a flag evaluation as a part of a transaction context, @@ -24,14 +24,14 @@ section of the trace semantic convention for feature flag evaluations. ## Recording an Evaluation Feature flag evaluations SHOULD be recorded as attributes on the -[LogRecord](../data-model.md#log-and-event-record-definition) passed to the [Logger](../bridge-api.md#logger) emit +[LogRecord](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#log-and-event-record-definition) passed to the [Logger](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/bridge-api.md#logger) emit operations. Evaluations MAY be recorded on "logs" or "events" depending on the context. ## Attributes The table below indicates which attributes should be added to the -[LogRecord](../data-model.md#log-and-event-record-definition) and their types. +[LogRecord](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#log-and-event-record-definition) and their types. The event name MUST be `feature_flag`. diff --git a/specification/logs/semantic_conventions/media.md b/specification/logs/semantic_conventions/media.md index f8e02542f7..b21452bc2d 100644 --- a/specification/logs/semantic_conventions/media.md +++ b/specification/logs/semantic_conventions/media.md @@ -21,7 +21,7 @@ This document describes attributes for log media in OpenTelemetry. Log media are ## Log Media -**Note:** The OpenTelemetry specification defines a [Resource](../../resource/sdk.md#resource-sdk) as `an immutable representation of the entity producing telemetry`. +**Note:** The OpenTelemetry specification defines a [Resource](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/sdk.md#resource-sdk) as `an immutable representation of the entity producing telemetry`. The following attributes do not describe entities that produce telemetry. Rather, they describe mechanisms of log transmission. As such, these should be recorded as Log Record attributes when applicable. They should not be recorded as Resource attributes. diff --git a/specification/metrics/metric-requirement-level.md b/specification/metrics/metric-requirement-level.md new file mode 100644 index 0000000000..2d1c0918c1 --- /dev/null +++ b/specification/metrics/metric-requirement-level.md @@ -0,0 +1,42 @@ +# Metric Requirement Levels + +This document is the same as [the specification](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/metric-requirement-level.md). + +**Status**: [Stable](../document-status.md) + +
+Table of Contents + + + +- [Required](#required) +- [Recommended](#recommended) +- [Opt-In](#opt-in) + + + +
+ +The following metric requirement levels are specified: + +- [Required](#required) +- [Recommended](#recommended) +- [Opt-In](#opt-in) + +## Required + +All instrumentations MUST emit the metric. +A semantic convention defining a Required metric expects that an absolute majority of instrumentation libraries and applications are able to efficiently emit it. + +## Recommended + +Instrumentations SHOULD emit the metric by default if it's readily available and can be efficiently emitted. Instrumentations MAY offer a configuration option to disable Recommended metrics. + +Instrumentations that decide not to emit `Recommended` metrics due to performance, security, privacy, or other consideration by default, SHOULD allow for opting in to emitting them as defined for the `Opt-In` requirement level if the metrics are logically applicable. + +## Opt-In + +Instrumentations SHOULD emit the metric if and only if the user configures the instrumentation to do so. +Instrumentation that doesn't support configuration MUST NOT emit `Opt-In` metrics. + +This attribute requirement level is recommended for metrics that are particularly expensive to retrieve or might pose a security or privacy risk. These should therefore only be enabled deliberately by a user making an informed decision. \ No newline at end of file diff --git a/specification/metrics/semantic_conventions/README.md b/specification/metrics/semantic_conventions/README.md index 718d894fa2..d9fec936c3 100644 --- a/specification/metrics/semantic_conventions/README.md +++ b/specification/metrics/semantic_conventions/README.md @@ -35,7 +35,7 @@ The following semantic conventions surrounding metrics are defined: Apart from semantic conventions for metrics and [traces](../../trace/semantic_conventions/README.md), OpenTelemetry also -defines the concept of overarching [Resources](../../resource/sdk.md) with +defines the concept of overarching [Resources](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/sdk.md) with their own [Resource Semantic Conventions](../../resource/semantic_conventions/README.md). @@ -97,7 +97,7 @@ usable. When building components that interoperate between OpenTelemetry and a system using the OpenMetrics exposition format, use the -[OpenMetrics Guidelines](../../compatibility/prometheus_and_openmetrics.md). +[OpenMetrics Guidelines](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/compatibility/prometheus_and_openmetrics.md). ### Pluralization diff --git a/specification/metrics/semantic_conventions/http-metrics.md b/specification/metrics/semantic_conventions/http-metrics.md index 8535d5dc0a..ca43d975f4 100644 --- a/specification/metrics/semantic_conventions/http-metrics.md +++ b/specification/metrics/semantic_conventions/http-metrics.md @@ -76,7 +76,7 @@ of `[ 0, 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, | [`network.protocol.version`](../../trace/semantic_conventions/span-general.md) | string | Version of the application layer protocol used. See note below. [2] | `3.1.1` | Recommended | | [`server.address`](../../trace/semantic_conventions/span-general.md) | string | Name of the local HTTP server that received the request. [3] | `example.com` | Required | | [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port of the local HTTP server that received the request. [4] | `80`; `8080`; `443` | Conditionally Required: [5] | -| [`url.scheme`](../../common/url.md) | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Required | +| `url.scheme` | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Required | **[1]:** MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it. SHOULD include the [application root](/specification/trace/semantic_conventions/http.md#http-server-definitions) if there is one. @@ -119,7 +119,7 @@ This metric is optional. | `http.request.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Required | | [`server.address`](../../trace/semantic_conventions/span-general.md) | string | Name of the local HTTP server that received the request. [1] | `example.com` | Required | | [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port of the local HTTP server that received the request. [2] | `80`; `8080`; `443` | Conditionally Required: [3] | -| [`url.scheme`](../../common/url.md) | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Required | +| `url.scheme` | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Required | **[1]:** Determined by using the first of the following that applies @@ -161,7 +161,7 @@ This metric is optional. | [`network.protocol.version`](../../trace/semantic_conventions/span-general.md) | string | Version of the application layer protocol used. See note below. [2] | `3.1.1` | Recommended | | [`server.address`](../../trace/semantic_conventions/span-general.md) | string | Name of the local HTTP server that received the request. [3] | `example.com` | Required | | [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port of the local HTTP server that received the request. [4] | `80`; `8080`; `443` | Conditionally Required: [5] | -| [`url.scheme`](../../common/url.md) | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Required | +| `url.scheme` | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Required | **[1]:** MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it. SHOULD include the [application root](/specification/trace/semantic_conventions/http.md#http-server-definitions) if there is one. @@ -208,7 +208,7 @@ This metric is optional. | [`network.protocol.version`](../../trace/semantic_conventions/span-general.md) | string | Version of the application layer protocol used. See note below. [2] | `3.1.1` | Recommended | | [`server.address`](../../trace/semantic_conventions/span-general.md) | string | Name of the local HTTP server that received the request. [3] | `example.com` | Required | | [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Port of the local HTTP server that received the request. [4] | `80`; `8080`; `443` | Conditionally Required: [5] | -| [`url.scheme`](../../common/url.md) | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Required | +| `url.scheme` | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Required | **[1]:** MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it. SHOULD include the [application root](/specification/trace/semantic_conventions/http.md#http-server-definitions) if there is one. diff --git a/specification/metrics/semantic_conventions/runtime-environment-metrics.md b/specification/metrics/semantic_conventions/runtime-environment-metrics.md index 160bf582fd..8133729fb2 100644 --- a/specification/metrics/semantic_conventions/runtime-environment-metrics.md +++ b/specification/metrics/semantic_conventions/runtime-environment-metrics.md @@ -217,7 +217,7 @@ This metric is obtained by subscribing to [`GarbageCollectionNotificationInfo`](https://docs.oracle.com/javase/8/docs/jre/api/management/extension/com/sun/management/GarbageCollectionNotificationInfo.html) events provided by [`GarbageCollectorMXBean`](https://docs.oracle.com/javase/8/docs/api/java/lang/management/GarbageCollectorMXBean.html). The duration value is obtained from [`GcInfo`](https://docs.oracle.com/javase/8/docs/jre/api/management/extension/com/sun/management/GcInfo.html#getDuration--) This metric SHOULD be specified with -[`ExplicitBucketBoundaries`](../../metrics/api.md#instrument-advice) +[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#instrument-advice) of `[]` (single bucket histogram capturing count, sum, min, max). diff --git a/specification/resource/semantic_conventions/README.md b/specification/resource/semantic_conventions/README.md index e6aeba57e9..0f214b2ae2 100644 --- a/specification/resource/semantic_conventions/README.md +++ b/specification/resource/semantic_conventions/README.md @@ -2,7 +2,7 @@ **Status**: [Mixed](../../document-status.md) -This document defines standard attributes for resources. These attributes are typically used in the [Resource](../sdk.md) and are also recommended to be used anywhere else where there is a need to describe a resource in a consistent manner. The majority of these attributes are inherited from +This document defines standard attributes for resources. These attributes are typically used in the [Resource](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/sdk.md) and are also recommended to be used anywhere else where there is a need to describe a resource in a consistent manner. The majority of these attributes are inherited from [OpenCensus Resource standard](https://github.com/census-instrumentation/opencensus-specs/blob/master/resource/StandardResources.md). @@ -40,7 +40,7 @@ This document defines standard attributes for resources. These attributes are ty Attributes are grouped logically by the type of the concept that they described. Attributes in the same group have a common prefix that ends with a dot. For example all attributes that describe Kubernetes properties start with "k8s." -See [Attribute Requirement Levels](../../common/attribute-requirement-level.md) for details on when attributes +See [Attribute Requirement Levels](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/attribute-requirement-level.md) for details on when attributes should be included. ## Attributes with Special Handling @@ -52,14 +52,14 @@ Given their significance some resource attributes are treated specifically as de ### Semantic Attributes with Dedicated Environment Variable These are the attributes which MAY be configurable via a dedicated environment variable -as specified in [OpenTelemetry Environment Variable Specification](../../configuration/sdk-environment-variables.md): +as specified in [OpenTelemetry Environment Variable Specification](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md): - [`service.name`](#service) ## Semantic Attributes with SDK-provided Default Value These are the attributes which MUST be provided by the SDK -as specified in the [Resource SDK specification](../sdk.md#sdk-provided-resource-attributes): +as specified in the [Resource SDK specification](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/sdk.md#sdk-provided-resource-attributes): - [`service.name`](#service) - [`telemetry.sdk` group](#telemetry-sdk) diff --git a/specification/trace/semantic_conventions/http.md b/specification/trace/semantic_conventions/http.md index eea84660c2..32014e1fc2 100644 --- a/specification/trace/semantic_conventions/http.md +++ b/specification/trace/semantic_conventions/http.md @@ -162,7 +162,7 @@ For an HTTP client span, `SpanKind` MUST be `Client`. | [`server.socket.address`](span-general.md) | string | Physical server IP address or Unix socket address. | `10.5.3.2` | Recommended: If different than `server.address`. | | [`server.socket.domain`](span-general.md) | string | The domain name of an immediate peer. [5] | `proxy.example.com` | Recommended | | [`server.socket.port`](span-general.md) | int | Physical server port. | `16456` | Recommended: If different than `server.port`. | -| [`url.full`](../../common/url.md) | string | Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) [6] | `https://www.foo.bar/search?q=OpenTelemetry#SemConv`; `//localhost` | Required | +| `url.full` | string | Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) [6] | `https://www.foo.bar/search?q=OpenTelemetry#SemConv`; `//localhost` | Required | **[1]:** The resend count SHOULD be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other). @@ -189,7 +189,7 @@ Following attributes MUST be provided **at span creation time** (when provided a * [`server.address`](span-general.md) * [`server.port`](span-general.md) -* [`url.full`](../../common/url.md) +* `url.full` Note that in some cases host and port identifiers in the `Host` header might be different from the `server.address` and `server.port`, in this case instrumentation MAY populate `Host` header on `http.request.header.host` attribute even if it's not enabled by user. @@ -279,9 +279,9 @@ If the route cannot be determined, the `name` attribute MUST be set as defined i | [`server.port`](span-general.md) | int | Port of the local HTTP server that received the request. [5] | `80`; `8080`; `443` | Conditionally Required: [6] | | [`server.socket.address`](span-general.md) | string | Local socket address. Useful in case of a multi-IP host. | `10.5.3.2` | Opt-In | | [`server.socket.port`](span-general.md) | int | Local socket port. Useful in case of a multi-port host. | `16456` | Opt-In | -| [`url.path`](../../common/url.md) | string | The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component [7] | `/search` | Required | -| [`url.query`](../../common/url.md) | string | The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component [8] | `q=OpenTelemetry` | Recommended | -| [`url.scheme`](../../common/url.md) | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Required | +| `url.path` | string | The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component [7] | `/search` | Required | +| `url.query` | string | The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component [8] | `q=OpenTelemetry` | Recommended | +| `url.scheme` | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Required | **[1]:** MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it. SHOULD include the [application root](/specification/trace/semantic_conventions/http.md#http-server-definitions) if there is one. @@ -317,9 +317,9 @@ Following attributes MUST be provided **at span creation time** (when provided a * [`server.address`](span-general.md) * [`server.port`](span-general.md) -* [`url.path`](../../common/url.md) -* [`url.query`](../../common/url.md) -* [`url.scheme`](../../common/url.md) +* `url.path` +* `url.query` +* `url.scheme` `http.route` MUST be provided at span creation time if and only if it's already available. If it becomes available after span starts, instrumentation MUST populate it anytime before span ends. From 707896f91b3a529ff65478832a96dd51f188f497 Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Thu, 11 May 2023 11:56:53 -0400 Subject: [PATCH 5/8] Fix links in trace. --- specification/trace/semantic_conventions/README.md | 4 ++-- specification/trace/semantic_conventions/exceptions.md | 2 +- specification/trace/semantic_conventions/http.md | 4 ++-- .../semantic_conventions/instrumentation/aws-lambda.md | 10 +++++----- specification/trace/semantic_conventions/messaging.md | 4 ++-- specification/trace/semantic_conventions/rpc.md | 6 +++--- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/specification/trace/semantic_conventions/README.md b/specification/trace/semantic_conventions/README.md index 78656e9671..b516cdf8e7 100644 --- a/specification/trace/semantic_conventions/README.md +++ b/specification/trace/semantic_conventions/README.md @@ -31,8 +31,8 @@ The following library-specific semantic conventions are defined: * [AWS SDK](instrumentation/aws-sdk.md): For AWS SDK spans. * [GraphQL](instrumentation/graphql.md): For GraphQL spans. -Apart from semantic conventions for traces and [metrics](../../metrics/semantic_conventions/README.md), -OpenTelemetry also defines the concept of overarching [Resources](../../resource/sdk.md) with their own +Apart from semantic conventions for traces and [metrics](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/semantic_conventions/README.md), +OpenTelemetry also defines the concept of overarching [Resources](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/sdk.md) with their own [Resource Semantic Conventions](../../resource/semantic_conventions/README.md). ## Event Name Reuse Prohibition diff --git a/specification/trace/semantic_conventions/exceptions.md b/specification/trace/semantic_conventions/exceptions.md index 234eb710fe..8661c2b8c5 100644 --- a/specification/trace/semantic_conventions/exceptions.md +++ b/specification/trace/semantic_conventions/exceptions.md @@ -19,7 +19,7 @@ An exception SHOULD be recorded as an `Event` on the span during which it occurr The name of the event MUST be `"exception"`. A typical template for an auto-instrumentation implementing this semantic convention -using an [API-provided `recordException` method](../api.md#record-exception) +using an [API-provided `recordException` method](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#record-exception) could look like this (pseudo-Java): ```java diff --git a/specification/trace/semantic_conventions/http.md b/specification/trace/semantic_conventions/http.md index 32014e1fc2..c1b9c543b7 100644 --- a/specification/trace/semantic_conventions/http.md +++ b/specification/trace/semantic_conventions/http.md @@ -53,7 +53,7 @@ and various HTTP versions like 1.1, 2 and SPDY. ## Name -HTTP spans MUST follow the overall [guidelines for span names](../api.md#span). +HTTP spans MUST follow the overall [guidelines for span names](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#span). HTTP server span names SHOULD be `{http.request.method} {http.route}` if there is a (low-cardinality) `http.route` available. HTTP server span names SHOULD be `{http.method}` if there is no (low-cardinality) @@ -67,7 +67,7 @@ default span name. ## Status -[Span Status](../api.md#set-status) MUST be left unset if HTTP status code was in the +[Span Status](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#set-status) MUST be left unset if HTTP status code was in the 1xx, 2xx or 3xx ranges, unless there was another error (e.g., network error receiving the response body; or 3xx codes with max redirects exceeded), in which case status MUST be set to `Error`. diff --git a/specification/trace/semantic_conventions/instrumentation/aws-lambda.md b/specification/trace/semantic_conventions/instrumentation/aws-lambda.md index aab4165acb..f8786259df 100644 --- a/specification/trace/semantic_conventions/instrumentation/aws-lambda.md +++ b/specification/trace/semantic_conventions/instrumentation/aws-lambda.md @@ -57,9 +57,9 @@ and the [cloud resource conventions][cloud]. The following AWS Lambda-specific a ### AWS X-Ray Environment Span Link If the `_X_AMZN_TRACE_ID` environment variable is set, instrumentation SHOULD try to parse an -OpenTelemetry `Context` out of it using the [AWS X-Ray Propagator](../../../context/api-propagators.md). If the -resulting `Context` is [valid](../../api.md#isvalid) then a [Span Link][] SHOULD be added to the new Span's -[start options](../../api.md#specifying-links) with an associated attribute of `source=x-ray-env` to +OpenTelemetry `Context` out of it using the [AWS X-Ray Propagator](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/context/api-propagators.md). If the +resulting `Context` is [valid](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#isvalid) then a [Span Link][] SHOULD be added to the new Span's +[start options](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#specifying-links) with an associated attribute of `source=x-ray-env` to indicate the source of the linked span. Instrumentation MUST check if the context is valid before using it because the `_X_AMZN_TRACE_ID` environment variable can contain an incomplete trace context which indicates X-Ray isn’t enabled. The environment variable will be set and the @@ -107,7 +107,7 @@ be ` process`. If there are multiple sources in the batch, the nam For every message in the event, the [message system attributes][] (not message attributes, which are provided by the user) SHOULD be checked for the key `AWSTraceHeader`. If it is present, an OpenTelemetry `Context` SHOULD be -parsed from the value of the attribute using the [AWS X-Ray Propagator](../../../context/api-propagators.md) and +parsed from the value of the attribute using the [AWS X-Ray Propagator](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/context/api-propagators.md) and added as a link to the span. This means the span may have as many links as messages in the batch. See [compatibility](../../../../supplementary-guidelines/compatibility/aws.md#context-propagation) for more info. @@ -121,7 +121,7 @@ See [compatibility](../../../../supplementary-guidelines/compatibility/aws.md#co For the SQS message span, the name MUST be ` process`. The parent MUST be the `CONSUMER` span corresponding to the SQS event. The [message system attributes][] (not message attributes, which are provided by the user) SHOULD be checked for the key `AWSTraceHeader`. If it is present, an OpenTelemetry `Context` SHOULD be -parsed from the value of the attribute using the [AWS X-Ray Propagator](../../../context/api-propagators.md) and +parsed from the value of the attribute using the [AWS X-Ray Propagator](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/context/api-propagators.md) and added as a link to the span. See [compatibility](../../../../supplementary-guidelines/compatibility/aws.md#context-propagation) for more info. diff --git a/specification/trace/semantic_conventions/messaging.md b/specification/trace/semantic_conventions/messaging.md index 1b97e3d594..3f9c247557 100644 --- a/specification/trace/semantic_conventions/messaging.md +++ b/specification/trace/semantic_conventions/messaging.md @@ -170,7 +170,7 @@ The span name SHOULD be set to the message destination name and the operation be ``` -The destination name SHOULD only be used for the span name if it is known to be of low cardinality (cf. [general span name guidelines](../api.md#span)). +The destination name SHOULD only be used for the span name if it is known to be of low cardinality (cf. [general span name guidelines](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#span)). This can be assumed if it is statically derived from application code or configuration. Wherever possible, the real destination names after resolving logical or aliased names SHOULD be used. If the destination name is dynamic, such as a [conversation ID](#conversations) or a value obtained from a `Reply-To` header, it SHOULD NOT be used for the span name. @@ -544,7 +544,7 @@ Process C: | Span Recv1 | Given is a process P, that publishes two messages to a queue Q on messaging system MS, and a process C, which receives them separately in two different operations (Span Recv1 and Recv2) and processes both messages in one batch (Span Proc1). -Since each span can only have one parent, C3 should not choose a random parent out of C1 and C2, but rather rely on the implicitly selected parent as defined by the [tracing API spec](../api.md). +Since each span can only have one parent, C3 should not choose a random parent out of C1 and C2, but rather rely on the implicitly selected parent as defined by the [tracing API spec](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md). Depending on the implementation, the producing spans might still be available in the meta data of the messages and should be added to C3 as links. The client library or application could also add the receiver span's SpanContext to the data structure it returns for each message. In this case, C3 could also add links to the receiver spans C1 and C2. diff --git a/specification/trace/semantic_conventions/rpc.md b/specification/trace/semantic_conventions/rpc.md index e8ce49a5c9..71db4b0023 100644 --- a/specification/trace/semantic_conventions/rpc.md +++ b/specification/trace/semantic_conventions/rpc.md @@ -241,10 +241,10 @@ For remote procedure calls via [gRPC][], additional conventions are described in ### gRPC Status The table below describes when -the [Span Status](../api.md#set-status) MUST be set +the [Span Status](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#set-status) MUST be set to `Error` or remain unset depending on the [gRPC status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) -and [Span Kind](../api.md#spankind). +and [Span Kind](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#spankind). | gRPC Status Code | `SpanKind.SERVER` Span Status | `SpanKind.CLIENT` Span Status | |---|---|---| @@ -317,7 +317,7 @@ Below is a table of attributes that SHOULD be included on client and server RPC ### Connect RPC Status -If `rpc.connect_rpc.error_code` is set, [Span Status](../api.md#set-status) MUST be set to `Error` and left unset in all other cases. +If `rpc.connect_rpc.error_code` is set, [Span Status](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#set-status) MUST be set to `Error` and left unset in all other cases. ### Connect RPC Request and Response Metadata From 408f697ecf326c2e81483e888ca6412243edf643 Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Thu, 11 May 2023 11:59:20 -0400 Subject: [PATCH 6/8] Fix lint issue. --- specification/document-status.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/document-status.md b/specification/document-status.md index 5e2f0ebea2..0e33e3cf53 100644 --- a/specification/document-status.md +++ b/specification/document-status.md @@ -1,3 +1,3 @@ # Document Status -Semantic Conventions follows the [Specification document status conventions](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/document-status.md). \ No newline at end of file +Semantic Conventions follows the [Specification document status conventions](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/document-status.md). From 1cfc181f4419190ee4b47f7abf3579e2c9fd2b8d Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Thu, 11 May 2023 11:59:57 -0400 Subject: [PATCH 7/8] Fix lint error. --- specification/metrics/metric-requirement-level.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/metrics/metric-requirement-level.md b/specification/metrics/metric-requirement-level.md index 2d1c0918c1..4d8f94cc3c 100644 --- a/specification/metrics/metric-requirement-level.md +++ b/specification/metrics/metric-requirement-level.md @@ -39,4 +39,4 @@ Instrumentations that decide not to emit `Recommended` metrics due to performanc Instrumentations SHOULD emit the metric if and only if the user configures the instrumentation to do so. Instrumentation that doesn't support configuration MUST NOT emit `Opt-In` metrics. -This attribute requirement level is recommended for metrics that are particularly expensive to retrieve or might pose a security or privacy risk. These should therefore only be enabled deliberately by a user making an informed decision. \ No newline at end of file +This attribute requirement level is recommended for metrics that are particularly expensive to retrieve or might pose a security or privacy risk. These should therefore only be enabled deliberately by a user making an informed decision. From 037ce82e643a18585c197a0c103573ac20753028 Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Thu, 11 May 2023 12:06:13 -0400 Subject: [PATCH 8/8] Fix lint errors. --- .../metrics/semantic_conventions/instrumentation/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/metrics/semantic_conventions/instrumentation/README.md b/specification/metrics/semantic_conventions/instrumentation/README.md index 0d0de5e463..ab7111ba62 100644 --- a/specification/metrics/semantic_conventions/instrumentation/README.md +++ b/specification/metrics/semantic_conventions/instrumentation/README.md @@ -1,2 +1 @@ # Instrumentation -