From 8f97cab6860bae6afb9e2ba073ca35c7dd606b52 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Sat, 29 Jul 2023 00:06:57 +0200 Subject: [PATCH] [SEMANTIC CONVENTIONS] Upgrade to 1.21.0 (#2248) --- .gitignore | 2 +- .../trace/semantic_conventions.h | 623 ++++++++++++------ buildscripts/semantic-convention/generate.sh | 21 +- examples/grpc/client.cc | 4 +- examples/http/client.cc | 8 +- examples/http/server.cc | 12 +- .../sdk/resource/semantic_conventions.h | 152 ++++- 7 files changed, 581 insertions(+), 241 deletions(-) diff --git a/.gitignore b/.gitignore index ce59c1a2e6..dc26aa2f82 100644 --- a/.gitignore +++ b/.gitignore @@ -57,7 +57,7 @@ tags .cache/clangd/* # Temporary dir used when generating semconv -./buildscripts/semantic-convention/opentelemetry-specification +buildscripts/semantic-convention/tmp-semconv/ # Generated cert keys in functional tests functional/cert/ca.csr diff --git a/api/include/opentelemetry/trace/semantic_conventions.h b/api/include/opentelemetry/trace/semantic_conventions.h index ecada99a41..42cf57d0ec 100644 --- a/api/include/opentelemetry/trace/semantic_conventions.h +++ b/api/include/opentelemetry/trace/semantic_conventions.h @@ -21,7 +21,159 @@ namespace SemanticConventions /** * The URL of the OpenTelemetry schema for these keys and values. */ -static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.20.0"; +static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.21.0"; + +/** + * Client address - unix domain socket name, IPv4 or IPv6 address. + * + *

Notes: +

+ */ +static constexpr const char *kClientAddress = "client.address"; + +/** + * Client port number + * + *

Notes: +

+ */ +static constexpr const char *kClientPort = "client.port"; + +/** + * Immediate client peer address - unix domain socket name, IPv4 or IPv6 address. + */ +static constexpr const char *kClientSocketAddress = "client.socket.address"; + +/** + * Immediate client peer port number + */ +static constexpr const char *kClientSocketPort = "client.socket.port"; + +/** + * Deprecated, use {@code http.request.method} instead. + */ +static constexpr const char *kHttpMethod = "http.method"; + +/** + * Deprecated, use {@code http.response.status_code} instead. + */ +static constexpr const char *kHttpStatusCode = "http.status_code"; + +/** + * Deprecated, use {@code url.scheme} instead. + */ +static constexpr const char *kHttpScheme = "http.scheme"; + +/** + * Deprecated, use {@code url.full} instead. + */ +static constexpr const char *kHttpUrl = "http.url"; + +/** + * Deprecated, use {@code url.path} and {@code url.query} instead. + */ +static constexpr const char *kHttpTarget = "http.target"; + +/** + * Deprecated, use {@code http.request.body.size} instead. + */ +static constexpr const char *kHttpRequestContentLength = "http.request_content_length"; + +/** + * Deprecated, use {@code http.response.body.size} instead. + */ +static constexpr const char *kHttpResponseContentLength = "http.response_content_length"; + +/** + * Deprecated, use {@code server.socket.domain} on client spans. + */ +static constexpr const char *kNetSockPeerName = "net.sock.peer.name"; + +/** + * Deprecated, use {@code server.socket.address} on client spans and {@code client.socket.address} + * on server spans. + */ +static constexpr const char *kNetSockPeerAddr = "net.sock.peer.addr"; + +/** + * Deprecated, use {@code server.socket.port} on client spans and {@code client.socket.port} on + * server spans. + */ +static constexpr const char *kNetSockPeerPort = "net.sock.peer.port"; + +/** + * Deprecated, use {@code server.address} on client spans and {@code client.address} on server + * spans. + */ +static constexpr const char *kNetPeerName = "net.peer.name"; + +/** + * Deprecated, use {@code server.port} on client spans and {@code client.port} on server spans. + */ +static constexpr const char *kNetPeerPort = "net.peer.port"; + +/** + * Deprecated, use {@code server.address}. + */ +static constexpr const char *kNetHostName = "net.host.name"; + +/** + * Deprecated, use {@code server.port}. + */ +static constexpr const char *kNetHostPort = "net.host.port"; + +/** + * Deprecated, use {@code server.socket.address}. + */ +static constexpr const char *kNetSockHostAddr = "net.sock.host.addr"; + +/** + * Deprecated, use {@code server.socket.port}. + */ +static constexpr const char *kNetSockHostPort = "net.sock.host.port"; + +/** + * Deprecated, use {@code network.transport}. + */ +static constexpr const char *kNetTransport = "net.transport"; + +/** + * Deprecated, use {@code network.protocol.name}. + */ +static constexpr const char *kNetProtocolName = "net.protocol.name"; + +/** + * Deprecated, use {@code network.protocol.version}. + */ +static constexpr const char *kNetProtocolVersion = "net.protocol.version"; + +/** + * Deprecated, use {@code network.transport} and {@code network.type}. + */ +static constexpr const char *kNetSockFamily = "net.sock.family"; + +/** + * The domain name of the destination system. + * + *

Notes: +

+ */ +static constexpr const char *kDestinationDomain = "destination.domain"; + +/** + * Peer address, for example IP address or UNIX socket name. + */ +static constexpr const char *kDestinationAddress = "destination.address"; + +/** + * Peer port number + */ +static constexpr const char *kDestinationPort = "destination.port"; /** * The type of the exception (its fully-qualified class name, if applicable). The dynamic type of @@ -42,18 +194,32 @@ static constexpr const char *kExceptionStacktrace = "exception.stacktrace"; /** * HTTP request method. - */ -static constexpr const char *kHttpMethod = "http.method"; + * + *

Notes: +

+ */ +static constexpr const char *kHttpRequestMethod = "http.request.method"; /** * HTTP response status code. */ -static constexpr const char *kHttpStatusCode = "http.status_code"; - -/** - * The URI scheme identifying the used protocol. - */ -static constexpr const char *kHttpScheme = "http.scheme"; +static constexpr const char *kHttpResponseStatusCode = "http.response.status_code"; /** * The matched route (path template in the format used by the respective server framework). See note @@ -62,8 +228,8 @@ below *

Notes:

+the application root if there is +one. */ static constexpr const char *kHttpRoute = "http.route"; @@ -92,6 +258,97 @@ Sortable Identifier (ULID), but other identifiers (e.g. UUID) may be used as */ static constexpr const char *kLogRecordUid = "log.record.uid"; +/** + * The stream associated with the log. See below for a list of well-known values. + */ +static constexpr const char *kLogIostream = "log.iostream"; + +/** + * The basename of the file. + */ +static constexpr const char *kLogFileName = "log.file.name"; + +/** + * The full path to the file. + */ +static constexpr const char *kLogFilePath = "log.file.path"; + +/** + * The basename of the file, with symlinks resolved. + */ +static constexpr const char *kLogFileNameResolved = "log.file.name_resolved"; + +/** + * The full path to the file, with symlinks resolved. + */ +static constexpr const char *kLogFilePathResolved = "log.file.path_resolved"; + +/** + * The type of memory. + */ +static constexpr const char *kType = "type"; + +/** + * Name of the memory pool. + * + *

Notes: +

+ */ +static constexpr const char *kPool = "pool"; + +/** + * Logical server hostname, matches server FQDN if available, and IP or socket address if FQDN is + * not known. + */ +static constexpr const char *kServerAddress = "server.address"; + +/** + * Logical server port number + */ +static constexpr const char *kServerPort = "server.port"; + +/** + * The domain name of an immediate peer. + * + *

Notes: +

+ */ +static constexpr const char *kServerSocketDomain = "server.socket.domain"; + +/** + * Physical server IP address or Unix socket address. If set from the client, should simply use the + * socket's peer address, and not attempt to find any actual server IP (i.e., if set from client, + * this may represent some proxy server instead of the logical server). + */ +static constexpr const char *kServerSocketAddress = "server.socket.address"; + +/** + * Physical server port. + */ +static constexpr const char *kServerSocketPort = "server.socket.port"; + +/** + * The domain name of the source system. + * + *

Notes: +

+ */ +static constexpr const char *kSourceDomain = "source.domain"; + +/** + * Source address, for example IP address or Unix socket name. + */ +static constexpr const char *kSourceAddress = "source.address"; + +/** + * Source port number + */ +static constexpr const char *kSourcePort = "source.port"; + /** * The full invoked ARN as provided on the {@code Context} passed to the function ({@code Lambda-Runtime-Invoked-Function-Arn} header on the {@code /runtime/invocation/next} applicable). @@ -203,7 +460,7 @@ static constexpr const char *kDbOperation = "db.operation"; name connecting to. This name is used to determine the port of a named instance. * *

Notes: -