diff --git a/semantic-conventions/CHANGELOG.md b/semantic-conventions/CHANGELOG.md index cbd1ff8f..7048798e 100644 --- a/semantic-conventions/CHANGELOG.md +++ b/semantic-conventions/CHANGELOG.md @@ -8,6 +8,8 @@ Please update the changelog as part of any significant pull request. ([#244](https://github.com/open-telemetry/build-tools/pull/244)) - Add backward-compatibility check mode. ([#271](https://github.com/open-telemetry/build-tools/pull/271)) +- Add link to requirement levels definition from Markdown table title. + ([#222](https://github.com/open-telemetry/build-tools/pull/222)) ## v0.23.0 diff --git a/semantic-conventions/src/opentelemetry/semconv/templating/markdown/__init__.py b/semantic-conventions/src/opentelemetry/semconv/templating/markdown/__init__.py index 3590502c..20537ced 100644 --- a/semantic-conventions/src/opentelemetry/semconv/templating/markdown/__init__.py +++ b/semantic-conventions/src/opentelemetry/semconv/templating/markdown/__init__.py @@ -39,6 +39,10 @@ from opentelemetry.semconv.model.utils import ID_RE from opentelemetry.semconv.templating.markdown.options import MarkdownOptions +_REQUIREMENT_LEVEL_URL = ( + "https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/" +) + class RenderContext: def __init__(self): @@ -80,10 +84,6 @@ class MarkdownRenderer: ] prelude = "\n" - table_headers = "| Attribute | Type | Description | Examples | Requirement Level |\n|---|---|---|---|---|\n" - table_headers_omitting_req_level = ( - "| Attribute | Type | Description | Examples |\n|---|---|---|---|\n" - ) def __init__( self, md_folder, semconvset: SemanticConventionSet, options=MarkdownOptions() @@ -100,6 +100,16 @@ def __init__( # that contains it self.filename_for_attr_fqn = self._create_attribute_location_dict() + req_level = f"[Requirement Level]({_REQUIREMENT_LEVEL_URL})" + + self.table_headers = ( + f"| Attribute | Type | Description | Examples | {req_level} |" + "\n|---|---|---|---|---|\n" + ) + self.table_headers_omitting_req_level = ( + "| Attribute | Type | Description | Examples |\n|---|---|---|---|\n" + ) + def to_markdown_attr( self, attribute: SemanticAttribute, @@ -169,14 +179,14 @@ def to_markdown_attr( def derive_requirement_level(self, attribute: SemanticAttribute): if attribute.requirement_level == RequirementLevel.REQUIRED: - required = "Required" + required = "`Required`" elif attribute.requirement_level == RequirementLevel.CONDITIONALLY_REQUIRED: if len(attribute.requirement_level_msg) < self.options.break_count: - required = "Conditionally Required: " + attribute.requirement_level_msg + required = "`Conditionally Required` " + attribute.requirement_level_msg else: # We put the condition in the notes after the table self.render_ctx.add_note(attribute.requirement_level_msg) - required = f"Conditionally Required: [{len(self.render_ctx.notes)}]" + required = f"`Conditionally Required` [{len(self.render_ctx.notes)}]" elif attribute.requirement_level == RequirementLevel.OPT_IN: required = "Opt-In" else: # attribute.requirement_level == Required.RECOMMENDED or None @@ -188,20 +198,20 @@ def derive_requirement_level(self, attribute: SemanticAttribute): required = "See below" else: if not attribute.requirement_level_msg: - required = "Recommended" + required = "`Recommended`" elif len(attribute.requirement_level_msg) < self.options.break_count: - required = "Recommended: " + attribute.requirement_level_msg + required = "`Recommended` " + attribute.requirement_level_msg else: # We put the condition in the notes after the table self.render_ctx.add_note(attribute.requirement_level_msg) - required = f"Recommended: [{len(self.render_ctx.notes)}]" + required = f"`Recommended` [{len(self.render_ctx.notes)}]" return required def write_table_header(self, output: io.StringIO): if self.render_ctx.is_omit_requirement_level: - output.write(MarkdownRenderer.table_headers_omitting_req_level) + output.write(self.table_headers_omitting_req_level) else: - output.write(MarkdownRenderer.table_headers) + output.write(self.table_headers) def to_markdown_attribute_table( self, semconv: BaseSemanticConvention, output: io.StringIO @@ -322,8 +332,8 @@ def to_markdown_enum(self, output: io.StringIO): if enum.custom_values: output.write( "has the following list of well-known values." - + " If one of them applies, then the respective value MUST be used," - + " otherwise a custom value MAY be used." + + " If one of them applies, then the respective value MUST be used;" + + " otherwise, a custom value MAY be used." ) else: output.write("MUST be one of the following:") diff --git a/semantic-conventions/src/tests/data/markdown/attribute_group/expected.md b/semantic-conventions/src/tests/data/markdown/attribute_group/expected.md index 82b4e34e..51fe266d 100644 --- a/semantic-conventions/src/tests/data/markdown/attribute_group/expected.md +++ b/semantic-conventions/src/tests/data/markdown/attribute_group/expected.md @@ -1,8 +1,8 @@ # Attribute Group Example -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `foo.bar` | string | Attribute 1 | `baz` | Recommended: if available | -| `foo.qux` | int | Attribute 2 | `42` | Conditionally Required: if available | +| `foo.bar` | string | Attribute 1 | `baz` | `Recommended` if available | +| `foo.qux` | int | Attribute 2 | `42` | `Conditionally Required` if available | diff --git a/semantic-conventions/src/tests/data/markdown/attribute_templates/expected.md b/semantic-conventions/src/tests/data/markdown/attribute_templates/expected.md index f304d72a..9a8be2b5 100644 --- a/semantic-conventions/src/tests/data/markdown/attribute_templates/expected.md +++ b/semantic-conventions/src/tests/data/markdown/attribute_templates/expected.md @@ -1,10 +1,10 @@ # Custom HTTP Semantic Conventions -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `custom_http.request.header.` | string[] | HTTP request headers, `` being the normalized HTTP Header name (lowercase, with - characters replaced by _), the value being the header values. | ``http.request.header.content_type=["application/json"]`` | Recommended | -| `custom_http.request.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Required | -| `general.some_general_attribute.` | string | This is a general attribute. | ``some_general_attribute.some_key="abc"`` | Recommended | -| `referenced_http.request.referenced.header.` | string[] | This is a referenced attribute. | ``http.request.header.content_type=["application/json"]`` | Recommended | +| `custom_http.request.header.` | string[] | HTTP request headers, `` being the normalized HTTP Header name (lowercase, with - characters replaced by _), the value being the header values. | ``http.request.header.content_type=["application/json"]`` | `Recommended` | +| `custom_http.request.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | `Required` | +| `general.some_general_attribute.` | string | This is a general attribute. | ``some_general_attribute.some_key="abc"`` | `Recommended` | +| `referenced_http.request.referenced.header.` | string[] | This is a referenced attribute. | ``http.request.header.content_type=["application/json"]`` | `Recommended` | diff --git a/semantic-conventions/src/tests/data/markdown/deprecated/expected.md b/semantic-conventions/src/tests/data/markdown/deprecated/expected.md index 988ac7c8..964e9d05 100644 --- a/semantic-conventions/src/tests/data/markdown/deprecated/expected.md +++ b/semantic-conventions/src/tests/data/markdown/deprecated/expected.md @@ -2,21 +2,21 @@ -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `http.flavor` | string | **Deprecated. Use attribute `flavor_new` instead.**
Kind of HTTP protocol used [1] | `1.0` | Recommended | -| `http.host` | string | The value of the [HTTP host header](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is empty or not present, this attribute should be the same. | `www.example.org` | Recommended | -| `http.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Required | -| `http.scheme` | string | The URI scheme identifying the used protocol. | `http`; `https` | Recommended | -| `http.status_code` | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | Conditionally Required: if and only if one was received/sent | -| `http.status_text` | string | **Deprecated: Use attribute `status_description` instead.**
[HTTP reason phrase](https://tools.ietf.org/html/rfc7230#section-3.1.2). | `OK` | Recommended | -| `http.target` | string | The full request target as passed in a HTTP request line or equivalent. | `/path/12314/?q=ddds#123` | Recommended | -| `http.url` | string | Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. | `https://www.foo.bar/search?q=OpenTelemetry#SemConv` | Recommended | -| `http.user_agent` | string | Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client. | `CERN-LineMode/2.15 libwww/2.17b3` | Recommended | +| `http.flavor` | string | **Deprecated. Use attribute `flavor_new` instead.**
Kind of HTTP protocol used [1] | `1.0` | `Recommended` | +| `http.host` | string | The value of the [HTTP host header](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is empty or not present, this attribute should be the same. | `www.example.org` | `Recommended` | +| `http.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | `Required` | +| `http.scheme` | string | The URI scheme identifying the used protocol. | `http`; `https` | `Recommended` | +| `http.status_code` | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | `Conditionally Required` if and only if one was received/sent | +| `http.status_text` | string | **Deprecated: Use attribute `status_description` instead.**
[HTTP reason phrase](https://tools.ietf.org/html/rfc7230#section-3.1.2). | `OK` | `Recommended` | +| `http.target` | string | The full request target as passed in a HTTP request line or equivalent. | `/path/12314/?q=ddds#123` | `Recommended` | +| `http.url` | string | Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. | `https://www.foo.bar/search?q=OpenTelemetry#SemConv` | `Recommended` | +| `http.user_agent` | string | Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client. | `CERN-LineMode/2.15 libwww/2.17b3` | `Recommended` | **[1]:** If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. -`http.flavor` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. +`http.flavor` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | |---|---| diff --git a/semantic-conventions/src/tests/data/markdown/deprecated/input.md b/semantic-conventions/src/tests/data/markdown/deprecated/input.md index 06fd8ea2..4e6e41b1 100644 --- a/semantic-conventions/src/tests/data/markdown/deprecated/input.md +++ b/semantic-conventions/src/tests/data/markdown/deprecated/input.md @@ -3,17 +3,17 @@ -| Attribute name | Notes and examples | Required? | +| Attribute name | Notes and examples | `Required`? | | :------------- | :----------------------------------------------------------- | --------- | -| `http.method` | HTTP request method. E.g. `"GET"`. | Required | +| `http.method` | HTTP request method. E.g. `"GET"`. | `Required` | | `http.url` | Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. | Defined later. | | `http.target` | The full request target as passed in a [HTTP request line][] or equivalent, e.g. `"/path/12314/?q=ddds#123"`. | Defined later. | | `http.host` | The value of the [HTTP host header][]. When the header is empty or not present, this attribute should be the same. | Defined later. | | `http.scheme` | The URI scheme identifying the used protocol: `"http"` or `"https"` | Defined later. | -| `http.status_code` | [HTTP response status code][]. E.g. `200` (integer) | Conditionally Required: if and only if one was received/sent. | -| `http.status_text` | [HTTP reason phrase][]. E.g. `"OK"` | Recommended | +| `http.status_code` | [HTTP response status code][]. E.g. `200` (integer) | `Conditionally Required` if and only if one was received/sent. | +| `http.status_text` | [HTTP reason phrase][]. E.g. `"OK"` | `Recommended` | | `http.flavor` | Kind of HTTP protocol used: `"1.0"`, `"1.1"`, `"2"`, `"SPDY"` or `"QUIC"`. | No | -| `http.user_agent` | Value of the HTTP [User-Agent][] header sent by the client. | Recommended | +| `http.user_agent` | Value of the HTTP [User-Agent][] header sent by the client. | `Recommended` | diff --git a/semantic-conventions/src/tests/data/markdown/empty/expected.md b/semantic-conventions/src/tests/data/markdown/empty/expected.md index e7874380..0b063ae1 100644 --- a/semantic-conventions/src/tests/data/markdown/empty/expected.md +++ b/semantic-conventions/src/tests/data/markdown/empty/expected.md @@ -70,17 +70,17 @@ Note that the items marked with [1] are different from the mapping defined in th -| Attribute name | Notes and examples | Required? | +| Attribute name | Notes and examples | `Required`? | | :------------- | :----------------------------------------------------------- | --------- | -| `http.method` | HTTP request method. E.g. `"GET"`. | Required | +| `http.method` | HTTP request method. E.g. `"GET"`. | `Required` | | `http.url` | Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. | Defined later. | | `http.target` | The full request target as passed in a [HTTP request line][] or equivalent, e.g. `"/path/12314/?q=ddds#123"`. | Defined later. | | `http.host` | The value of the [HTTP host header][]. When the header is empty or not present, this attribute should be the same. | Defined later. | | `http.scheme` | The URI scheme identifying the used protocol: `"http"` or `"https"` | Defined later. | -| `http.status_code` | [HTTP response status code][]. E.g. `200` (integer) | Conditionally Required: if and only if one was received/sent. | -| `http.status_text` | [HTTP reason phrase][]. E.g. `"OK"` | Recommended | +| `http.status_code` | [HTTP response status code][]. E.g. `200` (integer) | `Conditionally Required` if and only if one was received/sent. | +| `http.status_text` | [HTTP reason phrase][]. E.g. `"OK"` | `Recommended` | | `http.flavor` | Kind of HTTP protocol used: `"1.0"`, `"1.1"`, `"2"`, `"SPDY"` or `"QUIC"`. | Opt-In | -| `http.user_agent` | Value of the HTTP [User-Agent][] header sent by the client. | Recommended | +| `http.user_agent` | Value of the HTTP [User-Agent][] header sent by the client. | `Recommended` | It is recommended to also use the general [network attributes][], especially `net.peer.ip`. If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. @@ -183,11 +183,11 @@ If the route does not include the application root, it SHOULD be prepended to th If the route cannot be determined, the `name` attribute MUST be set as defined in the general semantic conventions for HTTP. -| Attribute name | Notes and examples | Required? | +| Attribute name | Notes and examples | `Required`? | | :------------- | :----------------------------------------------------------- | --------- | | `http.server_name` | The primary server name of the matched virtual host. This should be obtained via configuration. If no such configuration can be obtained, this attribute MUST NOT be set ( `net.host.name` should be used instead). | [1] | -| `http.route` | The matched route (path template). (TODO: Define whether to prepend application root) E.g. `"/users/:userID?"`. | Recommended | -| `http.client_ip` | The IP address of the original client behind all proxies, if known (e.g. from [X-Forwarded-For][]). Note that this is not necessarily the same as `net.peer.ip`, which would identify the network-level peer, which may be a proxy. | Recommended | +| `http.route` | The matched route (path template). (TODO: Define whether to prepend application root) E.g. `"/users/:userID?"`. | `Recommended` | +| `http.client_ip` | The IP address of the original client behind all proxies, if known (e.g. from [X-Forwarded-For][]). Note that this is not necessarily the same as `net.peer.ip`, which would identify the network-level peer, which may be a proxy. | `Recommended` | [HTTP request line]: https://tools.ietf.org/html/rfc7230#section-3.1.1 [HTTP host header]: https://tools.ietf.org/html/rfc7230#section-5.4 diff --git a/semantic-conventions/src/tests/data/markdown/empty/input.md b/semantic-conventions/src/tests/data/markdown/empty/input.md index e7874380..0b063ae1 100644 --- a/semantic-conventions/src/tests/data/markdown/empty/input.md +++ b/semantic-conventions/src/tests/data/markdown/empty/input.md @@ -70,17 +70,17 @@ Note that the items marked with [1] are different from the mapping defined in th -| Attribute name | Notes and examples | Required? | +| Attribute name | Notes and examples | `Required`? | | :------------- | :----------------------------------------------------------- | --------- | -| `http.method` | HTTP request method. E.g. `"GET"`. | Required | +| `http.method` | HTTP request method. E.g. `"GET"`. | `Required` | | `http.url` | Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. | Defined later. | | `http.target` | The full request target as passed in a [HTTP request line][] or equivalent, e.g. `"/path/12314/?q=ddds#123"`. | Defined later. | | `http.host` | The value of the [HTTP host header][]. When the header is empty or not present, this attribute should be the same. | Defined later. | | `http.scheme` | The URI scheme identifying the used protocol: `"http"` or `"https"` | Defined later. | -| `http.status_code` | [HTTP response status code][]. E.g. `200` (integer) | Conditionally Required: if and only if one was received/sent. | -| `http.status_text` | [HTTP reason phrase][]. E.g. `"OK"` | Recommended | +| `http.status_code` | [HTTP response status code][]. E.g. `200` (integer) | `Conditionally Required` if and only if one was received/sent. | +| `http.status_text` | [HTTP reason phrase][]. E.g. `"OK"` | `Recommended` | | `http.flavor` | Kind of HTTP protocol used: `"1.0"`, `"1.1"`, `"2"`, `"SPDY"` or `"QUIC"`. | Opt-In | -| `http.user_agent` | Value of the HTTP [User-Agent][] header sent by the client. | Recommended | +| `http.user_agent` | Value of the HTTP [User-Agent][] header sent by the client. | `Recommended` | It is recommended to also use the general [network attributes][], especially `net.peer.ip`. If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. @@ -183,11 +183,11 @@ If the route does not include the application root, it SHOULD be prepended to th If the route cannot be determined, the `name` attribute MUST be set as defined in the general semantic conventions for HTTP. -| Attribute name | Notes and examples | Required? | +| Attribute name | Notes and examples | `Required`? | | :------------- | :----------------------------------------------------------- | --------- | | `http.server_name` | The primary server name of the matched virtual host. This should be obtained via configuration. If no such configuration can be obtained, this attribute MUST NOT be set ( `net.host.name` should be used instead). | [1] | -| `http.route` | The matched route (path template). (TODO: Define whether to prepend application root) E.g. `"/users/:userID?"`. | Recommended | -| `http.client_ip` | The IP address of the original client behind all proxies, if known (e.g. from [X-Forwarded-For][]). Note that this is not necessarily the same as `net.peer.ip`, which would identify the network-level peer, which may be a proxy. | Recommended | +| `http.route` | The matched route (path template). (TODO: Define whether to prepend application root) E.g. `"/users/:userID?"`. | `Recommended` | +| `http.client_ip` | The IP address of the original client behind all proxies, if known (e.g. from [X-Forwarded-For][]). Note that this is not necessarily the same as `net.peer.ip`, which would identify the network-level peer, which may be a proxy. | `Recommended` | [HTTP request line]: https://tools.ietf.org/html/rfc7230#section-3.1.1 [HTTP host header]: https://tools.ietf.org/html/rfc7230#section-5.4 diff --git a/semantic-conventions/src/tests/data/markdown/enum_int/expected.md b/semantic-conventions/src/tests/data/markdown/enum_int/expected.md index 8238900f..e8361396 100644 --- a/semantic-conventions/src/tests/data/markdown/enum_int/expected.md +++ b/semantic-conventions/src/tests/data/markdown/enum_int/expected.md @@ -1,9 +1,9 @@ # RPC.GRPC with int enum -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `rpc.grpc.status_code` | int | The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. | `0`; `1`; `16` | Required | +| `rpc.grpc.status_code` | int | The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. | `0`; `1`; `16` | `Required` | `rpc.grpc.status_code` MUST be one of the following: diff --git a/semantic-conventions/src/tests/data/markdown/event/expected.md b/semantic-conventions/src/tests/data/markdown/event/expected.md index 41274345..ed3e9f0e 100644 --- a/semantic-conventions/src/tests/data/markdown/event/expected.md +++ b/semantic-conventions/src/tests/data/markdown/event/expected.md @@ -3,11 +3,11 @@ The event name MUST be `exception`. -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `exception.escaped` | boolean | SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span. [1] | | Recommended | +| `exception.escaped` | boolean | SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span. [1] | | `Recommended` | | `exception.message` | string | The exception message. | `Division by zero`; `Can't convert 'int' object to str implicitly` | See below | -| `exception.stacktrace` | string | A stacktrace. | `Exception in thread "main" java.lang.RuntimeException: Test exception\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n at com.example.GenerateTrace.main(GenerateTrace.java:5)` | Recommended | +| `exception.stacktrace` | string | A stacktrace. | `Exception in thread "main" java.lang.RuntimeException: Test exception\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n at com.example.GenerateTrace.main(GenerateTrace.java:5)` | `Recommended` | | `exception.type` | string | The type of the exception. | `java.net.ConnectException`; `OSError` | See below | **[1]:** An exception is considered to have escaped. diff --git a/semantic-conventions/src/tests/data/markdown/event_noprefix/expected.md b/semantic-conventions/src/tests/data/markdown/event_noprefix/expected.md index f0beeb52..1cb8695e 100644 --- a/semantic-conventions/src/tests/data/markdown/event_noprefix/expected.md +++ b/semantic-conventions/src/tests/data/markdown/event_noprefix/expected.md @@ -3,7 +3,7 @@ The event name MUST be `myname`. -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `attr` | boolean | attrbrief | | Recommended | +| `attr` | boolean | attrbrief | | `Recommended` | diff --git a/semantic-conventions/src/tests/data/markdown/event_renamed/expected.md b/semantic-conventions/src/tests/data/markdown/event_renamed/expected.md index b96e5e6b..dd574537 100644 --- a/semantic-conventions/src/tests/data/markdown/event_renamed/expected.md +++ b/semantic-conventions/src/tests/data/markdown/event_renamed/expected.md @@ -3,7 +3,7 @@ The event name MUST be `myname`. -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `myprefix.attr` | boolean | attrbrief | | Recommended | +| `myprefix.attr` | boolean | attrbrief | | `Recommended` | diff --git a/semantic-conventions/src/tests/data/markdown/example_array/expected.md b/semantic-conventions/src/tests/data/markdown/example_array/expected.md index b63a1b4a..4c1609f2 100644 --- a/semantic-conventions/src/tests/data/markdown/example_array/expected.md +++ b/semantic-conventions/src/tests/data/markdown/example_array/expected.md @@ -1,7 +1,7 @@ # Common Attributes -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `http.method` | string[] | HTTP request method. | `[GET, POST, HEAD]` | Required | +| `http.method` | string[] | HTTP request method. | `[GET, POST, HEAD]` | `Required` | \ No newline at end of file diff --git a/semantic-conventions/src/tests/data/markdown/extend_constraint/expected.md b/semantic-conventions/src/tests/data/markdown/extend_constraint/expected.md index 66372a62..414f25f8 100644 --- a/semantic-conventions/src/tests/data/markdown/extend_constraint/expected.md +++ b/semantic-conventions/src/tests/data/markdown/extend_constraint/expected.md @@ -34,15 +34,15 @@ These attributes will usually be the same for all operations performed over the Some database systems may allow a connection to switch to a different `db.user`, for example, and other database systems may not even have the concept of a connection at all. -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `db.connection_string` | string | The connection string used to connect to the database. [1] | `Server=(localdb)\v11.0;Integrated Security=true;` | Recommended | -| `db.system` | string | An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. | `other_sql` | Required | -| `db.user` | string | Username for accessing the database. | `readonly_user`; `reporting_user` | Recommended | +| `db.connection_string` | string | The connection string used to connect to the database. [1] | `Server=(localdb)\v11.0;Integrated Security=true;` | `Recommended` | +| `db.system` | string | An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. | `other_sql` | `Required` | +| `db.user` | string | Username for accessing the database. | `readonly_user`; `reporting_user` | `Recommended` | | `net.peer.ip` | string | Remote address of the peer (dotted decimal for IPv4 or [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6) | `127.0.0.1` | See below | | `net.peer.name` | string | Remote hostname or similar, see note below. | `example.com` | See below | -| `net.peer.port` | int | Remote port number. | `80`; `8080`; `443` | Conditionally Required: [2] | -| `net.transport` | string | Transport protocol used. See note below. | `IP.TCP` | Conditionally Required: [3] | +| `net.peer.port` | int | Remote port number. | `80`; `8080`; `443` | `Conditionally Required` [2] | +| `net.transport` | string | Transport protocol used. See note below. | `IP.TCP` | `Conditionally Required` [3] | **[1]:** It is recommended to remove embedded credentials. @@ -55,7 +55,7 @@ Some database systems may allow a connection to switch to a different `db.user`, * `net.peer.name` * `net.peer.ip` -`db.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. +`db.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | |---|---| @@ -125,10 +125,10 @@ When additional attributes are added that only apply to a specific DBMS, its ide ### Connection-level attributes for specific technologies -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `db.jdbc.driver_classname` | string | The fully-qualified class name of the JDBC driver used to connect. | `org.postgresql.Driver`; `com.microsoft.sqlserver.jdbc.SQLServerDriver` | Recommended | -| `db.mssql.instance_name` | string | The Microsoft SQL Server [instance name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. [1] | `MSSQLSERVER` | Recommended | +| `db.jdbc.driver_classname` | string | The fully-qualified class name of the JDBC driver used to connect. | `org.postgresql.Driver`; `com.microsoft.sqlserver.jdbc.SQLServerDriver` | `Recommended` | +| `db.mssql.instance_name` | string | The Microsoft SQL Server [instance name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. [1] | `MSSQLSERVER` | `Recommended` | **[1]:** If setting a `db.mssql.instance_name`, `net.peer.port` is no longer required (but still recommended if non-standard). @@ -139,11 +139,11 @@ These attributes may be different for each operation performed, even if the same Usually only one `db.name` will be used per connection though. -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `db.name` | string | If no tech-specific attribute is defined, this attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). [1] | `customers`; `main` | Conditionally Required: [2] | -| `db.operation` | string | The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`. [3] | `findAndModify`; `HMSET` | Conditionally Required: if `db.statement` is not applicable. | -| `db.statement` | string | The database statement being executed. [4] | `SELECT * FROM wuser_table`; `SET mykey "WuValue"` | Conditionally Required: if applicable. | +| `db.name` | string | If no tech-specific attribute is defined, this attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). [1] | `customers`; `main` | `Conditionally Required` [2] | +| `db.operation` | string | The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`. [3] | `findAndModify`; `HMSET` | `Conditionally Required` if `db.statement` is not applicable. | +| `db.statement` | string | The database statement being executed. [4] | `SELECT * FROM wuser_table`; `SET mykey "WuValue"` | `Conditionally Required` if applicable. | **[1]:** In some SQL databases, the database name to be used is called "schema name". @@ -169,33 +169,33 @@ For example, when retrieving a document, `db.operation` would be set to (literal #### Cassandra -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `db.cassandra.keyspace` | string | The name of the keyspace being accessed. To be used instead of the generic `db.name` attribute. | `mykeyspace` | Required | +| `db.cassandra.keyspace` | string | The name of the keyspace being accessed. To be used instead of the generic `db.name` attribute. | `mykeyspace` | `Required` | #### Apache HBase -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `db.hbase.namespace` | string | The [HBase namespace](https://hbase.apache.org/book.html#_namespace) being accessed. To be used instead of the generic `db.name` attribute. | `default` | Required | +| `db.hbase.namespace` | string | The [HBase namespace](https://hbase.apache.org/book.html#_namespace) being accessed. To be used instead of the generic `db.name` attribute. | `default` | `Required` | #### Redis -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `db.redis.database_index` | int | The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. | `0`; `1`; `15` | Conditionally Required: if other than the default database (`0`). | +| `db.redis.database_index` | int | The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. | `0`; `1`; `15` | `Conditionally Required` if other than the default database (`0`). | #### MongoDB -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `db.mongodb.collection` | string | The collection being accessed within the database stated in `db.name`. | `customers`; `products` | Required | +| `db.mongodb.collection` | string | The collection being accessed within the database stated in `db.name`. | `customers`; `products` | `Required` | ## Examples diff --git a/semantic-conventions/src/tests/data/markdown/extend_constraint/input.md b/semantic-conventions/src/tests/data/markdown/extend_constraint/input.md index f979a83a..28049197 100644 --- a/semantic-conventions/src/tests/data/markdown/extend_constraint/input.md +++ b/semantic-conventions/src/tests/data/markdown/extend_constraint/input.md @@ -34,19 +34,19 @@ These attributes will usually be the same for all operations performed over the Some database systems may allow a connection to switch to a different `db.user`, for example, and other database systems may not even have the concept of a connection at all. -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `db.system` | string | An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. | `other_sql` | Required | -| `db.connection_string` | string | The connection string used to connect to the database. [1] | `Server=(localdb)\v11.0;Integrated Security=true;` | Recommended | -| `db.user` | string | Username for accessing the database. | `readonly_user`
`reporting_user` | Recommended | +| `db.system` | string | An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. | `other_sql` | `Required` | +| `db.connection_string` | string | The connection string used to connect to the database. [1] | `Server=(localdb)\v11.0;Integrated Security=true;` | `Recommended` | +| `db.user` | string | Username for accessing the database. | `readonly_user`
`reporting_user` | `Recommended` | | `net.peer.ip` | string | Remote address of the peer (dotted decimal for IPv4 or [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6) | `127.0.0.1` | Conditional
See below. | | `net.peer.name` | string | Remote hostname or similar, see note below. | `example.com` | Conditional
See below. | -| `net.peer.port` | int | Remote port number. | `80`
`8080`
`443` | Conditionally Required: [2] | -| `net.transport` | string enum | Transport protocol used. See note below. | `IP.TCP` | Conditionally Required: [3] | +| `net.peer.port` | int | Remote port number. | `80`
`8080`
`443` | `Conditionally Required` [2] | +| `net.transport` | string enum | Transport protocol used. See note below. | `IP.TCP` | `Conditionally Required` [3] | **[1]:** It is recommended to remove embedded credentials. -**[2]:** Conditionally Required: if using a port other than the default port for this DBMS. +**[2]:** Conditionally Required if using a port other than the default port for this DBMS. **[3]:** Recommended in general, required for in-process databases (`"inproc"`). @@ -55,7 +55,7 @@ At least one of the following is required: * `net.peer.name` * `net.peer.ip` -`db.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. +`db.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | |---|---| @@ -125,10 +125,10 @@ When additional attributes are added that only apply to a specific DBMS, its ide ### Connection-level attributes for specific technologies -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `db.mssql.instance_name` | string | The Microsoft SQL Server [instance name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. [1] | `MSSQLSERVER` | Recommended | -| `db.jdbc.driver_classname` | string | The fully-qualified class name of the JDBC driver used to connect. | `org.postgresql.Driver`
`com.microsoft.sqlserver.jdbc.SQLServerDriver` | Recommended | +| `db.mssql.instance_name` | string | The Microsoft SQL Server [instance name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. [1] | `MSSQLSERVER` | `Recommended` | +| `db.jdbc.driver_classname` | string | The fully-qualified class name of the JDBC driver used to connect. | `org.postgresql.Driver`
`com.microsoft.sqlserver.jdbc.SQLServerDriver` | `Recommended` | **[1]:** If setting a `db.mssql.instance_name`, `net.peer.port` is no longer required (but still recommended if non-standard). @@ -139,11 +139,11 @@ These attributes may be different for each operation performed, even if the same Usually only one `db.name` will be used per connection though. -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `db.name` | string | If no tech-specific attribute is defined, this attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). [1] | `customers`
`main` | Conditionally Required: [2] | -| `db.statement` | string | The database statement being executed. [3] | `SELECT * FROM wuser_table`
`SET mykey "WuValue"` | Conditional
Conditionally Required: if applicable. | -| `db.operation` | string | The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`. [4] | `findAndModify`
`HMSET` | Conditional
Conditionally Required: if `db.statement` is not applicable. | +| `db.name` | string | If no tech-specific attribute is defined, this attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). [1] | `customers`
`main` | `Conditionally Required` [2] | +| `db.statement` | string | The database statement being executed. [3] | `SELECT * FROM wuser_table`
`SET mykey "WuValue"` | Conditional
Conditionally Required if applicable. | +| `db.operation` | string | The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`. [4] | `findAndModify`
`HMSET` | Conditional
Conditionally Required if `db.statement` is not applicable. | **[1]:** In some SQL databases, the database name to be used is called "schema name". @@ -169,23 +169,23 @@ For example, when retrieving a document, `db.operation` would be set to (literal #### Cassandra -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `db.cassandra.keyspace` | string | The name of the keyspace being accessed. To be used instead of the generic `db.name` attribute. | `mykeyspace` | Required | +| `db.cassandra.keyspace` | string | The name of the keyspace being accessed. To be used instead of the generic `db.name` attribute. | `mykeyspace` | `Required` | #### Apache HBase -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `db.hbase.namespace` | string | The [HBase namespace](https://hbase.apache.org/book.html#_namespace) being accessed. To be used instead of the generic `db.name` attribute. | `default` | Required | +| `db.hbase.namespace` | string | The [HBase namespace](https://hbase.apache.org/book.html#_namespace) being accessed. To be used instead of the generic `db.name` attribute. | `default` | `Required` | #### Redis -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| | `db.redis.database_index` | int | The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. | `0`
`1`
`15` | Conditional [1] | @@ -195,9 +195,9 @@ For example, when retrieving a document, `db.operation` would be set to (literal #### MongoDB -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `db.mongodb.collection` | string | The collection being accessed within the database stated in `db.name`. | `customers`
`products` | Required | +| `db.mongodb.collection` | string | The collection being accessed within the database stated in `db.name`. | `customers`
`products` | `Required` | ## Examples diff --git a/semantic-conventions/src/tests/data/markdown/extend_grandparent/expected.md b/semantic-conventions/src/tests/data/markdown/extend_grandparent/expected.md index 3964e411..40906dce 100644 --- a/semantic-conventions/src/tests/data/markdown/extend_grandparent/expected.md +++ b/semantic-conventions/src/tests/data/markdown/extend_grandparent/expected.md @@ -1,10 +1,10 @@ ## DB spans -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `db.foo.bar` | string | Some property. | `baz` | Recommended | -| `db.name` | string | Database name. | `the_shop` | Recommended | +| `db.foo.bar` | string | Some property. | `baz` | `Recommended` | +| `db.name` | string | Database name. | `the_shop` | `Recommended` | ## DB metrics @@ -16,8 +16,8 @@ -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `db.foo.bar` | string | Some property. | `baz` | Recommended | -| `db.name` | string | Database name. | `the_shop` | Recommended | +| `db.foo.bar` | string | Some property. | `baz` | `Recommended` | +| `db.name` | string | Database name. | `the_shop` | `Recommended` | diff --git a/semantic-conventions/src/tests/data/markdown/include/expected.md b/semantic-conventions/src/tests/data/markdown/include/expected.md index d29c6fff..7102b13e 100644 --- a/semantic-conventions/src/tests/data/markdown/include/expected.md +++ b/semantic-conventions/src/tests/data/markdown/include/expected.md @@ -1,21 +1,21 @@ # Test Markdown -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `faas.execution` | string | The execution id of the current function execution. | `af9d5aa4-a685-4c5f-a22b-444f80b3cc28` | Recommended | -| `faas.trigger` | string | Type of the trigger on which the function is executed. | `datasource` | Required | +| `faas.execution` | string | The execution id of the current function execution. | `af9d5aa4-a685-4c5f-a22b-444f80b3cc28` | `Recommended` | +| `faas.trigger` | string | Type of the trigger on which the function is executed. | `datasource` | `Required` | | `http.host` | string | The value of the [HTTP host header](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is empty or not present, this attribute should be the same. | `www.example.org` | See below | -| `http.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Required | -| `http.recommended_attribute` | string | brief | `foo` | Recommended: short note | -| `http.recommended_attribute_long_note` | string | brief | `bar` | Recommended: [1] | +| `http.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | `Required` | +| `http.recommended_attribute` | string | brief | `foo` | `Recommended` short note | +| `http.recommended_attribute_long_note` | string | brief | `bar` | `Recommended` [1] | | `http.scheme` | string | The URI scheme identifying the used protocol. | `http`; `https` | See below | -| [`http.server_name`](input_http.md) | string | The primary server name of the matched virtual host. [2] | `example.com` | Conditionally Required: [3] | -| `http.status_code` | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | Conditionally Required: if and only if one was received/sent | -| `http.status_text` | string | [HTTP reason phrase](https://tools.ietf.org/html/rfc7230#section-3.1.2). | `OK` | Recommended | +| [`http.server_name`](input_http.md) | string | The primary server name of the matched virtual host. [2] | `example.com` | `Conditionally Required` [3] | +| `http.status_code` | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | `Conditionally Required` if and only if one was received/sent | +| `http.status_text` | string | [HTTP reason phrase](https://tools.ietf.org/html/rfc7230#section-3.1.2). | `OK` | `Recommended` | | `http.target` | string | The full request target as passed in a HTTP request line or equivalent. | `/path/12314/?q=ddds#123` | See below | | `http.url` | string | Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. | `https://www.foo.bar/search?q=OpenTelemetry#SemConv` | See below | -| `http.user_agent` | string | Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client. | `CERN-LineMode/2.15 libwww/2.17b3` | Recommended | +| `http.user_agent` | string | Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client. | `CERN-LineMode/2.15 libwww/2.17b3` | `Recommended` | **[1]:** some very long note that should be written under the semconv table diff --git a/semantic-conventions/src/tests/data/markdown/metrics_tables/expected.md b/semantic-conventions/src/tests/data/markdown/metrics_tables/expected.md index fccac598..253863ba 100644 --- a/semantic-conventions/src/tests/data/markdown/metrics_tables/expected.md +++ b/semantic-conventions/src/tests/data/markdown/metrics_tables/expected.md @@ -11,10 +11,10 @@ **Attributes for `foo.size`** -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `http.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Required | -| `http.status_code` | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | Conditionally Required: if and only if one was received/sent. | +| `http.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | `Required` | +| `http.status_code` | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | `Conditionally Required` if and only if one was received/sent. | **`foo.active_eggs`** @@ -26,9 +26,9 @@ **Attributes for `foo.active_eggs`** -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `bar.egg.type` | string | Type of egg. [1] | `chicken`; `emu`; `dragon` | Conditionally Required: if available to instrumentation. | +| `bar.egg.type` | string | Type of egg. [1] | `chicken`; `emu`; `dragon` | `Conditionally Required` if available to instrumentation. | | `http.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Opt-In | **[1]:** Some notes on attribute diff --git a/semantic-conventions/src/tests/data/markdown/missing_end_tag/input.md b/semantic-conventions/src/tests/data/markdown/missing_end_tag/input.md index 738dbd13..8b5289a6 100644 --- a/semantic-conventions/src/tests/data/markdown/missing_end_tag/input.md +++ b/semantic-conventions/src/tests/data/markdown/missing_end_tag/input.md @@ -3,17 +3,17 @@ -| Attribute name | Notes and examples | Required? | +| Attribute name | Notes and examples | `Required`? | | :------------- | :----------------------------------------------------------- | --------- | -| `http.method` | HTTP request method. E.g. `"GET"`. | Required | +| `http.method` | HTTP request method. E.g. `"GET"`. | `Required` | | `http.url` | Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. | Defined later. | | `http.target` | The full request target as passed in a [HTTP request line][] or equivalent, e.g. `"/path/12314/?q=ddds#123"`. | Defined later. | | `http.host` | The value of the [HTTP host header][]. When the header is empty or not present, this attribute should be the same. | Defined later. | | `http.scheme` | The URI scheme identifying the used protocol: `"http"` or `"https"` | Defined later. | -| `http.status_code` | [HTTP response status code][]. E.g. `200` (integer) | Conditionally Required: if and only if one was received/sent. | -| `http.status_text` | [HTTP reason phrase][]. E.g. `"OK"` | Recommended | +| `http.status_code` | [HTTP response status code][]. E.g. `200` (integer) | `Conditionally Required` if and only if one was received/sent. | +| `http.status_text` | [HTTP reason phrase][]. E.g. `"OK"` | `Recommended` | | `http.flavor` | Kind of HTTP protocol used: `"1.0"`, `"1.1"`, `"2"`, `"SPDY"` or `"QUIC"`. | Opt-In | -| `http.user_agent` | Value of the HTTP [User-Agent][] header sent by the client. | Recommended | +| `http.user_agent` | Value of the HTTP [User-Agent][] header sent by the client. | `Recommended` | It is recommended to also use the general [network attributes][], especially `net.peer.ip`. If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. diff --git a/semantic-conventions/src/tests/data/markdown/multiple/expected.md b/semantic-conventions/src/tests/data/markdown/multiple/expected.md index 24b84332..a3fd8769 100644 --- a/semantic-conventions/src/tests/data/markdown/multiple/expected.md +++ b/semantic-conventions/src/tests/data/markdown/multiple/expected.md @@ -2,29 +2,29 @@ -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `http.host` | string | The value of the [HTTP host header](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is empty or not present, this attribute should be the same. | `www.example.org` | Recommended | -| `http.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Required | -| `http.scheme` | string | The URI scheme identifying the used protocol. | `http`; `https` | Recommended | -| `http.status_code` | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | Conditionally Required: if and only if one was received/sent | -| `http.status_text` | string | [HTTP reason phrase](https://tools.ietf.org/html/rfc7230#section-3.1.2). | `OK` | Recommended | -| `http.target` | string | The full request target as passed in a HTTP request line or equivalent. | `/path/12314/?q=ddds#123` | Recommended | -| `http.url` | string | Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. | `https://www.foo.bar/search?q=OpenTelemetry#SemConv` | Recommended | -| `http.user_agent` | string | Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client. | `CERN-LineMode/2.15 libwww/2.17b3` | Recommended | +| `http.host` | string | The value of the [HTTP host header](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is empty or not present, this attribute should be the same. | `www.example.org` | `Recommended` | +| `http.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | `Required` | +| `http.scheme` | string | The URI scheme identifying the used protocol. | `http`; `https` | `Recommended` | +| `http.status_code` | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | `Conditionally Required` if and only if one was received/sent | +| `http.status_text` | string | [HTTP reason phrase](https://tools.ietf.org/html/rfc7230#section-3.1.2). | `OK` | `Recommended` | +| `http.target` | string | The full request target as passed in a HTTP request line or equivalent. | `/path/12314/?q=ddds#123` | `Recommended` | +| `http.url` | string | Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. | `https://www.foo.bar/search?q=OpenTelemetry#SemConv` | `Recommended` | +| `http.user_agent` | string | Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client. | `CERN-LineMode/2.15 libwww/2.17b3` | `Recommended` | -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `http.host` | string | The value of the [HTTP host header](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is empty or not present, this attribute should be the same. | `www.example.org` | Recommended | -| `http.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Required | -| `http.scheme` | string | The URI scheme identifying the used protocol. | `http`; `https` | Recommended | -| `http.status_code` | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | Conditionally Required: if and only if one was received/sent | -| `http.status_text` | string | [HTTP reason phrase](https://tools.ietf.org/html/rfc7230#section-3.1.2). | `OK` | Recommended | -| `http.target` | string | The full request target as passed in a HTTP request line or equivalent. | `/path/12314/?q=ddds#123` | Recommended | -| `http.url` | string | Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. | `https://www.foo.bar/search?q=OpenTelemetry#SemConv` | Recommended | -| `http.user_agent` | string | Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client. | `CERN-LineMode/2.15 libwww/2.17b3` | Recommended | +| `http.host` | string | The value of the [HTTP host header](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is empty or not present, this attribute should be the same. | `www.example.org` | `Recommended` | +| `http.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | `Required` | +| `http.scheme` | string | The URI scheme identifying the used protocol. | `http`; `https` | `Recommended` | +| `http.status_code` | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | `Conditionally Required` if and only if one was received/sent | +| `http.status_text` | string | [HTTP reason phrase](https://tools.ietf.org/html/rfc7230#section-3.1.2). | `OK` | `Recommended` | +| `http.target` | string | The full request target as passed in a HTTP request line or equivalent. | `/path/12314/?q=ddds#123` | `Recommended` | +| `http.url` | string | Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. | `https://www.foo.bar/search?q=OpenTelemetry#SemConv` | `Recommended` | +| `http.user_agent` | string | Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client. | `CERN-LineMode/2.15 libwww/2.17b3` | `Recommended` | It is recommended to also use the general [network attributes][], especially `net.peer.ip`. If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. diff --git a/semantic-conventions/src/tests/data/markdown/multiple/input.md b/semantic-conventions/src/tests/data/markdown/multiple/input.md index 5364018f..45ae85c2 100644 --- a/semantic-conventions/src/tests/data/markdown/multiple/input.md +++ b/semantic-conventions/src/tests/data/markdown/multiple/input.md @@ -3,17 +3,17 @@ -| Attribute name | Notes and examples | Required? | +| Attribute name | Notes and examples | `Required`? | | :------------- | :----------------------------------------------------------- | --------- | -| `http.method` | HTTP request method. E.g. `"GET"`. | Required | +| `http.method` | HTTP request method. E.g. `"GET"`. | `Required` | | `http.url` | Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. | Defined later. | | `http.target` | The full request target as passed in a [HTTP request line][] or equivalent, e.g. `"/path/12314/?q=ddds#123"`. | Defined later. | | `http.host` | The value of the [HTTP host header][]. When the header is empty or not present, this attribute should be the same. | Defined later. | | `http.scheme` | The URI scheme identifying the used protocol: `"http"` or `"https"` | Defined later. | -| `http.status_code` | [HTTP response status code][]. E.g. `200` (integer) | Conditionally Required: if and only if one was received/sent. | -| `http.status_text` | [HTTP reason phrase][]. E.g. `"OK"` | Recommended | +| `http.status_code` | [HTTP response status code][]. E.g. `200` (integer) | `Conditionally Required` if and only if one was received/sent. | +| `http.status_text` | [HTTP reason phrase][]. E.g. `"OK"` | `Recommended` | | `http.flavor` | Kind of HTTP protocol used: `"1.0"`, `"1.1"`, `"2"`, `"SPDY"` or `"QUIC"`. | No | -| `http.user_agent` | Value of the HTTP [User-Agent][] header sent by the client. | Recommended | +| `http.user_agent` | Value of the HTTP [User-Agent][] header sent by the client. | `Recommended` | diff --git a/semantic-conventions/src/tests/data/markdown/multiple_enum/expected.md b/semantic-conventions/src/tests/data/markdown/multiple_enum/expected.md index 96781fc4..c3780d61 100644 --- a/semantic-conventions/src/tests/data/markdown/multiple_enum/expected.md +++ b/semantic-conventions/src/tests/data/markdown/multiple_enum/expected.md @@ -2,30 +2,30 @@ -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `net.host.carrier.icc` | string | host.carrier.icc | `DE` | Recommended | -| `net.host.carrier.mcc` | string | host.carrier.mcc | `310` | Recommended | -| `net.host.carrier.mnc` | string | host.carrier.mnc | `001` | Recommended | -| `net.host.carrier.name` | string | host.carrier.name | `sprint` | Recommended | -| `net.host.connection.subtype` | string | This describes more details regarding the connection.type. It may be the type of cell connection, but it could be used for describing details about a wifi connection. | `2G` | Recommended | -| `net.host.connection.type` | string | unavailable | `wifi` | Recommended | -| `net.host.ip` | string | Like `net.peer.ip` but for the host IP. Useful in case of a multi-IP host. | `192.168.0.1` | Recommended | -| `net.host.name` | string | Local hostname or similar, see note below. | `localhost` | Recommended | -| `net.host.port` | int | Like `net.peer.port` but for the host port. | `35555` | Recommended | -| `net.peer.ip` | string | Remote address of the peer (dotted decimal for IPv4 or [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6) | `127.0.0.1` | Recommended | -| `net.peer.name` | string | Remote hostname or similar, see note below. | `example.com` | Recommended | -| `net.peer.port` | int | Remote port number. | `80`; `8080`; `443` | Recommended | -| `net.transport` | string | Transport protocol used. See note below. | `IP.TCP` | Recommended | - -`net.host.connection.subtype` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. +| `net.host.carrier.icc` | string | host.carrier.icc | `DE` | `Recommended` | +| `net.host.carrier.mcc` | string | host.carrier.mcc | `310` | `Recommended` | +| `net.host.carrier.mnc` | string | host.carrier.mnc | `001` | `Recommended` | +| `net.host.carrier.name` | string | host.carrier.name | `sprint` | `Recommended` | +| `net.host.connection.subtype` | string | This describes more details regarding the connection.type. It may be the type of cell connection, but it could be used for describing details about a wifi connection. | `2G` | `Recommended` | +| `net.host.connection.type` | string | unavailable | `wifi` | `Recommended` | +| `net.host.ip` | string | Like `net.peer.ip` but for the host IP. Useful in case of a multi-IP host. | `192.168.0.1` | `Recommended` | +| `net.host.name` | string | Local hostname or similar, see note below. | `localhost` | `Recommended` | +| `net.host.port` | int | Like `net.peer.port` but for the host port. | `35555` | `Recommended` | +| `net.peer.ip` | string | Remote address of the peer (dotted decimal for IPv4 or [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6) | `127.0.0.1` | `Recommended` | +| `net.peer.name` | string | Remote hostname or similar, see note below. | `example.com` | `Recommended` | +| `net.peer.port` | int | Remote port number. | `80`; `8080`; `443` | `Recommended` | +| `net.transport` | string | Transport protocol used. See note below. | `IP.TCP` | `Recommended` | + +`net.host.connection.subtype` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | |---|---| | `1G` | 1G | | `2G` | 2G | -`net.host.connection.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. +`net.host.connection.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | |---|---| diff --git a/semantic-conventions/src/tests/data/markdown/parameter_empty/http.md b/semantic-conventions/src/tests/data/markdown/parameter_empty/http.md index e3d08f12..de3e6daa 100644 --- a/semantic-conventions/src/tests/data/markdown/parameter_empty/http.md +++ b/semantic-conventions/src/tests/data/markdown/parameter_empty/http.md @@ -1,11 +1,11 @@ # General -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `http.server_name` | String | The primary server name of the matched virtual host. [1] | `example.com` | Conditionally Required: [2] | -| `http.route` | String | The matched route (path template). | `/users/:userID?` | Recommended | -| `http.client_ip` | String | The IP address of the original client behind all proxies, if known (e.g. from [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)). [3] | `83.164.160.102` | Recommended | +| `http.server_name` | String | The primary server name of the matched virtual host. [1] | `example.com` | `Conditionally Required` [2] | +| `http.route` | String | The matched route (path template). | `/users/:userID?` | `Recommended` | +| `http.client_ip` | String | The IP address of the original client behind all proxies, if known (e.g. from [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)). [3] | `83.164.160.102` | `Recommended` | **[1]:** http.url is usually not readily available on the server side but would have to be assembled in a cumbersome and sometimes lossy process from other information (see e.g. open-telemetry/opentelemetry-python/pull/148). It is thus preferred to supply the raw data that is available. diff --git a/semantic-conventions/src/tests/data/markdown/parameter_full/expected.md b/semantic-conventions/src/tests/data/markdown/parameter_full/expected.md index 1ff9a1c2..52f04e18 100644 --- a/semantic-conventions/src/tests/data/markdown/parameter_full/expected.md +++ b/semantic-conventions/src/tests/data/markdown/parameter_full/expected.md @@ -1,21 +1,21 @@ # Attributes -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `faas.execution` | string | The execution id of the current function execution. | `af9d5aa4-a685-4c5f-a22b-444f80b3cc28` | Recommended | -| `faas.trigger` | string | Type of the trigger on which the function is executed. | `datasource` | Required | -| [`http.client_ip`](http.md) | string | The IP address of the original client behind all proxies, if known (e.g. from [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)). [1] | `83.164.160.102` | Recommended | -| `http.host` | string | The value of the [HTTP host header](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is empty or not present, this attribute should be the same. | `www.example.org` | Conditionally Required: | -| `http.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Required | -| [`http.route`](http.md) | string | The matched route (path template). | `/users/:userID?` | Recommended | +| `faas.execution` | string | The execution id of the current function execution. | `af9d5aa4-a685-4c5f-a22b-444f80b3cc28` | `Recommended` | +| `faas.trigger` | string | Type of the trigger on which the function is executed. | `datasource` | `Required` | +| [`http.client_ip`](http.md) | string | The IP address of the original client behind all proxies, if known (e.g. from [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)). [1] | `83.164.160.102` | `Recommended` | +| `http.host` | string | The value of the [HTTP host header](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is empty or not present, this attribute should be the same. | `www.example.org` | `Conditionally Required` | +| `http.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | `Required` | +| [`http.route`](http.md) | string | The matched route (path template). | `/users/:userID?` | `Recommended` | | `http.scheme` | string | The URI scheme identifying the used protocol. | `http`; `https` | See below | -| [`http.server_name`](http.md) | string | The primary server name of the matched virtual host. [2] | `example.com` | Conditionally Required: [3] | -| `http.status_code` | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | Conditionally Required: if and only if one was received/sent. | -| `http.status_text` | string | [HTTP reason phrase](https://tools.ietf.org/html/rfc7230#section-3.1.2). | `OK` | Recommended | +| [`http.server_name`](http.md) | string | The primary server name of the matched virtual host. [2] | `example.com` | `Conditionally Required` [3] | +| `http.status_code` | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | `Conditionally Required` if and only if one was received/sent. | +| `http.status_text` | string | [HTTP reason phrase](https://tools.ietf.org/html/rfc7230#section-3.1.2). | `OK` | `Recommended` | | `http.target` | string | The full request target as passed in a HTTP request line or equivalent. | `/path/12314/?q=ddds#123` | See below | | `http.url` | string | Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. | `https://www.foo.bar/search?q=OpenTelemetry#SemConv` | See below | -| `http.user_agent` | string | Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client. | `CERN-LineMode/2.15 libwww/2.17b3` | Recommended | +| `http.user_agent` | string | Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client. | `CERN-LineMode/2.15 libwww/2.17b3` | `Recommended` | **[1]:** This is not necessarily the same as `net.peer.ip`, which would identify the network-level peer, which may be a proxy. diff --git a/semantic-conventions/src/tests/data/markdown/parameter_full/http.md b/semantic-conventions/src/tests/data/markdown/parameter_full/http.md index eea49b57..b634120b 100644 --- a/semantic-conventions/src/tests/data/markdown/parameter_full/http.md +++ b/semantic-conventions/src/tests/data/markdown/parameter_full/http.md @@ -1,11 +1,11 @@ # General -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `http.server_name` | String | The primary server name of the matched virtual host. [1] | `example.com` | Conditionally Required: [2] | -| `http.route` | String | The matched route (path template). | `/users/:userID?` | Recommended | -| `http.client_ip` | String | The IP address of the original client behind all proxies, if known (e.g. from [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)). [3] | `83.164.160.102` | Recommended | +| `http.server_name` | String | The primary server name of the matched virtual host. [1] | `example.com` | `Conditionally Required` [2] | +| `http.route` | String | The matched route (path template). | `/users/:userID?` | `Recommended` | +| `http.client_ip` | String | The IP address of the original client behind all proxies, if known (e.g. from [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)). [3] | `83.164.160.102` | `Recommended` | **[1]:** http.url is usually not readily available on the server side but would have to be assembled in a cumbersome and sometimes lossy process from other information (see e.g. open-telemetry/opentelemetry-python/pull/148). It is thus preferred to supply the raw data that is available. diff --git a/semantic-conventions/src/tests/data/markdown/parameter_remove_constraint/expected.md b/semantic-conventions/src/tests/data/markdown/parameter_remove_constraint/expected.md index f37e496b..6d062e68 100644 --- a/semantic-conventions/src/tests/data/markdown/parameter_remove_constraint/expected.md +++ b/semantic-conventions/src/tests/data/markdown/parameter_remove_constraint/expected.md @@ -1,18 +1,18 @@ # DB -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `db.connection_string` | string | The connection string used to connect to the database. [1] | `Server=(localdb)\v11.0;Integrated Security=true;` | Recommended | -| `db.type` | string | Database type. For any SQL database, "sql". For others, the lower-case database category. | `sql` | Required | -| `db.user` | string | Username for accessing the database. | `readonly_user`; `reporting_user` | Recommended | -| `net.peer.ip` | string | Remote address of the peer (dotted decimal for IPv4 or [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6) | `127.0.0.1` | Recommended | -| `net.peer.name` | string | Remote hostname or similar, see note below. | `example.com` | Recommended | -| `net.peer.port` | int | Remote port number. | `80`; `8080`; `443` | Recommended | +| `db.connection_string` | string | The connection string used to connect to the database. [1] | `Server=(localdb)\v11.0;Integrated Security=true;` | `Recommended` | +| `db.type` | string | Database type. For any SQL database, "sql". For others, the lower-case database category. | `sql` | `Required` | +| `db.user` | string | Username for accessing the database. | `readonly_user`; `reporting_user` | `Recommended` | +| `net.peer.ip` | string | Remote address of the peer (dotted decimal for IPv4 or [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6) | `127.0.0.1` | `Recommended` | +| `net.peer.name` | string | Remote hostname or similar, see note below. | `example.com` | `Recommended` | +| `net.peer.port` | int | Remote port number. | `80`; `8080`; `443` | `Recommended` | **[1]:** It is recommended to remove embedded credentials. -`db.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. +`db.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | |---|---| diff --git a/semantic-conventions/src/tests/data/markdown/parameter_remove_constraint/input.md b/semantic-conventions/src/tests/data/markdown/parameter_remove_constraint/input.md index 4051b754..aa49e453 100644 --- a/semantic-conventions/src/tests/data/markdown/parameter_remove_constraint/input.md +++ b/semantic-conventions/src/tests/data/markdown/parameter_remove_constraint/input.md @@ -1,15 +1,15 @@ # DB -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `db.type` | String | Database type. For any SQL database, "sql". For others, the lower-case database category. | `sql` | Required | -| `db.connection_string` | String | The connection string used to connect to the database. [1] | `Server=(localdb)\v11.0;Integrated Security=true;` | Recommended | -| `db.user` | String | Username for accessing the database. | `readonly_user`
`reporting_user` | Recommended | -| [net.peer.ip](general.md) | String | None | `127.0.0.1` | Recommended | -| [net.peer.name](general.md) | String | None | `example.com` | Recommended | -| [net.peer.port](general.md) | int | None | `80`
`8080`
`443` | Recommended | -| [net.transport](general.md) | Enum | None | `IP.TCP` | Recommended | +| `db.type` | String | Database type. For any SQL database, "sql". For others, the lower-case database category. | `sql` | `Required` | +| `db.connection_string` | String | The connection string used to connect to the database. [1] | `Server=(localdb)\v11.0;Integrated Security=true;` | `Recommended` | +| `db.user` | String | Username for accessing the database. | `readonly_user`
`reporting_user` | `Recommended` | +| [net.peer.ip](general.md) | String | None | `127.0.0.1` | `Recommended` | +| [net.peer.name](general.md) | String | None | `example.com` | `Recommended` | +| [net.peer.port](general.md) | int | None | `80`
`8080`
`443` | `Recommended` | +| [net.transport](general.md) | Enum | None | `IP.TCP` | `Recommended` | **[1]:** It is recommended to remove embedded credentials. diff --git a/semantic-conventions/src/tests/data/markdown/parameter_tag/expected.md b/semantic-conventions/src/tests/data/markdown/parameter_tag/expected.md index 9332a6f9..bf1dd634 100644 --- a/semantic-conventions/src/tests/data/markdown/parameter_tag/expected.md +++ b/semantic-conventions/src/tests/data/markdown/parameter_tag/expected.md @@ -1,14 +1,14 @@ # DB -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `db.connection_string` | string | The connection string used to connect to the database. [1] | `Server=(localdb)\v11.0;Integrated Security=true;` | Recommended | -| `db.type` | string | Database type. For any SQL database, "sql". For others, the lower-case database category. | `sql` | Required | -| `db.user` | string | Username for accessing the database. | `readonly_user`; `reporting_user` | Recommended | +| `db.connection_string` | string | The connection string used to connect to the database. [1] | `Server=(localdb)\v11.0;Integrated Security=true;` | `Recommended` | +| `db.type` | string | Database type. For any SQL database, "sql". For others, the lower-case database category. | `sql` | `Required` | +| `db.user` | string | Username for accessing the database. | `readonly_user`; `reporting_user` | `Recommended` | | `net.peer.ip` | string | Remote address of the peer (dotted decimal for IPv4 or [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6) | `127.0.0.1` | See below | | `net.peer.name` | string | Remote hostname or similar, see note below. | `example.com` | See below | -| `net.peer.port` | int | Remote port number. | `80`; `8080`; `443` | Recommended | +| `net.peer.port` | int | Remote port number. | `80`; `8080`; `443` | `Recommended` | **[1]:** It is recommended to remove embedded credentials. @@ -17,7 +17,7 @@ * `net.peer.name` * `net.peer.ip` -`db.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. +`db.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | |---|---| diff --git a/semantic-conventions/src/tests/data/markdown/parameter_tag_empty/expected.md b/semantic-conventions/src/tests/data/markdown/parameter_tag_empty/expected.md index 59acab51..6197be43 100644 --- a/semantic-conventions/src/tests/data/markdown/parameter_tag_empty/expected.md +++ b/semantic-conventions/src/tests/data/markdown/parameter_tag_empty/expected.md @@ -1,14 +1,14 @@ # DB -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `db.dbms` | string | An identifier for the DBMS (database management system) product | `mssql` | Conditionally Required: for `db.type="sql"` | -| `db.jdbc.driver_classname` | string | The fully-qualified class name of the JDBC driver used to connect. | `org.postgresql.Driver`; `com.microsoft.sqlserver.jdbc.SQLServerDriver` | Recommended | -| `db.mssql.instance_name` | string | The Microsoft SQL Server [instance name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. [1] | `MSSQLSERVER` | Recommended | -| `db.name` | string | If no tech-specific attribute is defined below, this attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). [2] | `customers`; `master` | Conditionally Required: [3] | -| `db.operation` | string | The type of operation that is executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`. While it would semantically make sense to set this, e.g., to a SQL keyword like `SELECT` or `INSERT`, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property (the back end can do that if required). | `findAndModify` | Conditionally Required: if `db.statement` is not applicable. | -| `db.statement` | string | A database statement for the given database type. [4] | `SELECT * FROM wuser_table`; `SET mykey "WuValue"` | Conditionally Required: if applicable. | +| `db.dbms` | string | An identifier for the DBMS (database management system) product | `mssql` | `Conditionally Required` for `db.type="sql"` | +| `db.jdbc.driver_classname` | string | The fully-qualified class name of the JDBC driver used to connect. | `org.postgresql.Driver`; `com.microsoft.sqlserver.jdbc.SQLServerDriver` | `Recommended` | +| `db.mssql.instance_name` | string | The Microsoft SQL Server [instance name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. [1] | `MSSQLSERVER` | `Recommended` | +| `db.name` | string | If no tech-specific attribute is defined below, this attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). [2] | `customers`; `master` | `Conditionally Required` [3] | +| `db.operation` | string | The type of operation that is executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`. While it would semantically make sense to set this, e.g., to a SQL keyword like `SELECT` or `INSERT`, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property (the back end can do that if required). | `findAndModify` | `Conditionally Required` if `db.statement` is not applicable. | +| `db.statement` | string | A database statement for the given database type. [4] | `SELECT * FROM wuser_table`; `SET mykey "WuValue"` | `Conditionally Required` if applicable. | **[1]:** If setting a `db.mssql.instance_name`, `net.peer.port` is no longer required (but still recommended if non-standard). @@ -23,7 +23,7 @@ * `net.peer.name` * `net.peer.ip` -`db.dbms` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. +`db.dbms` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | |---|---| diff --git a/semantic-conventions/src/tests/data/markdown/ref/expected.md b/semantic-conventions/src/tests/data/markdown/ref/expected.md index 9f3a16e9..ad50fff0 100644 --- a/semantic-conventions/src/tests/data/markdown/ref/expected.md +++ b/semantic-conventions/src/tests/data/markdown/ref/expected.md @@ -1,13 +1,13 @@ # Attributes -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| | [`net.peer.name`](input_general.md) | string | override brief. [1] | `example.com` | Opt-In | -| [`net.peer.port`](input_general.md) | int | It describes the server port the client is connecting to | `80`; `8080`; `443` | Required | -| [`net.sock.peer.addr`](input_general.md) | string | Remote socket peer address. | `127.0.0.1`; `/tmp/mysql.sock` | Required | -| [`net.sock.peer.port`](input_general.md) | int | Remote socket peer port. | `16456` | Conditionally Required: | -| `rpc.service` | string | The service name, must be equal to the $service part in the span name. | `EchoService` | Required | +| [`net.peer.port`](input_general.md) | int | It describes the server port the client is connecting to | `80`; `8080`; `443` | `Required` | +| [`net.sock.peer.addr`](input_general.md) | string | Remote socket peer address. | `127.0.0.1`; `/tmp/mysql.sock` | `Required` | +| [`net.sock.peer.port`](input_general.md) | int | Remote socket peer port. | `16456` | `Conditionally Required` | +| `rpc.service` | string | The service name, must be equal to the $service part in the span name. | `EchoService` | `Required` | **[1]:** override note. diff --git a/semantic-conventions/src/tests/data/markdown/ref_extends/expected.md b/semantic-conventions/src/tests/data/markdown/ref_extends/expected.md index 82b59bbc..e08408c3 100644 --- a/semantic-conventions/src/tests/data/markdown/ref_extends/expected.md +++ b/semantic-conventions/src/tests/data/markdown/ref_extends/expected.md @@ -1,9 +1,9 @@ # Spans -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| [`server.address`](input_server.md) | string | Server component of Host header. (overridden brief) [1] | `foo.io` | Required | +| [`server.address`](input_server.md) | string | Server component of Host header. (overridden brief) [1] | `foo.io` | `Required` | **[1]:** Note on the overridden attribute definition. @@ -21,9 +21,9 @@ The following attributes can be important for making sampling decisions and SHOU -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| [`server.address`](input_server.md) | string | Server component of Host header. (overridden brief) [1] | `foo.io` | Required | +| [`server.address`](input_server.md) | string | Server component of Host header. (overridden brief) [1] | `foo.io` | `Required` | **[1]:** Note on the overridden attribute definition. diff --git a/semantic-conventions/src/tests/data/markdown/sampling_relevant/expected.md b/semantic-conventions/src/tests/data/markdown/sampling_relevant/expected.md index e00b6a84..ed838467 100644 --- a/semantic-conventions/src/tests/data/markdown/sampling_relevant/expected.md +++ b/semantic-conventions/src/tests/data/markdown/sampling_relevant/expected.md @@ -1,18 +1,18 @@ # Attributes -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `http.host` | string | . | `.` | Recommended | -| `http.method` | string | . | `GET` | Required | -| `http.scheme` | string | . | `http` | Recommended | -| `http.status_code` | int | . | | Conditionally Required: | -| `http.target` | string | . | `.` | Recommended | -| `http.url` | string | . [1] | `.` | Recommended | -| `http.user_agent` | string | . | `.` | Recommended | -| [`net.peer.ip`](span-general.md) | string | . | `.` | Recommended | -| [`net.peer.name`](span-general.md) | string | . | `.` | Recommended | -| [`net.peer.port`](span-general.md) | int | . | | Recommended | +| `http.host` | string | . | `.` | `Recommended` | +| `http.method` | string | . | `GET` | `Required` | +| `http.scheme` | string | . | `http` | `Recommended` | +| `http.status_code` | int | . | | `Conditionally Required` | +| `http.target` | string | . | `.` | `Recommended` | +| `http.url` | string | . [1] | `.` | `Recommended` | +| `http.user_agent` | string | . | `.` | `Recommended` | +| [`net.peer.ip`](span-general.md) | string | . | `.` | `Recommended` | +| [`net.peer.name`](span-general.md) | string | . | `.` | `Recommended` | +| [`net.peer.port`](span-general.md) | int | . | | `Recommended` | **[1]:** `http.url` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case the attribute's value should be `https://www.example.com/`. diff --git a/semantic-conventions/src/tests/data/markdown/scope/expected.md b/semantic-conventions/src/tests/data/markdown/scope/expected.md index 9707b860..e6ff24f9 100644 --- a/semantic-conventions/src/tests/data/markdown/scope/expected.md +++ b/semantic-conventions/src/tests/data/markdown/scope/expected.md @@ -1,7 +1,7 @@ # Instrumentation Scope Semantic Conventions -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `short_name` | string | The single-word name for the instrumentation scope. | `mylibrary` | Recommended | +| `short_name` | string | The single-word name for the instrumentation scope. | `mylibrary` | `Recommended` | diff --git a/semantic-conventions/src/tests/data/markdown/single/expected.md b/semantic-conventions/src/tests/data/markdown/single/expected.md index f10e136d..7bee2d95 100644 --- a/semantic-conventions/src/tests/data/markdown/single/expected.md +++ b/semantic-conventions/src/tests/data/markdown/single/expected.md @@ -2,16 +2,16 @@ -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `http.host` | string | The value of the [HTTP host header](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is empty or not present, this attribute should be the same. | `www.example.org` | Conditionally Required: | -| `http.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Required | -| `http.scheme` | string | The URI scheme identifying the used protocol. | `http`; `https` | Recommended | -| `http.status_code` | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | Conditionally Required: if and only if one was received/sent. | -| `http.status_text` | string | [HTTP reason phrase](https://tools.ietf.org/html/rfc7230#section-3.1.2). | `OK` | Recommended | -| `http.target` | string | The full request target as passed in a HTTP request line or equivalent. | `/path/12314/?q=ddds#123` | Recommended | -| `http.url` | string | Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. | `https://www.foo.bar/search?q=OpenTelemetry#SemConv` | Recommended | -| `http.user_agent` | string | Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client. | `CERN-LineMode/2.15 libwww/2.17b3` | Recommended | +| `http.host` | string | The value of the [HTTP host header](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is empty or not present, this attribute should be the same. | `www.example.org` | `Conditionally Required` | +| `http.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | `Required` | +| `http.scheme` | string | The URI scheme identifying the used protocol. | `http`; `https` | `Recommended` | +| `http.status_code` | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | `Conditionally Required` if and only if one was received/sent. | +| `http.status_text` | string | [HTTP reason phrase](https://tools.ietf.org/html/rfc7230#section-3.1.2). | `OK` | `Recommended` | +| `http.target` | string | The full request target as passed in a HTTP request line or equivalent. | `/path/12314/?q=ddds#123` | `Recommended` | +| `http.url` | string | Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. | `https://www.foo.bar/search?q=OpenTelemetry#SemConv` | `Recommended` | +| `http.user_agent` | string | Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client. | `CERN-LineMode/2.15 libwww/2.17b3` | `Recommended` | It is recommended to also use the general [network attributes][], especially `net.peer.ip`. If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. diff --git a/semantic-conventions/src/tests/data/markdown/single/input.md b/semantic-conventions/src/tests/data/markdown/single/input.md index 06fd8ea2..4e6e41b1 100644 --- a/semantic-conventions/src/tests/data/markdown/single/input.md +++ b/semantic-conventions/src/tests/data/markdown/single/input.md @@ -3,17 +3,17 @@ -| Attribute name | Notes and examples | Required? | +| Attribute name | Notes and examples | `Required`? | | :------------- | :----------------------------------------------------------- | --------- | -| `http.method` | HTTP request method. E.g. `"GET"`. | Required | +| `http.method` | HTTP request method. E.g. `"GET"`. | `Required` | | `http.url` | Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. | Defined later. | | `http.target` | The full request target as passed in a [HTTP request line][] or equivalent, e.g. `"/path/12314/?q=ddds#123"`. | Defined later. | | `http.host` | The value of the [HTTP host header][]. When the header is empty or not present, this attribute should be the same. | Defined later. | | `http.scheme` | The URI scheme identifying the used protocol: `"http"` or `"https"` | Defined later. | -| `http.status_code` | [HTTP response status code][]. E.g. `200` (integer) | Conditionally Required: if and only if one was received/sent. | -| `http.status_text` | [HTTP reason phrase][]. E.g. `"OK"` | Recommended | +| `http.status_code` | [HTTP response status code][]. E.g. `200` (integer) | `Conditionally Required` if and only if one was received/sent. | +| `http.status_text` | [HTTP reason phrase][]. E.g. `"OK"` | `Recommended` | | `http.flavor` | Kind of HTTP protocol used: `"1.0"`, `"1.1"`, `"2"`, `"SPDY"` or `"QUIC"`. | No | -| `http.user_agent` | Value of the HTTP [User-Agent][] header sent by the client. | Recommended | +| `http.user_agent` | Value of the HTTP [User-Agent][] header sent by the client. | `Recommended` | diff --git a/semantic-conventions/src/tests/data/markdown/sorting/expected.md b/semantic-conventions/src/tests/data/markdown/sorting/expected.md index f9a8e1f7..7e699905 100644 --- a/semantic-conventions/src/tests/data/markdown/sorting/expected.md +++ b/semantic-conventions/src/tests/data/markdown/sorting/expected.md @@ -1,12 +1,12 @@ # Attributes -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| `aaa.aaa` | string | the 1st attribute | `aaa` | Recommended | -| `mmm.bbb` | string | the 2nd attribute | `bbb` | Recommended | -| `mmm.ccc.` | string | the 3rd attribute | ``mmm.ccc="ccc"`` | Recommended | -| `nnn.nnn` | string | the 4th attribute | `nnn` | Recommended | -| `zzz.xxx` | string | the 5th attribute | `xxx` | Recommended | -| `zzz.yyy` | string | the 6th attribute | `yyy` | Recommended | +| `aaa.aaa` | string | the 1st attribute | `aaa` | `Recommended` | +| `mmm.bbb` | string | the 2nd attribute | `bbb` | `Recommended` | +| `mmm.ccc.` | string | the 3rd attribute | ``mmm.ccc="ccc"`` | `Recommended` | +| `nnn.nnn` | string | the 4th attribute | `nnn` | `Recommended` | +| `zzz.xxx` | string | the 5th attribute | `xxx` | `Recommended` | +| `zzz.yyy` | string | the 6th attribute | `yyy` | `Recommended` | diff --git a/semantic-conventions/src/tests/data/markdown/spec_version/expected.md b/semantic-conventions/src/tests/data/markdown/spec_version/expected.md new file mode 100644 index 00000000..3ba03a0a --- /dev/null +++ b/semantic-conventions/src/tests/data/markdown/spec_version/expected.md @@ -0,0 +1,7 @@ +# Attribute Group Example + + +| Attribute | [Type](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.26.0/specification/common/README.md#attribute) | Description | Examples | [Requirement Level](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.26.0/specification/common/attribute-requirement-level.md) | +|---|---|---|---|---| +| `foo.bar` | string | Attribute 1 | `baz` | `Recommended` if available | + diff --git a/semantic-conventions/src/tests/data/markdown/spec_version/input.md b/semantic-conventions/src/tests/data/markdown/spec_version/input.md new file mode 100644 index 00000000..b4f62f61 --- /dev/null +++ b/semantic-conventions/src/tests/data/markdown/spec_version/input.md @@ -0,0 +1,4 @@ +# Attribute Group Example + + + diff --git a/semantic-conventions/src/tests/data/markdown/spec_version/spec_version.yaml b/semantic-conventions/src/tests/data/markdown/spec_version/spec_version.yaml new file mode 100644 index 00000000..e637f192 --- /dev/null +++ b/semantic-conventions/src/tests/data/markdown/spec_version/spec_version.yaml @@ -0,0 +1,12 @@ +groups: + - id: attributes + prefix: "foo" + type: attribute_group + brief: Attribute group + attributes: + - id: bar + type: string + requirement_level: + recommended: if available + brief: Attribute 1 + examples: ['baz'] diff --git a/semantic-conventions/src/tests/data/markdown/stability/badges_expected.md b/semantic-conventions/src/tests/data/markdown/stability/badges_expected.md index de1439da..8c53eba4 100644 --- a/semantic-conventions/src/tests/data/markdown/stability/badges_expected.md +++ b/semantic-conventions/src/tests/data/markdown/stability/badges_expected.md @@ -1,10 +1,10 @@ # Common Attributes -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| [`test.def_stability`](labels_expected.md) | boolean | | | Required | -| [`test.deprecated_attr`](labels_expected.md) | boolean | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
| | Required | -| [`test.exp_attr`](labels_expected.md) | boolean | | | Required | -| [`test.stable_attr`](labels_expected.md) | boolean | ![Stable](https://img.shields.io/badge/-stable-lightgreen)
| | Required | +| [`test.def_stability`](labels_expected.md) | boolean | | | `Required` | +| [`test.deprecated_attr`](labels_expected.md) | boolean | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
| | `Required` | +| [`test.exp_attr`](labels_expected.md) | boolean | | | `Required` | +| [`test.stable_attr`](labels_expected.md) | boolean | ![Stable](https://img.shields.io/badge/-stable-lightgreen)
| | `Required` | diff --git a/semantic-conventions/src/tests/data/markdown/stability/labels_expected.md b/semantic-conventions/src/tests/data/markdown/stability/labels_expected.md index ab7f6194..d6edf766 100644 --- a/semantic-conventions/src/tests/data/markdown/stability/labels_expected.md +++ b/semantic-conventions/src/tests/data/markdown/stability/labels_expected.md @@ -1,10 +1,10 @@ # Common Attributes -| Attribute | Type | Description | Examples | Requirement Level | +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | |---|---|---|---|---| -| [`test.def_stability`](labels_expected.md) | boolean | | | Required | -| [`test.deprecated_attr`](labels_expected.md) | boolean | **Deprecated: Removed.**
| | Required | -| [`test.exp_attr`](labels_expected.md) | boolean | | | Required | -| [`test.stable_attr`](labels_expected.md) | boolean | | | Required | +| [`test.def_stability`](labels_expected.md) | boolean | | | `Required` | +| [`test.deprecated_attr`](labels_expected.md) | boolean | **Deprecated: Removed.**
| | `Required` | +| [`test.exp_attr`](labels_expected.md) | boolean | | | `Required` | +| [`test.stable_attr`](labels_expected.md) | boolean | | | `Required` | diff --git a/semantic-conventions/src/tests/data/markdown/wrong_semconv_id/input.md b/semantic-conventions/src/tests/data/markdown/wrong_semconv_id/input.md index f316463a..30656e50 100644 --- a/semantic-conventions/src/tests/data/markdown/wrong_semconv_id/input.md +++ b/semantic-conventions/src/tests/data/markdown/wrong_semconv_id/input.md @@ -3,17 +3,17 @@ -| Attribute name | Notes and examples | Required? | +| Attribute name | Notes and examples | `Required`? | | :------------- | :----------------------------------------------------------- | --------- | -| `http.method` | HTTP request method. E.g. `"GET"`. | Required | +| `http.method` | HTTP request method. E.g. `"GET"`. | `Required` | | `http.url` | Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. | Defined later. | | `http.target` | The full request target as passed in a [HTTP request line][] or equivalent, e.g. `"/path/12314/?q=ddds#123"`. | Defined later. | | `http.host` | The value of the [HTTP host header][]. When the header is empty or not present, this attribute should be the same. | Defined later. | | `http.scheme` | The URI scheme identifying the used protocol: `"http"` or `"https"` | Defined later. | -| `http.status_code` | [HTTP response status code][]. E.g. `200` (integer) | Conditionally Required: if and only if one was received/sent. | -| `http.status_text` | [HTTP reason phrase][]. E.g. `"OK"` | Recommended | +| `http.status_code` | [HTTP response status code][]. E.g. `200` (integer) | `Conditionally Required` if and only if one was received/sent. | +| `http.status_text` | [HTTP reason phrase][]. E.g. `"OK"` | `Recommended` | | `http.flavor` | Kind of HTTP protocol used: `"1.0"`, `"1.1"`, `"2"`, `"SPDY"` or `"QUIC"`. | No | -| `http.user_agent` | Value of the HTTP [User-Agent][] header sent by the client. | Recommended | +| `http.user_agent` | Value of the HTTP [User-Agent][] header sent by the client. | `Recommended` | It is recommended to also use the general [network attributes][], especially `net.peer.ip`. If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed.