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..0934d6fd 100644 --- a/semantic-conventions/src/tests/data/markdown/attribute_group/expected.md +++ b/semantic-conventions/src/tests/data/markdown/attribute_group/expected.md @@ -3,6 +3,6 @@ | Attribute | Type | Description | Examples | 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 | 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..05f5df2d 100644 --- a/semantic-conventions/src/tests/data/markdown/attribute_templates/expected.md +++ b/semantic-conventions/src/tests/data/markdown/attribute_templates/expected.md @@ -3,8 +3,8 @@ | Attribute | Type | Description | Examples | 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 | +| `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 | | `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..eff2cf49 100644 --- a/semantic-conventions/src/tests/data/markdown/deprecated/expected.md +++ b/semantic-conventions/src/tests/data/markdown/deprecated/expected.md @@ -4,11 +4,11 @@ | Attribute | Type | Description | Examples | 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.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 | 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..58cf5d87 100644 --- a/semantic-conventions/src/tests/data/markdown/extend_constraint/expected.md +++ b/semantic-conventions/src/tests/data/markdown/extend_constraint/expected.md @@ -36,19 +36,19 @@ Some database systems may allow a connection to switch to a different `db.user`, | Attribute | Type | Description | Examples | 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 | +| `net.peer.port` | int | Remote port number. | `80`; `8080`; `443` | Conditionally Required: [1] | +| `net.transport` | string | Transport protocol used. See note below. | `IP.TCP` | Conditionally Required: [2] | +| `db.connection_string` | string | The connection string used to connect to the database. [3] | `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` | 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] | -**[1]:** It is recommended to remove embedded credentials. +**[1]:** if using a port other than the default port for this DBMS. -**[2]:** if using a port other than the default port for this DBMS. +**[2]:** Recommended in general, required for in-process databases (`"inproc"`). -**[3]:** Recommended in general, required for in-process databases (`"inproc"`). +**[3]:** It is recommended to remove embedded credentials. **Additional attribute requirements:** At least one of the following sets of attributes is required: diff --git a/semantic-conventions/src/tests/data/markdown/include/expected.md b/semantic-conventions/src/tests/data/markdown/include/expected.md index d29c6fff..d42fa8f5 100644 --- a/semantic-conventions/src/tests/data/markdown/include/expected.md +++ b/semantic-conventions/src/tests/data/markdown/include/expected.md @@ -3,28 +3,28 @@ | Attribute | Type | Description | Examples | 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.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.server_name`](input_http.md) | string | The primary server name of the matched virtual host. [1] | `example.com` | Conditionally Required: [2] | +| `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.recommended_attribute` | string | brief | `foo` | Recommended: short note | -| `http.recommended_attribute_long_note` | string | brief | `bar` | Recommended: [1] | +| `http.recommended_attribute_long_note` | string | brief | `bar` | Recommended: [3] | +| `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 | +| `faas.execution` | string | The execution id of the current function execution. | `af9d5aa4-a685-4c5f-a22b-444f80b3cc28` | 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` | See below | | `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.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 | -**[1]:** some very long note that should be written under the semconv table - -**[2]:** This is an example +**[1]:** This is an example - of note - with list -**[3]:** This should be obtained via configuration. If this attribute can be obtained, this attribute MUST NOT be set ( `net.host.name` should be used instead). +**[2]:** This should be obtained via configuration. If this attribute can be obtained, this attribute MUST NOT be set ( `net.host.name` should be used instead). + +**[3]:** some very long note that should be written under the semconv table **Additional attribute requirements:** At least one of the following sets of attributes is required: diff --git a/semantic-conventions/src/tests/data/markdown/multiple/expected.md b/semantic-conventions/src/tests/data/markdown/multiple/expected.md index 24b84332..5c65bf25 100644 --- a/semantic-conventions/src/tests/data/markdown/multiple/expected.md +++ b/semantic-conventions/src/tests/data/markdown/multiple/expected.md @@ -4,10 +4,10 @@ | Attribute | Type | Description | Examples | 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.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.scheme` | string | The URI scheme identifying the used protocol. | `http`; `https` | Recommended | | `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 | @@ -17,10 +17,10 @@ | Attribute | Type | Description | Examples | 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.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.scheme` | string | The URI scheme identifying the used protocol. | `http`; `https` | Recommended | | `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 | 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..94da49c5 100644 --- a/semantic-conventions/src/tests/data/markdown/parameter_full/expected.md +++ b/semantic-conventions/src/tests/data/markdown/parameter_full/expected.md @@ -3,25 +3,25 @@ | Attribute | Type | Description | Examples | 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.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.server_name`](http.md) | string | The primary server name of the matched virtual host. [1] | `example.com` | Conditionally Required: [2] | +| `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. | +| `faas.execution` | string | The execution id of the current function execution. | `af9d5aa4-a685-4c5f-a22b-444f80b3cc28` | Recommended | +| [`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)). [3] | `83.164.160.102` | Recommended | | [`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.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 | -**[1]:** This is not necessarily the same as `net.peer.ip`, which would identify the network-level peer, which may be a proxy. +**[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. -**[2]:** 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. +**[2]:** This should be obtained via configuration. If this attribute can be obtained, this attribute MUST NOT be set ( `net.host.name` should be used instead). -**[3]:** This should be obtained via configuration. If this attribute can be obtained, this attribute MUST NOT be set ( `net.host.name` should be used instead). +**[3]:** This is not necessarily the same as `net.peer.ip`, which would identify the network-level peer, which may be a proxy. **Additional attribute requirements:** At least one of the following sets of attributes is required: 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..d126a6c1 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 @@ -3,8 +3,8 @@ | Attribute | Type | Description | Examples | 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.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` | Recommended | | `net.peer.name` | string | Remote hostname or similar, see note below. | `example.com` | Recommended | 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..08e186a7 100644 --- a/semantic-conventions/src/tests/data/markdown/parameter_tag/expected.md +++ b/semantic-conventions/src/tests/data/markdown/parameter_tag/expected.md @@ -3,8 +3,8 @@ | Attribute | Type | Description | Examples | 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.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` | See below | | `net.peer.name` | string | Remote hostname or similar, see note below. | `example.com` | See below | 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..34335cbf 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 @@ -4,19 +4,19 @@ | Attribute | Type | Description | Examples | 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.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). [1] | `customers`; `master` | Conditionally Required: [2] | | `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.statement` | string | A database statement for the given database type. [3] | `SELECT * FROM wuser_table`; `SET mykey "WuValue"` | Conditionally Required: if applicable. | +| `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. [4] | `MSSQLSERVER` | Recommended | -**[1]:** If setting a `db.mssql.instance_name`, `net.peer.port` is no longer required (but still recommended if non-standard). +**[1]:** In some SQL databases, the database name to be used is called "schema name". Redis does not have a database name to used here. -**[2]:** In some SQL databases, the database name to be used is called "schema name". Redis does not have a database name to used here. +**[2]:** if applicable and no more-specific attribute is defined. -**[3]:** if applicable and no more-specific attribute is defined. +**[3]:** The value may be sanitized to exclude sensitive information. -**[4]:** The value may be sanitized to exclude sensitive information. +**[4]:** If setting a `db.mssql.instance_name`, `net.peer.port` is no longer required (but still recommended if non-standard). **Additional attribute requirements:** At least one of the following sets of attributes is required: diff --git a/semantic-conventions/src/tests/data/markdown/ref/expected.md b/semantic-conventions/src/tests/data/markdown/ref/expected.md index 9f3a16e9..74d6d8f4 100644 --- a/semantic-conventions/src/tests/data/markdown/ref/expected.md +++ b/semantic-conventions/src/tests/data/markdown/ref/expected.md @@ -3,11 +3,11 @@ | Attribute | Type | Description | Examples | 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.sock.peer.port`](input_general.md) | int | Remote socket peer port. | `16456` | Conditionally Required: | +| [`net.peer.name`](input_general.md) | string | override brief. [1] | `example.com` | Opt-In | **[1]:** override note. 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..9374130c 100644 --- a/semantic-conventions/src/tests/data/markdown/sampling_relevant/expected.md +++ b/semantic-conventions/src/tests/data/markdown/sampling_relevant/expected.md @@ -3,10 +3,10 @@ | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| -| `http.host` | string | . | `.` | Recommended | | `http.method` | string | . | `GET` | Required | -| `http.scheme` | string | . | `http` | Recommended | | `http.status_code` | int | . | | Conditionally Required: | +| `http.host` | string | . | `.` | Recommended | +| `http.scheme` | string | . | `http` | Recommended | | `http.target` | string | . | `.` | Recommended | | `http.url` | string | . [1] | `.` | Recommended | | `http.user_agent` | string | . | `.` | Recommended | @@ -18,8 +18,8 @@ The following attributes can be important for making sampling decisions and SHOULD be provided **at span creation time** (if provided at all): -* `http.host` * `http.method` +* `http.host` * `http.scheme` * `http.target` * `http.url` diff --git a/semantic-conventions/src/tests/data/markdown/single/expected.md b/semantic-conventions/src/tests/data/markdown/single/expected.md index f10e136d..92d2bac3 100644 --- a/semantic-conventions/src/tests/data/markdown/single/expected.md +++ b/semantic-conventions/src/tests/data/markdown/single/expected.md @@ -4,10 +4,10 @@ | Attribute | Type | Description | Examples | 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.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.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.scheme` | string | The URI scheme identifying the used protocol. | `http`; `https` | Recommended | | `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 | diff --git a/semantic-conventions/src/tests/semconv/model/test_correct_parse.py b/semantic-conventions/src/tests/semconv/model/test_correct_parse.py index 11597797..46a90d45 100644 --- a/semantic-conventions/src/tests/semconv/model/test_correct_parse.py +++ b/semantic-conventions/src/tests/semconv/model/test_correct_parse.py @@ -84,7 +84,7 @@ def test_faas(self): "prefix": "faas", "extends": "", "n_constraints": 0, - "attributes": ["faas.execution", "faas.trigger"], + "attributes": [ "faas.trigger", "faas.execution" ] } self.semantic_convention_check(list(semconv.models.values())[0], expected) expected = { @@ -94,9 +94,9 @@ def test_faas(self): "n_constraints": 0, "attributes": [ "faas.document.collection", - "faas.document.name", "faas.document.operation", "faas.document.time", + "faas.document.name", ], } self.semantic_convention_check(list(semconv.models.values())[1], expected) @@ -121,7 +121,7 @@ def test_faas(self): "prefix": "faas", "extends": "faas", "n_constraints": 0, - "attributes": ["faas.cron", "faas.time"], + "attributes": ["faas.time", "faas.cron"], } self.semantic_convention_check(list(semconv.models.values())[4], expected) @@ -166,11 +166,11 @@ def test_http(self): "extends": "", "n_constraints": 0, "attributes": [ + "http.method", + "http.status_code", "http.flavor", "http.host", - "http.method", "http.scheme", - "http.status_code", "http.status_text", "http.target", "http.url", @@ -368,11 +368,11 @@ def test_extends(self): "extends": "", "n_constraints": 0, "attributes": [ + "http.method", + "http.status_code", "http.flavor", "http.host", - "http.method", "http.scheme", - "http.status_code", "http.status_text", "http.target", "http.url", @@ -386,11 +386,11 @@ def test_extends(self): "extends": "http", "n_constraints": 1, "attributes": [ + "http.method", + "http.status_code", "http.flavor", "http.host", - "http.method", "http.scheme", - "http.status_code", "http.status_text", "http.target", "http.url", @@ -404,12 +404,12 @@ def test_extends(self): "extends": "http", "n_constraints": 1, "attributes": [ - "http.flavor", - "http.host", "http.method", - "http.scheme", "http.server_name", "http.status_code", + "http.flavor", + "http.host", + "http.scheme", "http.status_text", "http.target", "http.url", @@ -435,16 +435,14 @@ def test_include(self): "extends": "faas", "n_constraints": 2, "attributes": [ - # Parent - "faas.execution", - "faas.trigger", - # Include - "http.flavor", - "http.host", + "faas.trigger", # Parent "http.method", - "http.scheme", "http.server_name", "http.status_code", + "faas.execution", # Parent + "http.flavor", + "http.host", + "http.scheme", "http.status_text", "http.target", "http.url", @@ -590,61 +588,61 @@ def test_inherited_imported(self): self.assertEqual(models[2].semconv_id, "rpc") self.assertEqual(len(attrs), 4) - self.assertEqual(attrs[0].fqn, "net.peer.ip") - self.assertEqual(attrs[0].imported, True) + self.assertEqual(attrs[0].fqn, "rpc.service") + self.assertEqual(attrs[0].imported, False) self.assertEqual(attrs[0].inherited, False) self.assertEqual(attrs[0].ref, None) - self.assertEqual(attrs[1].fqn, "net.peer.name") + self.assertEqual(attrs[1].fqn, "net.peer.ip") self.assertEqual(attrs[1].imported, True) self.assertEqual(attrs[1].inherited, False) self.assertEqual(attrs[1].ref, None) - self.assertEqual(attrs[2].fqn, "net.peer.port") + self.assertEqual(attrs[2].fqn, "net.peer.name") self.assertEqual(attrs[2].imported, True) self.assertEqual(attrs[2].inherited, False) self.assertEqual(attrs[2].ref, None) - self.assertEqual(attrs[2].note, "not override") - self.assertEqual(attrs[3].fqn, "rpc.service") - self.assertEqual(attrs[3].imported, False) + self.assertEqual(attrs[3].fqn, "net.peer.port") + self.assertEqual(attrs[3].imported, True) self.assertEqual(attrs[3].inherited, False) self.assertEqual(attrs[3].ref, None) + self.assertEqual(attrs[3].note, "not override") # Extended - rpc.client attrs = models[3].attributes_and_templates self.assertEqual(models[3].semconv_id, "rpc.client") self.assertEqual(len(attrs), 6) - self.assertEqual(attrs[0].fqn, "http.method") - self.assertEqual(attrs[0].imported, True) + self.assertEqual(attrs[0].fqn, "net.peer.port") + self.assertEqual(attrs[0].imported, False) self.assertEqual(attrs[0].inherited, False) - self.assertEqual(attrs[0].ref, None) + self.assertEqual(attrs[0].ref, "net.peer.port") + self.assertEqual(attrs[0].brief, "override") + self.assertEqual(attrs[0].note, "not override") - self.assertEqual(attrs[1].fqn, "net.peer.ip") - self.assertEqual(attrs[1].imported, True) - self.assertEqual(attrs[1].inherited, True) + self.assertEqual(attrs[1].fqn, "rpc.client.name") + self.assertEqual(attrs[1].imported, False) + self.assertEqual(attrs[1].inherited, False) self.assertEqual(attrs[1].ref, None) - self.assertEqual(attrs[2].fqn, "net.peer.name") - self.assertEqual(attrs[2].imported, True) + self.assertEqual(attrs[2].fqn, "rpc.service") + self.assertEqual(attrs[2].imported, False) self.assertEqual(attrs[2].inherited, True) self.assertEqual(attrs[2].ref, None) - self.assertEqual(attrs[3].fqn, "net.peer.port") - self.assertEqual(attrs[3].imported, False) + self.assertEqual(attrs[3].fqn, "http.method") + self.assertEqual(attrs[3].imported, True) self.assertEqual(attrs[3].inherited, False) - self.assertEqual(attrs[3].ref, "net.peer.port") - self.assertEqual(attrs[3].brief, "override") - self.assertEqual(attrs[3].note, "not override") + self.assertEqual(attrs[3].ref, None) - self.assertEqual(attrs[4].fqn, "rpc.client.name") - self.assertEqual(attrs[4].imported, False) - self.assertEqual(attrs[4].inherited, False) + self.assertEqual(attrs[4].fqn, "net.peer.ip") + self.assertEqual(attrs[4].imported, True) + self.assertEqual(attrs[4].inherited, True) self.assertEqual(attrs[4].ref, None) - self.assertEqual(attrs[5].fqn, "rpc.service") - self.assertEqual(attrs[5].imported, False) + self.assertEqual(attrs[5].fqn, "net.peer.name") + self.assertEqual(attrs[5].imported, True) self.assertEqual(attrs[5].inherited, True) self.assertEqual(attrs[5].ref, None) @@ -663,40 +661,40 @@ def test_inherited_imported(self): self.assertEqual(models[5].semconv_id, "zz.rpc.client") self.assertEqual(len(attrs), 8) - self.assertEqual(attrs[0].fqn, "http.method") - self.assertEqual(attrs[0].imported, True) + self.assertEqual(attrs[0].fqn, "net.peer.port") + self.assertEqual(attrs[0].imported, False) self.assertEqual(attrs[0].inherited, True) - self.assertEqual(attrs[0].ref, None) + self.assertEqual(attrs[0].ref, "net.peer.port") + self.assertEqual(attrs[0].brief, "override") + self.assertEqual(attrs[0].note, "not override") - self.assertEqual(attrs[1].fqn, "net.peer.ip") - self.assertEqual(attrs[1].imported, True) + self.assertEqual(attrs[1].fqn, "rpc.client.name") + self.assertEqual(attrs[1].imported, False) self.assertEqual(attrs[1].inherited, True) self.assertEqual(attrs[1].ref, None) - self.assertEqual(attrs[2].fqn, "net.peer.name") - self.assertEqual(attrs[2].imported, True) - self.assertEqual(attrs[2].inherited, True) + self.assertEqual(attrs[2].fqn, "rpc.client.zz.attr") + self.assertEqual(attrs[2].imported, False) + self.assertEqual(attrs[2].inherited, False) self.assertEqual(attrs[2].ref, None) - self.assertEqual(attrs[3].fqn, "net.peer.port") + self.assertEqual(attrs[3].fqn, "rpc.service") self.assertEqual(attrs[3].imported, False) self.assertEqual(attrs[3].inherited, True) - self.assertEqual(attrs[3].ref, "net.peer.port") - self.assertEqual(attrs[3].brief, "override") - self.assertEqual(attrs[3].note, "not override") + self.assertEqual(attrs[3].ref, None) - self.assertEqual(attrs[4].fqn, "rpc.client.name") - self.assertEqual(attrs[4].imported, False) + self.assertEqual(attrs[4].fqn, "http.method") + self.assertEqual(attrs[4].imported, True) self.assertEqual(attrs[4].inherited, True) self.assertEqual(attrs[4].ref, None) - self.assertEqual(attrs[5].fqn, "rpc.client.zz.attr") - self.assertEqual(attrs[5].imported, False) - self.assertEqual(attrs[5].inherited, False) + self.assertEqual(attrs[5].fqn, "net.peer.ip") + self.assertEqual(attrs[5].imported, True) + self.assertEqual(attrs[5].inherited, True) self.assertEqual(attrs[5].ref, None) - self.assertEqual(attrs[6].fqn, "rpc.service") - self.assertEqual(attrs[6].imported, False) + self.assertEqual(attrs[6].fqn, "net.peer.name") + self.assertEqual(attrs[6].imported, True) self.assertEqual(attrs[6].inherited, True) self.assertEqual(attrs[6].ref, None) @@ -705,6 +703,7 @@ def test_inherited_imported(self): self.assertEqual(attrs[7].inherited, False) self.assertEqual(attrs[7].ref, None) + def semantic_convention_check(self, s, expected): self.assertEqual(expected["prefix"], s.prefix) self.assertEqual(expected["extends"], s.extends)