Skip to content

Commit

Permalink
Add warning that issues when using prefix (#407)
Browse files Browse the repository at this point in the history
* Add warning that issues when using prefix, as it's no longer supported in semconv.

* Add unit tests for prefix warning.

* Remove prefix from codegen test.

* Fix weaver forge tests.

* Fix missed file for test.

* Set some tests to check prefix, start removing prefix from other resolution tests.

* Fix another resolution test.

* Fix more tests for prefix removal.

* Fix more tests.

* REmove more prefix from tests.

* Fix up markdown gen tests for removal of prefix.
  • Loading branch information
jsuereth authored Oct 15, 2024
1 parent 402583b commit 9fb5289
Show file tree
Hide file tree
Showing 97 changed files with 631 additions and 1,697 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
groups:
- id: registry.client
prefix: client
type: attribute_group
brief: >
These attributes may be used to describe the client in a connection-based network interaction
Expand All @@ -10,15 +9,15 @@ groups:
protocol / API doesn't expose a clear notion of client and server).
This also covers UDP network interactions where one side initiates the interaction, e.g. QUIC (HTTP/3) and DNS.
attributes:
- id: address
- id: client.address
stability: stable
type: string
brief: "Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name."
note: >
When observed from the server side, and when communicating through an intermediary, `client.address` SHOULD represent
the client address behind any intermediaries, for example proxies, if it's available.
examples: ['client.example.com', '10.1.2.80', '/tmp/my.sock']
- id: port
- id: client.port
stability: stable
type: int
brief: Client port number.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,65 +1,64 @@
groups:
- id: registry.network.deprecated
prefix: net
type: attribute_group
brief: >
These attributes may be used for any network related operation.
attributes:
- id: sock.peer.name
- id: net.sock.peer.name
type: string
deprecated: "Removed."
stability: experimental
brief: Deprecated, no replacement at this time.
examples: ['/var/my.sock']
- id: sock.peer.addr
- id: net.sock.peer.addr
type: string
deprecated: "Replaced by `network.peer.address`."
stability: experimental
brief: Deprecated, use `network.peer.address`.
examples: ['192.168.0.1']
- id: sock.peer.port
- id: net.sock.peer.port
type: int
deprecated: "Replaced by `network.peer.port`."
stability: experimental
examples: [65531]
brief: Deprecated, use `network.peer.port`.
- id: peer.name
- id: net.peer.name
type: string
deprecated: "Replaced by `server.address` on client spans and `client.address` on server spans."
stability: experimental
brief: Deprecated, use `server.address` on client spans and `client.address` on server spans.
examples: ['example.com']
- id: peer.port
- id: net.peer.port
type: int
deprecated: "Replaced by `server.port` on client spans and `client.port` on server spans."
stability: experimental
brief: Deprecated, use `server.port` on client spans and `client.port` on server spans.
examples: [8080]
- id: host.name
- id: net.host.name
type: string
deprecated: "Replaced by `server.address`."
stability: experimental
brief: Deprecated, use `server.address`.
examples: ['example.com']
- id: host.port
- id: net.host.port
type: int
deprecated: "Replaced by `server.port`."
stability: experimental
brief: Deprecated, use `server.port`.
examples: [8080]
- id: sock.host.addr
- id: net.sock.host.addr
type: string
deprecated: "Replaced by `network.local.address`."
stability: experimental
brief: Deprecated, use `network.local.address`.
examples: ['/var/my.sock']
- id: sock.host.port
- id: net.sock.host.port
type: int
deprecated: "Replaced by `network.local.port`."
stability: experimental
brief: Deprecated, use `network.local.port`.
examples: [8080]
- id: transport
- id: net.transport
type:
allow_custom_values: true
members:
Expand Down Expand Up @@ -88,19 +87,19 @@ groups:
deprecated: "Replaced by `network.transport`."
stability: experimental
brief: Deprecated, use `network.transport`.
- id: protocol.name
- id: net.protocol.name
type: string
deprecated: "Replaced by `network.protocol.name`."
stability: experimental
brief: Deprecated, use `network.protocol.name`.
examples: ['amqp', 'http', 'mqtt']
- id: protocol.version
- id: net.protocol.version
type: string
deprecated: "Replaced by `network.protocol.version`."
stability: experimental
brief: Deprecated, use `network.protocol.version`.
examples: '3.1.1'
- id: sock.family
- id: net.sock.family
type:
allow_custom_values: true
members:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
groups:
- id: registry.error
type: attribute_group
prefix: error
brief: >
This document defines the shared attributes used to report an error.
attributes:
- id: type
- id: error.type
stability: stable
brief: >
Describes a class of error the operation ended with.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
groups:
- id: registry.exception
type: attribute_group
prefix: exception
brief: >
This document defines the shared attributes used to
report a single exception associated with a span or log.
attributes:
- id: type
- id: exception.type
type: string
stability: stable
brief: >
The type of the exception (its fully-qualified class name, if applicable).
The dynamic type of the exception should be preferred over the static type
in languages that support it.
examples: ["java.net.ConnectException", "OSError"]
- id: message
- id: exception.message
type: string
stability: stable
brief: The exception message.
examples: ["Division by zero", "Can't convert 'int' object to str implicitly"]
- id: stacktrace
- id: exception.stacktrace
type: string
stability: stable
brief: >
Expand All @@ -29,7 +28,7 @@ groups:
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)'
- id: escaped
- id: exception.escaped
type: boolean
stability: stable
brief: >
Expand Down
25 changes: 12 additions & 13 deletions crates/weaver_codegen_test/semconv_registry/registry/http.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
groups:
- id: registry.http
prefix: http
type: attribute_group
brief: 'This document defines semantic convention attributes in the HTTP namespace.'
attributes:
- id: request.body.size
- id: http.request.body.size
type: int
brief: >
The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and
is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
header. For requests using transport encoding, this should be the compressed size.
examples: 3495
stability: experimental # this should not be marked stable with other HTTP attributes
- id: request.header
- id: http.request.header
stability: stable
type: template[string[]]
brief: >
Expand All @@ -28,7 +27,7 @@ groups:
or a single-item array containing a possibly comma-concatenated string, depending on the way
the HTTP library provides access to headers.
examples: ['http.request.header.content-type=["application/json"]', 'http.request.header.x-forwarded-for=["1.2.3.4", "1.2.3.5"]']
- id: request.method
- id: http.request.method
stability: stable
type:
allow_custom_values: true
Expand Down Expand Up @@ -90,12 +89,12 @@ groups:
HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a known HTTP method name exactly.
Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent.
Tracing instrumentations that do so, MUST also set `http.request.method_original` to the original value.
- id: request.method_original
- id: http.request.method_original
stability: stable
type: string
brief: Original HTTP method sent by the client in the request line.
examples: ["GeT", "ACL", "foo"]
- id: request.resend_count
- id: http.request.resend_count
stability: stable
type: int
brief: >
Expand All @@ -105,22 +104,22 @@ groups:
was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues,
or any other).
examples: 3
- id: request.size
- id: http.request.size
type: int
brief: >
The total size of the request in bytes. This should be the total number of bytes sent over the wire, including the request line (HTTP/1.1),
framing (HTTP/2 and HTTP/3), headers, and request body if any.
examples: 1437
stability: experimental
- id: response.body.size
- id: http.response.body.size
type: int
brief: >
The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and
is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
header. For requests using transport encoding, this should be the compressed size.
examples: 3495
stability: experimental # this should not be marked stable with other HTTP attributes
- id: response.header
- id: http.response.header
stability: stable
type: template[string[]]
brief: >
Expand All @@ -135,19 +134,19 @@ groups:
or a single-item array containing a possibly comma-concatenated string, depending on the way
the HTTP library provides access to headers.
examples: ['http.response.header.content-type=["application/json"]', 'http.response.header.my-custom-header=["abc", "def"]']
- id: response.size
- id: http.response.size
type: int
brief: >
The total size of the response in bytes. This should be the total number of bytes sent over the wire, including the status line (HTTP/1.1),
framing (HTTP/2 and HTTP/3), headers, and response body and trailers if any.
examples: 1437
stability: experimental
- id: response.status_code
- id: http.response.status_code
stability: stable
type: int
brief: '[HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).'
examples: [200]
- id: route
- id: http.route
stability: stable
type: string
brief: >
Expand All @@ -157,7 +156,7 @@ groups:
MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it.
SHOULD include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one.
- id: connection.state
- id: http.connection.state
type:
allow_custom_values: true
members:
Expand Down
31 changes: 15 additions & 16 deletions crates/weaver_codegen_test/semconv_registry/registry/network.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
groups:
- id: registry.network
prefix: network
type: attribute_group
brief: >
These attributes may be used for any network related operation.
attributes:
- id: carrier.icc
- id: network.carrier.icc
type: string
stability: experimental
brief: "The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network."
examples: "DE"
- id: carrier.mcc
- id: network.carrier.mcc
type: string
stability: experimental
brief: "The mobile carrier country code."
examples: "310"
- id: carrier.mnc
- id: network.carrier.mnc
type: string
stability: experimental
brief: "The mobile carrier network code."
examples: "001"
- id: carrier.name
- id: network.carrier.name
type: string
stability: experimental
brief: "The name of the mobile carrier."
examples: "sprint"
- id: connection.subtype
- id: network.connection.subtype
type:
allow_custom_values: true
members:
Expand Down Expand Up @@ -116,7 +115,7 @@ groups:
stability: experimental
brief: 'This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection.'
examples: 'LTE'
- id: connection.type
- id: network.connection.type
type:
allow_custom_values: true
members:
Expand All @@ -138,33 +137,33 @@ groups:
stability: experimental
brief: 'The internet connection type.'
examples: 'wifi'
- id: local.address
- id: network.local.address
stability: stable
type: string
brief: Local address of the network connection - IP address or Unix domain socket name.
examples: ['10.1.2.80', '/tmp/my.sock']
- id: local.port
- id: network.local.port
stability: stable
type: int
brief: Local port number of the network connection.
examples: [65123]
- id: peer.address
- id: network.peer.address
stability: stable
type: string
brief: Peer address of the network connection - IP address or Unix domain socket name.
examples: ['10.1.2.80', '/tmp/my.sock']
- id: peer.port
- id: network.peer.port
stability: stable
type: int
brief: Peer port number of the network connection.
examples: [65123]
- id: protocol.name
- id: network.protocol.name
stability: stable
type: string
brief: '[OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent.'
note: The value SHOULD be normalized to lowercase.
examples: ['amqp', 'http', 'mqtt']
- id: protocol.version
- id: network.protocol.version
stability: stable
type: string
brief: The actual version of the protocol used for network communication.
Expand All @@ -173,7 +172,7 @@ groups:
If protocol version is subject to negotiation (for example using [ALPN](https://www.rfc-editor.org/rfc/rfc7301.html)),
this attribute SHOULD be set to the negotiated version. If the actual protocol version is not known,
this attribute SHOULD NOT be set.
- id: transport
- id: network.transport
stability: stable
type:
allow_custom_values: true
Expand Down Expand Up @@ -204,7 +203,7 @@ groups:
a port number is ambiguous without knowing the transport. For example
different processes could be listening on TCP port 12345 and UDP port 12345.
examples: ['tcp', 'udp']
- id: type
- id: network.type
stability: stable
type:
allow_custom_values: true
Expand All @@ -220,7 +219,7 @@ groups:
brief: '[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent.'
note: The value SHOULD be normalized to lowercase.
examples: ['ipv4', 'ipv6']
- id: io.direction
- id: network.io.direction
type:
allow_custom_values: false
members:
Expand Down
Loading

0 comments on commit 9fb5289

Please sign in to comment.