From e8339e6873bb829b336e1a0e55879d1fe7f1ff82 Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Wed, 9 Oct 2024 13:49:14 -0400 Subject: [PATCH] Remove prefix from codegen test. --- .../semconv_registry/registry/client.yaml | 5 ++- .../registry/deprecated/network.yaml | 27 ++++++++-------- .../semconv_registry/registry/error.yaml | 3 +- .../semconv_registry/registry/exception.yaml | 9 +++--- .../semconv_registry/registry/http.yaml | 25 +++++++-------- .../semconv_registry/registry/network.yaml | 31 +++++++++---------- .../semconv_registry/registry/server.yaml | 5 ++- .../semconv_registry/registry/system.yaml | 8 ++--- .../semconv_registry/registry/url.yaml | 25 +++++++-------- 9 files changed, 64 insertions(+), 74 deletions(-) diff --git a/crates/weaver_codegen_test/semconv_registry/registry/client.yaml b/crates/weaver_codegen_test/semconv_registry/registry/client.yaml index 3b17ed8b..bfd7f835 100644 --- a/crates/weaver_codegen_test/semconv_registry/registry/client.yaml +++ b/crates/weaver_codegen_test/semconv_registry/registry/client.yaml @@ -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 @@ -10,7 +9,7 @@ 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." @@ -18,7 +17,7 @@ groups: 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. diff --git a/crates/weaver_codegen_test/semconv_registry/registry/deprecated/network.yaml b/crates/weaver_codegen_test/semconv_registry/registry/deprecated/network.yaml index 66144671..bc1f2ab4 100644 --- a/crates/weaver_codegen_test/semconv_registry/registry/deprecated/network.yaml +++ b/crates/weaver_codegen_test/semconv_registry/registry/deprecated/network.yaml @@ -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: @@ -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: diff --git a/crates/weaver_codegen_test/semconv_registry/registry/error.yaml b/crates/weaver_codegen_test/semconv_registry/registry/error.yaml index 621022f6..f9579551 100644 --- a/crates/weaver_codegen_test/semconv_registry/registry/error.yaml +++ b/crates/weaver_codegen_test/semconv_registry/registry/error.yaml @@ -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. diff --git a/crates/weaver_codegen_test/semconv_registry/registry/exception.yaml b/crates/weaver_codegen_test/semconv_registry/registry/exception.yaml index 7e1b0118..50d24e21 100644 --- a/crates/weaver_codegen_test/semconv_registry/registry/exception.yaml +++ b/crates/weaver_codegen_test/semconv_registry/registry/exception.yaml @@ -1,12 +1,11 @@ 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: > @@ -14,12 +13,12 @@ groups: 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: > @@ -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: > diff --git a/crates/weaver_codegen_test/semconv_registry/registry/http.yaml b/crates/weaver_codegen_test/semconv_registry/registry/http.yaml index e013704a..8fd8c3ae 100644 --- a/crates/weaver_codegen_test/semconv_registry/registry/http.yaml +++ b/crates/weaver_codegen_test/semconv_registry/registry/http.yaml @@ -1,10 +1,9 @@ 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 @@ -12,7 +11,7 @@ groups: 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: > @@ -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 @@ -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: > @@ -105,14 +104,14 @@ 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 @@ -120,7 +119,7 @@ groups: 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: > @@ -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: > @@ -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: diff --git a/crates/weaver_codegen_test/semconv_registry/registry/network.yaml b/crates/weaver_codegen_test/semconv_registry/registry/network.yaml index 591a0188..4591f15f 100644 --- a/crates/weaver_codegen_test/semconv_registry/registry/network.yaml +++ b/crates/weaver_codegen_test/semconv_registry/registry/network.yaml @@ -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: @@ -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: @@ -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. @@ -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 @@ -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 @@ -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: diff --git a/crates/weaver_codegen_test/semconv_registry/registry/server.yaml b/crates/weaver_codegen_test/semconv_registry/registry/server.yaml index 0afe3fab..9e258017 100644 --- a/crates/weaver_codegen_test/semconv_registry/registry/server.yaml +++ b/crates/weaver_codegen_test/semconv_registry/registry/server.yaml @@ -1,6 +1,5 @@ groups: - id: registry.server - prefix: server type: attribute_group brief: > These attributes may be used to describe the server in a connection-based network interaction @@ -10,7 +9,7 @@ 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: server.address stability: stable type: string brief: "Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name." @@ -18,7 +17,7 @@ groups: When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. examples: ['example.com', '10.1.2.80', '/tmp/my.sock'] - - id: port + - id: server.port stability: stable type: int brief: Server port number. diff --git a/crates/weaver_codegen_test/semconv_registry/registry/system.yaml b/crates/weaver_codegen_test/semconv_registry/registry/system.yaml index 1f6bc175..81c50144 100644 --- a/crates/weaver_codegen_test/semconv_registry/registry/system.yaml +++ b/crates/weaver_codegen_test/semconv_registry/registry/system.yaml @@ -1,11 +1,10 @@ groups: # system.cpu.* attribute group - id: registry.system.cpu - prefix: system.cpu type: attribute_group brief: "Describes System CPU attributes" attributes: - - id: state + - id: system.cpu.state type: allow_custom_values: true members: @@ -29,18 +28,17 @@ groups: brief: "The state of the CPU" stability: stable examples: ["idle", "interrupt"] - - id: logical_number + - id: system.cpu.logical_number type: int stability: stable brief: "The logical CPU number [0..n-1]" examples: [1] # sytem.memory.* attribute group - id: registry.system.memory - prefix: system.memory type: attribute_group brief: "Describes System Memory attributes" attributes: - - id: state + - id: system.memory.state type: allow_custom_values: true members: diff --git a/crates/weaver_codegen_test/semconv_registry/registry/url.yaml b/crates/weaver_codegen_test/semconv_registry/registry/url.yaml index 7c132dae..895259ce 100644 --- a/crates/weaver_codegen_test/semconv_registry/registry/url.yaml +++ b/crates/weaver_codegen_test/semconv_registry/registry/url.yaml @@ -2,9 +2,8 @@ groups: - id: registry.url brief: Attributes describing URL. type: attribute_group - prefix: url attributes: - - id: domain + - id: url.domain type: string stability: experimental brief: > @@ -15,7 +14,7 @@ groups: If the URL contains a [literal IPv6 address](https://www.rfc-editor.org/rfc/rfc2732#section-2) enclosed by `[` and `]`, the `[` and `]` characters should also be captured in the domain field. examples: ["www.foo.bar", "opentelemetry.io", "3.12.167.2", "[1080:0:0:0:8:800:200C:417A]"] - - id: extension + - id: url.extension type: string stability: experimental brief: > @@ -24,13 +23,13 @@ groups: The file extension is only set if it exists, as not every url has a file extension. When the file name has multiple extensions `example.tar.gz`, only the last one should be captured `gz`, not `tar.gz`. examples: [ "png", "gz" ] - - id: fragment + - id: url.fragment stability: stable type: string brief: > The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component examples: ["SemConv"] - - id: full + - id: url.full stability: stable type: string brief: Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) @@ -44,7 +43,7 @@ groups: `url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed). Sensitive content provided in `url.full` SHOULD be scrubbed when instrumentations can identify it. examples: ['https://www.foo.bar/search?q=OpenTelemetry#SemConv', '//localhost'] - - id: original + - id: url.original type: string stability: experimental brief: > @@ -56,7 +55,7 @@ groups: `url.original` might contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case password and username SHOULD NOT be redacted and attribute's value SHOULD remain the same. examples: ["https://www.foo.bar/search?q=OpenTelemetry#SemConv", "search?q=OpenTelemetry"] - - id: path + - id: url.path stability: stable type: string brief: > @@ -64,13 +63,13 @@ groups: examples: ["/search"] note: > Sensitive content provided in `url.path` SHOULD be scrubbed when instrumentations can identify it. - - id: port + - id: url.port type: int stability: experimental brief: > Port extracted from the `url.full` examples: [443] - - id: query + - id: url.query stability: stable type: string brief: > @@ -78,7 +77,7 @@ groups: examples: ["q=OpenTelemetry"] note: > Sensitive content provided in `url.query` SHOULD be scrubbed when instrumentations can identify it. - - id: registered_domain + - id: url.registered_domain type: string stability: experimental brief: > @@ -88,13 +87,13 @@ groups: This value can be determined precisely with the [public suffix list](http://publicsuffix.org). For example, the registered domain for `foo.example.com` is `example.com`. Trying to approximate this by simply taking the last two labels will not work well for TLDs such as `co.uk`. - - id: scheme + - id: url.scheme stability: stable type: string brief: > The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. examples: ["https", "ftp", "telnet"] - - id: subdomain + - id: url.subdomain type: string stability: experimental brief: > @@ -105,7 +104,7 @@ groups: note: > The subdomain portion of `www.east.mydomain.co.uk` is `east`. If the domain has multiple levels of subdomain, such as `sub2.sub1.example.com`, the subdomain field should contain `sub2.sub1`, with no trailing period. - - id: top_level_domain + - id: url.top_level_domain type: string stability: experimental brief: >