From 8eabd8a569d7bbd1151109617398a47389eb27b5 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Thu, 17 Oct 2024 00:04:47 +0200 Subject: [PATCH 01/16] Migration to weaver - work in progress --- .../semconv/attributes/client_attributes.h | 42 + .../semconv/attributes/error_attributes.h | 77 ++ .../semconv/attributes/exception_attributes.h | 61 ++ .../semconv/attributes/http_attributes.h | 194 ++++ .../semconv/attributes/network_attributes.h | 148 +++ .../semconv/attributes/otel_attributes.h | 71 ++ .../semconv/attributes/server_attributes.h | 42 + .../semconv/attributes/service_attributes.h | 42 + .../semconv/attributes/telemetry_attributes.h | 140 +++ .../semconv/attributes/url_attributes.h | 66 ++ .../attributes/user_agent_attributes.h | 32 + .../attributes/artifact_attributes.h | 84 ++ .../incubating/attributes/aws_attributes.h | 356 +++++++ .../incubating/attributes/az_attributes.h | 32 + .../attributes/browser_attributes.h | 64 ++ .../incubating/attributes/cicd_attributes.h | 88 ++ .../incubating/attributes/client_attributes.h | 38 + .../incubating/attributes/cloud_attributes.h | 377 +++++++ .../attributes/cloudevents_attributes.h | 60 ++ .../incubating/attributes/code_attributes.h | 62 ++ .../attributes/container_attributes.h | 149 +++ .../incubating/attributes/cpu_attributes.h | 96 ++ .../incubating/attributes/db_attributes.h | 964 ++++++++++++++++++ .../attributes/deployment_attributes.h | 81 ++ .../attributes/destination_attributes.h | 39 + .../incubating/attributes/device_attributes.h | 64 ++ .../incubating/attributes/disk_attributes.h | 53 + .../incubating/attributes/dns_attributes.h | 35 + .../attributes/enduser_attributes.h | 41 + .../incubating/attributes/error_attributes.h | 63 ++ .../incubating/attributes/event_attributes.h | 35 + .../attributes/exception_attributes.h | 50 + .../incubating/attributes/faas_attributes.h | 274 +++++ .../attributes/feature_flag_attributes.h | 47 + .../incubating/attributes/file_attributes.h | 54 + .../incubating/attributes/gcp_attributes.h | 65 ++ .../incubating/attributes/gen_ai_attributes.h | 240 +++++ .../attributes/graphql_attributes.h | 72 ++ .../incubating/attributes/heroku_attributes.h | 41 + .../incubating/attributes/host_attributes.h | 180 ++++ .../incubating/attributes/http_attributes.h | 358 +++++++ .../incubating/attributes/k8s_attributes.h | 177 ++++ .../incubating/attributes/linux_attributes.h | 53 + .../incubating/attributes/log_attributes.h | 91 ++ .../attributes/message_attributes.h | 69 ++ .../attributes/messaging_attributes.h | 570 +++++++++++ .../incubating/attributes/net_attributes.h | 184 ++++ .../attributes/network_attributes.h | 417 ++++++++ .../incubating/attributes/oci_attributes.h | 38 + .../attributes/opentracing_attributes.h | 57 ++ .../incubating/attributes/os_attributes.h | 141 +++ .../incubating/attributes/otel_attributes.h | 88 ++ .../incubating/attributes/other_attributes.h | 55 + .../incubating/attributes/peer_attributes.h | 33 + .../incubating/attributes/pool_attributes.h | 31 + .../attributes/process_attributes.h | 251 +++++ .../incubating/attributes/rpc_attributes.h | 466 +++++++++ .../incubating/attributes/server_attributes.h | 38 + .../attributes/service_attributes.h | 79 ++ .../attributes/session_attributes.h | 36 + .../incubating/attributes/source_attributes.h | 39 + .../incubating/attributes/system_attributes.h | 519 ++++++++++ .../attributes/telemetry_attributes.h | 167 +++ .../incubating/attributes/test_attributes.h | 121 +++ .../incubating/attributes/thread_attributes.h | 36 + .../incubating/attributes/tls_attributes.h | 229 +++++ .../incubating/attributes/url_attributes.h | 123 +++ .../attributes/user_agent_attributes.h | 51 + .../incubating/attributes/user_attributes.h | 58 ++ .../incubating/attributes/vcs_attributes.h | 101 ++ .../attributes/webengine_attributes.h | 41 + .../trace/semantic_conventions.h | 3 + buildscripts/semantic-convention/generate.sh | 107 +- .../templates/registry/common.j2 | 34 + .../registry/semantic_attributes-h.j2 | 118 +++ .../templates/registry/semantic_metrics-h.j2 | 96 ++ .../templates/registry/weaver.yaml | 78 ++ examples/grpc/client.cc | 24 +- examples/grpc/server.cc | 11 +- examples/http/client.cc | 12 +- examples/http/server.cc | 18 +- .../otlp/test/otlp_log_recordable_test.cc | 1 - exporters/prometheus/src/exporter_utils.cc | 5 +- exporters/zipkin/src/recordable.cc | 6 +- .../opentracingshim/shim_utils.h | 10 +- opentracing-shim/src/span_shim.cc | 8 +- .../sdk/resource/semantic_conventions.h | 3 + sdk/src/resource/resource.cc | 16 +- sdk/src/resource/resource_detector.cc | 4 +- sdk/test/resource/resource_test.cc | 30 +- 90 files changed, 9904 insertions(+), 116 deletions(-) create mode 100644 api/include/opentelemetry/semconv/attributes/client_attributes.h create mode 100644 api/include/opentelemetry/semconv/attributes/error_attributes.h create mode 100644 api/include/opentelemetry/semconv/attributes/exception_attributes.h create mode 100644 api/include/opentelemetry/semconv/attributes/http_attributes.h create mode 100644 api/include/opentelemetry/semconv/attributes/network_attributes.h create mode 100644 api/include/opentelemetry/semconv/attributes/otel_attributes.h create mode 100644 api/include/opentelemetry/semconv/attributes/server_attributes.h create mode 100644 api/include/opentelemetry/semconv/attributes/service_attributes.h create mode 100644 api/include/opentelemetry/semconv/attributes/telemetry_attributes.h create mode 100644 api/include/opentelemetry/semconv/attributes/url_attributes.h create mode 100644 api/include/opentelemetry/semconv/attributes/user_agent_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/artifact_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/aws_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/az_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/browser_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/cicd_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/client_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/cloud_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/cloudevents_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/code_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/container_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/cpu_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/db_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/deployment_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/destination_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/device_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/disk_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/dns_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/enduser_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/error_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/event_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/exception_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/faas_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/feature_flag_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/file_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/gcp_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/gen_ai_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/graphql_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/heroku_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/host_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/http_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/k8s_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/linux_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/log_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/message_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/messaging_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/net_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/network_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/oci_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/opentracing_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/os_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/otel_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/other_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/peer_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/pool_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/process_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/rpc_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/server_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/service_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/session_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/source_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/system_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/telemetry_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/test_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/thread_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/tls_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/url_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/user_agent_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/user_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/vcs_attributes.h create mode 100644 api/include/opentelemetry/semconv/incubating/attributes/webengine_attributes.h create mode 100644 buildscripts/semantic-convention/templates/registry/common.j2 create mode 100644 buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 create mode 100644 buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 create mode 100644 buildscripts/semantic-convention/templates/registry/weaver.yaml diff --git a/api/include/opentelemetry/semconv/attributes/client_attributes.h b/api/include/opentelemetry/semconv/attributes/client_attributes.h new file mode 100644 index 0000000000..80bc16407b --- /dev/null +++ b/api/include/opentelemetry/semconv/attributes/client_attributes.h @@ -0,0 +1,42 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace client +{ + +/** + * 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, @code client.address @endcode SHOULD represent the client address behind any + * intermediaries, for example proxies, if it's available. + */ +static const char *kClientAddress = "client.address"; + +/** + * Client port number. + * Note: When observed from the server side, and when communicating through an intermediary, @code + * client.port @endcode SHOULD represent the client port behind any intermediaries, for example + * proxies, if it's available. + */ +static const char *kClientPort = "client.port"; + +} // namespace client +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/attributes/error_attributes.h b/api/include/opentelemetry/semconv/attributes/error_attributes.h new file mode 100644 index 0000000000..baf0335f0e --- /dev/null +++ b/api/include/opentelemetry/semconv/attributes/error_attributes.h @@ -0,0 +1,77 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace error +{ + +/** + * Describes a class of error the operation ended with. + * Note: The @code error.type @endcode SHOULD be predictable, and SHOULD have low cardinality. + *

+ * When @code error.type @endcode is set to a type (e.g., an exception type), its + * canonical class name identifying the type within the artifact SHOULD be used. + *

+ * Instrumentations SHOULD document the list of errors they report. + *

+ * The cardinality of @code error.type @endcode within one instrumentation library SHOULD be low. + * Telemetry consumers that aggregate data from multiple instrumentation libraries and applications + * should be prepared for @code error.type @endcode to have high cardinality at query time when no + * additional filters are applied. + *

+ * If the operation has completed successfully, instrumentations SHOULD NOT set @code error.type + * @endcode.

If a specific domain defines its own set of error identifiers (such as HTTP or gRPC + * status codes), it's RECOMMENDED to:

+ */ +static const char *kErrorType = "error.type"; + +// DEBUG: {"brief": "Describes a class of error the operation ended with.\n", "examples": +// ["timeout", "java.net.UnknownHostException", "server_certificate_invalid", "500"], "name": +// "error.type", "note": "The `error.type` SHOULD be predictable, and SHOULD have low +// cardinality.\n\nWhen `error.type` is set to a type (e.g., an exception type), its\ncanonical +// class name identifying the type within the artifact SHOULD be used.\n\nInstrumentations SHOULD +// document the list of errors they report.\n\nThe cardinality of `error.type` within one +// instrumentation library SHOULD be low.\nTelemetry consumers that aggregate data from multiple +// instrumentation libraries and applications\nshould be prepared for `error.type` to have high +// cardinality at query time when no\nadditional filters are applied.\n\nIf the operation has +// completed successfully, instrumentations SHOULD NOT set `error.type`.\n\nIf a specific domain +// defines its own set of error identifiers (such as HTTP or gRPC status codes),\nit's RECOMMENDED +// to:\n\n* Use a domain-specific attribute\n* Set `error.type` to capture all errors, regardless of +// whether they are defined within the domain-specific set or not.\n", "requirement_level": +// "recommended", "root_namespace": "error", "stability": "stable", "type": {"allow_custom_values": +// true, "members": [{"brief": "A fallback error value to be used when the instrumentation doesn't +// define a custom value.\n", "deprecated": none, "id": "other", "note": none, "stability": +// "stable", "value": "_OTHER"}]}} +namespace ErrorTypeValues +{ +/** + * A fallback error value to be used when the instrumentation doesn't define a custom value. + */ +// DEBUG: {"brief": "A fallback error value to be used when the instrumentation doesn't define a +// custom value.\n", "deprecated": none, "id": "other", "note": none, "stability": "stable", +// "value": "_OTHER"} +static constexpr const char *kOther = "_OTHER"; +} // namespace ErrorTypeValues + +} // namespace error +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/attributes/exception_attributes.h b/api/include/opentelemetry/semconv/attributes/exception_attributes.h new file mode 100644 index 0000000000..d700e99493 --- /dev/null +++ b/api/include/opentelemetry/semconv/attributes/exception_attributes.h @@ -0,0 +1,61 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace exception +{ + +/** + * 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. Note: An exception is considered to have escaped (or + * left) the scope of a span, if that span is ended while the exception is still logically "in + * flight". This may be actually "in flight" in some languages (e.g. if the exception is passed to a + * Context manager's @code __exit__ @endcode method in Python) but will usually be caught at the + * point of recording the exception in most languages.

It is usually not possible to determine + * at the point where an exception is thrown whether it will escape the scope of a span. However, it + * is trivial to know that an exception will escape, if one checks for an active exception just + * before ending the span, as done in the example + * for recording span exceptions.

It follows that an exception may still escape the scope of + * the span even if the @code exception.escaped @endcode attribute was not set or set to false, + * since the event might have been recorded at a time where it was not + * clear whether the exception will escape. + */ +static const char *kExceptionEscaped = "exception.escaped"; + +/** + * The exception message. + */ +static const char *kExceptionMessage = "exception.message"; + +/** + * A stacktrace as a string in the natural representation for the language runtime. The + * representation is to be determined and documented by each language SIG. + */ +static const char *kExceptionStacktrace = "exception.stacktrace"; + +/** + * 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. + */ +static const char *kExceptionType = "exception.type"; + +} // namespace exception +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/attributes/http_attributes.h b/api/include/opentelemetry/semconv/attributes/http_attributes.h new file mode 100644 index 0000000000..7a9c45dc02 --- /dev/null +++ b/api/include/opentelemetry/semconv/attributes/http_attributes.h @@ -0,0 +1,194 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace http +{ + +/** + * HTTP request headers, @code @endcode being the normalized HTTP Header name (lowercase), the + * value being the header values. Note: Instrumentations SHOULD require an explicit configuration of + * which headers are to be captured. Including all request headers can be a security risk - explicit + * configuration helps avoid leaking sensitive information. The @code User-Agent @endcode header is + * already captured in the @code user_agent.original @endcode attribute. Users MAY explicitly + * configure instrumentations to capture them even though it is not recommended. The attribute value + * MUST consist of either multiple header values as an array of strings or a single-item array + * containing a possibly comma-concatenated string, depending on the way the HTTP library provides + * access to headers. + */ +static const char *kHttpRequestHeader = "http.request.header"; + +/** + * HTTP request method. + * Note: HTTP request method value SHOULD be "known" to the instrumentation. + * By default, this convention defines "known" methods as the ones listed in RFC9110 and the PATCH method + * defined in RFC5789.

If the HTTP + * request method is not known to instrumentation, it MUST set the @code http.request.method + * @endcode attribute to @code _OTHER @endcode.

If the HTTP instrumentation could end up + * converting valid HTTP request methods to @code _OTHER @endcode, then it MUST provide a way to + * override the list of known HTTP methods. If this override is done via environment variable, then + * the environment variable MUST be named OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a + * comma-separated list of case-sensitive known HTTP methods (this list MUST be a full override of + * the default known method, it is not a list of known methods in addition to the defaults).

+ * HTTP method names are case-sensitive and @code http.request.method @endcode 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 @code http.request.method_original @endcode to the + * original value. + */ +static const char *kHttpRequestMethod = "http.request.method"; + +/** + * Original HTTP method sent by the client in the request line. + */ +static const char *kHttpRequestMethodOriginal = "http.request.method_original"; + +/** + * The ordinal number of request resending attempt (for any reason, including redirects). + * Note: The resend count SHOULD be updated each time an HTTP request gets resent by the client, + * regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 + * Server Unavailable, network issues, or any other). + */ +static const char *kHttpRequestResendCount = "http.request.resend_count"; + +/** + * HTTP response headers, @code @endcode being the normalized HTTP Header name (lowercase), + * the value being the header values. Note: Instrumentations SHOULD require an explicit + * configuration of which headers are to be captured. Including all response headers can be a + * security risk - explicit configuration helps avoid leaking sensitive information. Users MAY + * explicitly configure instrumentations to capture them even though it is not recommended. The + * attribute value MUST consist of either multiple header values as an array of strings or a + * single-item array containing a possibly comma-concatenated string, depending on the way the HTTP + * library provides access to headers. + */ +static const char *kHttpResponseHeader = "http.response.header"; + +/** + * HTTP response status code. + */ +static const char *kHttpResponseStatusCode = "http.response.status_code"; + +/** + * The matched route, that is, the path template in the format used by the respective server + * framework. Note: 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 if + * there is one. + */ +static const char *kHttpRoute = "http.route"; + +// DEBUG: {"brief": "HTTP request method.", "examples": ["GET", "POST", "HEAD"], "name": +// "http.request.method", "note": "HTTP request method value SHOULD be \"known\" to the +// instrumentation.\nBy default, this convention defines \"known\" methods as the ones listed in +// [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods)\nand the PATCH method defined +// in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html).\n\nIf the HTTP request method is not +// known to instrumentation, it MUST set the `http.request.method` attribute to `_OTHER`.\n\nIf the +// HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it MUST +// provide a way to override\nthe list of known HTTP methods. If this override is done via +// environment variable, then the environment variable MUST be +// named\nOTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of +// case-sensitive known HTTP methods\n(this list MUST be a full override of the default known +// method, it is not a list of known methods in addition to the defaults).\n\nHTTP method names are +// case-sensitive and `http.request.method` attribute value MUST match a known HTTP method name +// exactly.\nInstrumentations for specific web frameworks that consider HTTP methods to be case +// insensitive, SHOULD populate a canonical equivalent.\nTracing instrumentations that do so, MUST +// also set `http.request.method_original` to the original value.\n", "requirement_level": +// "recommended", "root_namespace": "http", "stability": "stable", "type": {"allow_custom_values": +// true, "members": [{"brief": "CONNECT method.", "deprecated": none, "id": "connect", "note": none, +// "stability": "stable", "value": "CONNECT"}, {"brief": "DELETE method.", "deprecated": none, "id": +// "delete", "note": none, "stability": "stable", "value": "DELETE"}, {"brief": "GET method.", +// "deprecated": none, "id": "get", "note": none, "stability": "stable", "value": "GET"}, {"brief": +// "HEAD method.", "deprecated": none, "id": "head", "note": none, "stability": "stable", "value": +// "HEAD"}, {"brief": "OPTIONS method.", "deprecated": none, "id": "options", "note": none, +// "stability": "stable", "value": "OPTIONS"}, {"brief": "PATCH method.", "deprecated": none, "id": +// "patch", "note": none, "stability": "stable", "value": "PATCH"}, {"brief": "POST method.", +// "deprecated": none, "id": "post", "note": none, "stability": "stable", "value": "POST"}, +// {"brief": "PUT method.", "deprecated": none, "id": "put", "note": none, "stability": "stable", +// "value": "PUT"}, {"brief": "TRACE method.", "deprecated": none, "id": "trace", "note": none, +// "stability": "stable", "value": "TRACE"}, {"brief": "Any HTTP method that the instrumentation has +// no prior knowledge of.", "deprecated": none, "id": "other", "note": none, "stability": "stable", +// "value": "_OTHER"}]}} +namespace HttpRequestMethodValues +{ +/** + * CONNECT method. + */ +// DEBUG: {"brief": "CONNECT method.", "deprecated": none, "id": "connect", "note": none, +// "stability": "stable", "value": "CONNECT"} +static constexpr const char *kConnect = "CONNECT"; +/** + * DELETE method. + */ +// DEBUG: {"brief": "DELETE method.", "deprecated": none, "id": "delete", "note": none, "stability": +// "stable", "value": "DELETE"} +static constexpr const char *kDelete = "DELETE"; +/** + * GET method. + */ +// DEBUG: {"brief": "GET method.", "deprecated": none, "id": "get", "note": none, "stability": +// "stable", "value": "GET"} +static constexpr const char *kGet = "GET"; +/** + * HEAD method. + */ +// DEBUG: {"brief": "HEAD method.", "deprecated": none, "id": "head", "note": none, "stability": +// "stable", "value": "HEAD"} +static constexpr const char *kHead = "HEAD"; +/** + * OPTIONS method. + */ +// DEBUG: {"brief": "OPTIONS method.", "deprecated": none, "id": "options", "note": none, +// "stability": "stable", "value": "OPTIONS"} +static constexpr const char *kOptions = "OPTIONS"; +/** + * PATCH method. + */ +// DEBUG: {"brief": "PATCH method.", "deprecated": none, "id": "patch", "note": none, "stability": +// "stable", "value": "PATCH"} +static constexpr const char *kPatch = "PATCH"; +/** + * POST method. + */ +// DEBUG: {"brief": "POST method.", "deprecated": none, "id": "post", "note": none, "stability": +// "stable", "value": "POST"} +static constexpr const char *kPost = "POST"; +/** + * PUT method. + */ +// DEBUG: {"brief": "PUT method.", "deprecated": none, "id": "put", "note": none, "stability": +// "stable", "value": "PUT"} +static constexpr const char *kPut = "PUT"; +/** + * TRACE method. + */ +// DEBUG: {"brief": "TRACE method.", "deprecated": none, "id": "trace", "note": none, "stability": +// "stable", "value": "TRACE"} +static constexpr const char *kTrace = "TRACE"; +/** + * Any HTTP method that the instrumentation has no prior knowledge of. + */ +// DEBUG: {"brief": "Any HTTP method that the instrumentation has no prior knowledge of.", +// "deprecated": none, "id": "other", "note": none, "stability": "stable", "value": "_OTHER"} +static constexpr const char *kOther = "_OTHER"; +} // namespace HttpRequestMethodValues + +} // namespace http +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/attributes/network_attributes.h b/api/include/opentelemetry/semconv/attributes/network_attributes.h new file mode 100644 index 0000000000..73c777abad --- /dev/null +++ b/api/include/opentelemetry/semconv/attributes/network_attributes.h @@ -0,0 +1,148 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace network +{ + +/** + * Local address of the network connection - IP address or Unix domain socket name. + */ +static const char *kNetworkLocalAddress = "network.local.address"; + +/** + * Local port number of the network connection. + */ +static const char *kNetworkLocalPort = "network.local.port"; + +/** + * Peer address of the network connection - IP address or Unix domain socket name. + */ +static const char *kNetworkPeerAddress = "network.peer.address"; + +/** + * Peer port number of the network connection. + */ +static const char *kNetworkPeerPort = "network.peer.port"; + +/** + * OSI application layer or non-OSI + * equivalent. Note: The value SHOULD be normalized to lowercase. + */ +static const char *kNetworkProtocolName = "network.protocol.name"; + +/** + * The actual version of the protocol used for network communication. + * Note: If protocol version is subject to negotiation (for example using ALPN), this attribute SHOULD be set to the + * negotiated version. If the actual protocol version is not known, this attribute SHOULD NOT be + * set. + */ +static const char *kNetworkProtocolVersion = "network.protocol.version"; + +/** + * OSI transport layer or inter-process communication + * method. Note: The value SHOULD be normalized to lowercase.

Consider always setting the + * transport when setting a port number, since a port number is ambiguous without knowing the + * transport. For example different processes could be listening on TCP port 12345 and UDP port + * 12345. + */ +static const char *kNetworkTransport = "network.transport"; + +/** + * OSI network layer or non-OSI equivalent. + * Note: The value SHOULD be normalized to lowercase. + */ +static const char *kNetworkType = "network.type"; + +// DEBUG: {"brief": "[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process +// communication method](https://wikipedia.org/wiki/Inter-process_communication).\n", "examples": +// ["tcp", "udp"], "name": "network.transport", "note": "The value SHOULD be normalized to +// lowercase.\n\nConsider always setting the transport when setting a port number, since\na port +// number is ambiguous without knowing the transport. For example\ndifferent processes could be +// listening on TCP port 12345 and UDP port 12345.\n", "requirement_level": "recommended", +// "root_namespace": "network", "stability": "stable", "type": {"allow_custom_values": true, +// "members": [{"brief": "TCP", "deprecated": none, "id": "tcp", "note": none, "stability": +// "stable", "value": "tcp"}, {"brief": "UDP", "deprecated": none, "id": "udp", "note": none, +// "stability": "stable", "value": "udp"}, {"brief": "Named or anonymous pipe.", "deprecated": none, +// "id": "pipe", "note": none, "stability": "stable", "value": "pipe"}, {"brief": "Unix domain +// socket", "deprecated": none, "id": "unix", "note": none, "stability": "stable", "value": "unix"}, +// {"brief": "QUIC", "deprecated": none, "id": "quic", "note": none, "stability": "experimental", +// "value": "quic"}]}} +namespace NetworkTransportValues +{ +/** + * TCP. + */ +// DEBUG: {"brief": "TCP", "deprecated": none, "id": "tcp", "note": none, "stability": "stable", +// "value": "tcp"} +static constexpr const char *kTcp = "tcp"; +/** + * UDP. + */ +// DEBUG: {"brief": "UDP", "deprecated": none, "id": "udp", "note": none, "stability": "stable", +// "value": "udp"} +static constexpr const char *kUdp = "udp"; +/** + * Named or anonymous pipe. + */ +// DEBUG: {"brief": "Named or anonymous pipe.", "deprecated": none, "id": "pipe", "note": none, +// "stability": "stable", "value": "pipe"} +static constexpr const char *kPipe = "pipe"; +/** + * Unix domain socket. + */ +// DEBUG: {"brief": "Unix domain socket", "deprecated": none, "id": "unix", "note": none, +// "stability": "stable", "value": "unix"} +static constexpr const char *kUnix = "unix"; +/** + * QUIC. + */ +// DEBUG: {"brief": "QUIC", "deprecated": none, "id": "quic", "note": none, "stability": +// "experimental", "value": "quic"} +static constexpr const char *kQuic = "quic"; +} // namespace NetworkTransportValues + +// DEBUG: {"brief": "[OSI network layer](https://osi-model.com/network-layer/) or non-OSI +// equivalent.", "examples": ["ipv4", "ipv6"], "name": "network.type", "note": "The value SHOULD be +// normalized to lowercase.", "requirement_level": "recommended", "root_namespace": "network", +// "stability": "stable", "type": {"allow_custom_values": true, "members": [{"brief": "IPv4", +// "deprecated": none, "id": "ipv4", "note": none, "stability": "stable", "value": "ipv4"}, +// {"brief": "IPv6", "deprecated": none, "id": "ipv6", "note": none, "stability": "stable", "value": +// "ipv6"}]}} +namespace NetworkTypeValues +{ +/** + * IPv4. + */ +// DEBUG: {"brief": "IPv4", "deprecated": none, "id": "ipv4", "note": none, "stability": "stable", +// "value": "ipv4"} +static constexpr const char *kIpv4 = "ipv4"; +/** + * IPv6. + */ +// DEBUG: {"brief": "IPv6", "deprecated": none, "id": "ipv6", "note": none, "stability": "stable", +// "value": "ipv6"} +static constexpr const char *kIpv6 = "ipv6"; +} // namespace NetworkTypeValues + +} // namespace network +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/attributes/otel_attributes.h b/api/include/opentelemetry/semconv/attributes/otel_attributes.h new file mode 100644 index 0000000000..92f9f8600c --- /dev/null +++ b/api/include/opentelemetry/semconv/attributes/otel_attributes.h @@ -0,0 +1,71 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace otel +{ + +/** + * The name of the instrumentation scope - (@code InstrumentationScope.Name @endcode in OTLP). + */ +static const char *kOtelScopeName = "otel.scope.name"; + +/** + * The version of the instrumentation scope - (@code InstrumentationScope.Version @endcode in OTLP). + */ +static const char *kOtelScopeVersion = "otel.scope.version"; + +/** + * Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET. + */ +static const char *kOtelStatusCode = "otel.status_code"; + +/** + * Description of the Status if it has a value, otherwise not set. + */ +static const char *kOtelStatusDescription = "otel.status_description"; + +// DEBUG: {"brief": "Name of the code, either \"OK\" or \"ERROR\". MUST NOT be set if the status +// code is UNSET.", "name": "otel.status_code", "requirement_level": "recommended", +// "root_namespace": "otel", "stability": "stable", "type": {"allow_custom_values": true, "members": +// [{"brief": "The operation has been validated by an Application developer or Operator to have +// completed successfully.", "deprecated": none, "id": "ok", "note": none, "stability": "stable", +// "value": "OK"}, {"brief": "The operation contains an error.", "deprecated": none, "id": "error", +// "note": none, "stability": "stable", "value": "ERROR"}]}} +namespace OtelStatusCodeValues +{ +/** + * The operation has been validated by an Application developer or Operator to have completed + * successfully. + */ +// DEBUG: {"brief": "The operation has been validated by an Application developer or Operator to +// have completed successfully.", "deprecated": none, "id": "ok", "note": none, "stability": +// "stable", "value": "OK"} +static constexpr const char *kOk = "OK"; +/** + * The operation contains an error. + */ +// DEBUG: {"brief": "The operation contains an error.", "deprecated": none, "id": "error", "note": +// none, "stability": "stable", "value": "ERROR"} +static constexpr const char *kError = "ERROR"; +} // namespace OtelStatusCodeValues + +} // namespace otel +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/attributes/server_attributes.h b/api/include/opentelemetry/semconv/attributes/server_attributes.h new file mode 100644 index 0000000000..b12946b27b --- /dev/null +++ b/api/include/opentelemetry/semconv/attributes/server_attributes.h @@ -0,0 +1,42 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace server +{ + +/** + * Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain + * socket name. Note: When observed from the client side, and when communicating through an + * intermediary, @code server.address @endcode SHOULD represent the server address behind any + * intermediaries, for example proxies, if it's available. + */ +static const char *kServerAddress = "server.address"; + +/** + * Server port number. + * Note: When observed from the client side, and when communicating through an intermediary, @code + * server.port @endcode SHOULD represent the server port behind any intermediaries, for example + * proxies, if it's available. + */ +static const char *kServerPort = "server.port"; + +} // namespace server +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/attributes/service_attributes.h b/api/include/opentelemetry/semconv/attributes/service_attributes.h new file mode 100644 index 0000000000..ab299fbb8d --- /dev/null +++ b/api/include/opentelemetry/semconv/attributes/service_attributes.h @@ -0,0 +1,42 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace service +{ + +/** + * Logical name of the service. + * Note: MUST be the same for all instances of horizontally scaled services. If the value was not + * specified, SDKs MUST fallback to @code unknown_service: @endcode concatenated with @code process.executable.name @endcode, e.g. @code unknown_service:bash + * @endcode. If @code process.executable.name @endcode is not available, the value MUST be set to + * @code unknown_service @endcode. + */ +static const char *kServiceName = "service.name"; + +/** + * The version string of the service API or implementation. The format is not defined by these + * conventions. + */ +static const char *kServiceVersion = "service.version"; + +} // namespace service +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/attributes/telemetry_attributes.h b/api/include/opentelemetry/semconv/attributes/telemetry_attributes.h new file mode 100644 index 0000000000..46c3b88f3a --- /dev/null +++ b/api/include/opentelemetry/semconv/attributes/telemetry_attributes.h @@ -0,0 +1,140 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace telemetry +{ + +/** + * The language of the telemetry SDK. + */ +static const char *kTelemetrySdkLanguage = "telemetry.sdk.language"; + +/** + * The name of the telemetry SDK as defined above. + * Note: The OpenTelemetry SDK MUST set the @code telemetry.sdk.name @endcode attribute to @code + * opentelemetry @endcode. If another SDK, like a fork or a vendor-provided implementation, is used, + * this SDK MUST set the + * @code telemetry.sdk.name @endcode attribute to the fully-qualified class or module name of this + * SDK's main entry point or another suitable identifier depending on the language. The identifier + * @code opentelemetry @endcode is reserved and MUST NOT be used in this case. All custom + * identifiers SHOULD be stable across different versions of an implementation. + */ +static const char *kTelemetrySdkName = "telemetry.sdk.name"; + +/** + * The version string of the telemetry SDK. + */ +static const char *kTelemetrySdkVersion = "telemetry.sdk.version"; + +// DEBUG: {"brief": "The language of the telemetry SDK.\n", "name": "telemetry.sdk.language", +// "requirement_level": "required", "root_namespace": "telemetry", "stability": "stable", "type": +// {"allow_custom_values": true, "members": [{"brief": none, "deprecated": none, "id": "cpp", +// "note": none, "stability": "stable", "value": "cpp"}, {"brief": none, "deprecated": none, "id": +// "dotnet", "note": none, "stability": "stable", "value": "dotnet"}, {"brief": none, "deprecated": +// none, "id": "erlang", "note": none, "stability": "stable", "value": "erlang"}, {"brief": none, +// "deprecated": none, "id": "go", "note": none, "stability": "stable", "value": "go"}, {"brief": +// none, "deprecated": none, "id": "java", "note": none, "stability": "stable", "value": "java"}, +// {"brief": none, "deprecated": none, "id": "nodejs", "note": none, "stability": "stable", "value": +// "nodejs"}, {"brief": none, "deprecated": none, "id": "php", "note": none, "stability": "stable", +// "value": "php"}, {"brief": none, "deprecated": none, "id": "python", "note": none, "stability": +// "stable", "value": "python"}, {"brief": none, "deprecated": none, "id": "ruby", "note": none, +// "stability": "stable", "value": "ruby"}, {"brief": none, "deprecated": none, "id": "rust", +// "note": none, "stability": "stable", "value": "rust"}, {"brief": none, "deprecated": none, "id": +// "swift", "note": none, "stability": "stable", "value": "swift"}, {"brief": none, "deprecated": +// none, "id": "webjs", "note": none, "stability": "stable", "value": "webjs"}]}} +namespace TelemetrySdkLanguageValues +{ +/** + * cpp. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "cpp", "note": none, "stability": "stable", +// "value": "cpp"} +static constexpr const char *kCpp = "cpp"; +/** + * dotnet. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "dotnet", "note": none, "stability": "stable", +// "value": "dotnet"} +static constexpr const char *kDotnet = "dotnet"; +/** + * erlang. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "erlang", "note": none, "stability": "stable", +// "value": "erlang"} +static constexpr const char *kErlang = "erlang"; +/** + * go. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "go", "note": none, "stability": "stable", +// "value": "go"} +static constexpr const char *kGo = "go"; +/** + * java. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "java", "note": none, "stability": "stable", +// "value": "java"} +static constexpr const char *kJava = "java"; +/** + * nodejs. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "nodejs", "note": none, "stability": "stable", +// "value": "nodejs"} +static constexpr const char *kNodejs = "nodejs"; +/** + * php. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "php", "note": none, "stability": "stable", +// "value": "php"} +static constexpr const char *kPhp = "php"; +/** + * python. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "python", "note": none, "stability": "stable", +// "value": "python"} +static constexpr const char *kPython = "python"; +/** + * ruby. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "ruby", "note": none, "stability": "stable", +// "value": "ruby"} +static constexpr const char *kRuby = "ruby"; +/** + * rust. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "rust", "note": none, "stability": "stable", +// "value": "rust"} +static constexpr const char *kRust = "rust"; +/** + * swift. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "swift", "note": none, "stability": "stable", +// "value": "swift"} +static constexpr const char *kSwift = "swift"; +/** + * webjs. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "webjs", "note": none, "stability": "stable", +// "value": "webjs"} +static constexpr const char *kWebjs = "webjs"; +} // namespace TelemetrySdkLanguageValues + +} // namespace telemetry +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/attributes/url_attributes.h b/api/include/opentelemetry/semconv/attributes/url_attributes.h new file mode 100644 index 0000000000..6d38114389 --- /dev/null +++ b/api/include/opentelemetry/semconv/attributes/url_attributes.h @@ -0,0 +1,66 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace url +{ + +/** + * The URI fragment component. + */ +static const char *kUrlFragment = "url.fragment"; + +/** + * Absolute URL describing a network resource according to RFC3986. Note: For network calls, URL usually + * has @code scheme://host[:port][path][?query][#fragment] @endcode format, where the fragment is + * not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless. + * @code url.full @endcode MUST NOT contain credentials passed via URL in form of @code + * https://username:password@www.example.com/ @endcode. In such case username and password SHOULD be + * redacted and attribute's value SHOULD be @code https://REDACTED:REDACTED@www.example.com/ + * @endcode. + * @code url.full @endcode SHOULD capture the absolute URL when it is available (or can be + * reconstructed). Sensitive content provided in @code url.full @endcode SHOULD be scrubbed when + * instrumentations can identify it. + */ +static const char *kUrlFull = "url.full"; + +/** + * The URI path component. + * Note: Sensitive content provided in @code url.path @endcode SHOULD be scrubbed when + * instrumentations can identify it. + */ +static const char *kUrlPath = "url.path"; + +/** + * The URI query component. + * Note: Sensitive content provided in @code url.query @endcode SHOULD be scrubbed when + * instrumentations can identify it. + */ +static const char *kUrlQuery = "url.query"; + +/** + * The URI scheme component + * identifying the used protocol. + */ +static const char *kUrlScheme = "url.scheme"; + +} // namespace url +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/attributes/user_agent_attributes.h b/api/include/opentelemetry/semconv/attributes/user_agent_attributes.h new file mode 100644 index 0000000000..4618d99500 --- /dev/null +++ b/api/include/opentelemetry/semconv/attributes/user_agent_attributes.h @@ -0,0 +1,32 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace user_agent +{ + +/** + * Value of the HTTP + * User-Agent header sent by the client. + */ +static const char *kUserAgentOriginal = "user_agent.original"; + +} // namespace user_agent +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/artifact_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/artifact_attributes.h new file mode 100644 index 0000000000..9eeb5914c0 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/artifact_attributes.h @@ -0,0 +1,84 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace artifact +{ + +/** + * The provenance filename of the built attestation which directly relates to the build artifact + * filename. This filename SHOULD accompany the artifact at publish time. See the SLSA + * Relationship specification for more information. + */ +static const char *kArtifactAttestationFilename = "artifact.attestation.filename"; + +/** + * The full hash value (see + * glossary), of the built attestation. Some envelopes in the software attestation space also + * refer to this as the digest. + */ +static const char *kArtifactAttestationHash = "artifact.attestation.hash"; + +/** + * The id of the build software attestation. + */ +static const char *kArtifactAttestationId = "artifact.attestation.id"; + +/** + * The human readable file name of the artifact, typically generated during build and release + * processes. Often includes the package name and version in the file name. Note: This file name can + * also act as the Package Name + * in cases where the package ecosystem maps accordingly. + * Additionally, the artifact can be published for + * others, but that is not a guarantee. + */ +static const char *kArtifactFilename = "artifact.filename"; + +/** + * The full hash value (see + * glossary), often found in checksum.txt on a release of the artifact and used to verify + * package integrity. Note: The specific algorithm used to create the cryptographic hash value is + * not defined. In situations where an artifact has multiple + * cryptographic hashes, it is up to the implementer to choose which + * hash value to set here; this should be the most secure hash algorithm + * that is suitable for the situation and consistent with the + * corresponding attestation. The implementer can then provide the other + * hash values through an additional set of attribute extensions as they + * deem necessary. + */ +static const char *kArtifactHash = "artifact.hash"; + +/** + * The Package URL of the package artifact provides a + * standard way to identify and locate the packaged artifact. + */ +static const char *kArtifactPurl = "artifact.purl"; + +/** + * The version of the artifact. + */ +static const char *kArtifactVersion = "artifact.version"; + +} // namespace artifact +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/aws_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/aws_attributes.h new file mode 100644 index 0000000000..204a41f8e4 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/aws_attributes.h @@ -0,0 +1,356 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace aws +{ + +/** + * The JSON-serialized value of each item in the @code AttributeDefinitions @endcode request field. + */ +static const char *kAwsDynamodbAttributeDefinitions = "aws.dynamodb.attribute_definitions"; + +/** + * The value of the @code AttributesToGet @endcode request parameter. + */ +static const char *kAwsDynamodbAttributesToGet = "aws.dynamodb.attributes_to_get"; + +/** + * The value of the @code ConsistentRead @endcode request parameter. + */ +static const char *kAwsDynamodbConsistentRead = "aws.dynamodb.consistent_read"; + +/** + * The JSON-serialized value of each item in the @code ConsumedCapacity @endcode response field. + */ +static const char *kAwsDynamodbConsumedCapacity = "aws.dynamodb.consumed_capacity"; + +/** + * The value of the @code Count @endcode response parameter. + */ +static const char *kAwsDynamodbCount = "aws.dynamodb.count"; + +/** + * The value of the @code ExclusiveStartTableName @endcode request parameter. + */ +static const char *kAwsDynamodbExclusiveStartTable = "aws.dynamodb.exclusive_start_table"; + +/** + * The JSON-serialized value of each item in the @code GlobalSecondaryIndexUpdates @endcode request + * field. + */ +static const char *kAwsDynamodbGlobalSecondaryIndexUpdates = + "aws.dynamodb.global_secondary_index_updates"; + +/** + * The JSON-serialized value of each item of the @code GlobalSecondaryIndexes @endcode request + * field. + */ +static const char *kAwsDynamodbGlobalSecondaryIndexes = "aws.dynamodb.global_secondary_indexes"; + +/** + * The value of the @code IndexName @endcode request parameter. + */ +static const char *kAwsDynamodbIndexName = "aws.dynamodb.index_name"; + +/** + * The JSON-serialized value of the @code ItemCollectionMetrics @endcode response field. + */ +static const char *kAwsDynamodbItemCollectionMetrics = "aws.dynamodb.item_collection_metrics"; + +/** + * The value of the @code Limit @endcode request parameter. + */ +static const char *kAwsDynamodbLimit = "aws.dynamodb.limit"; + +/** + * The JSON-serialized value of each item of the @code LocalSecondaryIndexes @endcode request field. + */ +static const char *kAwsDynamodbLocalSecondaryIndexes = "aws.dynamodb.local_secondary_indexes"; + +/** + * The value of the @code ProjectionExpression @endcode request parameter. + */ +static const char *kAwsDynamodbProjection = "aws.dynamodb.projection"; + +/** + * The value of the @code ProvisionedThroughput.ReadCapacityUnits @endcode request parameter. + */ +static const char *kAwsDynamodbProvisionedReadCapacity = "aws.dynamodb.provisioned_read_capacity"; + +/** + * The value of the @code ProvisionedThroughput.WriteCapacityUnits @endcode request parameter. + */ +static const char *kAwsDynamodbProvisionedWriteCapacity = "aws.dynamodb.provisioned_write_capacity"; + +/** + * The value of the @code ScanIndexForward @endcode request parameter. + */ +static const char *kAwsDynamodbScanForward = "aws.dynamodb.scan_forward"; + +/** + * The value of the @code ScannedCount @endcode response parameter. + */ +static const char *kAwsDynamodbScannedCount = "aws.dynamodb.scanned_count"; + +/** + * The value of the @code Segment @endcode request parameter. + */ +static const char *kAwsDynamodbSegment = "aws.dynamodb.segment"; + +/** + * The value of the @code Select @endcode request parameter. + */ +static const char *kAwsDynamodbSelect = "aws.dynamodb.select"; + +/** + * The number of items in the @code TableNames @endcode response parameter. + */ +static const char *kAwsDynamodbTableCount = "aws.dynamodb.table_count"; + +/** + * The keys in the @code RequestItems @endcode object field. + */ +static const char *kAwsDynamodbTableNames = "aws.dynamodb.table_names"; + +/** + * The value of the @code TotalSegments @endcode request parameter. + */ +static const char *kAwsDynamodbTotalSegments = "aws.dynamodb.total_segments"; + +/** + * The ARN of an ECS cluster. + */ +static const char *kAwsEcsClusterArn = "aws.ecs.cluster.arn"; + +/** + * The Amazon Resource Name (ARN) of an ECS + * container instance. + */ +static const char *kAwsEcsContainerArn = "aws.ecs.container.arn"; + +/** + * The launch + * type for an ECS task. + */ +static const char *kAwsEcsLaunchtype = "aws.ecs.launchtype"; + +/** + * The ARN of a running ECS + * task. + */ +static const char *kAwsEcsTaskArn = "aws.ecs.task.arn"; + +/** + * The family name of the ECS task + * definition used to create the ECS task. + */ +static const char *kAwsEcsTaskFamily = "aws.ecs.task.family"; + +/** + * The ID of a running ECS task. The ID MUST be extracted from @code task.arn @endcode. + */ +static const char *kAwsEcsTaskId = "aws.ecs.task.id"; + +/** + * The revision for the task definition used to create the ECS task. + */ +static const char *kAwsEcsTaskRevision = "aws.ecs.task.revision"; + +/** + * The ARN of an EKS cluster. + */ +static const char *kAwsEksClusterArn = "aws.eks.cluster.arn"; + +/** + * The full invoked ARN as provided on the @code Context @endcode passed to the function (@code + * Lambda-Runtime-Invoked-Function-Arn @endcode header on the @code /runtime/invocation/next + * @endcode applicable). Note: This may be different from @code cloud.resource_id @endcode if an + * alias is involved. + */ +static const char *kAwsLambdaInvokedArn = "aws.lambda.invoked_arn"; + +/** + * The Amazon Resource Name(s) (ARN) of the AWS log group(s). + * Note: See the log + * group ARN format documentation. + */ +static const char *kAwsLogGroupArns = "aws.log.group.arns"; + +/** + * The name(s) of the AWS log group(s) an application is writing to. + * Note: Multiple log groups must be supported for cases like multi-container applications, where a + * single application has sidecar containers, and each write to their own log group. + */ +static const char *kAwsLogGroupNames = "aws.log.group.names"; + +/** + * The ARN(s) of the AWS log stream(s). + * Note: See the log + * stream ARN format documentation. One log group can contain several log streams, so these ARNs + * necessarily identify both a log group and a log stream. + */ +static const char *kAwsLogStreamArns = "aws.log.stream.arns"; + +/** + * The name(s) of the AWS log stream(s) an application is writing to. + */ +static const char *kAwsLogStreamNames = "aws.log.stream.names"; + +/** + * The AWS request ID as returned in the response headers @code x-amz-request-id @endcode or @code + * x-amz-requestid @endcode. + */ +static const char *kAwsRequestId = "aws.request_id"; + +/** + * The S3 bucket name the request refers to. Corresponds to the @code --bucket @endcode parameter of + * the S3 API + * operations. Note: The @code bucket @endcode attribute is applicable to all S3 operations that + * reference a bucket, i.e. that require the bucket name as a mandatory parameter. This applies to + * almost all S3 operations except @code list-buckets @endcode. + */ +static const char *kAwsS3Bucket = "aws.s3.bucket"; + +/** + * The source object (in the form @code bucket @endcode/@code key @endcode) for the copy operation. + * Note: The @code copy_source @endcode attribute applies to S3 copy operations and corresponds to + * the @code --copy-source @endcode parameter of the copy-object + * operation within the S3 API. This applies in particular to the following operations:

+ */ +static const char *kAwsS3CopySource = "aws.s3.copy_source"; + +/** + * The delete request container that specifies the objects to be deleted. + * Note: The @code delete @endcode attribute is only applicable to the delete-object + * operation. The @code delete @endcode attribute corresponds to the @code --delete @endcode + * parameter of the delete-objects + * operation within the S3 API. + */ +static const char *kAwsS3Delete = "aws.s3.delete"; + +/** + * The S3 object key the request refers to. Corresponds to the @code --key @endcode parameter of the + * S3 API + * operations. Note: The @code key @endcode attribute is applicable to all object-related S3 + * operations, i.e. that require the object key as a mandatory parameter. This applies in particular + * to the following operations:

+ */ +static const char *kAwsS3Key = "aws.s3.key"; + +/** + * The part number of the part being uploaded in a multipart-upload operation. This is a positive + * integer between 1 and 10,000. Note: The @code part_number @endcode attribute is only applicable + * to the upload-part + * and upload-part-copy + * operations. The @code part_number @endcode attribute corresponds to the @code --part-number + * @endcode parameter of the upload-part + * operation within the S3 API. + */ +static const char *kAwsS3PartNumber = "aws.s3.part_number"; + +/** + * Upload ID that identifies the multipart upload. + * Note: The @code upload_id @endcode attribute applies to S3 multipart-upload operations and + * corresponds to the @code --upload-id @endcode parameter of the S3 API multipart + * operations. This applies in particular to the following operations:

+ */ +static const char *kAwsS3UploadId = "aws.s3.upload_id"; + +// DEBUG: {"brief": "The [launch +// type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS +// task.\n", "name": "aws.ecs.launchtype", "requirement_level": "recommended", "root_namespace": +// "aws", "stability": "experimental", "type": {"allow_custom_values": true, "members": [{"brief": +// none, "deprecated": none, "id": "ec2", "note": none, "stability": "experimental", "value": +// "ec2"}, {"brief": none, "deprecated": none, "id": "fargate", "note": none, "stability": +// "experimental", "value": "fargate"}]}} +namespace AwsEcsLaunchtypeValues +{ +/** + * ec2. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "ec2", "note": none, "stability": +// "experimental", "value": "ec2"} +static constexpr const char *kEc2 = "ec2"; +/** + * fargate. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "fargate", "note": none, "stability": +// "experimental", "value": "fargate"} +static constexpr const char *kFargate = "fargate"; +} // namespace AwsEcsLaunchtypeValues + +} // namespace aws +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/az_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/az_attributes.h new file mode 100644 index 0000000000..4198f52b91 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/az_attributes.h @@ -0,0 +1,32 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace az +{ + +/** + * The unique identifier of the service request. It's generated by the Azure service and returned + * with the response. + */ +static const char *kAzServiceRequestId = "az.service_request_id"; + +} // namespace az +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/browser_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/browser_attributes.h new file mode 100644 index 0000000000..0f5b88b562 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/browser_attributes.h @@ -0,0 +1,64 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace browser +{ + +/** + * Array of brand name and version separated by a space. + * Note: This value is intended to be taken from the UA client hints API (@code + * navigator.userAgentData.brands @endcode). + */ +static const char *kBrowserBrands = "browser.brands"; + +/** + * Preferred language of the user using the browser. + * Note: This value is intended to be taken from the Navigator API @code navigator.language + * @endcode. + */ +static const char *kBrowserLanguage = "browser.language"; + +/** + * A boolean that is true if the browser is running on a mobile device. + * Note: This value is intended to be taken from the UA client hints API (@code + * navigator.userAgentData.mobile @endcode). If unavailable, this attribute SHOULD be left unset. + */ +static const char *kBrowserMobile = "browser.mobile"; + +/** + * The platform on which the browser is running. + * Note: This value is intended to be taken from the UA client hints API (@code + * navigator.userAgentData.platform @endcode). If unavailable, the legacy @code navigator.platform + * @endcode API SHOULD NOT be used instead and this attribute SHOULD be left unset in order for the + * values to be consistent. The list of possible values is defined in the W3C User-Agent Client Hints + * specification. Note that some (but not all) of these values can overlap with values in the @code os.type @endcode and @code os.name @endcode attributes. However, for + * consistency, the values in the @code browser.platform @endcode attribute should capture the exact + * value that the user agent provides. + */ +static const char *kBrowserPlatform = "browser.platform"; + +} // namespace browser +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/cicd_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/cicd_attributes.h new file mode 100644 index 0000000000..e2468fea60 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/cicd_attributes.h @@ -0,0 +1,88 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace cicd +{ + +/** + * The human readable name of the pipeline within a CI/CD system. + */ +static const char *kCicdPipelineName = "cicd.pipeline.name"; + +/** + * The unique identifier of a pipeline run within a CI/CD system. + */ +static const char *kCicdPipelineRunId = "cicd.pipeline.run.id"; + +/** + * The human readable name of a task within a pipeline. Task here most closely aligns with a computing process in a pipeline. + * Other terms for tasks include commands, steps, and procedures. + */ +static const char *kCicdPipelineTaskName = "cicd.pipeline.task.name"; + +/** + * The unique identifier of a task run within a pipeline. + */ +static const char *kCicdPipelineTaskRunId = "cicd.pipeline.task.run.id"; + +/** + * The URL of the pipeline run providing the + * complete address in order to locate and identify the pipeline run. + */ +static const char *kCicdPipelineTaskRunUrlFull = "cicd.pipeline.task.run.url.full"; + +/** + * The type of the task within a pipeline. + */ +static const char *kCicdPipelineTaskType = "cicd.pipeline.task.type"; + +// DEBUG: {"brief": "The type of the task within a pipeline.\n", "examples": ["build", "test", +// "deploy"], "name": "cicd.pipeline.task.type", "requirement_level": "recommended", +// "root_namespace": "cicd", "stability": "experimental", "type": {"allow_custom_values": true, +// "members": [{"brief": "build", "deprecated": none, "id": "build", "note": none, "stability": +// "experimental", "value": "build"}, {"brief": "test", "deprecated": none, "id": "test", "note": +// none, "stability": "experimental", "value": "test"}, {"brief": "deploy", "deprecated": none, +// "id": "deploy", "note": none, "stability": "experimental", "value": "deploy"}]}} +namespace CicdPipelineTaskTypeValues +{ +/** + * build. + */ +// DEBUG: {"brief": "build", "deprecated": none, "id": "build", "note": none, "stability": +// "experimental", "value": "build"} +static constexpr const char *kBuild = "build"; +/** + * test. + */ +// DEBUG: {"brief": "test", "deprecated": none, "id": "test", "note": none, "stability": +// "experimental", "value": "test"} +static constexpr const char *kTest = "test"; +/** + * deploy. + */ +// DEBUG: {"brief": "deploy", "deprecated": none, "id": "deploy", "note": none, "stability": +// "experimental", "value": "deploy"} +static constexpr const char *kDeploy = "deploy"; +} // namespace CicdPipelineTaskTypeValues + +} // namespace cicd +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/client_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/client_attributes.h new file mode 100644 index 0000000000..f0f095f2c1 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/client_attributes.h @@ -0,0 +1,38 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace client +{ + +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.client_attributes. @endcode. + */ +static const char *kClientAddress = "client.address"; + +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.client_attributes. @endcode. + */ +static const char *kClientPort = "client.port"; + +} // namespace client +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/cloud_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/cloud_attributes.h new file mode 100644 index 0000000000..10ba825e5e --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/cloud_attributes.h @@ -0,0 +1,377 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace cloud +{ + +/** + * The cloud account ID the resource is assigned to. + */ +static const char *kCloudAccountId = "cloud.account.id"; + +/** + * Cloud regions often have multiple, isolated locations known as zones to increase availability. + * Availability zone represents the zone where the resource is running. Note: Availability zones are + * called "zones" on Alibaba Cloud and Google Cloud. + */ +static const char *kCloudAvailabilityZone = "cloud.availability_zone"; + +/** + * The cloud platform in use. + * Note: The prefix of the service SHOULD match the one specified in @code cloud.provider @endcode. + */ +static const char *kCloudPlatform = "cloud.platform"; + +/** + * Name of the cloud provider. + */ +static const char *kCloudProvider = "cloud.provider"; + +/** + * The geographical region the resource is running. + * Note: Refer to your provider's docs to see the available regions, for example Alibaba Cloud regions, AWS regions, Azure regions, Google Cloud regions, or Tencent Cloud regions. + */ +static const char *kCloudRegion = "cloud.region"; + +/** + * Cloud provider-specific native identifier of the monitored cloud resource (e.g. an ARN on AWS, + * a fully qualified + * resource ID on Azure, a full resource + * name on GCP). Note: On some cloud providers, it may not be possible to determine the full ID + * at startup, so it may be necessary to set @code cloud.resource_id @endcode as a span attribute + * instead.

The exact value to use for @code cloud.resource_id @endcode depends on the cloud + * provider. The following well-known definitions MUST be used if you set this attribute and they + * apply:

+ */ +static const char *kCloudResourceId = "cloud.resource_id"; + +// DEBUG: {"brief": "The cloud platform in use.\n", "name": "cloud.platform", "note": "The prefix of +// the service SHOULD match the one specified in `cloud.provider`.\n", "requirement_level": +// "recommended", "root_namespace": "cloud", "stability": "experimental", "type": +// {"allow_custom_values": true, "members": [{"brief": "Alibaba Cloud Elastic Compute Service", +// "deprecated": none, "id": "alibaba_cloud_ecs", "note": none, "stability": "experimental", +// "value": "alibaba_cloud_ecs"}, {"brief": "Alibaba Cloud Function Compute", "deprecated": none, +// "id": "alibaba_cloud_fc", "note": none, "stability": "experimental", "value": +// "alibaba_cloud_fc"}, {"brief": "Red Hat OpenShift on Alibaba Cloud", "deprecated": none, "id": +// "alibaba_cloud_openshift", "note": none, "stability": "experimental", "value": +// "alibaba_cloud_openshift"}, {"brief": "AWS Elastic Compute Cloud", "deprecated": none, "id": +// "aws_ec2", "note": none, "stability": "experimental", "value": "aws_ec2"}, {"brief": "AWS Elastic +// Container Service", "deprecated": none, "id": "aws_ecs", "note": none, "stability": +// "experimental", "value": "aws_ecs"}, {"brief": "AWS Elastic Kubernetes Service", "deprecated": +// none, "id": "aws_eks", "note": none, "stability": "experimental", "value": "aws_eks"}, {"brief": +// "AWS Lambda", "deprecated": none, "id": "aws_lambda", "note": none, "stability": "experimental", +// "value": "aws_lambda"}, {"brief": "AWS Elastic Beanstalk", "deprecated": none, "id": +// "aws_elastic_beanstalk", "note": none, "stability": "experimental", "value": +// "aws_elastic_beanstalk"}, {"brief": "AWS App Runner", "deprecated": none, "id": "aws_app_runner", +// "note": none, "stability": "experimental", "value": "aws_app_runner"}, {"brief": "Red Hat +// OpenShift on AWS (ROSA)", "deprecated": none, "id": "aws_openshift", "note": none, "stability": +// "experimental", "value": "aws_openshift"}, {"brief": "Azure Virtual Machines", "deprecated": +// none, "id": "azure_vm", "note": none, "stability": "experimental", "value": "azure_vm"}, +// {"brief": "Azure Container Apps", "deprecated": none, "id": "azure_container_apps", "note": none, +// "stability": "experimental", "value": "azure_container_apps"}, {"brief": "Azure Container +// Instances", "deprecated": none, "id": "azure_container_instances", "note": none, "stability": +// "experimental", "value": "azure_container_instances"}, {"brief": "Azure Kubernetes Service", +// "deprecated": none, "id": "azure_aks", "note": none, "stability": "experimental", "value": +// "azure_aks"}, {"brief": "Azure Functions", "deprecated": none, "id": "azure_functions", "note": +// none, "stability": "experimental", "value": "azure_functions"}, {"brief": "Azure App Service", +// "deprecated": none, "id": "azure_app_service", "note": none, "stability": "experimental", +// "value": "azure_app_service"}, {"brief": "Azure Red Hat OpenShift", "deprecated": none, "id": +// "azure_openshift", "note": none, "stability": "experimental", "value": "azure_openshift"}, +// {"brief": "Google Bare Metal Solution (BMS)", "deprecated": none, "id": +// "gcp_bare_metal_solution", "note": none, "stability": "experimental", "value": +// "gcp_bare_metal_solution"}, {"brief": "Google Cloud Compute Engine (GCE)", "deprecated": none, +// "id": "gcp_compute_engine", "note": none, "stability": "experimental", "value": +// "gcp_compute_engine"}, {"brief": "Google Cloud Run", "deprecated": none, "id": "gcp_cloud_run", +// "note": none, "stability": "experimental", "value": "gcp_cloud_run"}, {"brief": "Google Cloud +// Kubernetes Engine (GKE)", "deprecated": none, "id": "gcp_kubernetes_engine", "note": none, +// "stability": "experimental", "value": "gcp_kubernetes_engine"}, {"brief": "Google Cloud Functions +// (GCF)", "deprecated": none, "id": "gcp_cloud_functions", "note": none, "stability": +// "experimental", "value": "gcp_cloud_functions"}, {"brief": "Google Cloud App Engine (GAE)", +// "deprecated": none, "id": "gcp_app_engine", "note": none, "stability": "experimental", "value": +// "gcp_app_engine"}, {"brief": "Red Hat OpenShift on Google Cloud", "deprecated": none, "id": +// "gcp_openshift", "note": none, "stability": "experimental", "value": "gcp_openshift"}, {"brief": +// "Red Hat OpenShift on IBM Cloud", "deprecated": none, "id": "ibm_cloud_openshift", "note": none, +// "stability": "experimental", "value": "ibm_cloud_openshift"}, {"brief": "Tencent Cloud Cloud +// Virtual Machine (CVM)", "deprecated": none, "id": "tencent_cloud_cvm", "note": none, "stability": +// "experimental", "value": "tencent_cloud_cvm"}, {"brief": "Tencent Cloud Elastic Kubernetes +// Service (EKS)", "deprecated": none, "id": "tencent_cloud_eks", "note": none, "stability": +// "experimental", "value": "tencent_cloud_eks"}, {"brief": "Tencent Cloud Serverless Cloud Function +// (SCF)", "deprecated": none, "id": "tencent_cloud_scf", "note": none, "stability": "experimental", +// "value": "tencent_cloud_scf"}]}} +namespace CloudPlatformValues +{ +/** + * Alibaba Cloud Elastic Compute Service. + */ +// DEBUG: {"brief": "Alibaba Cloud Elastic Compute Service", "deprecated": none, "id": +// "alibaba_cloud_ecs", "note": none, "stability": "experimental", "value": "alibaba_cloud_ecs"} +static constexpr const char *kAlibabaCloudEcs = "alibaba_cloud_ecs"; +/** + * Alibaba Cloud Function Compute. + */ +// DEBUG: {"brief": "Alibaba Cloud Function Compute", "deprecated": none, "id": "alibaba_cloud_fc", +// "note": none, "stability": "experimental", "value": "alibaba_cloud_fc"} +static constexpr const char *kAlibabaCloudFc = "alibaba_cloud_fc"; +/** + * Red Hat OpenShift on Alibaba Cloud. + */ +// DEBUG: {"brief": "Red Hat OpenShift on Alibaba Cloud", "deprecated": none, "id": +// "alibaba_cloud_openshift", "note": none, "stability": "experimental", "value": +// "alibaba_cloud_openshift"} +static constexpr const char *kAlibabaCloudOpenshift = "alibaba_cloud_openshift"; +/** + * AWS Elastic Compute Cloud. + */ +// DEBUG: {"brief": "AWS Elastic Compute Cloud", "deprecated": none, "id": "aws_ec2", "note": none, +// "stability": "experimental", "value": "aws_ec2"} +static constexpr const char *kAwsEc2 = "aws_ec2"; +/** + * AWS Elastic Container Service. + */ +// DEBUG: {"brief": "AWS Elastic Container Service", "deprecated": none, "id": "aws_ecs", "note": +// none, "stability": "experimental", "value": "aws_ecs"} +static constexpr const char *kAwsEcs = "aws_ecs"; +/** + * AWS Elastic Kubernetes Service. + */ +// DEBUG: {"brief": "AWS Elastic Kubernetes Service", "deprecated": none, "id": "aws_eks", "note": +// none, "stability": "experimental", "value": "aws_eks"} +static constexpr const char *kAwsEks = "aws_eks"; +/** + * AWS Lambda. + */ +// DEBUG: {"brief": "AWS Lambda", "deprecated": none, "id": "aws_lambda", "note": none, "stability": +// "experimental", "value": "aws_lambda"} +static constexpr const char *kAwsLambda = "aws_lambda"; +/** + * AWS Elastic Beanstalk. + */ +// DEBUG: {"brief": "AWS Elastic Beanstalk", "deprecated": none, "id": "aws_elastic_beanstalk", +// "note": none, "stability": "experimental", "value": "aws_elastic_beanstalk"} +static constexpr const char *kAwsElasticBeanstalk = "aws_elastic_beanstalk"; +/** + * AWS App Runner. + */ +// DEBUG: {"brief": "AWS App Runner", "deprecated": none, "id": "aws_app_runner", "note": none, +// "stability": "experimental", "value": "aws_app_runner"} +static constexpr const char *kAwsAppRunner = "aws_app_runner"; +/** + * Red Hat OpenShift on AWS (ROSA). + */ +// DEBUG: {"brief": "Red Hat OpenShift on AWS (ROSA)", "deprecated": none, "id": "aws_openshift", +// "note": none, "stability": "experimental", "value": "aws_openshift"} +static constexpr const char *kAwsOpenshift = "aws_openshift"; +/** + * Azure Virtual Machines. + */ +// DEBUG: {"brief": "Azure Virtual Machines", "deprecated": none, "id": "azure_vm", "note": none, +// "stability": "experimental", "value": "azure_vm"} +static constexpr const char *kAzureVm = "azure_vm"; +/** + * Azure Container Apps. + */ +// DEBUG: {"brief": "Azure Container Apps", "deprecated": none, "id": "azure_container_apps", +// "note": none, "stability": "experimental", "value": "azure_container_apps"} +static constexpr const char *kAzureContainerApps = "azure_container_apps"; +/** + * Azure Container Instances. + */ +// DEBUG: {"brief": "Azure Container Instances", "deprecated": none, "id": +// "azure_container_instances", "note": none, "stability": "experimental", "value": +// "azure_container_instances"} +static constexpr const char *kAzureContainerInstances = "azure_container_instances"; +/** + * Azure Kubernetes Service. + */ +// DEBUG: {"brief": "Azure Kubernetes Service", "deprecated": none, "id": "azure_aks", "note": none, +// "stability": "experimental", "value": "azure_aks"} +static constexpr const char *kAzureAks = "azure_aks"; +/** + * Azure Functions. + */ +// DEBUG: {"brief": "Azure Functions", "deprecated": none, "id": "azure_functions", "note": none, +// "stability": "experimental", "value": "azure_functions"} +static constexpr const char *kAzureFunctions = "azure_functions"; +/** + * Azure App Service. + */ +// DEBUG: {"brief": "Azure App Service", "deprecated": none, "id": "azure_app_service", "note": +// none, "stability": "experimental", "value": "azure_app_service"} +static constexpr const char *kAzureAppService = "azure_app_service"; +/** + * Azure Red Hat OpenShift. + */ +// DEBUG: {"brief": "Azure Red Hat OpenShift", "deprecated": none, "id": "azure_openshift", "note": +// none, "stability": "experimental", "value": "azure_openshift"} +static constexpr const char *kAzureOpenshift = "azure_openshift"; +/** + * Google Bare Metal Solution (BMS). + */ +// DEBUG: {"brief": "Google Bare Metal Solution (BMS)", "deprecated": none, "id": +// "gcp_bare_metal_solution", "note": none, "stability": "experimental", "value": +// "gcp_bare_metal_solution"} +static constexpr const char *kGcpBareMetalSolution = "gcp_bare_metal_solution"; +/** + * Google Cloud Compute Engine (GCE). + */ +// DEBUG: {"brief": "Google Cloud Compute Engine (GCE)", "deprecated": none, "id": +// "gcp_compute_engine", "note": none, "stability": "experimental", "value": "gcp_compute_engine"} +static constexpr const char *kGcpComputeEngine = "gcp_compute_engine"; +/** + * Google Cloud Run. + */ +// DEBUG: {"brief": "Google Cloud Run", "deprecated": none, "id": "gcp_cloud_run", "note": none, +// "stability": "experimental", "value": "gcp_cloud_run"} +static constexpr const char *kGcpCloudRun = "gcp_cloud_run"; +/** + * Google Cloud Kubernetes Engine (GKE). + */ +// DEBUG: {"brief": "Google Cloud Kubernetes Engine (GKE)", "deprecated": none, "id": +// "gcp_kubernetes_engine", "note": none, "stability": "experimental", "value": +// "gcp_kubernetes_engine"} +static constexpr const char *kGcpKubernetesEngine = "gcp_kubernetes_engine"; +/** + * Google Cloud Functions (GCF). + */ +// DEBUG: {"brief": "Google Cloud Functions (GCF)", "deprecated": none, "id": "gcp_cloud_functions", +// "note": none, "stability": "experimental", "value": "gcp_cloud_functions"} +static constexpr const char *kGcpCloudFunctions = "gcp_cloud_functions"; +/** + * Google Cloud App Engine (GAE). + */ +// DEBUG: {"brief": "Google Cloud App Engine (GAE)", "deprecated": none, "id": "gcp_app_engine", +// "note": none, "stability": "experimental", "value": "gcp_app_engine"} +static constexpr const char *kGcpAppEngine = "gcp_app_engine"; +/** + * Red Hat OpenShift on Google Cloud. + */ +// DEBUG: {"brief": "Red Hat OpenShift on Google Cloud", "deprecated": none, "id": "gcp_openshift", +// "note": none, "stability": "experimental", "value": "gcp_openshift"} +static constexpr const char *kGcpOpenshift = "gcp_openshift"; +/** + * Red Hat OpenShift on IBM Cloud. + */ +// DEBUG: {"brief": "Red Hat OpenShift on IBM Cloud", "deprecated": none, "id": +// "ibm_cloud_openshift", "note": none, "stability": "experimental", "value": "ibm_cloud_openshift"} +static constexpr const char *kIbmCloudOpenshift = "ibm_cloud_openshift"; +/** + * Tencent Cloud Cloud Virtual Machine (CVM). + */ +// DEBUG: {"brief": "Tencent Cloud Cloud Virtual Machine (CVM)", "deprecated": none, "id": +// "tencent_cloud_cvm", "note": none, "stability": "experimental", "value": "tencent_cloud_cvm"} +static constexpr const char *kTencentCloudCvm = "tencent_cloud_cvm"; +/** + * Tencent Cloud Elastic Kubernetes Service (EKS). + */ +// DEBUG: {"brief": "Tencent Cloud Elastic Kubernetes Service (EKS)", "deprecated": none, "id": +// "tencent_cloud_eks", "note": none, "stability": "experimental", "value": "tencent_cloud_eks"} +static constexpr const char *kTencentCloudEks = "tencent_cloud_eks"; +/** + * Tencent Cloud Serverless Cloud Function (SCF). + */ +// DEBUG: {"brief": "Tencent Cloud Serverless Cloud Function (SCF)", "deprecated": none, "id": +// "tencent_cloud_scf", "note": none, "stability": "experimental", "value": "tencent_cloud_scf"} +static constexpr const char *kTencentCloudScf = "tencent_cloud_scf"; +} // namespace CloudPlatformValues + +// DEBUG: {"brief": "Name of the cloud provider.\n", "name": "cloud.provider", "requirement_level": +// "recommended", "root_namespace": "cloud", "stability": "experimental", "type": +// {"allow_custom_values": true, "members": [{"brief": "Alibaba Cloud", "deprecated": none, "id": +// "alibaba_cloud", "note": none, "stability": "experimental", "value": "alibaba_cloud"}, {"brief": +// "Amazon Web Services", "deprecated": none, "id": "aws", "note": none, "stability": +// "experimental", "value": "aws"}, {"brief": "Microsoft Azure", "deprecated": none, "id": "azure", +// "note": none, "stability": "experimental", "value": "azure"}, {"brief": "Google Cloud Platform", +// "deprecated": none, "id": "gcp", "note": none, "stability": "experimental", "value": "gcp"}, +// {"brief": "Heroku Platform as a Service", "deprecated": none, "id": "heroku", "note": none, +// "stability": "experimental", "value": "heroku"}, {"brief": "IBM Cloud", "deprecated": none, "id": +// "ibm_cloud", "note": none, "stability": "experimental", "value": "ibm_cloud"}, {"brief": "Tencent +// Cloud", "deprecated": none, "id": "tencent_cloud", "note": none, "stability": "experimental", +// "value": "tencent_cloud"}]}} +namespace CloudProviderValues +{ +/** + * Alibaba Cloud. + */ +// DEBUG: {"brief": "Alibaba Cloud", "deprecated": none, "id": "alibaba_cloud", "note": none, +// "stability": "experimental", "value": "alibaba_cloud"} +static constexpr const char *kAlibabaCloud = "alibaba_cloud"; +/** + * Amazon Web Services. + */ +// DEBUG: {"brief": "Amazon Web Services", "deprecated": none, "id": "aws", "note": none, +// "stability": "experimental", "value": "aws"} +static constexpr const char *kAws = "aws"; +/** + * Microsoft Azure. + */ +// DEBUG: {"brief": "Microsoft Azure", "deprecated": none, "id": "azure", "note": none, "stability": +// "experimental", "value": "azure"} +static constexpr const char *kAzure = "azure"; +/** + * Google Cloud Platform. + */ +// DEBUG: {"brief": "Google Cloud Platform", "deprecated": none, "id": "gcp", "note": none, +// "stability": "experimental", "value": "gcp"} +static constexpr const char *kGcp = "gcp"; +/** + * Heroku Platform as a Service. + */ +// DEBUG: {"brief": "Heroku Platform as a Service", "deprecated": none, "id": "heroku", "note": +// none, "stability": "experimental", "value": "heroku"} +static constexpr const char *kHeroku = "heroku"; +/** + * IBM Cloud. + */ +// DEBUG: {"brief": "IBM Cloud", "deprecated": none, "id": "ibm_cloud", "note": none, "stability": +// "experimental", "value": "ibm_cloud"} +static constexpr const char *kIbmCloud = "ibm_cloud"; +/** + * Tencent Cloud. + */ +// DEBUG: {"brief": "Tencent Cloud", "deprecated": none, "id": "tencent_cloud", "note": none, +// "stability": "experimental", "value": "tencent_cloud"} +static constexpr const char *kTencentCloud = "tencent_cloud"; +} // namespace CloudProviderValues + +} // namespace cloud +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/cloudevents_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/cloudevents_attributes.h new file mode 100644 index 0000000000..ca70d2d2d9 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/cloudevents_attributes.h @@ -0,0 +1,60 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace cloudevents +{ + +/** + * The event_id + * uniquely identifies the event. + */ +static const char *kCloudeventsEventId = "cloudevents.event_id"; + +/** + * The source + * identifies the context in which an event happened. + */ +static const char *kCloudeventsEventSource = "cloudevents.event_source"; + +/** + * The version of + * the CloudEvents specification which the event uses. + */ +static const char *kCloudeventsEventSpecVersion = "cloudevents.event_spec_version"; + +/** + * The subject of + * the event in the context of the event producer (identified by source). + */ +static const char *kCloudeventsEventSubject = "cloudevents.event_subject"; + +/** + * The event_type + * contains a value describing the type of event related to the originating occurrence. + */ +static const char *kCloudeventsEventType = "cloudevents.event_type"; + +} // namespace cloudevents +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/code_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/code_attributes.h new file mode 100644 index 0000000000..5a2fcdefd4 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/code_attributes.h @@ -0,0 +1,62 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace code +{ + +/** + * The column number in @code code.filepath @endcode best representing the operation. It SHOULD + * point within the code unit named in @code code.function @endcode. + */ +static const char *kCodeColumn = "code.column"; + +/** + * The source code file name that identifies the code unit as uniquely as possible (preferably an + * absolute file path). + */ +static const char *kCodeFilepath = "code.filepath"; + +/** + * The method or function name, or equivalent (usually rightmost part of the code unit's name). + */ +static const char *kCodeFunction = "code.function"; + +/** + * The line number in @code code.filepath @endcode best representing the operation. It SHOULD point + * within the code unit named in @code code.function @endcode. + */ +static const char *kCodeLineno = "code.lineno"; + +/** + * The "namespace" within which @code code.function @endcode is defined. Usually the qualified class + * or module name, such that @code code.namespace @endcode + some separator + @code code.function + * @endcode form a unique identifier for the code unit. + */ +static const char *kCodeNamespace = "code.namespace"; + +/** + * A stacktrace as a string in the natural representation for the language runtime. The + * representation is to be determined and documented by each language SIG. + */ +static const char *kCodeStacktrace = "code.stacktrace"; + +} // namespace code +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/container_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/container_attributes.h new file mode 100644 index 0000000000..beb5bf684a --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/container_attributes.h @@ -0,0 +1,149 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace container +{ + +/** + * The command used to run the container (i.e. the command name). + * Note: If using embedded credentials or sensitive data, it is recommended to remove them to + * prevent potential leakage. + */ +static const char *kContainerCommand = "container.command"; + +/** + * All the command arguments (including the command/executable itself) run by the container. [2]. + */ +static const char *kContainerCommandArgs = "container.command_args"; + +/** + * The full command run by the container as a single string representing the full command. [2]. + */ +static const char *kContainerCommandLine = "container.command_line"; + +/** + * @Deprecated: Replaced by @code cpu.mode @endcode. + */ +static const char *kContainerCpuState = "container.cpu.state"; + +/** + * Container ID. Usually a UUID, as for example used to identify Docker + * containers. The UUID might be abbreviated. + */ +static const char *kContainerId = "container.id"; + +/** + * Runtime specific image identifier. Usually a hash algorithm followed by a UUID. + * Note: Docker defines a sha256 of the image id; @code container.image.id @endcode corresponds to + * the @code Image @endcode field from the Docker container inspect API + * endpoint. K8s defines a link to the container registry repository with digest @code "imageID": + * "registry.azurecr.io + * /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625" + * @endcode. The ID is assigned by the container runtime and can vary in different environments. + * Consider using @code oci.manifest.digest @endcode if it is important to identify the same image + * in different environments/runtimes. + */ +static const char *kContainerImageId = "container.image.id"; + +/** + * Name of the image the container was built on. + */ +static const char *kContainerImageName = "container.image.name"; + +/** + * Repo digests of the container image as provided by the container runtime. + * Note: Docker and + * CRI + * report those under the @code RepoDigests @endcode field. + */ +static const char *kContainerImageRepoDigests = "container.image.repo_digests"; + +/** + * Container image tags. An example can be found in Docker Image + * Inspect. Should be only the @code @endcode section of the full name for example from + * @code registry.example.com/my-org/my-image: @endcode. + */ +static const char *kContainerImageTags = "container.image.tags"; + +/** + * Container labels, @code @endcode being the label name, the value being the label value. + */ +static const char *kContainerLabel = "container.label"; + +/** + * @Deprecated: Replaced by @code container.label @endcode. + */ +static const char *kContainerLabels = "container.labels"; + +/** + * Container name used by container runtime. + */ +static const char *kContainerName = "container.name"; + +/** + * The container runtime managing this container. + */ +static const char *kContainerRuntime = "container.runtime"; + +// @deprecated(reason="The attribute container.cpu.state is deprecated - Replaced by `cpu.mode`") # +// type: ignore DEBUG: {"brief": "Deprecated, use `cpu.mode` instead.", "deprecated": "Replaced by +// `cpu.mode`", "examples": ["user", "kernel"], "name": "container.cpu.state", "requirement_level": +// "recommended", "root_namespace": "container", "stability": "experimental", "type": +// {"allow_custom_values": true, "members": [{"brief": "When tasks of the cgroup are in user mode +// (Linux). When all container processes are in user mode (Windows).", "deprecated": none, "id": +// "user", "note": none, "stability": "experimental", "value": "user"}, {"brief": "When CPU is used +// by the system (host OS)", "deprecated": none, "id": "system", "note": none, "stability": +// "experimental", "value": "system"}, {"brief": "When tasks of the cgroup are in kernel mode +// (Linux). When all container processes are in kernel mode (Windows).", "deprecated": none, "id": +// "kernel", "note": none, "stability": "experimental", "value": "kernel"}]}} +namespace ContainerCpuStateValues +{ +/** + * When tasks of the cgroup are in user mode (Linux). When all container processes are in user mode + * (Windows). + */ +// DEBUG: {"brief": "When tasks of the cgroup are in user mode (Linux). When all container processes +// are in user mode (Windows).", "deprecated": none, "id": "user", "note": none, "stability": +// "experimental", "value": "user"} +static constexpr const char *kUser = "user"; +/** + * When CPU is used by the system (host OS). + */ +// DEBUG: {"brief": "When CPU is used by the system (host OS)", "deprecated": none, "id": "system", +// "note": none, "stability": "experimental", "value": "system"} +static constexpr const char *kSystem = "system"; +/** + * When tasks of the cgroup are in kernel mode (Linux). When all container processes are in kernel + * mode (Windows). + */ +// DEBUG: {"brief": "When tasks of the cgroup are in kernel mode (Linux). When all container +// processes are in kernel mode (Windows).", "deprecated": none, "id": "kernel", "note": none, +// "stability": "experimental", "value": "kernel"} +static constexpr const char *kKernel = "kernel"; +} // namespace ContainerCpuStateValues + +} // namespace container +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/cpu_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/cpu_attributes.h new file mode 100644 index 0000000000..7298e3929c --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/cpu_attributes.h @@ -0,0 +1,96 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace cpu +{ + +/** + * The mode of the CPU. + */ +static const char *kCpuMode = "cpu.mode"; + +// DEBUG: {"brief": "The mode of the CPU", "examples": ["user", "system"], "name": "cpu.mode", +// "requirement_level": "recommended", "root_namespace": "cpu", "stability": "experimental", "type": +// {"allow_custom_values": true, "members": [{"brief": none, "deprecated": none, "id": "user", +// "note": none, "stability": "experimental", "value": "user"}, {"brief": none, "deprecated": none, +// "id": "system", "note": none, "stability": "experimental", "value": "system"}, {"brief": none, +// "deprecated": none, "id": "nice", "note": none, "stability": "experimental", "value": "nice"}, +// {"brief": none, "deprecated": none, "id": "idle", "note": none, "stability": "experimental", +// "value": "idle"}, {"brief": none, "deprecated": none, "id": "iowait", "note": none, "stability": +// "experimental", "value": "iowait"}, {"brief": none, "deprecated": none, "id": "interrupt", +// "note": none, "stability": "experimental", "value": "interrupt"}, {"brief": none, "deprecated": +// none, "id": "steal", "note": none, "stability": "experimental", "value": "steal"}, {"brief": +// none, "deprecated": none, "id": "kernel", "note": none, "stability": "experimental", "value": +// "kernel"}]}} +namespace CpuModeValues +{ +/** + * user. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "user", "note": none, "stability": +// "experimental", "value": "user"} +static constexpr const char *kUser = "user"; +/** + * system. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "system", "note": none, "stability": +// "experimental", "value": "system"} +static constexpr const char *kSystem = "system"; +/** + * nice. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "nice", "note": none, "stability": +// "experimental", "value": "nice"} +static constexpr const char *kNice = "nice"; +/** + * idle. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "idle", "note": none, "stability": +// "experimental", "value": "idle"} +static constexpr const char *kIdle = "idle"; +/** + * iowait. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "iowait", "note": none, "stability": +// "experimental", "value": "iowait"} +static constexpr const char *kIowait = "iowait"; +/** + * interrupt. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "interrupt", "note": none, "stability": +// "experimental", "value": "interrupt"} +static constexpr const char *kInterrupt = "interrupt"; +/** + * steal. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "steal", "note": none, "stability": +// "experimental", "value": "steal"} +static constexpr const char *kSteal = "steal"; +/** + * kernel. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "kernel", "note": none, "stability": +// "experimental", "value": "kernel"} +static constexpr const char *kKernel = "kernel"; +} // namespace CpuModeValues + +} // namespace cpu +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/db_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/db_attributes.h new file mode 100644 index 0000000000..19137c8747 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/db_attributes.h @@ -0,0 +1,964 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace db +{ + +/** + * The consistency level of the query. Based on consistency values from CQL. + */ +static const char *kDbCassandraConsistencyLevel = "db.cassandra.consistency_level"; + +/** + * The data center of the coordinating node for a query. + */ +static const char *kDbCassandraCoordinatorDc = "db.cassandra.coordinator.dc"; + +/** + * The ID of the coordinating node for a query. + */ +static const char *kDbCassandraCoordinatorId = "db.cassandra.coordinator.id"; + +/** + * Whether or not the query is idempotent. + */ +static const char *kDbCassandraIdempotence = "db.cassandra.idempotence"; + +/** + * The fetch size used for paging, i.e. how many rows will be returned at once. + */ +static const char *kDbCassandraPageSize = "db.cassandra.page_size"; + +/** + * The number of times a query was speculatively executed. Not set or @code 0 @endcode if the query + * was not executed speculatively. + */ +static const char *kDbCassandraSpeculativeExecutionCount = + "db.cassandra.speculative_execution_count"; + +/** + * @Deprecated: Replaced by @code db.collection.name @endcode. + */ +static const char *kDbCassandraTable = "db.cassandra.table"; + +/** + * The name of the connection pool; unique within the instrumented application. In case the + * connection pool implementation doesn't provide a name, instrumentation SHOULD use a combination + * of parameters that would make the name unique, for example, combining attributes @code + * server.address @endcode, @code server.port @endcode, and @code db.namespace @endcode, formatted + * as @code server.address:server.port/db.namespace @endcode. Instrumentations that generate + * connection pool name following different patterns SHOULD document it. + */ +static const char *kDbClientConnectionPoolName = "db.client.connection.pool.name"; + +/** + * The state of a connection in the pool. + */ +static const char *kDbClientConnectionState = "db.client.connection.state"; + +/** + * @Deprecated: Replaced by @code db.client.connection.pool.name @endcode. + */ +static const char *kDbClientConnectionsPoolName = "db.client.connections.pool.name"; + +/** + * @Deprecated: Replaced by @code db.client.connection.state @endcode. + */ +static const char *kDbClientConnectionsState = "db.client.connections.state"; + +/** + * The name of a collection (table, container) within the database. + * Note: It is RECOMMENDED to capture the value as provided by the application without attempting to + * do any case normalization. If the collection name is parsed from the query text, it SHOULD be the + * first collection name found in the query and it SHOULD match the value provided in the query text + * including any schema and database name prefix. For batch operations, if the individual operations + * are known to have the same collection name then that collection name SHOULD be used, otherwise + * @code db.collection.name @endcode SHOULD NOT be captured. + */ +static const char *kDbCollectionName = "db.collection.name"; + +/** + * @Deprecated: "Replaced by @code server.address @endcode and @code server.port @endcode.". + */ +static const char *kDbConnectionString = "db.connection_string"; + +/** + * Unique Cosmos client instance id. + */ +static const char *kDbCosmosdbClientId = "db.cosmosdb.client_id"; + +/** + * Cosmos client connection mode. + */ +static const char *kDbCosmosdbConnectionMode = "db.cosmosdb.connection_mode"; + +/** + * @Deprecated: Replaced by @code db.collection.name @endcode. + */ +static const char *kDbCosmosdbContainer = "db.cosmosdb.container"; + +/** + * CosmosDB Operation Type. + */ +static const char *kDbCosmosdbOperationType = "db.cosmosdb.operation_type"; + +/** + * RU consumed for that operation. + */ +static const char *kDbCosmosdbRequestCharge = "db.cosmosdb.request_charge"; + +/** + * Request payload size in bytes. + */ +static const char *kDbCosmosdbRequestContentLength = "db.cosmosdb.request_content_length"; + +/** + * Cosmos DB status code. + */ +static const char *kDbCosmosdbStatusCode = "db.cosmosdb.status_code"; + +/** + * Cosmos DB sub status code. + */ +static const char *kDbCosmosdbSubStatusCode = "db.cosmosdb.sub_status_code"; + +/** + * @Deprecated: Replaced by @code db.namespace @endcode. + */ +static const char *kDbElasticsearchClusterName = "db.elasticsearch.cluster.name"; + +/** + * Represents the human-readable identifier of the node/instance to which a request was routed. + */ +static const char *kDbElasticsearchNodeName = "db.elasticsearch.node.name"; + +/** + * A dynamic value in the url path. + * Note: Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span + * attributes in the format @code db.elasticsearch.path_parts. @endcode, where @code + * @endcode is the url path part name. The implementation SHOULD reference the elasticsearch + * schema in order to map the path part values to their names. + */ +static const char *kDbElasticsearchPathParts = "db.elasticsearch.path_parts"; + +/** + * @Deprecated: Deprecated, no general replacement at this time. For Elasticsearch, use @code + * db.elasticsearch.node.name @endcode instead. + */ +static const char *kDbInstanceId = "db.instance.id"; + +/** + * @Deprecated: Removed as not used. + */ +static const char *kDbJdbcDriverClassname = "db.jdbc.driver_classname"; + +/** + * @Deprecated: Replaced by @code db.collection.name @endcode. + */ +static const char *kDbMongodbCollection = "db.mongodb.collection"; + +/** + * @Deprecated: Deprecated, no replacement at this time. + */ +static const char *kDbMssqlInstanceName = "db.mssql.instance_name"; + +/** + * @Deprecated: Replaced by @code db.namespace @endcode. + */ +static const char *kDbName = "db.name"; + +/** + * The name of the database, fully qualified within the server address and port. + * Note: If a database system has multiple namespace components, they SHOULD be concatenated + * (potentially using database system specific conventions) from most general to most specific + * namespace component, and more specific namespaces SHOULD NOT be captured without the more general + * namespaces, to ensure that "startswith" queries for the more general namespaces will be valid. + * Semantic conventions for individual database systems SHOULD document what @code db.namespace + * @endcode means in the context of that system. It is RECOMMENDED to capture the value as provided + * by the application without attempting to do any case normalization. + */ +static const char *kDbNamespace = "db.namespace"; + +/** + * @Deprecated: Replaced by @code db.operation.name @endcode. + */ +static const char *kDbOperation = "db.operation"; + +/** + * The number of queries included in a batch operation. Note: Operations + * are only considered batches when they contain two or more operations, and so @code + * db.operation.batch.size @endcode SHOULD never be @code 1 @endcode. + */ +static const char *kDbOperationBatchSize = "db.operation.batch.size"; + +/** + * The name of the operation or command being executed. + * Note: It is RECOMMENDED to capture the value as provided by the application without attempting to + * do any case normalization. If the operation name is parsed from the query text, it SHOULD be the + * first operation name found in the query. For batch operations, if the individual operations are + * known to have the same operation name then that operation name SHOULD be used prepended by @code + * BATCH @endcode, otherwise @code db.operation.name @endcode SHOULD be @code BATCH @endcode or + * some other database system specific term if more applicable. + */ +static const char *kDbOperationName = "db.operation.name"; + +/** + * A query parameter used in @code db.query.text @endcode, with @code @endcode being the + * parameter name, and the attribute value being a string representation of the parameter value. + * Note: Query parameters should only be captured when @code db.query.text @endcode is parameterized + * with placeholders. If a parameter has no name and instead is referenced only by index, then @code + * @endcode SHOULD be the 0-based index. + */ +static const char *kDbQueryParameter = "db.query.parameter"; + +/** + * The database query being executed. + * Note: For sanitization see Sanitization of @code + * db.query.text @endcode. For batch operations, if the individual operations are known to have + * the same query text then that query text SHOULD be used, otherwise all of the individual query + * texts SHOULD be concatenated with separator @code ; @endcode or some other database system + * specific separator if more applicable. Even though parameterized query text can potentially have + * sensitive data, by using a parameterized query the user is giving a strong signal that any + * sensitive data will be passed as parameter values, and the benefit to observability of capturing + * the static part of the query text by default outweighs the risk. + */ +static const char *kDbQueryText = "db.query.text"; + +/** + * @Deprecated: Replaced by @code db.namespace @endcode. + */ +static const char *kDbRedisDatabaseIndex = "db.redis.database_index"; + +/** + * @Deprecated: Replaced by @code db.collection.name @endcode. + */ +static const char *kDbSqlTable = "db.sql.table"; + +/** + * @Deprecated: Replaced by @code db.query.text @endcode. + */ +static const char *kDbStatement = "db.statement"; + +/** + * The database management system (DBMS) product as identified by the client instrumentation. + * Note: The actual DBMS may differ from the one identified by the client. For example, when using + * PostgreSQL client libraries to connect to a CockroachDB, the @code db.system @endcode is set to + * @code postgresql @endcode based on the instrumentation's best knowledge. + */ +static const char *kDbSystem = "db.system"; + +/** + * @Deprecated: No replacement at this time. + */ +static const char *kDbUser = "db.user"; + +// DEBUG: {"brief": "The consistency level of the query. Based on consistency values from +// [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html).\n", +// "name": "db.cassandra.consistency_level", "requirement_level": "recommended", "root_namespace": +// "db", "stability": "experimental", "type": {"allow_custom_values": true, "members": [{"brief": +// none, "deprecated": none, "id": "all", "note": none, "stability": "experimental", "value": +// "all"}, {"brief": none, "deprecated": none, "id": "each_quorum", "note": none, "stability": +// "experimental", "value": "each_quorum"}, {"brief": none, "deprecated": none, "id": "quorum", +// "note": none, "stability": "experimental", "value": "quorum"}, {"brief": none, "deprecated": +// none, "id": "local_quorum", "note": none, "stability": "experimental", "value": "local_quorum"}, +// {"brief": none, "deprecated": none, "id": "one", "note": none, "stability": "experimental", +// "value": "one"}, {"brief": none, "deprecated": none, "id": "two", "note": none, "stability": +// "experimental", "value": "two"}, {"brief": none, "deprecated": none, "id": "three", "note": none, +// "stability": "experimental", "value": "three"}, {"brief": none, "deprecated": none, "id": +// "local_one", "note": none, "stability": "experimental", "value": "local_one"}, {"brief": none, +// "deprecated": none, "id": "any", "note": none, "stability": "experimental", "value": "any"}, +// {"brief": none, "deprecated": none, "id": "serial", "note": none, "stability": "experimental", +// "value": "serial"}, {"brief": none, "deprecated": none, "id": "local_serial", "note": none, +// "stability": "experimental", "value": "local_serial"}]}} +namespace DbCassandraConsistencyLevelValues +{ +/** + * all. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "all", "note": none, "stability": +// "experimental", "value": "all"} +static constexpr const char *kAll = "all"; +/** + * each_quorum. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "each_quorum", "note": none, "stability": +// "experimental", "value": "each_quorum"} +static constexpr const char *kEachQuorum = "each_quorum"; +/** + * quorum. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "quorum", "note": none, "stability": +// "experimental", "value": "quorum"} +static constexpr const char *kQuorum = "quorum"; +/** + * local_quorum. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "local_quorum", "note": none, "stability": +// "experimental", "value": "local_quorum"} +static constexpr const char *kLocalQuorum = "local_quorum"; +/** + * one. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "one", "note": none, "stability": +// "experimental", "value": "one"} +static constexpr const char *kOne = "one"; +/** + * two. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "two", "note": none, "stability": +// "experimental", "value": "two"} +static constexpr const char *kTwo = "two"; +/** + * three. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "three", "note": none, "stability": +// "experimental", "value": "three"} +static constexpr const char *kThree = "three"; +/** + * local_one. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "local_one", "note": none, "stability": +// "experimental", "value": "local_one"} +static constexpr const char *kLocalOne = "local_one"; +/** + * any. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "any", "note": none, "stability": +// "experimental", "value": "any"} +static constexpr const char *kAny = "any"; +/** + * serial. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "serial", "note": none, "stability": +// "experimental", "value": "serial"} +static constexpr const char *kSerial = "serial"; +/** + * local_serial. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "local_serial", "note": none, "stability": +// "experimental", "value": "local_serial"} +static constexpr const char *kLocalSerial = "local_serial"; +} // namespace DbCassandraConsistencyLevelValues + +// DEBUG: {"brief": "The state of a connection in the pool", "examples": ["idle"], "name": +// "db.client.connection.state", "requirement_level": "recommended", "root_namespace": "db", +// "stability": "experimental", "type": {"allow_custom_values": true, "members": [{"brief": none, +// "deprecated": none, "id": "idle", "note": none, "stability": "experimental", "value": "idle"}, +// {"brief": none, "deprecated": none, "id": "used", "note": none, "stability": "experimental", +// "value": "used"}]}} +namespace DbClientConnectionStateValues +{ +/** + * idle. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "idle", "note": none, "stability": +// "experimental", "value": "idle"} +static constexpr const char *kIdle = "idle"; +/** + * used. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "used", "note": none, "stability": +// "experimental", "value": "used"} +static constexpr const char *kUsed = "used"; +} // namespace DbClientConnectionStateValues + +// @deprecated(reason="The attribute db.client.connections.state is deprecated - Replaced by +// `db.client.connection.state`") # type: ignore DEBUG: {"brief": "Deprecated, use +// `db.client.connection.state` instead.", "deprecated": "Replaced by +// `db.client.connection.state`.", "examples": ["idle"], "name": "db.client.connections.state", +// "requirement_level": "recommended", "root_namespace": "db", "stability": "experimental", "type": +// {"allow_custom_values": true, "members": [{"brief": none, "deprecated": none, "id": "idle", +// "note": none, "stability": "experimental", "value": "idle"}, {"brief": none, "deprecated": none, +// "id": "used", "note": none, "stability": "experimental", "value": "used"}]}} +namespace DbClientConnectionsStateValues +{ +/** + * idle. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "idle", "note": none, "stability": +// "experimental", "value": "idle"} +static constexpr const char *kIdle = "idle"; +/** + * used. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "used", "note": none, "stability": +// "experimental", "value": "used"} +static constexpr const char *kUsed = "used"; +} // namespace DbClientConnectionsStateValues + +// DEBUG: {"brief": "Cosmos client connection mode.", "name": "db.cosmosdb.connection_mode", +// "requirement_level": "recommended", "root_namespace": "db", "stability": "experimental", "type": +// {"allow_custom_values": true, "members": [{"brief": "Gateway (HTTP) connections mode", +// "deprecated": none, "id": "gateway", "note": none, "stability": "experimental", "value": +// "gateway"}, {"brief": "Direct connection.", "deprecated": none, "id": "direct", "note": none, +// "stability": "experimental", "value": "direct"}]}} +namespace DbCosmosdbConnectionModeValues +{ +/** + * Gateway (HTTP) connections mode. + */ +// DEBUG: {"brief": "Gateway (HTTP) connections mode", "deprecated": none, "id": "gateway", "note": +// none, "stability": "experimental", "value": "gateway"} +static constexpr const char *kGateway = "gateway"; +/** + * Direct connection. + */ +// DEBUG: {"brief": "Direct connection.", "deprecated": none, "id": "direct", "note": none, +// "stability": "experimental", "value": "direct"} +static constexpr const char *kDirect = "direct"; +} // namespace DbCosmosdbConnectionModeValues + +// DEBUG: {"brief": "CosmosDB Operation Type.", "name": "db.cosmosdb.operation_type", +// "requirement_level": "recommended", "root_namespace": "db", "stability": "experimental", "type": +// {"allow_custom_values": true, "members": [{"brief": none, "deprecated": none, "id": "invalid", +// "note": none, "stability": "experimental", "value": "Invalid"}, {"brief": none, "deprecated": +// none, "id": "create", "note": none, "stability": "experimental", "value": "Create"}, {"brief": +// none, "deprecated": none, "id": "patch", "note": none, "stability": "experimental", "value": +// "Patch"}, {"brief": none, "deprecated": none, "id": "read", "note": none, "stability": +// "experimental", "value": "Read"}, {"brief": none, "deprecated": none, "id": "read_feed", "note": +// none, "stability": "experimental", "value": "ReadFeed"}, {"brief": none, "deprecated": none, +// "id": "delete", "note": none, "stability": "experimental", "value": "Delete"}, {"brief": none, +// "deprecated": none, "id": "replace", "note": none, "stability": "experimental", "value": +// "Replace"}, {"brief": none, "deprecated": none, "id": "execute", "note": none, "stability": +// "experimental", "value": "Execute"}, {"brief": none, "deprecated": none, "id": "query", "note": +// none, "stability": "experimental", "value": "Query"}, {"brief": none, "deprecated": none, "id": +// "head", "note": none, "stability": "experimental", "value": "Head"}, {"brief": none, +// "deprecated": none, "id": "head_feed", "note": none, "stability": "experimental", "value": +// "HeadFeed"}, {"brief": none, "deprecated": none, "id": "upsert", "note": none, "stability": +// "experimental", "value": "Upsert"}, {"brief": none, "deprecated": none, "id": "batch", "note": +// none, "stability": "experimental", "value": "Batch"}, {"brief": none, "deprecated": none, "id": +// "query_plan", "note": none, "stability": "experimental", "value": "QueryPlan"}, {"brief": none, +// "deprecated": none, "id": "execute_javascript", "note": none, "stability": "experimental", +// "value": "ExecuteJavaScript"}]}} +namespace DbCosmosdbOperationTypeValues +{ +/** + * invalid. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "invalid", "note": none, "stability": +// "experimental", "value": "Invalid"} +static constexpr const char *kInvalid = "Invalid"; +/** + * create. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "create", "note": none, "stability": +// "experimental", "value": "Create"} +static constexpr const char *kCreate = "Create"; +/** + * patch. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "patch", "note": none, "stability": +// "experimental", "value": "Patch"} +static constexpr const char *kPatch = "Patch"; +/** + * read. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "read", "note": none, "stability": +// "experimental", "value": "Read"} +static constexpr const char *kRead = "Read"; +/** + * read_feed. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "read_feed", "note": none, "stability": +// "experimental", "value": "ReadFeed"} +static constexpr const char *kReadFeed = "ReadFeed"; +/** + * delete. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "delete", "note": none, "stability": +// "experimental", "value": "Delete"} +static constexpr const char *kDelete = "Delete"; +/** + * replace. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "replace", "note": none, "stability": +// "experimental", "value": "Replace"} +static constexpr const char *kReplace = "Replace"; +/** + * execute. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "execute", "note": none, "stability": +// "experimental", "value": "Execute"} +static constexpr const char *kExecute = "Execute"; +/** + * query. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "query", "note": none, "stability": +// "experimental", "value": "Query"} +static constexpr const char *kQuery = "Query"; +/** + * head. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "head", "note": none, "stability": +// "experimental", "value": "Head"} +static constexpr const char *kHead = "Head"; +/** + * head_feed. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "head_feed", "note": none, "stability": +// "experimental", "value": "HeadFeed"} +static constexpr const char *kHeadFeed = "HeadFeed"; +/** + * upsert. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "upsert", "note": none, "stability": +// "experimental", "value": "Upsert"} +static constexpr const char *kUpsert = "Upsert"; +/** + * batch. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "batch", "note": none, "stability": +// "experimental", "value": "Batch"} +static constexpr const char *kBatch = "Batch"; +/** + * query_plan. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "query_plan", "note": none, "stability": +// "experimental", "value": "QueryPlan"} +static constexpr const char *kQueryPlan = "QueryPlan"; +/** + * execute_javascript. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "execute_javascript", "note": none, "stability": +// "experimental", "value": "ExecuteJavaScript"} +static constexpr const char *kExecuteJavascript = "ExecuteJavaScript"; +} // namespace DbCosmosdbOperationTypeValues + +// DEBUG: {"brief": "The database management system (DBMS) product as identified by the client +// instrumentation.", "name": "db.system", "note": "The actual DBMS may differ from the one +// identified by the client. For example, when using PostgreSQL client libraries to connect to a +// CockroachDB, the `db.system` is set to `postgresql` based on the instrumentation's best +// knowledge.\n", "requirement_level": "recommended", "root_namespace": "db", "stability": +// "experimental", "type": {"allow_custom_values": true, "members": [{"brief": "Some other SQL +// database. Fallback only. See notes.", "deprecated": none, "id": "other_sql", "note": none, +// "stability": "experimental", "value": "other_sql"}, {"brief": "Adabas (Adaptable Database +// System)", "deprecated": none, "id": "adabas", "note": none, "stability": "experimental", "value": +// "adabas"}, {"brief": "Deprecated, use `intersystems_cache` instead.", "deprecated": "Replaced by +// `intersystems_cache`.", "id": "cache", "note": none, "stability": "experimental", "value": +// "cache"}, {"brief": "InterSystems Caché", "deprecated": none, "id": "intersystems_cache", "note": +// none, "stability": "experimental", "value": "intersystems_cache"}, {"brief": "Apache Cassandra", +// "deprecated": none, "id": "cassandra", "note": none, "stability": "experimental", "value": +// "cassandra"}, {"brief": "ClickHouse", "deprecated": none, "id": "clickhouse", "note": none, +// "stability": "experimental", "value": "clickhouse"}, {"brief": "Deprecated, use `other_sql` +// instead.", "deprecated": "Replaced by `other_sql`.", "id": "cloudscape", "note": none, +// "stability": "experimental", "value": "cloudscape"}, {"brief": "CockroachDB", "deprecated": none, +// "id": "cockroachdb", "note": none, "stability": "experimental", "value": "cockroachdb"}, +// {"brief": "Deprecated, no replacement at this time.", "deprecated": "Removed.", "id": +// "coldfusion", "note": none, "stability": "experimental", "value": "coldfusion"}, {"brief": +// "Microsoft Azure Cosmos DB", "deprecated": none, "id": "cosmosdb", "note": none, "stability": +// "experimental", "value": "cosmosdb"}, {"brief": "Couchbase", "deprecated": none, "id": +// "couchbase", "note": none, "stability": "experimental", "value": "couchbase"}, {"brief": +// "CouchDB", "deprecated": none, "id": "couchdb", "note": none, "stability": "experimental", +// "value": "couchdb"}, {"brief": "IBM Db2", "deprecated": none, "id": "db2", "note": none, +// "stability": "experimental", "value": "db2"}, {"brief": "Apache Derby", "deprecated": none, "id": +// "derby", "note": none, "stability": "experimental", "value": "derby"}, {"brief": "Amazon +// DynamoDB", "deprecated": none, "id": "dynamodb", "note": none, "stability": "experimental", +// "value": "dynamodb"}, {"brief": "EnterpriseDB", "deprecated": none, "id": "edb", "note": none, +// "stability": "experimental", "value": "edb"}, {"brief": "Elasticsearch", "deprecated": none, +// "id": "elasticsearch", "note": none, "stability": "experimental", "value": "elasticsearch"}, +// {"brief": "FileMaker", "deprecated": none, "id": "filemaker", "note": none, "stability": +// "experimental", "value": "filemaker"}, {"brief": "Firebird", "deprecated": none, "id": +// "firebird", "note": none, "stability": "experimental", "value": "firebird"}, {"brief": +// "Deprecated, use `other_sql` instead.", "deprecated": "Replaced by `other_sql`.", "id": +// "firstsql", "note": none, "stability": "experimental", "value": "firstsql"}, {"brief": "Apache +// Geode", "deprecated": none, "id": "geode", "note": none, "stability": "experimental", "value": +// "geode"}, {"brief": "H2", "deprecated": none, "id": "h2", "note": none, "stability": +// "experimental", "value": "h2"}, {"brief": "SAP HANA", "deprecated": none, "id": "hanadb", "note": +// none, "stability": "experimental", "value": "hanadb"}, {"brief": "Apache HBase", "deprecated": +// none, "id": "hbase", "note": none, "stability": "experimental", "value": "hbase"}, {"brief": +// "Apache Hive", "deprecated": none, "id": "hive", "note": none, "stability": "experimental", +// "value": "hive"}, {"brief": "HyperSQL DataBase", "deprecated": none, "id": "hsqldb", "note": +// none, "stability": "experimental", "value": "hsqldb"}, {"brief": "InfluxDB", "deprecated": none, +// "id": "influxdb", "note": none, "stability": "experimental", "value": "influxdb"}, {"brief": +// "Informix", "deprecated": none, "id": "informix", "note": none, "stability": "experimental", +// "value": "informix"}, {"brief": "Ingres", "deprecated": none, "id": "ingres", "note": none, +// "stability": "experimental", "value": "ingres"}, {"brief": "InstantDB", "deprecated": none, "id": +// "instantdb", "note": none, "stability": "experimental", "value": "instantdb"}, {"brief": +// "InterBase", "deprecated": none, "id": "interbase", "note": none, "stability": "experimental", +// "value": "interbase"}, {"brief": "MariaDB", "deprecated": none, "id": "mariadb", "note": none, +// "stability": "experimental", "value": "mariadb"}, {"brief": "SAP MaxDB", "deprecated": none, +// "id": "maxdb", "note": none, "stability": "experimental", "value": "maxdb"}, {"brief": +// "Memcached", "deprecated": none, "id": "memcached", "note": none, "stability": "experimental", +// "value": "memcached"}, {"brief": "MongoDB", "deprecated": none, "id": "mongodb", "note": none, +// "stability": "experimental", "value": "mongodb"}, {"brief": "Microsoft SQL Server", "deprecated": +// none, "id": "mssql", "note": none, "stability": "experimental", "value": "mssql"}, {"brief": +// "Deprecated, Microsoft SQL Server Compact is discontinued.", "deprecated": "Removed, use +// `other_sql` instead.", "id": "mssqlcompact", "note": none, "stability": "experimental", "value": +// "mssqlcompact"}, {"brief": "MySQL", "deprecated": none, "id": "mysql", "note": none, "stability": +// "experimental", "value": "mysql"}, {"brief": "Neo4j", "deprecated": none, "id": "neo4j", "note": +// none, "stability": "experimental", "value": "neo4j"}, {"brief": "Netezza", "deprecated": none, +// "id": "netezza", "note": none, "stability": "experimental", "value": "netezza"}, {"brief": +// "OpenSearch", "deprecated": none, "id": "opensearch", "note": none, "stability": "experimental", +// "value": "opensearch"}, {"brief": "Oracle Database", "deprecated": none, "id": "oracle", "note": +// none, "stability": "experimental", "value": "oracle"}, {"brief": "Pervasive PSQL", "deprecated": +// none, "id": "pervasive", "note": none, "stability": "experimental", "value": "pervasive"}, +// {"brief": "PointBase", "deprecated": none, "id": "pointbase", "note": none, "stability": +// "experimental", "value": "pointbase"}, {"brief": "PostgreSQL", "deprecated": none, "id": +// "postgresql", "note": none, "stability": "experimental", "value": "postgresql"}, {"brief": +// "Progress Database", "deprecated": none, "id": "progress", "note": none, "stability": +// "experimental", "value": "progress"}, {"brief": "Redis", "deprecated": none, "id": "redis", +// "note": none, "stability": "experimental", "value": "redis"}, {"brief": "Amazon Redshift", +// "deprecated": none, "id": "redshift", "note": none, "stability": "experimental", "value": +// "redshift"}, {"brief": "Cloud Spanner", "deprecated": none, "id": "spanner", "note": none, +// "stability": "experimental", "value": "spanner"}, {"brief": "SQLite", "deprecated": none, "id": +// "sqlite", "note": none, "stability": "experimental", "value": "sqlite"}, {"brief": "Sybase", +// "deprecated": none, "id": "sybase", "note": none, "stability": "experimental", "value": +// "sybase"}, {"brief": "Teradata", "deprecated": none, "id": "teradata", "note": none, "stability": +// "experimental", "value": "teradata"}, {"brief": "Trino", "deprecated": none, "id": "trino", +// "note": none, "stability": "experimental", "value": "trino"}, {"brief": "Vertica", "deprecated": +// none, "id": "vertica", "note": none, "stability": "experimental", "value": "vertica"}]}} +namespace DbSystemValues +{ +/** + * Some other SQL database. Fallback only. See notes. + */ +// DEBUG: {"brief": "Some other SQL database. Fallback only. See notes.", "deprecated": none, "id": +// "other_sql", "note": none, "stability": "experimental", "value": "other_sql"} +static constexpr const char *kOtherSql = "other_sql"; +/** + * Adabas (Adaptable Database System). + */ +// DEBUG: {"brief": "Adabas (Adaptable Database System)", "deprecated": none, "id": "adabas", +// "note": none, "stability": "experimental", "value": "adabas"} +static constexpr const char *kAdabas = "adabas"; +/** + * @Deprecated: Replaced by @code intersystems_cache @endcode. + */ +// DEBUG: {"brief": "Deprecated, use `intersystems_cache` instead.", "deprecated": "Replaced by +// `intersystems_cache`.", "id": "cache", "note": none, "stability": "experimental", "value": +// "cache"} +static constexpr const char *kCache = "cache"; +/** + * InterSystems Caché. + */ +// DEBUG: {"brief": "InterSystems Caché", "deprecated": none, "id": "intersystems_cache", "note": +// none, "stability": "experimental", "value": "intersystems_cache"} +static constexpr const char *kIntersystemsCache = "intersystems_cache"; +/** + * Apache Cassandra. + */ +// DEBUG: {"brief": "Apache Cassandra", "deprecated": none, "id": "cassandra", "note": none, +// "stability": "experimental", "value": "cassandra"} +static constexpr const char *kCassandra = "cassandra"; +/** + * ClickHouse. + */ +// DEBUG: {"brief": "ClickHouse", "deprecated": none, "id": "clickhouse", "note": none, "stability": +// "experimental", "value": "clickhouse"} +static constexpr const char *kClickhouse = "clickhouse"; +/** + * @Deprecated: Replaced by @code other_sql @endcode. + */ +// DEBUG: {"brief": "Deprecated, use `other_sql` instead.", "deprecated": "Replaced by +// `other_sql`.", "id": "cloudscape", "note": none, "stability": "experimental", "value": +// "cloudscape"} +static constexpr const char *kCloudscape = "cloudscape"; +/** + * CockroachDB. + */ +// DEBUG: {"brief": "CockroachDB", "deprecated": none, "id": "cockroachdb", "note": none, +// "stability": "experimental", "value": "cockroachdb"} +static constexpr const char *kCockroachdb = "cockroachdb"; +/** + * @Deprecated: Removed. + */ +// DEBUG: {"brief": "Deprecated, no replacement at this time.", "deprecated": "Removed.", "id": +// "coldfusion", "note": none, "stability": "experimental", "value": "coldfusion"} +static constexpr const char *kColdfusion = "coldfusion"; +/** + * Microsoft Azure Cosmos DB. + */ +// DEBUG: {"brief": "Microsoft Azure Cosmos DB", "deprecated": none, "id": "cosmosdb", "note": none, +// "stability": "experimental", "value": "cosmosdb"} +static constexpr const char *kCosmosdb = "cosmosdb"; +/** + * Couchbase. + */ +// DEBUG: {"brief": "Couchbase", "deprecated": none, "id": "couchbase", "note": none, "stability": +// "experimental", "value": "couchbase"} +static constexpr const char *kCouchbase = "couchbase"; +/** + * CouchDB. + */ +// DEBUG: {"brief": "CouchDB", "deprecated": none, "id": "couchdb", "note": none, "stability": +// "experimental", "value": "couchdb"} +static constexpr const char *kCouchdb = "couchdb"; +/** + * IBM Db2. + */ +// DEBUG: {"brief": "IBM Db2", "deprecated": none, "id": "db2", "note": none, "stability": +// "experimental", "value": "db2"} +static constexpr const char *kDb2 = "db2"; +/** + * Apache Derby. + */ +// DEBUG: {"brief": "Apache Derby", "deprecated": none, "id": "derby", "note": none, "stability": +// "experimental", "value": "derby"} +static constexpr const char *kDerby = "derby"; +/** + * Amazon DynamoDB. + */ +// DEBUG: {"brief": "Amazon DynamoDB", "deprecated": none, "id": "dynamodb", "note": none, +// "stability": "experimental", "value": "dynamodb"} +static constexpr const char *kDynamodb = "dynamodb"; +/** + * EnterpriseDB. + */ +// DEBUG: {"brief": "EnterpriseDB", "deprecated": none, "id": "edb", "note": none, "stability": +// "experimental", "value": "edb"} +static constexpr const char *kEdb = "edb"; +/** + * Elasticsearch. + */ +// DEBUG: {"brief": "Elasticsearch", "deprecated": none, "id": "elasticsearch", "note": none, +// "stability": "experimental", "value": "elasticsearch"} +static constexpr const char *kElasticsearch = "elasticsearch"; +/** + * FileMaker. + */ +// DEBUG: {"brief": "FileMaker", "deprecated": none, "id": "filemaker", "note": none, "stability": +// "experimental", "value": "filemaker"} +static constexpr const char *kFilemaker = "filemaker"; +/** + * Firebird. + */ +// DEBUG: {"brief": "Firebird", "deprecated": none, "id": "firebird", "note": none, "stability": +// "experimental", "value": "firebird"} +static constexpr const char *kFirebird = "firebird"; +/** + * @Deprecated: Replaced by @code other_sql @endcode. + */ +// DEBUG: {"brief": "Deprecated, use `other_sql` instead.", "deprecated": "Replaced by +// `other_sql`.", "id": "firstsql", "note": none, "stability": "experimental", "value": "firstsql"} +static constexpr const char *kFirstsql = "firstsql"; +/** + * Apache Geode. + */ +// DEBUG: {"brief": "Apache Geode", "deprecated": none, "id": "geode", "note": none, "stability": +// "experimental", "value": "geode"} +static constexpr const char *kGeode = "geode"; +/** + * H2. + */ +// DEBUG: {"brief": "H2", "deprecated": none, "id": "h2", "note": none, "stability": "experimental", +// "value": "h2"} +static constexpr const char *kH2 = "h2"; +/** + * SAP HANA. + */ +// DEBUG: {"brief": "SAP HANA", "deprecated": none, "id": "hanadb", "note": none, "stability": +// "experimental", "value": "hanadb"} +static constexpr const char *kHanadb = "hanadb"; +/** + * Apache HBase. + */ +// DEBUG: {"brief": "Apache HBase", "deprecated": none, "id": "hbase", "note": none, "stability": +// "experimental", "value": "hbase"} +static constexpr const char *kHbase = "hbase"; +/** + * Apache Hive. + */ +// DEBUG: {"brief": "Apache Hive", "deprecated": none, "id": "hive", "note": none, "stability": +// "experimental", "value": "hive"} +static constexpr const char *kHive = "hive"; +/** + * HyperSQL DataBase. + */ +// DEBUG: {"brief": "HyperSQL DataBase", "deprecated": none, "id": "hsqldb", "note": none, +// "stability": "experimental", "value": "hsqldb"} +static constexpr const char *kHsqldb = "hsqldb"; +/** + * InfluxDB. + */ +// DEBUG: {"brief": "InfluxDB", "deprecated": none, "id": "influxdb", "note": none, "stability": +// "experimental", "value": "influxdb"} +static constexpr const char *kInfluxdb = "influxdb"; +/** + * Informix. + */ +// DEBUG: {"brief": "Informix", "deprecated": none, "id": "informix", "note": none, "stability": +// "experimental", "value": "informix"} +static constexpr const char *kInformix = "informix"; +/** + * Ingres. + */ +// DEBUG: {"brief": "Ingres", "deprecated": none, "id": "ingres", "note": none, "stability": +// "experimental", "value": "ingres"} +static constexpr const char *kIngres = "ingres"; +/** + * InstantDB. + */ +// DEBUG: {"brief": "InstantDB", "deprecated": none, "id": "instantdb", "note": none, "stability": +// "experimental", "value": "instantdb"} +static constexpr const char *kInstantdb = "instantdb"; +/** + * InterBase. + */ +// DEBUG: {"brief": "InterBase", "deprecated": none, "id": "interbase", "note": none, "stability": +// "experimental", "value": "interbase"} +static constexpr const char *kInterbase = "interbase"; +/** + * MariaDB. + */ +// DEBUG: {"brief": "MariaDB", "deprecated": none, "id": "mariadb", "note": none, "stability": +// "experimental", "value": "mariadb"} +static constexpr const char *kMariadb = "mariadb"; +/** + * SAP MaxDB. + */ +// DEBUG: {"brief": "SAP MaxDB", "deprecated": none, "id": "maxdb", "note": none, "stability": +// "experimental", "value": "maxdb"} +static constexpr const char *kMaxdb = "maxdb"; +/** + * Memcached. + */ +// DEBUG: {"brief": "Memcached", "deprecated": none, "id": "memcached", "note": none, "stability": +// "experimental", "value": "memcached"} +static constexpr const char *kMemcached = "memcached"; +/** + * MongoDB. + */ +// DEBUG: {"brief": "MongoDB", "deprecated": none, "id": "mongodb", "note": none, "stability": +// "experimental", "value": "mongodb"} +static constexpr const char *kMongodb = "mongodb"; +/** + * Microsoft SQL Server. + */ +// DEBUG: {"brief": "Microsoft SQL Server", "deprecated": none, "id": "mssql", "note": none, +// "stability": "experimental", "value": "mssql"} +static constexpr const char *kMssql = "mssql"; +/** + * @Deprecated: Removed, use @code other_sql @endcode instead. + */ +// DEBUG: {"brief": "Deprecated, Microsoft SQL Server Compact is discontinued.", "deprecated": +// "Removed, use `other_sql` instead.", "id": "mssqlcompact", "note": none, "stability": +// "experimental", "value": "mssqlcompact"} +static constexpr const char *kMssqlcompact = "mssqlcompact"; +/** + * MySQL. + */ +// DEBUG: {"brief": "MySQL", "deprecated": none, "id": "mysql", "note": none, "stability": +// "experimental", "value": "mysql"} +static constexpr const char *kMysql = "mysql"; +/** + * Neo4j. + */ +// DEBUG: {"brief": "Neo4j", "deprecated": none, "id": "neo4j", "note": none, "stability": +// "experimental", "value": "neo4j"} +static constexpr const char *kNeo4j = "neo4j"; +/** + * Netezza. + */ +// DEBUG: {"brief": "Netezza", "deprecated": none, "id": "netezza", "note": none, "stability": +// "experimental", "value": "netezza"} +static constexpr const char *kNetezza = "netezza"; +/** + * OpenSearch. + */ +// DEBUG: {"brief": "OpenSearch", "deprecated": none, "id": "opensearch", "note": none, "stability": +// "experimental", "value": "opensearch"} +static constexpr const char *kOpensearch = "opensearch"; +/** + * Oracle Database. + */ +// DEBUG: {"brief": "Oracle Database", "deprecated": none, "id": "oracle", "note": none, +// "stability": "experimental", "value": "oracle"} +static constexpr const char *kOracle = "oracle"; +/** + * Pervasive PSQL. + */ +// DEBUG: {"brief": "Pervasive PSQL", "deprecated": none, "id": "pervasive", "note": none, +// "stability": "experimental", "value": "pervasive"} +static constexpr const char *kPervasive = "pervasive"; +/** + * PointBase. + */ +// DEBUG: {"brief": "PointBase", "deprecated": none, "id": "pointbase", "note": none, "stability": +// "experimental", "value": "pointbase"} +static constexpr const char *kPointbase = "pointbase"; +/** + * PostgreSQL. + */ +// DEBUG: {"brief": "PostgreSQL", "deprecated": none, "id": "postgresql", "note": none, "stability": +// "experimental", "value": "postgresql"} +static constexpr const char *kPostgresql = "postgresql"; +/** + * Progress Database. + */ +// DEBUG: {"brief": "Progress Database", "deprecated": none, "id": "progress", "note": none, +// "stability": "experimental", "value": "progress"} +static constexpr const char *kProgress = "progress"; +/** + * Redis. + */ +// DEBUG: {"brief": "Redis", "deprecated": none, "id": "redis", "note": none, "stability": +// "experimental", "value": "redis"} +static constexpr const char *kRedis = "redis"; +/** + * Amazon Redshift. + */ +// DEBUG: {"brief": "Amazon Redshift", "deprecated": none, "id": "redshift", "note": none, +// "stability": "experimental", "value": "redshift"} +static constexpr const char *kRedshift = "redshift"; +/** + * Cloud Spanner. + */ +// DEBUG: {"brief": "Cloud Spanner", "deprecated": none, "id": "spanner", "note": none, "stability": +// "experimental", "value": "spanner"} +static constexpr const char *kSpanner = "spanner"; +/** + * SQLite. + */ +// DEBUG: {"brief": "SQLite", "deprecated": none, "id": "sqlite", "note": none, "stability": +// "experimental", "value": "sqlite"} +static constexpr const char *kSqlite = "sqlite"; +/** + * Sybase. + */ +// DEBUG: {"brief": "Sybase", "deprecated": none, "id": "sybase", "note": none, "stability": +// "experimental", "value": "sybase"} +static constexpr const char *kSybase = "sybase"; +/** + * Teradata. + */ +// DEBUG: {"brief": "Teradata", "deprecated": none, "id": "teradata", "note": none, "stability": +// "experimental", "value": "teradata"} +static constexpr const char *kTeradata = "teradata"; +/** + * Trino. + */ +// DEBUG: {"brief": "Trino", "deprecated": none, "id": "trino", "note": none, "stability": +// "experimental", "value": "trino"} +static constexpr const char *kTrino = "trino"; +/** + * Vertica. + */ +// DEBUG: {"brief": "Vertica", "deprecated": none, "id": "vertica", "note": none, "stability": +// "experimental", "value": "vertica"} +static constexpr const char *kVertica = "vertica"; +} // namespace DbSystemValues + +} // namespace db +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/deployment_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/deployment_attributes.h new file mode 100644 index 0000000000..bd4a557c34 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/deployment_attributes.h @@ -0,0 +1,81 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace deployment +{ + +/** + * @Deprecated: Deprecated, use @code deployment.environment.name @endcode instead. + */ +static const char *kDeploymentEnvironment = "deployment.environment"; + +/** + * Name of the deployment + * environment (aka deployment tier). Note: @code deployment.environment.name @endcode does not + * affect the uniqueness constraints defined through the @code service.namespace @endcode, @code + * service.name @endcode and @code service.instance.id @endcode resource attributes. This implies + * that resources carrying the following attribute combinations MUST be considered to be identifying + * the same service:

  • @code service.name=frontend @endcode, @code + * deployment.environment.name=production @endcode
  • @code service.name=frontend @endcode, + * @code deployment.environment.name=staging @endcode.
  • + *
+ */ +static const char *kDeploymentEnvironmentName = "deployment.environment.name"; + +/** + * The id of the deployment. + */ +static const char *kDeploymentId = "deployment.id"; + +/** + * The name of the deployment. + */ +static const char *kDeploymentName = "deployment.name"; + +/** + * The status of the deployment. + */ +static const char *kDeploymentStatus = "deployment.status"; + +// DEBUG: {"brief": "The status of the deployment.\n", "name": "deployment.status", +// "requirement_level": "recommended", "root_namespace": "deployment", "stability": "experimental", +// "type": {"allow_custom_values": true, "members": [{"brief": "failed", "deprecated": none, "id": +// "failed", "note": none, "stability": "experimental", "value": "failed"}, {"brief": "succeeded", +// "deprecated": none, "id": "succeeded", "note": none, "stability": "experimental", "value": +// "succeeded"}]}} +namespace DeploymentStatusValues +{ +/** + * failed. + */ +// DEBUG: {"brief": "failed", "deprecated": none, "id": "failed", "note": none, "stability": +// "experimental", "value": "failed"} +static constexpr const char *kFailed = "failed"; +/** + * succeeded. + */ +// DEBUG: {"brief": "succeeded", "deprecated": none, "id": "succeeded", "note": none, "stability": +// "experimental", "value": "succeeded"} +static constexpr const char *kSucceeded = "succeeded"; +} // namespace DeploymentStatusValues + +} // namespace deployment +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/destination_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/destination_attributes.h new file mode 100644 index 0000000000..65b9bc5e1e --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/destination_attributes.h @@ -0,0 +1,39 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace destination +{ + +/** + * Destination address - domain name if available without reverse DNS lookup; otherwise, IP address + * or Unix domain socket name. Note: When observed from the source side, and when communicating + * through an intermediary, @code destination.address @endcode SHOULD represent the destination + * address behind any intermediaries, for example proxies, if it's available. + */ +static const char *kDestinationAddress = "destination.address"; + +/** + * Destination port number. + */ +static const char *kDestinationPort = "destination.port"; + +} // namespace destination +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/device_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/device_attributes.h new file mode 100644 index 0000000000..d47a154239 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/device_attributes.h @@ -0,0 +1,64 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace device +{ + +/** + * A unique identifier representing the device. + * Note: The device identifier MUST only be defined using the values outlined below. This value is + * not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this + * value MUST be equal to the vendor + * identifier. On Android (Java or Kotlin), this value MUST be equal to the Firebase + * Installation ID or a globally unique UUID which is persisted across sessions in your application. + * More information can be found here on best practices + * and exact implementation details. Caution should be taken when storing personal data or anything + * which can identify a user. GDPR and data protection laws may apply, ensure you do your own due + * diligence. + */ +static const char *kDeviceId = "device.id"; + +/** + * The name of the device manufacturer. + * Note: The Android OS provides this field via Build. iOS apps + * SHOULD hardcode the value @code Apple @endcode. + */ +static const char *kDeviceManufacturer = "device.manufacturer"; + +/** + * The model identifier for the device. + * Note: It's recommended this value represents a machine-readable version of the model identifier + * rather than the market or consumer-friendly name of the device. + */ +static const char *kDeviceModelIdentifier = "device.model.identifier"; + +/** + * The marketing name for the device model. + * Note: It's recommended this value represents a human-readable version of the device model rather + * than a machine-readable alternative. + */ +static const char *kDeviceModelName = "device.model.name"; + +} // namespace device +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/disk_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/disk_attributes.h new file mode 100644 index 0000000000..d13ba63473 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/disk_attributes.h @@ -0,0 +1,53 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace disk +{ + +/** + * The disk IO operation direction. + */ +static const char *kDiskIoDirection = "disk.io.direction"; + +// DEBUG: {"brief": "The disk IO operation direction.", "examples": ["read"], "name": +// "disk.io.direction", "requirement_level": "recommended", "root_namespace": "disk", "stability": +// "experimental", "type": {"allow_custom_values": true, "members": [{"brief": none, "deprecated": +// none, "id": "read", "note": none, "stability": "experimental", "value": "read"}, {"brief": none, +// "deprecated": none, "id": "write", "note": none, "stability": "experimental", "value": +// "write"}]}} +namespace DiskIoDirectionValues +{ +/** + * read. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "read", "note": none, "stability": +// "experimental", "value": "read"} +static constexpr const char *kRead = "read"; +/** + * write. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "write", "note": none, "stability": +// "experimental", "value": "write"} +static constexpr const char *kWrite = "write"; +} // namespace DiskIoDirectionValues + +} // namespace disk +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/dns_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/dns_attributes.h new file mode 100644 index 0000000000..b146b1d657 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/dns_attributes.h @@ -0,0 +1,35 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace dns +{ + +/** + * The name being queried. + * Note: If the name field contains non-printable characters (below 32 or above 126), those + * characters should be represented as escaped base 10 integers (\DDD). Back slashes and quotes + * should be escaped. Tabs, carriage returns, and line feeds should be converted to \t, \r, and \n + * respectively. + */ +static const char *kDnsQuestionName = "dns.question.name"; + +} // namespace dns +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/enduser_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/enduser_attributes.h new file mode 100644 index 0000000000..5b1b438146 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/enduser_attributes.h @@ -0,0 +1,41 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace enduser +{ + +/** + * @Deprecated: Replaced by @code user.id @endcode attribute. + */ +static const char *kEnduserId = "enduser.id"; + +/** + * @Deprecated: Replaced by @code user.roles @endcode attribute. + */ +static const char *kEnduserRole = "enduser.role"; + +/** + * @Deprecated: Removed. + */ +static const char *kEnduserScope = "enduser.scope"; + +} // namespace enduser +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/error_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/error_attributes.h new file mode 100644 index 0000000000..22b7505a53 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/error_attributes.h @@ -0,0 +1,63 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace error +{ + +/** + * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.error_attributes. + * @endcode. + */ +static const char *kErrorType = "error.type"; + +// @deprecated(reason="Deprecated in favor of stable +// `opentelemetry.semconv.attributes.error_attributes.ErrorTypeValues`.") # type: ignore DEBUG: +// {"brief": "Describes a class of error the operation ended with.\n", "examples": ["timeout", +// "java.net.UnknownHostException", "server_certificate_invalid", "500"], "name": "error.type", +// "note": "The `error.type` SHOULD be predictable, and SHOULD have low cardinality.\n\nWhen +// `error.type` is set to a type (e.g., an exception type), its\ncanonical class name identifying +// the type within the artifact SHOULD be used.\n\nInstrumentations SHOULD document the list of +// errors they report.\n\nThe cardinality of `error.type` within one instrumentation library SHOULD +// be low.\nTelemetry consumers that aggregate data from multiple instrumentation libraries and +// applications\nshould be prepared for `error.type` to have high cardinality at query time when +// no\nadditional filters are applied.\n\nIf the operation has completed successfully, +// instrumentations SHOULD NOT set `error.type`.\n\nIf a specific domain defines its own set of +// error identifiers (such as HTTP or gRPC status codes),\nit's RECOMMENDED to:\n\n* Use a +// domain-specific attribute\n* Set `error.type` to capture all errors, regardless of whether they +// are defined within the domain-specific set or not.\n", "requirement_level": "recommended", +// "root_namespace": "error", "stability": "stable", "type": {"allow_custom_values": true, +// "members": [{"brief": "A fallback error value to be used when the instrumentation doesn't define +// a custom value.\n", "deprecated": none, "id": "other", "note": none, "stability": "stable", +// "value": "_OTHER"}]}} +namespace ErrorTypeValues +{ +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.error_attributes.ErrorTypeValues.kOther @endcode. + */ +// DEBUG: {"brief": "A fallback error value to be used when the instrumentation doesn't define a +// custom value.\n", "deprecated": none, "id": "other", "note": none, "stability": "stable", +// "value": "_OTHER"} +static constexpr const char *kOther = "_OTHER"; +} // namespace ErrorTypeValues + +} // namespace error +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/event_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/event_attributes.h new file mode 100644 index 0000000000..49d5a29ea7 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/event_attributes.h @@ -0,0 +1,35 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace event +{ + +/** + * Identifies the class / type of event. + * Note: Event names are subject to the same rules as attribute names. Notably, event names are namespaced + * to avoid collisions and provide a clean separation of semantics for events in separate domains + * like browser, mobile, and kubernetes. + */ +static const char *kEventName = "event.name"; + +} // namespace event +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/exception_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/exception_attributes.h new file mode 100644 index 0000000000..7f351b7ab6 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/exception_attributes.h @@ -0,0 +1,50 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace exception +{ + +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.exception_attributes. @endcode. + */ +static const char *kExceptionEscaped = "exception.escaped"; + +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.exception_attributes. @endcode. + */ +static const char *kExceptionMessage = "exception.message"; + +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.exception_attributes. @endcode. + */ +static const char *kExceptionStacktrace = "exception.stacktrace"; + +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.exception_attributes. @endcode. + */ +static const char *kExceptionType = "exception.type"; + +} // namespace exception +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/faas_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/faas_attributes.h new file mode 100644 index 0000000000..3e1a2bd6c3 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/faas_attributes.h @@ -0,0 +1,274 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace faas +{ + +/** + * A boolean that is true if the serverless function is executed for the first time (aka + * cold-start). + */ +static const char *kFaasColdstart = "faas.coldstart"; + +/** + * A string containing the schedule period as Cron + * Expression. + */ +static const char *kFaasCron = "faas.cron"; + +/** + * The name of the source on which the triggering operation was performed. For example, in Cloud + * Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. + */ +static const char *kFaasDocumentCollection = "faas.document.collection"; + +/** + * The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the + * name of the file, and in Cosmos DB the table name. + */ +static const char *kFaasDocumentName = "faas.document.name"; + +/** + * Describes the type of the operation that was performed on the data. + */ +static const char *kFaasDocumentOperation = "faas.document.operation"; + +/** + * A string containing the time when the data was accessed in the ISO 8601 format expressed in UTC. + */ +static const char *kFaasDocumentTime = "faas.document.time"; + +/** + * The execution environment ID as a string, that will be potentially reused for other invocations + * to the same function/function version. Note: * AWS Lambda: Use the (full) log + * stream name. + */ +static const char *kFaasInstance = "faas.instance"; + +/** + * The invocation ID of the current function invocation. + */ +static const char *kFaasInvocationId = "faas.invocation_id"; + +/** + * The name of the invoked function. + * Note: SHOULD be equal to the @code faas.name @endcode resource attribute of the invoked function. + */ +static const char *kFaasInvokedName = "faas.invoked_name"; + +/** + * The cloud provider of the invoked function. + * Note: SHOULD be equal to the @code cloud.provider @endcode resource attribute of the invoked + * function. + */ +static const char *kFaasInvokedProvider = "faas.invoked_provider"; + +/** + * The cloud region of the invoked function. + * Note: SHOULD be equal to the @code cloud.region @endcode resource attribute of the invoked + * function. + */ +static const char *kFaasInvokedRegion = "faas.invoked_region"; + +/** + * The amount of memory available to the serverless function converted to Bytes. + * Note: It's recommended to set this attribute since e.g. too little memory can easily stop a Java + * AWS Lambda function from working correctly. On AWS Lambda, the environment variable @code + * AWS_LAMBDA_FUNCTION_MEMORY_SIZE @endcode provides this information (which must be multiplied by + * 1,048,576). + */ +static const char *kFaasMaxMemory = "faas.max_memory"; + +/** + * The name of the single function that this runtime instance executes. + * Note: This is the name of the function as configured/deployed on the FaaS + * platform and is usually different from the name of the callback + * function (which may be stored in the + * @code code.namespace @endcode/@code + * code.function @endcode span attributes).

For some cloud providers, the above definition + * is ambiguous. The following definition of function name MUST be used for this attribute (and + * consequently the span name) for the listed cloud providers/products:

    + *
  • Azure: The full name @code / @endcode, i.e., function app + * name followed by a forward slash followed by the function name (this form can also be seen in the + * resource JSON for the function). This means that a span attribute MUST be used, as an Azure + * function app can host multiple functions that would usually share a TracerProvider (see also the + * @code cloud.resource_id @endcode attribute).
  • + *
+ */ +static const char *kFaasName = "faas.name"; + +/** + * A string containing the function invocation time in the ISO 8601 format expressed in UTC. + */ +static const char *kFaasTime = "faas.time"; + +/** + * Type of the trigger which caused this function invocation. + */ +static const char *kFaasTrigger = "faas.trigger"; + +/** + * The immutable version of the function being executed. + * Note: Depending on the cloud provider and platform, use: + *

+ *

+ */ +static const char *kFaasVersion = "faas.version"; + +// DEBUG: {"brief": "Describes the type of the operation that was performed on the data.", "name": +// "faas.document.operation", "requirement_level": "recommended", "root_namespace": "faas", +// "stability": "experimental", "type": {"allow_custom_values": true, "members": [{"brief": "When a +// new object is created.", "deprecated": none, "id": "insert", "note": none, "stability": +// "experimental", "value": "insert"}, {"brief": "When an object is modified.", "deprecated": none, +// "id": "edit", "note": none, "stability": "experimental", "value": "edit"}, {"brief": "When an +// object is deleted.", "deprecated": none, "id": "delete", "note": none, "stability": +// "experimental", "value": "delete"}]}} +namespace FaasDocumentOperationValues +{ +/** + * When a new object is created. + */ +// DEBUG: {"brief": "When a new object is created.", "deprecated": none, "id": "insert", "note": +// none, "stability": "experimental", "value": "insert"} +static constexpr const char *kInsert = "insert"; +/** + * When an object is modified. + */ +// DEBUG: {"brief": "When an object is modified.", "deprecated": none, "id": "edit", "note": none, +// "stability": "experimental", "value": "edit"} +static constexpr const char *kEdit = "edit"; +/** + * When an object is deleted. + */ +// DEBUG: {"brief": "When an object is deleted.", "deprecated": none, "id": "delete", "note": none, +// "stability": "experimental", "value": "delete"} +static constexpr const char *kDelete = "delete"; +} // namespace FaasDocumentOperationValues + +// DEBUG: {"brief": "The cloud provider of the invoked function.\n", "name": +// "faas.invoked_provider", "note": "SHOULD be equal to the `cloud.provider` resource attribute of +// the invoked function.\n", "requirement_level": "recommended", "root_namespace": "faas", +// "stability": "experimental", "type": {"allow_custom_values": true, "members": [{"brief": "Alibaba +// Cloud", "deprecated": none, "id": "alibaba_cloud", "note": none, "stability": "experimental", +// "value": "alibaba_cloud"}, {"brief": "Amazon Web Services", "deprecated": none, "id": "aws", +// "note": none, "stability": "experimental", "value": "aws"}, {"brief": "Microsoft Azure", +// "deprecated": none, "id": "azure", "note": none, "stability": "experimental", "value": "azure"}, +// {"brief": "Google Cloud Platform", "deprecated": none, "id": "gcp", "note": none, "stability": +// "experimental", "value": "gcp"}, {"brief": "Tencent Cloud", "deprecated": none, "id": +// "tencent_cloud", "note": none, "stability": "experimental", "value": "tencent_cloud"}]}} +namespace FaasInvokedProviderValues +{ +/** + * Alibaba Cloud. + */ +// DEBUG: {"brief": "Alibaba Cloud", "deprecated": none, "id": "alibaba_cloud", "note": none, +// "stability": "experimental", "value": "alibaba_cloud"} +static constexpr const char *kAlibabaCloud = "alibaba_cloud"; +/** + * Amazon Web Services. + */ +// DEBUG: {"brief": "Amazon Web Services", "deprecated": none, "id": "aws", "note": none, +// "stability": "experimental", "value": "aws"} +static constexpr const char *kAws = "aws"; +/** + * Microsoft Azure. + */ +// DEBUG: {"brief": "Microsoft Azure", "deprecated": none, "id": "azure", "note": none, "stability": +// "experimental", "value": "azure"} +static constexpr const char *kAzure = "azure"; +/** + * Google Cloud Platform. + */ +// DEBUG: {"brief": "Google Cloud Platform", "deprecated": none, "id": "gcp", "note": none, +// "stability": "experimental", "value": "gcp"} +static constexpr const char *kGcp = "gcp"; +/** + * Tencent Cloud. + */ +// DEBUG: {"brief": "Tencent Cloud", "deprecated": none, "id": "tencent_cloud", "note": none, +// "stability": "experimental", "value": "tencent_cloud"} +static constexpr const char *kTencentCloud = "tencent_cloud"; +} // namespace FaasInvokedProviderValues + +// DEBUG: {"brief": "Type of the trigger which caused this function invocation.\n", "name": +// "faas.trigger", "requirement_level": "recommended", "root_namespace": "faas", "stability": +// "experimental", "type": {"allow_custom_values": true, "members": [{"brief": "A response to some +// data source operation such as a database or filesystem read/write", "deprecated": none, "id": +// "datasource", "note": none, "stability": "experimental", "value": "datasource"}, {"brief": "To +// provide an answer to an inbound HTTP request", "deprecated": none, "id": "http", "note": none, +// "stability": "experimental", "value": "http"}, {"brief": "A function is set to be executed when +// messages are sent to a messaging system", "deprecated": none, "id": "pubsub", "note": none, +// "stability": "experimental", "value": "pubsub"}, {"brief": "A function is scheduled to be +// executed regularly", "deprecated": none, "id": "timer", "note": none, "stability": +// "experimental", "value": "timer"}, {"brief": "If none of the others apply", "deprecated": none, +// "id": "other", "note": none, "stability": "experimental", "value": "other"}]}} +namespace FaasTriggerValues +{ +/** + * A response to some data source operation such as a database or filesystem read/write. + */ +// DEBUG: {"brief": "A response to some data source operation such as a database or filesystem +// read/write", "deprecated": none, "id": "datasource", "note": none, "stability": "experimental", +// "value": "datasource"} +static constexpr const char *kDatasource = "datasource"; +/** + * To provide an answer to an inbound HTTP request. + */ +// DEBUG: {"brief": "To provide an answer to an inbound HTTP request", "deprecated": none, "id": +// "http", "note": none, "stability": "experimental", "value": "http"} +static constexpr const char *kHttp = "http"; +/** + * A function is set to be executed when messages are sent to a messaging system. + */ +// DEBUG: {"brief": "A function is set to be executed when messages are sent to a messaging system", +// "deprecated": none, "id": "pubsub", "note": none, "stability": "experimental", "value": "pubsub"} +static constexpr const char *kPubsub = "pubsub"; +/** + * A function is scheduled to be executed regularly. + */ +// DEBUG: {"brief": "A function is scheduled to be executed regularly", "deprecated": none, "id": +// "timer", "note": none, "stability": "experimental", "value": "timer"} +static constexpr const char *kTimer = "timer"; +/** + * If none of the others apply. + */ +// DEBUG: {"brief": "If none of the others apply", "deprecated": none, "id": "other", "note": none, +// "stability": "experimental", "value": "other"} +static constexpr const char *kOther = "other"; +} // namespace FaasTriggerValues + +} // namespace faas +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/feature_flag_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/feature_flag_attributes.h new file mode 100644 index 0000000000..a3c784511c --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/feature_flag_attributes.h @@ -0,0 +1,47 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace feature_flag +{ + +/** + * The unique identifier of the feature flag. + */ +static const char *kFeatureFlagKey = "feature_flag.key"; + +/** + * The name of the service provider that performs the flag evaluation. + */ +static const char *kFeatureFlagProviderName = "feature_flag.provider_name"; + +/** + * SHOULD be a semantic identifier for a value. If one is unavailable, a stringified version of the + * value can be used. Note: A semantic identifier, commonly referred to as a variant, provides a + * means for referring to a value without including the value itself. This can provide additional + * context for understanding the meaning behind a value. For example, the variant @code red @endcode + * maybe be used for the value @code #c05543 @endcode.

A stringified version of the value can be + * used in situations where a semantic identifier is unavailable. String representation of the value + * should be determined by the implementer. + */ +static const char *kFeatureFlagVariant = "feature_flag.variant"; + +} // namespace feature_flag +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/file_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/file_attributes.h new file mode 100644 index 0000000000..e77d0c6c6e --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/file_attributes.h @@ -0,0 +1,54 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace file +{ + +/** + * Directory where the file is located. It should include the drive letter, when appropriate. + */ +static const char *kFileDirectory = "file.directory"; + +/** + * File extension, excluding the leading dot. + * Note: When the file name has multiple extensions (example.tar.gz), only the last one should be + * captured ("gz", not "tar.gz"). + */ +static const char *kFileExtension = "file.extension"; + +/** + * Name of the file including the extension, without the directory. + */ +static const char *kFileName = "file.name"; + +/** + * Full path to the file, including the file name. It should include the drive letter, when + * appropriate. + */ +static const char *kFilePath = "file.path"; + +/** + * File size in bytes. + */ +static const char *kFileSize = "file.size"; + +} // namespace file +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/gcp_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/gcp_attributes.h new file mode 100644 index 0000000000..3902f3eb01 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/gcp_attributes.h @@ -0,0 +1,65 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace gcp +{ + +/** + * Identifies the Google Cloud service for which the official client library is intended. + * Note: Intended to be a stable identifier for Google Cloud client libraries that is uniform across + * implementation languages. The value should be derived from the canonical service domain for the + * service; for example, 'foo.googleapis.com' should result in a value of 'foo'. + */ +static const char *kGcpClientService = "gcp.client.service"; + +/** + * The name of the Cloud Run execution being run for the + * Job, as set by the @code + * CLOUD_RUN_EXECUTION @endcode environment variable. + */ +static const char *kGcpCloudRunJobExecution = "gcp.cloud_run.job.execution"; + +/** + * The index for a task within an execution as provided by the @code + * CLOUD_RUN_TASK_INDEX @endcode environment variable. + */ +static const char *kGcpCloudRunJobTaskIndex = "gcp.cloud_run.job.task_index"; + +/** + * The hostname of a GCE instance. This is the full value of the default or custom hostname. + */ +static const char *kGcpGceInstanceHostname = "gcp.gce.instance.hostname"; + +/** + * The instance name of a GCE instance. This is the value provided by @code host.name @endcode, the + * visible name of the instance in the Cloud Console UI, and the prefix for the default hostname of + * the instance as defined by the default + * internal DNS name. + */ +static const char *kGcpGceInstanceName = "gcp.gce.instance.name"; + +} // namespace gcp +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/gen_ai_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/gen_ai_attributes.h new file mode 100644 index 0000000000..f05802adff --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/gen_ai_attributes.h @@ -0,0 +1,240 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace gen_ai +{ + +/** + * The full response received from the GenAI model. + * Note: It's RECOMMENDED to format completions as JSON string matching OpenAI messages format. + */ +static const char *kGenAiCompletion = "gen_ai.completion"; + +/** + * The name of the operation being performed. + * Note: If one of the predefined values applies, but specific system uses a different name it's + * RECOMMENDED to document it in the semantic conventions for specific GenAI system and use + * system-specific name in the instrumentation. If a different name is not documented, + * instrumentation libraries SHOULD use applicable predefined value. + */ +static const char *kGenAiOperationName = "gen_ai.operation.name"; + +/** + * The full prompt sent to the GenAI model. + * Note: It's RECOMMENDED to format prompts as JSON string matching OpenAI messages format. + */ +static const char *kGenAiPrompt = "gen_ai.prompt"; + +/** + * The frequency penalty setting for the GenAI request. + */ +static const char *kGenAiRequestFrequencyPenalty = "gen_ai.request.frequency_penalty"; + +/** + * The maximum number of tokens the model generates for a request. + */ +static const char *kGenAiRequestMaxTokens = "gen_ai.request.max_tokens"; + +/** + * The name of the GenAI model a request is being made to. + */ +static const char *kGenAiRequestModel = "gen_ai.request.model"; + +/** + * The presence penalty setting for the GenAI request. + */ +static const char *kGenAiRequestPresencePenalty = "gen_ai.request.presence_penalty"; + +/** + * List of sequences that the model will use to stop generating further tokens. + */ +static const char *kGenAiRequestStopSequences = "gen_ai.request.stop_sequences"; + +/** + * The temperature setting for the GenAI request. + */ +static const char *kGenAiRequestTemperature = "gen_ai.request.temperature"; + +/** + * The top_k sampling setting for the GenAI request. + */ +static const char *kGenAiRequestTopK = "gen_ai.request.top_k"; + +/** + * The top_p sampling setting for the GenAI request. + */ +static const char *kGenAiRequestTopP = "gen_ai.request.top_p"; + +/** + * Array of reasons the model stopped generating tokens, corresponding to each generation received. + */ +static const char *kGenAiResponseFinishReasons = "gen_ai.response.finish_reasons"; + +/** + * The unique identifier for the completion. + */ +static const char *kGenAiResponseId = "gen_ai.response.id"; + +/** + * The name of the model that generated the response. + */ +static const char *kGenAiResponseModel = "gen_ai.response.model"; + +/** + * The Generative AI product as identified by the client or server instrumentation. + * Note: The @code gen_ai.system @endcode describes a family of GenAI models with specific model + * identified by @code gen_ai.request.model @endcode and @code gen_ai.response.model @endcode + * attributes.

The actual GenAI product may differ from the one identified by the client. For + * example, when using OpenAI client libraries to communicate with Mistral, the @code gen_ai.system + * @endcode is set to @code openai @endcode based on the instrumentation's best knowledge.

For + * custom model, a custom friendly name SHOULD be used. If none of these options apply, the @code + * gen_ai.system @endcode SHOULD be set to @code _OTHER @endcode. + */ +static const char *kGenAiSystem = "gen_ai.system"; + +/** + * The type of token being counted. + */ +static const char *kGenAiTokenType = "gen_ai.token.type"; + +/** + * @Deprecated: Replaced by @code gen_ai.usage.output_tokens @endcode attribute. + */ +static const char *kGenAiUsageCompletionTokens = "gen_ai.usage.completion_tokens"; + +/** + * The number of tokens used in the GenAI input (prompt). + */ +static const char *kGenAiUsageInputTokens = "gen_ai.usage.input_tokens"; + +/** + * The number of tokens used in the GenAI response (completion). + */ +static const char *kGenAiUsageOutputTokens = "gen_ai.usage.output_tokens"; + +/** + * @Deprecated: Replaced by @code gen_ai.usage.input_tokens @endcode attribute. + */ +static const char *kGenAiUsagePromptTokens = "gen_ai.usage.prompt_tokens"; + +// DEBUG: {"brief": "The name of the operation being performed.", "name": "gen_ai.operation.name", +// "note": "If one of the predefined values applies, but specific system uses a different name it's +// RECOMMENDED to document it in the semantic conventions for specific GenAI system and use +// system-specific name in the instrumentation. If a different name is not documented, +// instrumentation libraries SHOULD use applicable predefined value.\n", "requirement_level": +// "recommended", "root_namespace": "gen_ai", "stability": "experimental", "type": +// {"allow_custom_values": true, "members": [{"brief": "Chat completion operation such as [OpenAI +// Chat API](https://platform.openai.com/docs/api-reference/chat)", "deprecated": none, "id": +// "chat", "note": none, "stability": "experimental", "value": "chat"}, {"brief": "Text completions +// operation such as [OpenAI Completions API +// (Legacy)](https://platform.openai.com/docs/api-reference/completions)", "deprecated": none, "id": +// "text_completion", "note": none, "stability": "experimental", "value": "text_completion"}]}} +namespace GenAiOperationNameValues +{ +/** + * Chat completion operation such as OpenAI Chat API. + */ +// DEBUG: {"brief": "Chat completion operation such as [OpenAI Chat +// API](https://platform.openai.com/docs/api-reference/chat)", "deprecated": none, "id": "chat", +// "note": none, "stability": "experimental", "value": "chat"} +static constexpr const char *kChat = "chat"; +/** + * Text completions operation such as OpenAI Completions API + * (Legacy). + */ +// DEBUG: {"brief": "Text completions operation such as [OpenAI Completions API +// (Legacy)](https://platform.openai.com/docs/api-reference/completions)", "deprecated": none, "id": +// "text_completion", "note": none, "stability": "experimental", "value": "text_completion"} +static constexpr const char *kTextCompletion = "text_completion"; +} // namespace GenAiOperationNameValues + +// DEBUG: {"brief": "The Generative AI product as identified by the client or server +// instrumentation.", "examples": "openai", "name": "gen_ai.system", "note": "The `gen_ai.system` +// describes a family of GenAI models with specific model identified\nby `gen_ai.request.model` and +// `gen_ai.response.model` attributes.\n\nThe actual GenAI product may differ from the one +// identified by the client.\nFor example, when using OpenAI client libraries to communicate with +// Mistral, the `gen_ai.system`\nis set to `openai` based on the instrumentation's best +// knowledge.\n\nFor custom model, a custom friendly name SHOULD be used.\nIf none of these options +// apply, the `gen_ai.system` SHOULD be set to `_OTHER`.\n", "requirement_level": "recommended", +// "root_namespace": "gen_ai", "stability": "experimental", "type": {"allow_custom_values": true, +// "members": [{"brief": "OpenAI", "deprecated": none, "id": "openai", "note": none, "stability": +// "experimental", "value": "openai"}, {"brief": "Vertex AI", "deprecated": none, "id": "vertex_ai", +// "note": none, "stability": "experimental", "value": "vertex_ai"}, {"brief": "Anthropic", +// "deprecated": none, "id": "anthropic", "note": none, "stability": "experimental", "value": +// "anthropic"}, {"brief": "Cohere", "deprecated": none, "id": "cohere", "note": none, "stability": +// "experimental", "value": "cohere"}]}} +namespace GenAiSystemValues +{ +/** + * OpenAI. + */ +// DEBUG: {"brief": "OpenAI", "deprecated": none, "id": "openai", "note": none, "stability": +// "experimental", "value": "openai"} +static constexpr const char *kOpenai = "openai"; +/** + * Vertex AI. + */ +// DEBUG: {"brief": "Vertex AI", "deprecated": none, "id": "vertex_ai", "note": none, "stability": +// "experimental", "value": "vertex_ai"} +static constexpr const char *kVertexAi = "vertex_ai"; +/** + * Anthropic. + */ +// DEBUG: {"brief": "Anthropic", "deprecated": none, "id": "anthropic", "note": none, "stability": +// "experimental", "value": "anthropic"} +static constexpr const char *kAnthropic = "anthropic"; +/** + * Cohere. + */ +// DEBUG: {"brief": "Cohere", "deprecated": none, "id": "cohere", "note": none, "stability": +// "experimental", "value": "cohere"} +static constexpr const char *kCohere = "cohere"; +} // namespace GenAiSystemValues + +// DEBUG: {"brief": "The type of token being counted.", "examples": ["input", "output"], "name": +// "gen_ai.token.type", "requirement_level": "recommended", "root_namespace": "gen_ai", "stability": +// "experimental", "type": {"allow_custom_values": true, "members": [{"brief": "Input tokens +// (prompt, input, etc.)", "deprecated": none, "id": "input", "note": none, "stability": +// "experimental", "value": "input"}, {"brief": "Output tokens (completion, response, etc.)", +// "deprecated": none, "id": "completion", "note": none, "stability": "experimental", "value": +// "output"}]}} +namespace GenAiTokenTypeValues +{ +/** + * Input tokens (prompt, input, etc.). + */ +// DEBUG: {"brief": "Input tokens (prompt, input, etc.)", "deprecated": none, "id": "input", "note": +// none, "stability": "experimental", "value": "input"} +static constexpr const char *kInput = "input"; +/** + * Output tokens (completion, response, etc.). + */ +// DEBUG: {"brief": "Output tokens (completion, response, etc.)", "deprecated": none, "id": +// "completion", "note": none, "stability": "experimental", "value": "output"} +static constexpr const char *kCompletion = "output"; +} // namespace GenAiTokenTypeValues + +} // namespace gen_ai +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/graphql_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/graphql_attributes.h new file mode 100644 index 0000000000..77aa8c9731 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/graphql_attributes.h @@ -0,0 +1,72 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace graphql +{ + +/** + * The GraphQL document being executed. + * Note: The value may be sanitized to exclude sensitive information. + */ +static const char *kGraphqlDocument = "graphql.document"; + +/** + * The name of the operation being executed. + */ +static const char *kGraphqlOperationName = "graphql.operation.name"; + +/** + * The type of the operation being executed. + */ +static const char *kGraphqlOperationType = "graphql.operation.type"; + +// DEBUG: {"brief": "The type of the operation being executed.", "examples": ["query", "mutation", +// "subscription"], "name": "graphql.operation.type", "requirement_level": "recommended", +// "root_namespace": "graphql", "stability": "experimental", "type": {"allow_custom_values": true, +// "members": [{"brief": "GraphQL query", "deprecated": none, "id": "query", "note": none, +// "stability": "experimental", "value": "query"}, {"brief": "GraphQL mutation", "deprecated": none, +// "id": "mutation", "note": none, "stability": "experimental", "value": "mutation"}, {"brief": +// "GraphQL subscription", "deprecated": none, "id": "subscription", "note": none, "stability": +// "experimental", "value": "subscription"}]}} +namespace GraphqlOperationTypeValues +{ +/** + * GraphQL query. + */ +// DEBUG: {"brief": "GraphQL query", "deprecated": none, "id": "query", "note": none, "stability": +// "experimental", "value": "query"} +static constexpr const char *kQuery = "query"; +/** + * GraphQL mutation. + */ +// DEBUG: {"brief": "GraphQL mutation", "deprecated": none, "id": "mutation", "note": none, +// "stability": "experimental", "value": "mutation"} +static constexpr const char *kMutation = "mutation"; +/** + * GraphQL subscription. + */ +// DEBUG: {"brief": "GraphQL subscription", "deprecated": none, "id": "subscription", "note": none, +// "stability": "experimental", "value": "subscription"} +static constexpr const char *kSubscription = "subscription"; +} // namespace GraphqlOperationTypeValues + +} // namespace graphql +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/heroku_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/heroku_attributes.h new file mode 100644 index 0000000000..3854c0f60b --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/heroku_attributes.h @@ -0,0 +1,41 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace heroku +{ + +/** + * Unique identifier for the application. + */ +static const char *kHerokuAppId = "heroku.app.id"; + +/** + * Commit hash for the current release. + */ +static const char *kHerokuReleaseCommit = "heroku.release.commit"; + +/** + * Time and date the release was created. + */ +static const char *kHerokuReleaseCreationTimestamp = "heroku.release.creation_timestamp"; + +} // namespace heroku +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/host_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/host_attributes.h new file mode 100644 index 0000000000..216b14216b --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/host_attributes.h @@ -0,0 +1,180 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace host +{ + +/** + * The CPU architecture the host system is running on. + */ +static const char *kHostArch = "host.arch"; + +/** + * The amount of level 2 memory cache available to the processor (in Bytes). + */ +static const char *kHostCpuCacheL2Size = "host.cpu.cache.l2.size"; + +/** + * Family or generation of the CPU. + */ +static const char *kHostCpuFamily = "host.cpu.family"; + +/** + * Model identifier. It provides more granular information about the CPU, distinguishing it from + * other CPUs within the same family. + */ +static const char *kHostCpuModelId = "host.cpu.model.id"; + +/** + * Model designation of the processor. + */ +static const char *kHostCpuModelName = "host.cpu.model.name"; + +/** + * Stepping or core revisions. + */ +static const char *kHostCpuStepping = "host.cpu.stepping"; + +/** + * Processor manufacturer identifier. A maximum 12-character string. + * Note: CPUID command returns the vendor ID string in + * EBX, EDX and ECX registers. Writing these to memory in this order results in a 12-character + * string. + */ +static const char *kHostCpuVendorId = "host.cpu.vendor.id"; + +/** + * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For + * non-containerized systems, this should be the @code machine-id @endcode. See the table below for + * the sources to use to determine the @code machine-id @endcode based on operating system. + */ +static const char *kHostId = "host.id"; + +/** + * VM image ID or host OS image ID. For Cloud, this value is from the provider. + */ +static const char *kHostImageId = "host.image.id"; + +/** + * Name of the VM image or OS install the host was instantiated from. + */ +static const char *kHostImageName = "host.image.name"; + +/** + * The version string of the VM image or host OS as defined in Version Attributes. + */ +static const char *kHostImageVersion = "host.image.version"; + +/** + * Available IP addresses of the host, excluding loopback interfaces. + * Note: IPv4 Addresses MUST be specified in dotted-quad notation. IPv6 addresses MUST be specified + * in the RFC 5952 format. + */ +static const char *kHostIp = "host.ip"; + +/** + * Available MAC addresses of the host, excluding loopback interfaces. + * Note: MAC Addresses MUST be represented in IEEE RA + * hexadecimal form: as hyphen-separated octets in uppercase hexadecimal form from most to least + * significant. + */ +static const char *kHostMac = "host.mac"; + +/** + * Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully + * qualified hostname, or another name specified by the user. + */ +static const char *kHostName = "host.name"; + +/** + * Type of host. For Cloud, this must be the machine type. + */ +static const char *kHostType = "host.type"; + +// DEBUG: {"brief": "The CPU architecture the host system is running on.\n", "name": "host.arch", +// "requirement_level": "recommended", "root_namespace": "host", "stability": "experimental", +// "type": {"allow_custom_values": true, "members": [{"brief": "AMD64", "deprecated": none, "id": +// "amd64", "note": none, "stability": "experimental", "value": "amd64"}, {"brief": "ARM32", +// "deprecated": none, "id": "arm32", "note": none, "stability": "experimental", "value": "arm32"}, +// {"brief": "ARM64", "deprecated": none, "id": "arm64", "note": none, "stability": "experimental", +// "value": "arm64"}, {"brief": "Itanium", "deprecated": none, "id": "ia64", "note": none, +// "stability": "experimental", "value": "ia64"}, {"brief": "32-bit PowerPC", "deprecated": none, +// "id": "ppc32", "note": none, "stability": "experimental", "value": "ppc32"}, {"brief": "64-bit +// PowerPC", "deprecated": none, "id": "ppc64", "note": none, "stability": "experimental", "value": +// "ppc64"}, {"brief": "IBM z/Architecture", "deprecated": none, "id": "s390x", "note": none, +// "stability": "experimental", "value": "s390x"}, {"brief": "32-bit x86", "deprecated": none, "id": +// "x86", "note": none, "stability": "experimental", "value": "x86"}]}} +namespace HostArchValues +{ +/** + * AMD64. + */ +// DEBUG: {"brief": "AMD64", "deprecated": none, "id": "amd64", "note": none, "stability": +// "experimental", "value": "amd64"} +static constexpr const char *kAmd64 = "amd64"; +/** + * ARM32. + */ +// DEBUG: {"brief": "ARM32", "deprecated": none, "id": "arm32", "note": none, "stability": +// "experimental", "value": "arm32"} +static constexpr const char *kArm32 = "arm32"; +/** + * ARM64. + */ +// DEBUG: {"brief": "ARM64", "deprecated": none, "id": "arm64", "note": none, "stability": +// "experimental", "value": "arm64"} +static constexpr const char *kArm64 = "arm64"; +/** + * Itanium. + */ +// DEBUG: {"brief": "Itanium", "deprecated": none, "id": "ia64", "note": none, "stability": +// "experimental", "value": "ia64"} +static constexpr const char *kIa64 = "ia64"; +/** + * 32-bit PowerPC. + */ +// DEBUG: {"brief": "32-bit PowerPC", "deprecated": none, "id": "ppc32", "note": none, "stability": +// "experimental", "value": "ppc32"} +static constexpr const char *kPpc32 = "ppc32"; +/** + * 64-bit PowerPC. + */ +// DEBUG: {"brief": "64-bit PowerPC", "deprecated": none, "id": "ppc64", "note": none, "stability": +// "experimental", "value": "ppc64"} +static constexpr const char *kPpc64 = "ppc64"; +/** + * IBM z/Architecture. + */ +// DEBUG: {"brief": "IBM z/Architecture", "deprecated": none, "id": "s390x", "note": none, +// "stability": "experimental", "value": "s390x"} +static constexpr const char *kS390x = "s390x"; +/** + * 32-bit x86. + */ +// DEBUG: {"brief": "32-bit x86", "deprecated": none, "id": "x86", "note": none, "stability": +// "experimental", "value": "x86"} +static constexpr const char *kX86 = "x86"; +} // namespace HostArchValues + +} // namespace host +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/http_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/http_attributes.h new file mode 100644 index 0000000000..5450f06f92 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/http_attributes.h @@ -0,0 +1,358 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace http +{ + +/** + * @Deprecated: Replaced by @code client.address @endcode. + */ +static const char *kHttpClientIp = "http.client_ip"; + +/** + * State of the HTTP connection in the HTTP connection pool. + */ +static const char *kHttpConnectionState = "http.connection.state"; + +/** + * @Deprecated: Replaced by @code network.protocol.name @endcode. + */ +static const char *kHttpFlavor = "http.flavor"; + +/** + * @Deprecated: Replaced by one of @code server.address @endcode, @code client.address @endcode or + * @code http.request.header.host @endcode, depending on the usage. + */ +static const char *kHttpHost = "http.host"; + +/** + * @Deprecated: Replaced by @code http.request.method @endcode. + */ +static const char *kHttpMethod = "http.method"; + +/** + * 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 + * header. For requests using transport encoding, this should be the compressed size. + */ +static const char *kHttpRequestBodySize = "http.request.body.size"; + +/** + * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.http_attributes. + * @endcode. + */ +static const char *kHttpRequestHeader = "http.request.header"; + +/** + * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.http_attributes. + * @endcode. + */ +static const char *kHttpRequestMethod = "http.request.method"; + +/** + * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.http_attributes. + * @endcode. + */ +static const char *kHttpRequestMethodOriginal = "http.request.method_original"; + +/** + * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.http_attributes. + * @endcode. + */ +static const char *kHttpRequestResendCount = "http.request.resend_count"; + +/** + * 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. + */ +static const char *kHttpRequestSize = "http.request.size"; + +/** + * @Deprecated: Replaced by @code http.request.header.content-length @endcode. + */ +static const char *kHttpRequestContentLength = "http.request_content_length"; + +/** + * @Deprecated: Replaced by @code http.request.body.size @endcode. + */ +static const char *kHttpRequestContentLengthUncompressed = + "http.request_content_length_uncompressed"; + +/** + * 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 + * header. For requests using transport encoding, this should be the compressed size. + */ +static const char *kHttpResponseBodySize = "http.response.body.size"; + +/** + * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.http_attributes. + * @endcode. + */ +static const char *kHttpResponseHeader = "http.response.header"; + +/** + * 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. + */ +static const char *kHttpResponseSize = "http.response.size"; + +/** + * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.http_attributes. + * @endcode. + */ +static const char *kHttpResponseStatusCode = "http.response.status_code"; + +/** + * @Deprecated: Replaced by @code http.response.header.content-length @endcode. + */ +static const char *kHttpResponseContentLength = "http.response_content_length"; + +/** + * @Deprecated: Replace by @code http.response.body.size @endcode. + */ +static const char *kHttpResponseContentLengthUncompressed = + "http.response_content_length_uncompressed"; + +/** + * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.http_attributes. + * @endcode. + */ +static const char *kHttpRoute = "http.route"; + +/** + * @Deprecated: Replaced by @code url.scheme @endcode instead. + */ +static const char *kHttpScheme = "http.scheme"; + +/** + * @Deprecated: Replaced by @code server.address @endcode. + */ +static const char *kHttpServerName = "http.server_name"; + +/** + * @Deprecated: Replaced by @code http.response.status_code @endcode. + */ +static const char *kHttpStatusCode = "http.status_code"; + +/** + * @Deprecated: Split to @code url.path @endcode and `url.query. + */ +static const char *kHttpTarget = "http.target"; + +/** + * @Deprecated: Replaced by @code url.full @endcode. + */ +static const char *kHttpUrl = "http.url"; + +/** + * @Deprecated: Replaced by @code user_agent.original @endcode. + */ +static const char *kHttpUserAgent = "http.user_agent"; + +// DEBUG: {"brief": "State of the HTTP connection in the HTTP connection pool.", "examples": +// ["active", "idle"], "name": "http.connection.state", "requirement_level": "recommended", +// "root_namespace": "http", "stability": "experimental", "type": {"allow_custom_values": true, +// "members": [{"brief": "active state.", "deprecated": none, "id": "active", "note": none, +// "stability": "experimental", "value": "active"}, {"brief": "idle state.", "deprecated": none, +// "id": "idle", "note": none, "stability": "experimental", "value": "idle"}]}} +namespace HttpConnectionStateValues +{ +/** + * active state. + */ +// DEBUG: {"brief": "active state.", "deprecated": none, "id": "active", "note": none, "stability": +// "experimental", "value": "active"} +static constexpr const char *kActive = "active"; +/** + * idle state. + */ +// DEBUG: {"brief": "idle state.", "deprecated": none, "id": "idle", "note": none, "stability": +// "experimental", "value": "idle"} +static constexpr const char *kIdle = "idle"; +} // namespace HttpConnectionStateValues + +// @deprecated(reason="The attribute http.flavor is deprecated - Replaced by +// `network.protocol.name`") # type: ignore DEBUG: {"brief": "Deprecated, use +// `network.protocol.name` instead.", "deprecated": "Replaced by `network.protocol.name`.", "name": +// "http.flavor", "requirement_level": "recommended", "root_namespace": "http", "stability": +// "experimental", "type": {"allow_custom_values": true, "members": [{"brief": "HTTP/1.0", +// "deprecated": none, "id": "http_1_0", "note": none, "stability": "experimental", "value": "1.0"}, +// {"brief": "HTTP/1.1", "deprecated": none, "id": "http_1_1", "note": none, "stability": +// "experimental", "value": "1.1"}, {"brief": "HTTP/2", "deprecated": none, "id": "http_2_0", +// "note": none, "stability": "experimental", "value": "2.0"}, {"brief": "HTTP/3", "deprecated": +// none, "id": "http_3_0", "note": none, "stability": "experimental", "value": "3.0"}, {"brief": +// "SPDY protocol.", "deprecated": none, "id": "spdy", "note": none, "stability": "experimental", +// "value": "SPDY"}, {"brief": "QUIC protocol.", "deprecated": none, "id": "quic", "note": none, +// "stability": "experimental", "value": "QUIC"}]}} +namespace HttpFlavorValues +{ +/** + * HTTP/1.0. + */ +// DEBUG: {"brief": "HTTP/1.0", "deprecated": none, "id": "http_1_0", "note": none, "stability": +// "experimental", "value": "1.0"} +static constexpr const char *kHttp10 = "1.0"; +/** + * HTTP/1.1. + */ +// DEBUG: {"brief": "HTTP/1.1", "deprecated": none, "id": "http_1_1", "note": none, "stability": +// "experimental", "value": "1.1"} +static constexpr const char *kHttp11 = "1.1"; +/** + * HTTP/2. + */ +// DEBUG: {"brief": "HTTP/2", "deprecated": none, "id": "http_2_0", "note": none, "stability": +// "experimental", "value": "2.0"} +static constexpr const char *kHttp20 = "2.0"; +/** + * HTTP/3. + */ +// DEBUG: {"brief": "HTTP/3", "deprecated": none, "id": "http_3_0", "note": none, "stability": +// "experimental", "value": "3.0"} +static constexpr const char *kHttp30 = "3.0"; +/** + * SPDY protocol. + */ +// DEBUG: {"brief": "SPDY protocol.", "deprecated": none, "id": "spdy", "note": none, "stability": +// "experimental", "value": "SPDY"} +static constexpr const char *kSpdy = "SPDY"; +/** + * QUIC protocol. + */ +// DEBUG: {"brief": "QUIC protocol.", "deprecated": none, "id": "quic", "note": none, "stability": +// "experimental", "value": "QUIC"} +static constexpr const char *kQuic = "QUIC"; +} // namespace HttpFlavorValues + +// @deprecated(reason="Deprecated in favor of stable +// `opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues`.") # type: ignore +// DEBUG: {"brief": "HTTP request method.", "examples": ["GET", "POST", "HEAD"], "name": +// "http.request.method", "note": "HTTP request method value SHOULD be \"known\" to the +// instrumentation.\nBy default, this convention defines \"known\" methods as the ones listed in +// [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods)\nand the PATCH method defined +// in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html).\n\nIf the HTTP request method is not +// known to instrumentation, it MUST set the `http.request.method` attribute to `_OTHER`.\n\nIf the +// HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it MUST +// provide a way to override\nthe list of known HTTP methods. If this override is done via +// environment variable, then the environment variable MUST be +// named\nOTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of +// case-sensitive known HTTP methods\n(this list MUST be a full override of the default known +// method, it is not a list of known methods in addition to the defaults).\n\nHTTP method names are +// case-sensitive and `http.request.method` attribute value MUST match a known HTTP method name +// exactly.\nInstrumentations for specific web frameworks that consider HTTP methods to be case +// insensitive, SHOULD populate a canonical equivalent.\nTracing instrumentations that do so, MUST +// also set `http.request.method_original` to the original value.\n", "requirement_level": +// "recommended", "root_namespace": "http", "stability": "stable", "type": {"allow_custom_values": +// true, "members": [{"brief": "CONNECT method.", "deprecated": none, "id": "connect", "note": none, +// "stability": "stable", "value": "CONNECT"}, {"brief": "DELETE method.", "deprecated": none, "id": +// "delete", "note": none, "stability": "stable", "value": "DELETE"}, {"brief": "GET method.", +// "deprecated": none, "id": "get", "note": none, "stability": "stable", "value": "GET"}, {"brief": +// "HEAD method.", "deprecated": none, "id": "head", "note": none, "stability": "stable", "value": +// "HEAD"}, {"brief": "OPTIONS method.", "deprecated": none, "id": "options", "note": none, +// "stability": "stable", "value": "OPTIONS"}, {"brief": "PATCH method.", "deprecated": none, "id": +// "patch", "note": none, "stability": "stable", "value": "PATCH"}, {"brief": "POST method.", +// "deprecated": none, "id": "post", "note": none, "stability": "stable", "value": "POST"}, +// {"brief": "PUT method.", "deprecated": none, "id": "put", "note": none, "stability": "stable", +// "value": "PUT"}, {"brief": "TRACE method.", "deprecated": none, "id": "trace", "note": none, +// "stability": "stable", "value": "TRACE"}, {"brief": "Any HTTP method that the instrumentation has +// no prior knowledge of.", "deprecated": none, "id": "other", "note": none, "stability": "stable", +// "value": "_OTHER"}]}} +namespace HttpRequestMethodValues +{ +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues.kConnect @endcode. + */ +// DEBUG: {"brief": "CONNECT method.", "deprecated": none, "id": "connect", "note": none, +// "stability": "stable", "value": "CONNECT"} +static constexpr const char *kConnect = "CONNECT"; +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues.kDelete @endcode. + */ +// DEBUG: {"brief": "DELETE method.", "deprecated": none, "id": "delete", "note": none, "stability": +// "stable", "value": "DELETE"} +static constexpr const char *kDelete = "DELETE"; +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues.kGet @endcode. + */ +// DEBUG: {"brief": "GET method.", "deprecated": none, "id": "get", "note": none, "stability": +// "stable", "value": "GET"} +static constexpr const char *kGet = "GET"; +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues.kHead @endcode. + */ +// DEBUG: {"brief": "HEAD method.", "deprecated": none, "id": "head", "note": none, "stability": +// "stable", "value": "HEAD"} +static constexpr const char *kHead = "HEAD"; +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues.kOptions @endcode. + */ +// DEBUG: {"brief": "OPTIONS method.", "deprecated": none, "id": "options", "note": none, +// "stability": "stable", "value": "OPTIONS"} +static constexpr const char *kOptions = "OPTIONS"; +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues.kPatch @endcode. + */ +// DEBUG: {"brief": "PATCH method.", "deprecated": none, "id": "patch", "note": none, "stability": +// "stable", "value": "PATCH"} +static constexpr const char *kPatch = "PATCH"; +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues.kPost @endcode. + */ +// DEBUG: {"brief": "POST method.", "deprecated": none, "id": "post", "note": none, "stability": +// "stable", "value": "POST"} +static constexpr const char *kPost = "POST"; +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues.kPut @endcode. + */ +// DEBUG: {"brief": "PUT method.", "deprecated": none, "id": "put", "note": none, "stability": +// "stable", "value": "PUT"} +static constexpr const char *kPut = "PUT"; +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues.kTrace @endcode. + */ +// DEBUG: {"brief": "TRACE method.", "deprecated": none, "id": "trace", "note": none, "stability": +// "stable", "value": "TRACE"} +static constexpr const char *kTrace = "TRACE"; +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues.kOther @endcode. + */ +// DEBUG: {"brief": "Any HTTP method that the instrumentation has no prior knowledge of.", +// "deprecated": none, "id": "other", "note": none, "stability": "stable", "value": "_OTHER"} +static constexpr const char *kOther = "_OTHER"; +} // namespace HttpRequestMethodValues + +} // namespace http +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/k8s_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/k8s_attributes.h new file mode 100644 index 0000000000..b6f21a38ad --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/k8s_attributes.h @@ -0,0 +1,177 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace k8s +{ + +/** + * The name of the cluster. + */ +static const char *kK8sClusterName = "k8s.cluster.name"; + +/** + * A pseudo-ID for the cluster, set to the UID of the @code kube-system @endcode namespace. + * Note: K8s doesn't have support for obtaining a cluster ID. If this is ever + * added, we will recommend collecting the @code k8s.cluster.uid @endcode through the + * official APIs. In the meantime, we are able to use the @code uid @endcode of the + * @code kube-system @endcode namespace as a proxy for cluster ID. Read on for the + * rationale. + *

+ * Every object created in a K8s cluster is assigned a distinct UID. The + * @code kube-system @endcode namespace is used by Kubernetes itself and will exist + * for the lifetime of the cluster. Using the @code uid @endcode of the @code kube-system @endcode + * namespace is a reasonable proxy for the K8s ClusterID as it will only + * change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are + * UUIDs as standardized by + * ISO/IEC 9834-8 and ITU-T + * X.667. Which states:

If generated according to one of the mechanisms defined + * in Rec. ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be different from all other + * UUIDs generated before 3603 A.D., or is extremely likely to be different (depending on the + * mechanism chosen).
+ * + *

+ * Therefore, UIDs between clusters should be extremely unlikely to + * conflict. + */ +static const char *kK8sClusterUid = "k8s.cluster.uid"; + +/** + * The name of the Container from Pod specification, must be unique within a Pod. Container runtime + * usually uses different globally unique name (@code container.name @endcode). + */ +static const char *kK8sContainerName = "k8s.container.name"; + +/** + * Number of times the container was restarted. This attribute can be used to identify a particular + * container (running or stopped) within a container spec. + */ +static const char *kK8sContainerRestartCount = "k8s.container.restart_count"; + +/** + * Last terminated reason of the Container. + */ +static const char *kK8sContainerStatusLastTerminatedReason = + "k8s.container.status.last_terminated_reason"; + +/** + * The name of the CronJob. + */ +static const char *kK8sCronjobName = "k8s.cronjob.name"; + +/** + * The UID of the CronJob. + */ +static const char *kK8sCronjobUid = "k8s.cronjob.uid"; + +/** + * The name of the DaemonSet. + */ +static const char *kK8sDaemonsetName = "k8s.daemonset.name"; + +/** + * The UID of the DaemonSet. + */ +static const char *kK8sDaemonsetUid = "k8s.daemonset.uid"; + +/** + * The name of the Deployment. + */ +static const char *kK8sDeploymentName = "k8s.deployment.name"; + +/** + * The UID of the Deployment. + */ +static const char *kK8sDeploymentUid = "k8s.deployment.uid"; + +/** + * The name of the Job. + */ +static const char *kK8sJobName = "k8s.job.name"; + +/** + * The UID of the Job. + */ +static const char *kK8sJobUid = "k8s.job.uid"; + +/** + * The name of the namespace that the pod is running in. + */ +static const char *kK8sNamespaceName = "k8s.namespace.name"; + +/** + * The name of the Node. + */ +static const char *kK8sNodeName = "k8s.node.name"; + +/** + * The UID of the Node. + */ +static const char *kK8sNodeUid = "k8s.node.uid"; + +/** + * The annotation key-value pairs placed on the Pod, the @code @endcode being the annotation + * name, the value being the annotation value. + */ +static const char *kK8sPodAnnotation = "k8s.pod.annotation"; + +/** + * The label key-value pairs placed on the Pod, the @code @endcode being the label name, the + * value being the label value. + */ +static const char *kK8sPodLabel = "k8s.pod.label"; + +/** + * @Deprecated: Replaced by @code k8s.pod.label @endcode. + */ +static const char *kK8sPodLabels = "k8s.pod.labels"; + +/** + * The name of the Pod. + */ +static const char *kK8sPodName = "k8s.pod.name"; + +/** + * The UID of the Pod. + */ +static const char *kK8sPodUid = "k8s.pod.uid"; + +/** + * The name of the ReplicaSet. + */ +static const char *kK8sReplicasetName = "k8s.replicaset.name"; + +/** + * The UID of the ReplicaSet. + */ +static const char *kK8sReplicasetUid = "k8s.replicaset.uid"; + +/** + * The name of the StatefulSet. + */ +static const char *kK8sStatefulsetName = "k8s.statefulset.name"; + +/** + * The UID of the StatefulSet. + */ +static const char *kK8sStatefulsetUid = "k8s.statefulset.uid"; + +} // namespace k8s +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/linux_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/linux_attributes.h new file mode 100644 index 0000000000..19f5a5af24 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/linux_attributes.h @@ -0,0 +1,53 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace linux +{ + +/** + * The Linux Slab memory state. + */ +static const char *kLinuxMemorySlabState = "linux.memory.slab.state"; + +// DEBUG: {"brief": "The Linux Slab memory state", "examples": ["reclaimable", "unreclaimable"], +// "name": "linux.memory.slab.state", "requirement_level": "recommended", "root_namespace": "linux", +// "stability": "experimental", "type": {"allow_custom_values": true, "members": [{"brief": none, +// "deprecated": none, "id": "reclaimable", "note": none, "stability": "experimental", "value": +// "reclaimable"}, {"brief": none, "deprecated": none, "id": "unreclaimable", "note": none, +// "stability": "experimental", "value": "unreclaimable"}]}} +namespace LinuxMemorySlabStateValues +{ +/** + * reclaimable. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "reclaimable", "note": none, "stability": +// "experimental", "value": "reclaimable"} +static constexpr const char *kReclaimable = "reclaimable"; +/** + * unreclaimable. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "unreclaimable", "note": none, "stability": +// "experimental", "value": "unreclaimable"} +static constexpr const char *kUnreclaimable = "unreclaimable"; +} // namespace LinuxMemorySlabStateValues + +} // namespace linux +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/log_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/log_attributes.h new file mode 100644 index 0000000000..3b455bf23c --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/log_attributes.h @@ -0,0 +1,91 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace log +{ + +/** + * The basename of the file. + */ +static const char *kLogFileName = "log.file.name"; + +/** + * The basename of the file, with symlinks resolved. + */ +static const char *kLogFileNameResolved = "log.file.name_resolved"; + +/** + * The full path to the file. + */ +static const char *kLogFilePath = "log.file.path"; + +/** + * The full path to the file, with symlinks resolved. + */ +static const char *kLogFilePathResolved = "log.file.path_resolved"; + +/** + * The stream associated with the log. See below for a list of well-known values. + */ +static const char *kLogIostream = "log.iostream"; + +/** + * The complete orignal Log Record. + * Note: This value MAY be added when processing a Log Record which was originally transmitted as a + * string or equivalent data type AND the Body field of the Log Record does not contain the same + * value. (e.g. a syslog or a log record read from a file.). + */ +static const char *kLogRecordOriginal = "log.record.original"; + +/** + * A unique identifier for the Log Record. + * Note: If an id is provided, other log records with the same id will be considered duplicates and + * can be removed safely. This means, that two distinguishable log records MUST have different + * values. The id MAY be an Universally Unique + * Lexicographically Sortable Identifier (ULID), but other identifiers (e.g. UUID) may be used + * as needed. + */ +static const char *kLogRecordUid = "log.record.uid"; + +// DEBUG: {"brief": "The stream associated with the log. See below for a list of well-known +// values.\n", "name": "log.iostream", "requirement_level": "recommended", "root_namespace": "log", +// "stability": "experimental", "type": {"allow_custom_values": true, "members": [{"brief": "Logs +// from stdout stream", "deprecated": none, "id": "stdout", "note": none, "stability": +// "experimental", "value": "stdout"}, {"brief": "Events from stderr stream", "deprecated": none, +// "id": "stderr", "note": none, "stability": "experimental", "value": "stderr"}]}} +namespace LogIostreamValues +{ +/** + * Logs from stdout stream. + */ +// DEBUG: {"brief": "Logs from stdout stream", "deprecated": none, "id": "stdout", "note": none, +// "stability": "experimental", "value": "stdout"} +static constexpr const char *kStdout = "stdout"; +/** + * Events from stderr stream. + */ +// DEBUG: {"brief": "Events from stderr stream", "deprecated": none, "id": "stderr", "note": none, +// "stability": "experimental", "value": "stderr"} +static constexpr const char *kStderr = "stderr"; +} // namespace LogIostreamValues + +} // namespace log +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/message_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/message_attributes.h new file mode 100644 index 0000000000..6ce682415f --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/message_attributes.h @@ -0,0 +1,69 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace message +{ + +/** + * @Deprecated: Replaced by @code rpc.message.compressed_size @endcode. + */ +static const char *kMessageCompressedSize = "message.compressed_size"; + +/** + * @Deprecated: Replaced by @code rpc.message.id @endcode. + */ +static const char *kMessageId = "message.id"; + +/** + * @Deprecated: Replaced by @code rpc.message.type @endcode. + */ +static const char *kMessageType = "message.type"; + +/** + * @Deprecated: Replaced by @code rpc.message.uncompressed_size @endcode. + */ +static const char *kMessageUncompressedSize = "message.uncompressed_size"; + +// @deprecated(reason="The attribute message.type is deprecated - Replaced by `rpc.message.type`") +// # type: ignore DEBUG: {"brief": "Deprecated, use `rpc.message.type` instead.", "deprecated": +// "Replaced by `rpc.message.type`.", "name": "message.type", "requirement_level": "recommended", +// "root_namespace": "message", "stability": "experimental", "type": {"allow_custom_values": true, +// "members": [{"brief": none, "deprecated": none, "id": "sent", "note": none, "stability": +// "experimental", "value": "SENT"}, {"brief": none, "deprecated": none, "id": "received", "note": +// none, "stability": "experimental", "value": "RECEIVED"}]}} +namespace MessageTypeValues +{ +/** + * sent. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "sent", "note": none, "stability": +// "experimental", "value": "SENT"} +static constexpr const char *kSent = "SENT"; +/** + * received. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "received", "note": none, "stability": +// "experimental", "value": "RECEIVED"} +static constexpr const char *kReceived = "RECEIVED"; +} // namespace MessageTypeValues + +} // namespace message +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/messaging_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/messaging_attributes.h new file mode 100644 index 0000000000..77b6e7a7de --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/messaging_attributes.h @@ -0,0 +1,570 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace messaging +{ + +/** + * The number of messages sent, received, or processed in the scope of the batching operation. + * Note: Instrumentations SHOULD NOT set @code messaging.batch.message_count @endcode on spans that + * operate with a single message. When a messaging client library supports both batch and + * single-message API for the same operation, instrumentations SHOULD use @code + * messaging.batch.message_count @endcode for batching APIs and SHOULD NOT use it for single-message + * APIs. + */ +static const char *kMessagingBatchMessageCount = "messaging.batch.message_count"; + +/** + * A unique identifier for the client that consumes or produces a message. + */ +static const char *kMessagingClientId = "messaging.client.id"; + +// /** +*@Deprecated : Replaced by @code messaging.client.id @endcode.* / + // static const char *kMessagingClientId = "messaging.client_id"; + + /** + * The name of the consumer group with which a consumer is associated. + * Note: Semantic conventions for individual messaging systems SHOULD document whether @code + * messaging.consumer.group.name @endcode is applicable and what it means in the context of that + * system. + */ + static const char *kMessagingConsumerGroupName = "messaging.consumer.group.name"; + +/** + * A boolean that is true if the message destination is anonymous (could be unnamed or have + * auto-generated name). + */ +static const char *kMessagingDestinationAnonymous = "messaging.destination.anonymous"; + +/** + * The message destination name. + * Note: Destination name SHOULD uniquely identify a specific queue, topic or other entity within + * the broker. If the broker doesn't have such notion, the destination name SHOULD uniquely identify + * the broker. + */ +static const char *kMessagingDestinationName = "messaging.destination.name"; + +/** + * The identifier of the partition messages are sent to or received from, unique within the @code + * messaging.destination.name @endcode. + */ +static const char *kMessagingDestinationPartitionId = "messaging.destination.partition.id"; + +/** + * The name of the destination subscription from which a message is consumed. + * Note: Semantic conventions for individual messaging systems SHOULD document whether @code + * messaging.destination.subscription.name @endcode is applicable and what it means in the context + * of that system. + */ +static const char *kMessagingDestinationSubscriptionName = + "messaging.destination.subscription.name"; + +/** + * Low cardinality representation of the messaging destination name. + * Note: Destination names could be constructed from templates. An example would be a destination + * name involving a user name or product id. Although the destination name in this case is of high + * cardinality, the underlying template is of low cardinality and can be effectively used for + * grouping and aggregation. + */ +static const char *kMessagingDestinationTemplate = "messaging.destination.template"; + +/** + * A boolean that is true if the message destination is temporary and might not exist anymore after + * messages are processed. + */ +static const char *kMessagingDestinationTemporary = "messaging.destination.temporary"; + +/** + * @Deprecated: No replacement at this time. + */ +static const char *kMessagingDestinationPublishAnonymous = + "messaging.destination_publish.anonymous"; + +/** + * @Deprecated: No replacement at this time. + */ +static const char *kMessagingDestinationPublishName = "messaging.destination_publish.name"; + +/** + * @Deprecated: Replaced by @code messaging.consumer.group.name @endcode. + */ +static const char *kMessagingEventhubsConsumerGroup = "messaging.eventhubs.consumer.group"; + +/** + * The UTC epoch seconds at which the message has been accepted and stored in the entity. + */ +static const char *kMessagingEventhubsMessageEnqueuedTime = + "messaging.eventhubs.message.enqueued_time"; + +/** + * The ack deadline in seconds set for the modify ack deadline request. + */ +static const char *kMessagingGcpPubsubMessageAckDeadline = + "messaging.gcp_pubsub.message.ack_deadline"; + +/** + * The ack id for a given message. + */ +static const char *kMessagingGcpPubsubMessageAckId = "messaging.gcp_pubsub.message.ack_id"; + +/** + * The delivery attempt for a given message. + */ +static const char *kMessagingGcpPubsubMessageDeliveryAttempt = + "messaging.gcp_pubsub.message.delivery_attempt"; + +/** + * The ordering key for a given message. If the attribute is not present, the message does not have + * an ordering key. + */ +static const char *kMessagingGcpPubsubMessageOrderingKey = + "messaging.gcp_pubsub.message.ordering_key"; + +/** + * @Deprecated: Replaced by @code messaging.consumer.group.name @endcode. + */ +static const char *kMessagingKafkaConsumerGroup = "messaging.kafka.consumer.group"; + +/** + * @Deprecated: Replaced by @code messaging.destination.partition.id @endcode. + */ +static const char *kMessagingKafkaDestinationPartition = "messaging.kafka.destination.partition"; + +/** + * Message keys in Kafka are used for grouping alike messages to ensure they're processed on the + * same partition. They differ from @code messaging.message.id @endcode in that they're not unique. + * If the key is @code null @endcode, the attribute MUST NOT be set. Note: If the key type is not + * string, it's string representation has to be supplied for the attribute. If the key has no + * unambiguous, canonical string form, don't include its value. + */ +static const char *kMessagingKafkaMessageKey = "messaging.kafka.message.key"; + +/** + * @Deprecated: Replaced by @code messaging.kafka.offset @endcode. + */ +static const char *kMessagingKafkaMessageOffset = "messaging.kafka.message.offset"; + +/** + * A boolean that is true if the message is a tombstone. + */ +static const char *kMessagingKafkaMessageTombstone = "messaging.kafka.message.tombstone"; + +/** + * The offset of a record in the corresponding Kafka partition. + */ +static const char *kMessagingKafkaOffset = "messaging.kafka.offset"; + +/** + * The size of the message body in bytes. + * Note: This can refer to both the compressed or uncompressed body size. If both sizes are known, + * the uncompressed body size should be used. + */ +static const char *kMessagingMessageBodySize = "messaging.message.body.size"; + +/** + * The conversation ID identifying the conversation to which the message belongs, represented as a + * string. Sometimes called "Correlation ID". + */ +static const char *kMessagingMessageConversationId = "messaging.message.conversation_id"; + +/** + * The size of the message body and metadata in bytes. + * Note: This can refer to both the compressed or uncompressed size. If both sizes are known, the + * uncompressed size should be used. + */ +static const char *kMessagingMessageEnvelopeSize = "messaging.message.envelope.size"; + +/** + * A value used by the messaging system as an identifier for the message, represented as a string. + */ +static const char *kMessagingMessageId = "messaging.message.id"; + +/** + * @Deprecated: Replaced by @code messaging.operation.type @endcode. + */ +static const char *kMessagingOperation = "messaging.operation"; + +/** + * The system-specific name of the messaging operation. + */ +static const char *kMessagingOperationName = "messaging.operation.name"; + +/** + * A string identifying the type of the messaging operation. + * Note: If a custom value is used, it MUST be of low cardinality. + */ +static const char *kMessagingOperationType = "messaging.operation.type"; + +/** + * RabbitMQ message routing key. + */ +static const char *kMessagingRabbitmqDestinationRoutingKey = + "messaging.rabbitmq.destination.routing_key"; + +/** + * RabbitMQ message delivery tag. + */ +static const char *kMessagingRabbitmqMessageDeliveryTag = "messaging.rabbitmq.message.delivery_tag"; + +/** + * @Deprecated: Replaced by @code messaging.consumer.group.name @endcode on the consumer spans. No + * replacement for producer spans. + */ +static const char *kMessagingRocketmqClientGroup = "messaging.rocketmq.client_group"; + +/** + * Model of message consumption. This only applies to consumer spans. + */ +static const char *kMessagingRocketmqConsumptionModel = "messaging.rocketmq.consumption_model"; + +/** + * The delay time level for delay message, which determines the message delay time. + */ +static const char *kMessagingRocketmqMessageDelayTimeLevel = + "messaging.rocketmq.message.delay_time_level"; + +/** + * The timestamp in milliseconds that the delay message is expected to be delivered to consumer. + */ +static const char *kMessagingRocketmqMessageDeliveryTimestamp = + "messaging.rocketmq.message.delivery_timestamp"; + +/** + * It is essential for FIFO message. Messages that belong to the same message group are always + * processed one by one within the same consumer group. + */ +static const char *kMessagingRocketmqMessageGroup = "messaging.rocketmq.message.group"; + +/** + * Key(s) of message, another way to mark message besides message id. + */ +static const char *kMessagingRocketmqMessageKeys = "messaging.rocketmq.message.keys"; + +/** + * The secondary classifier of message besides topic. + */ +static const char *kMessagingRocketmqMessageTag = "messaging.rocketmq.message.tag"; + +/** + * Type of message. + */ +static const char *kMessagingRocketmqMessageType = "messaging.rocketmq.message.type"; + +/** + * Namespace of RocketMQ resources, resources in different namespaces are individual. + */ +static const char *kMessagingRocketmqNamespace = "messaging.rocketmq.namespace"; + +/** + * @Deprecated: Replaced by @code messaging.servicebus.destination.subscription_name @endcode. + */ +static const char *kMessagingServicebusDestinationSubscriptionName = + "messaging.servicebus.destination.subscription_name"; + +/** + * Describes the settlement + * type. + */ +static const char *kMessagingServicebusDispositionStatus = + "messaging.servicebus.disposition_status"; + +/** + * Number of deliveries that have been attempted for this message. + */ +static const char *kMessagingServicebusMessageDeliveryCount = + "messaging.servicebus.message.delivery_count"; + +/** + * The UTC epoch seconds at which the message has been accepted and stored in the entity. + */ +static const char *kMessagingServicebusMessageEnqueuedTime = + "messaging.servicebus.message.enqueued_time"; + +/** + * The messaging system as identified by the client instrumentation. + * Note: The actual messaging system may differ from the one known by the client. For example, when + * using Kafka client libraries to communicate with Azure Event Hubs, the @code messaging.system + * @endcode is set to @code kafka @endcode based on the instrumentation's best knowledge. + */ +static const char *kMessagingSystem = "messaging.system"; + +// DEBUG: {"brief": "A string identifying the type of the messaging operation.\n", "name": +// "messaging.operation.type", "note": "If a custom value is used, it MUST be of low cardinality.", +// "requirement_level": "recommended", "root_namespace": "messaging", "stability": "experimental", +// "type": {"allow_custom_values": true, "members": [{"brief": "One or more messages are provided +// for publishing to an intermediary. If a single message is published, the context of the +// \"Publish\" span can be used as the creation context and no \"Create\" span needs to be +// created.\n", "deprecated": none, "id": "publish", "note": none, "stability": "experimental", +// "value": "publish"}, {"brief": "A message is created. \"Create\" spans always refer to a single +// message and are used to provide a unique creation context for messages in batch publishing +// scenarios.\n", "deprecated": none, "id": "create", "note": none, "stability": "experimental", +// "value": "create"}, {"brief": "One or more messages are requested by a consumer. This operation +// refers to pull-based scenarios, where consumers explicitly call methods of messaging SDKs to +// receive messages.\n", "deprecated": none, "id": "receive", "note": none, "stability": +// "experimental", "value": "receive"}, {"brief": "One or more messages are processed by a +// consumer.\n", "deprecated": none, "id": "process", "note": none, "stability": "experimental", +// "value": "process"}, {"brief": "One or more messages are settled.\n", "deprecated": none, "id": +// "settle", "note": none, "stability": "experimental", "value": "settle"}, {"brief": "Deprecated. +// Use `process` instead.", "deprecated": "Replaced by `process`.", "id": "deliver", "note": none, +// "stability": "experimental", "value": "deliver"}]}} +namespace MessagingOperationTypeValues +{ +/** + * One or more messages are provided for publishing to an intermediary. If a single message is + * published, the context of the "Publish" span can be used as the creation context and no "Create" + * span needs to be created. + */ +// DEBUG: {"brief": "One or more messages are provided for publishing to an intermediary. If a +// single message is published, the context of the \"Publish\" span can be used as the creation +// context and no \"Create\" span needs to be created.\n", "deprecated": none, "id": "publish", +// "note": none, "stability": "experimental", "value": "publish"} +static constexpr const char *kPublish = "publish"; +/** + * A message is created. "Create" spans always refer to a single message and are used to provide a + * unique creation context for messages in batch publishing scenarios. + */ +// DEBUG: {"brief": "A message is created. \"Create\" spans always refer to a single message and are +// used to provide a unique creation context for messages in batch publishing scenarios.\n", +// "deprecated": none, "id": "create", "note": none, "stability": "experimental", "value": "create"} +static constexpr const char *kCreate = "create"; +/** + * One or more messages are requested by a consumer. This operation refers to pull-based scenarios, + * where consumers explicitly call methods of messaging SDKs to receive messages. + */ +// DEBUG: {"brief": "One or more messages are requested by a consumer. This operation refers to +// pull-based scenarios, where consumers explicitly call methods of messaging SDKs to receive +// messages.\n", "deprecated": none, "id": "receive", "note": none, "stability": "experimental", +// "value": "receive"} +static constexpr const char *kReceive = "receive"; +/** + * One or more messages are processed by a consumer. + */ +// DEBUG: {"brief": "One or more messages are processed by a consumer.\n", "deprecated": none, "id": +// "process", "note": none, "stability": "experimental", "value": "process"} +static constexpr const char *kProcess = "process"; +/** + * One or more messages are settled. + */ +// DEBUG: {"brief": "One or more messages are settled.\n", "deprecated": none, "id": "settle", +// "note": none, "stability": "experimental", "value": "settle"} +static constexpr const char *kSettle = "settle"; +/** + * @Deprecated: Replaced by @code process @endcode. + */ +// DEBUG: {"brief": "Deprecated. Use `process` instead.", "deprecated": "Replaced by `process`.", +// "id": "deliver", "note": none, "stability": "experimental", "value": "deliver"} +static constexpr const char *kDeliver = "deliver"; +} // namespace MessagingOperationTypeValues + +// DEBUG: {"brief": "Model of message consumption. This only applies to consumer spans.\n", "name": +// "messaging.rocketmq.consumption_model", "requirement_level": "recommended", "root_namespace": +// "messaging", "stability": "experimental", "type": {"allow_custom_values": true, "members": +// [{"brief": "Clustering consumption model", "deprecated": none, "id": "clustering", "note": none, +// "stability": "experimental", "value": "clustering"}, {"brief": "Broadcasting consumption model", +// "deprecated": none, "id": "broadcasting", "note": none, "stability": "experimental", "value": +// "broadcasting"}]}} +namespace MessagingRocketmqConsumptionModelValues +{ +/** + * Clustering consumption model. + */ +// DEBUG: {"brief": "Clustering consumption model", "deprecated": none, "id": "clustering", "note": +// none, "stability": "experimental", "value": "clustering"} +static constexpr const char *kClustering = "clustering"; +/** + * Broadcasting consumption model. + */ +// DEBUG: {"brief": "Broadcasting consumption model", "deprecated": none, "id": "broadcasting", +// "note": none, "stability": "experimental", "value": "broadcasting"} +static constexpr const char *kBroadcasting = "broadcasting"; +} // namespace MessagingRocketmqConsumptionModelValues + +// DEBUG: {"brief": "Type of message.\n", "name": "messaging.rocketmq.message.type", +// "requirement_level": "recommended", "root_namespace": "messaging", "stability": "experimental", +// "type": {"allow_custom_values": true, "members": [{"brief": "Normal message", "deprecated": none, +// "id": "normal", "note": none, "stability": "experimental", "value": "normal"}, {"brief": "FIFO +// message", "deprecated": none, "id": "fifo", "note": none, "stability": "experimental", "value": +// "fifo"}, {"brief": "Delay message", "deprecated": none, "id": "delay", "note": none, "stability": +// "experimental", "value": "delay"}, {"brief": "Transaction message", "deprecated": none, "id": +// "transaction", "note": none, "stability": "experimental", "value": "transaction"}]}} +namespace MessagingRocketmqMessageTypeValues +{ +/** + * Normal message. + */ +// DEBUG: {"brief": "Normal message", "deprecated": none, "id": "normal", "note": none, "stability": +// "experimental", "value": "normal"} +static constexpr const char *kNormal = "normal"; +/** + * FIFO message. + */ +// DEBUG: {"brief": "FIFO message", "deprecated": none, "id": "fifo", "note": none, "stability": +// "experimental", "value": "fifo"} +static constexpr const char *kFifo = "fifo"; +/** + * Delay message. + */ +// DEBUG: {"brief": "Delay message", "deprecated": none, "id": "delay", "note": none, "stability": +// "experimental", "value": "delay"} +static constexpr const char *kDelay = "delay"; +/** + * Transaction message. + */ +// DEBUG: {"brief": "Transaction message", "deprecated": none, "id": "transaction", "note": none, +// "stability": "experimental", "value": "transaction"} +static constexpr const char *kTransaction = "transaction"; +} // namespace MessagingRocketmqMessageTypeValues + +// DEBUG: {"brief": "Describes the [settlement +// type](https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock).\n", +// "name": "messaging.servicebus.disposition_status", "requirement_level": "recommended", +// "root_namespace": "messaging", "stability": "experimental", "type": {"allow_custom_values": true, +// "members": [{"brief": "Message is completed", "deprecated": none, "id": "complete", "note": none, +// "stability": "experimental", "value": "complete"}, {"brief": "Message is abandoned", +// "deprecated": none, "id": "abandon", "note": none, "stability": "experimental", "value": +// "abandon"}, {"brief": "Message is sent to dead letter queue", "deprecated": none, "id": +// "dead_letter", "note": none, "stability": "experimental", "value": "dead_letter"}, {"brief": +// "Message is deferred", "deprecated": none, "id": "defer", "note": none, "stability": +// "experimental", "value": "defer"}]}} +namespace MessagingServicebusDispositionStatusValues +{ +/** + * Message is completed. + */ +// DEBUG: {"brief": "Message is completed", "deprecated": none, "id": "complete", "note": none, +// "stability": "experimental", "value": "complete"} +static constexpr const char *kComplete = "complete"; +/** + * Message is abandoned. + */ +// DEBUG: {"brief": "Message is abandoned", "deprecated": none, "id": "abandon", "note": none, +// "stability": "experimental", "value": "abandon"} +static constexpr const char *kAbandon = "abandon"; +/** + * Message is sent to dead letter queue. + */ +// DEBUG: {"brief": "Message is sent to dead letter queue", "deprecated": none, "id": "dead_letter", +// "note": none, "stability": "experimental", "value": "dead_letter"} +static constexpr const char *kDeadLetter = "dead_letter"; +/** + * Message is deferred. + */ +// DEBUG: {"brief": "Message is deferred", "deprecated": none, "id": "defer", "note": none, +// "stability": "experimental", "value": "defer"} +static constexpr const char *kDefer = "defer"; +} // namespace MessagingServicebusDispositionStatusValues + +// DEBUG: {"brief": "The messaging system as identified by the client instrumentation.", "name": +// "messaging.system", "note": "The actual messaging system may differ from the one known by the +// client. For example, when using Kafka client libraries to communicate with Azure Event Hubs, the +// `messaging.system` is set to `kafka` based on the instrumentation's best knowledge.\n", +// "requirement_level": "recommended", "root_namespace": "messaging", "stability": "experimental", +// "type": {"allow_custom_values": true, "members": [{"brief": "Apache ActiveMQ", "deprecated": +// none, "id": "activemq", "note": none, "stability": "experimental", "value": "activemq"}, +// {"brief": "Amazon Simple Queue Service (SQS)", "deprecated": none, "id": "aws_sqs", "note": none, +// "stability": "experimental", "value": "aws_sqs"}, {"brief": "Azure Event Grid", "deprecated": +// none, "id": "eventgrid", "note": none, "stability": "experimental", "value": "eventgrid"}, +// {"brief": "Azure Event Hubs", "deprecated": none, "id": "eventhubs", "note": none, "stability": +// "experimental", "value": "eventhubs"}, {"brief": "Azure Service Bus", "deprecated": none, "id": +// "servicebus", "note": none, "stability": "experimental", "value": "servicebus"}, {"brief": +// "Google Cloud Pub/Sub", "deprecated": none, "id": "gcp_pubsub", "note": none, "stability": +// "experimental", "value": "gcp_pubsub"}, {"brief": "Java Message Service", "deprecated": none, +// "id": "jms", "note": none, "stability": "experimental", "value": "jms"}, {"brief": "Apache +// Kafka", "deprecated": none, "id": "kafka", "note": none, "stability": "experimental", "value": +// "kafka"}, {"brief": "RabbitMQ", "deprecated": none, "id": "rabbitmq", "note": none, "stability": +// "experimental", "value": "rabbitmq"}, {"brief": "Apache RocketMQ", "deprecated": none, "id": +// "rocketmq", "note": none, "stability": "experimental", "value": "rocketmq"}, {"brief": "Apache +// Pulsar", "deprecated": none, "id": "pulsar", "note": none, "stability": "experimental", "value": +// "pulsar"}]}} +namespace MessagingSystemValues +{ +/** + * Apache ActiveMQ. + */ +// DEBUG: {"brief": "Apache ActiveMQ", "deprecated": none, "id": "activemq", "note": none, +// "stability": "experimental", "value": "activemq"} +static constexpr const char *kActivemq = "activemq"; +/** + * Amazon Simple Queue Service (SQS). + */ +// DEBUG: {"brief": "Amazon Simple Queue Service (SQS)", "deprecated": none, "id": "aws_sqs", +// "note": none, "stability": "experimental", "value": "aws_sqs"} +static constexpr const char *kAwsSqs = "aws_sqs"; +/** + * Azure Event Grid. + */ +// DEBUG: {"brief": "Azure Event Grid", "deprecated": none, "id": "eventgrid", "note": none, +// "stability": "experimental", "value": "eventgrid"} +static constexpr const char *kEventgrid = "eventgrid"; +/** + * Azure Event Hubs. + */ +// DEBUG: {"brief": "Azure Event Hubs", "deprecated": none, "id": "eventhubs", "note": none, +// "stability": "experimental", "value": "eventhubs"} +static constexpr const char *kEventhubs = "eventhubs"; +/** + * Azure Service Bus. + */ +// DEBUG: {"brief": "Azure Service Bus", "deprecated": none, "id": "servicebus", "note": none, +// "stability": "experimental", "value": "servicebus"} +static constexpr const char *kServicebus = "servicebus"; +/** + * Google Cloud Pub/Sub. + */ +// DEBUG: {"brief": "Google Cloud Pub/Sub", "deprecated": none, "id": "gcp_pubsub", "note": none, +// "stability": "experimental", "value": "gcp_pubsub"} +static constexpr const char *kGcpPubsub = "gcp_pubsub"; +/** + * Java Message Service. + */ +// DEBUG: {"brief": "Java Message Service", "deprecated": none, "id": "jms", "note": none, +// "stability": "experimental", "value": "jms"} +static constexpr const char *kJms = "jms"; +/** + * Apache Kafka. + */ +// DEBUG: {"brief": "Apache Kafka", "deprecated": none, "id": "kafka", "note": none, "stability": +// "experimental", "value": "kafka"} +static constexpr const char *kKafka = "kafka"; +/** + * RabbitMQ. + */ +// DEBUG: {"brief": "RabbitMQ", "deprecated": none, "id": "rabbitmq", "note": none, "stability": +// "experimental", "value": "rabbitmq"} +static constexpr const char *kRabbitmq = "rabbitmq"; +/** + * Apache RocketMQ. + */ +// DEBUG: {"brief": "Apache RocketMQ", "deprecated": none, "id": "rocketmq", "note": none, +// "stability": "experimental", "value": "rocketmq"} +static constexpr const char *kRocketmq = "rocketmq"; +/** + * Apache Pulsar. + */ +// DEBUG: {"brief": "Apache Pulsar", "deprecated": none, "id": "pulsar", "note": none, "stability": +// "experimental", "value": "pulsar"} +static constexpr const char *kPulsar = "pulsar"; +} // namespace MessagingSystemValues + +} // namespace messaging +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/net_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/net_attributes.h new file mode 100644 index 0000000000..e340a3501e --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/net_attributes.h @@ -0,0 +1,184 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace net +{ + +/** + * @Deprecated: Replaced by @code network.local.address @endcode. + */ +static const char *kNetHostIp = "net.host.ip"; + +/** + * @Deprecated: Replaced by @code server.address @endcode. + */ +static const char *kNetHostName = "net.host.name"; + +/** + * @Deprecated: Replaced by @code server.port @endcode. + */ +static const char *kNetHostPort = "net.host.port"; + +/** + * @Deprecated: Replaced by @code network.peer.address @endcode. + */ +static const char *kNetPeerIp = "net.peer.ip"; + +/** + * @Deprecated: Replaced by @code server.address @endcode on client spans and @code client.address + * @endcode on server spans. + */ +static const char *kNetPeerName = "net.peer.name"; + +/** + * @Deprecated: Replaced by @code server.port @endcode on client spans and @code client.port + * @endcode on server spans. + */ +static const char *kNetPeerPort = "net.peer.port"; + +/** + * @Deprecated: Replaced by @code network.protocol.name @endcode. + */ +static const char *kNetProtocolName = "net.protocol.name"; + +/** + * @Deprecated: Replaced by @code network.protocol.version @endcode. + */ +static const char *kNetProtocolVersion = "net.protocol.version"; + +/** + * @Deprecated: Split to @code network.transport @endcode and @code network.type @endcode. + */ +static const char *kNetSockFamily = "net.sock.family"; + +/** + * @Deprecated: Replaced by @code network.local.address @endcode. + */ +static const char *kNetSockHostAddr = "net.sock.host.addr"; + +/** + * @Deprecated: Replaced by @code network.local.port @endcode. + */ +static const char *kNetSockHostPort = "net.sock.host.port"; + +/** + * @Deprecated: Replaced by @code network.peer.address @endcode. + */ +static const char *kNetSockPeerAddr = "net.sock.peer.addr"; + +/** + * @Deprecated: Removed. + */ +static const char *kNetSockPeerName = "net.sock.peer.name"; + +/** + * @Deprecated: Replaced by @code network.peer.port @endcode. + */ +static const char *kNetSockPeerPort = "net.sock.peer.port"; + +/** + * @Deprecated: Replaced by @code network.transport @endcode. + */ +static const char *kNetTransport = "net.transport"; + +// @deprecated(reason="The attribute net.sock.family is deprecated - Split to `network.transport` +// and `network.type`") # type: ignore DEBUG: {"brief": "Deprecated, use `network.transport` and +// `network.type`.", "deprecated": "Split to `network.transport` and `network.type`.", "name": +// "net.sock.family", "requirement_level": "recommended", "root_namespace": "net", "stability": +// "experimental", "type": {"allow_custom_values": true, "members": [{"brief": "IPv4 address", +// "deprecated": none, "id": "inet", "note": none, "stability": "experimental", "value": "inet"}, +// {"brief": "IPv6 address", "deprecated": none, "id": "inet6", "note": none, "stability": +// "experimental", "value": "inet6"}, {"brief": "Unix domain socket path", "deprecated": none, "id": +// "unix", "note": none, "stability": "experimental", "value": "unix"}]}} +namespace NetSockFamilyValues +{ +/** + * IPv4 address. + */ +// DEBUG: {"brief": "IPv4 address", "deprecated": none, "id": "inet", "note": none, "stability": +// "experimental", "value": "inet"} +static constexpr const char *kInet = "inet"; +/** + * IPv6 address. + */ +// DEBUG: {"brief": "IPv6 address", "deprecated": none, "id": "inet6", "note": none, "stability": +// "experimental", "value": "inet6"} +static constexpr const char *kInet6 = "inet6"; +/** + * Unix domain socket path. + */ +// DEBUG: {"brief": "Unix domain socket path", "deprecated": none, "id": "unix", "note": none, +// "stability": "experimental", "value": "unix"} +static constexpr const char *kUnix = "unix"; +} // namespace NetSockFamilyValues + +// @deprecated(reason="The attribute net.transport is deprecated - Replaced by `network.transport`") +// # type: ignore DEBUG: {"brief": "Deprecated, use `network.transport`.", "deprecated": "Replaced +// by `network.transport`.", "name": "net.transport", "requirement_level": "recommended", +// "root_namespace": "net", "stability": "experimental", "type": {"allow_custom_values": true, +// "members": [{"brief": none, "deprecated": none, "id": "ip_tcp", "note": none, "stability": +// "experimental", "value": "ip_tcp"}, {"brief": none, "deprecated": none, "id": "ip_udp", "note": +// none, "stability": "experimental", "value": "ip_udp"}, {"brief": "Named or anonymous pipe.", +// "deprecated": none, "id": "pipe", "note": none, "stability": "experimental", "value": "pipe"}, +// {"brief": "In-process communication.", "deprecated": none, "id": "inproc", "note": "Signals that +// there is only in-process communication not using a \"real\" network protocol in cases where +// network attributes would normally be expected. Usually all other network attributes can be left +// out in that case.\n", "stability": "experimental", "value": "inproc"}, {"brief": "Something else +// (non IP-based).", "deprecated": none, "id": "other", "note": none, "stability": "experimental", +// "value": "other"}]}} +namespace NetTransportValues +{ +/** + * ip_tcp. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "ip_tcp", "note": none, "stability": +// "experimental", "value": "ip_tcp"} +static constexpr const char *kIpTcp = "ip_tcp"; +/** + * ip_udp. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "ip_udp", "note": none, "stability": +// "experimental", "value": "ip_udp"} +static constexpr const char *kIpUdp = "ip_udp"; +/** + * Named or anonymous pipe. + */ +// DEBUG: {"brief": "Named or anonymous pipe.", "deprecated": none, "id": "pipe", "note": none, +// "stability": "experimental", "value": "pipe"} +static constexpr const char *kPipe = "pipe"; +/** + * In-process communication. + */ +// DEBUG: {"brief": "In-process communication.", "deprecated": none, "id": "inproc", "note": +// "Signals that there is only in-process communication not using a \"real\" network protocol in +// cases where network attributes would normally be expected. Usually all other network attributes +// can be left out in that case.\n", "stability": "experimental", "value": "inproc"} +static constexpr const char *kInproc = "inproc"; +/** + * Something else (non IP-based). + */ +// DEBUG: {"brief": "Something else (non IP-based).", "deprecated": none, "id": "other", "note": +// none, "stability": "experimental", "value": "other"} +static constexpr const char *kOther = "other"; +} // namespace NetTransportValues + +} // namespace net +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/network_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/network_attributes.h new file mode 100644 index 0000000000..c01e5c5ab7 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/network_attributes.h @@ -0,0 +1,417 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace network +{ + +/** + * The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. + */ +static const char *kNetworkCarrierIcc = "network.carrier.icc"; + +/** + * The mobile carrier country code. + */ +static const char *kNetworkCarrierMcc = "network.carrier.mcc"; + +/** + * The mobile carrier network code. + */ +static const char *kNetworkCarrierMnc = "network.carrier.mnc"; + +/** + * The name of the mobile carrier. + */ +static const char *kNetworkCarrierName = "network.carrier.name"; + +/** + * 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. + */ +static const char *kNetworkConnectionSubtype = "network.connection.subtype"; + +/** + * The internet connection type. + */ +static const char *kNetworkConnectionType = "network.connection.type"; + +/** + * The network IO operation direction. + */ +static const char *kNetworkIoDirection = "network.io.direction"; + +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.network_attributes. @endcode. + */ +static const char *kNetworkLocalAddress = "network.local.address"; + +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.network_attributes. @endcode. + */ +static const char *kNetworkLocalPort = "network.local.port"; + +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.network_attributes. @endcode. + */ +static const char *kNetworkPeerAddress = "network.peer.address"; + +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.network_attributes. @endcode. + */ +static const char *kNetworkPeerPort = "network.peer.port"; + +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.network_attributes. @endcode. + */ +static const char *kNetworkProtocolName = "network.protocol.name"; + +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.network_attributes. @endcode. + */ +static const char *kNetworkProtocolVersion = "network.protocol.version"; + +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.network_attributes. @endcode. + */ +static const char *kNetworkTransport = "network.transport"; + +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.network_attributes. @endcode. + */ +static const char *kNetworkType = "network.type"; + +// DEBUG: {"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", "name": "network.connection.subtype", "requirement_level": +// "recommended", "root_namespace": "network", "stability": "experimental", "type": +// {"allow_custom_values": true, "members": [{"brief": "GPRS", "deprecated": none, "id": "gprs", +// "note": none, "stability": "experimental", "value": "gprs"}, {"brief": "EDGE", "deprecated": +// none, "id": "edge", "note": none, "stability": "experimental", "value": "edge"}, {"brief": +// "UMTS", "deprecated": none, "id": "umts", "note": none, "stability": "experimental", "value": +// "umts"}, {"brief": "CDMA", "deprecated": none, "id": "cdma", "note": none, "stability": +// "experimental", "value": "cdma"}, {"brief": "EVDO Rel. 0", "deprecated": none, "id": "evdo_0", +// "note": none, "stability": "experimental", "value": "evdo_0"}, {"brief": "EVDO Rev. A", +// "deprecated": none, "id": "evdo_a", "note": none, "stability": "experimental", "value": +// "evdo_a"}, {"brief": "CDMA2000 1XRTT", "deprecated": none, "id": "cdma2000_1xrtt", "note": none, +// "stability": "experimental", "value": "cdma2000_1xrtt"}, {"brief": "HSDPA", "deprecated": none, +// "id": "hsdpa", "note": none, "stability": "experimental", "value": "hsdpa"}, {"brief": "HSUPA", +// "deprecated": none, "id": "hsupa", "note": none, "stability": "experimental", "value": "hsupa"}, +// {"brief": "HSPA", "deprecated": none, "id": "hspa", "note": none, "stability": "experimental", +// "value": "hspa"}, {"brief": "IDEN", "deprecated": none, "id": "iden", "note": none, "stability": +// "experimental", "value": "iden"}, {"brief": "EVDO Rev. B", "deprecated": none, "id": "evdo_b", +// "note": none, "stability": "experimental", "value": "evdo_b"}, {"brief": "LTE", "deprecated": +// none, "id": "lte", "note": none, "stability": "experimental", "value": "lte"}, {"brief": "EHRPD", +// "deprecated": none, "id": "ehrpd", "note": none, "stability": "experimental", "value": "ehrpd"}, +// {"brief": "HSPAP", "deprecated": none, "id": "hspap", "note": none, "stability": "experimental", +// "value": "hspap"}, {"brief": "GSM", "deprecated": none, "id": "gsm", "note": none, "stability": +// "experimental", "value": "gsm"}, {"brief": "TD-SCDMA", "deprecated": none, "id": "td_scdma", +// "note": none, "stability": "experimental", "value": "td_scdma"}, {"brief": "IWLAN", "deprecated": +// none, "id": "iwlan", "note": none, "stability": "experimental", "value": "iwlan"}, {"brief": "5G +// NR (New Radio)", "deprecated": none, "id": "nr", "note": none, "stability": "experimental", +// "value": "nr"}, {"brief": "5G NRNSA (New Radio Non-Standalone)", "deprecated": none, "id": +// "nrnsa", "note": none, "stability": "experimental", "value": "nrnsa"}, {"brief": "LTE CA", +// "deprecated": none, "id": "lte_ca", "note": none, "stability": "experimental", "value": +// "lte_ca"}]}} +namespace NetworkConnectionSubtypeValues +{ +/** + * GPRS. + */ +// DEBUG: {"brief": "GPRS", "deprecated": none, "id": "gprs", "note": none, "stability": +// "experimental", "value": "gprs"} +static constexpr const char *kGprs = "gprs"; +/** + * EDGE. + */ +// DEBUG: {"brief": "EDGE", "deprecated": none, "id": "edge", "note": none, "stability": +// "experimental", "value": "edge"} +static constexpr const char *kEdge = "edge"; +/** + * UMTS. + */ +// DEBUG: {"brief": "UMTS", "deprecated": none, "id": "umts", "note": none, "stability": +// "experimental", "value": "umts"} +static constexpr const char *kUmts = "umts"; +/** + * CDMA. + */ +// DEBUG: {"brief": "CDMA", "deprecated": none, "id": "cdma", "note": none, "stability": +// "experimental", "value": "cdma"} +static constexpr const char *kCdma = "cdma"; +/** + * EVDO Rel. 0. + */ +// DEBUG: {"brief": "EVDO Rel. 0", "deprecated": none, "id": "evdo_0", "note": none, "stability": +// "experimental", "value": "evdo_0"} +static constexpr const char *kEvdo0 = "evdo_0"; +/** + * EVDO Rev. A. + */ +// DEBUG: {"brief": "EVDO Rev. A", "deprecated": none, "id": "evdo_a", "note": none, "stability": +// "experimental", "value": "evdo_a"} +static constexpr const char *kEvdoA = "evdo_a"; +/** + * CDMA2000 1XRTT. + */ +// DEBUG: {"brief": "CDMA2000 1XRTT", "deprecated": none, "id": "cdma2000_1xrtt", "note": none, +// "stability": "experimental", "value": "cdma2000_1xrtt"} +static constexpr const char *kCdma20001xrtt = "cdma2000_1xrtt"; +/** + * HSDPA. + */ +// DEBUG: {"brief": "HSDPA", "deprecated": none, "id": "hsdpa", "note": none, "stability": +// "experimental", "value": "hsdpa"} +static constexpr const char *kHsdpa = "hsdpa"; +/** + * HSUPA. + */ +// DEBUG: {"brief": "HSUPA", "deprecated": none, "id": "hsupa", "note": none, "stability": +// "experimental", "value": "hsupa"} +static constexpr const char *kHsupa = "hsupa"; +/** + * HSPA. + */ +// DEBUG: {"brief": "HSPA", "deprecated": none, "id": "hspa", "note": none, "stability": +// "experimental", "value": "hspa"} +static constexpr const char *kHspa = "hspa"; +/** + * IDEN. + */ +// DEBUG: {"brief": "IDEN", "deprecated": none, "id": "iden", "note": none, "stability": +// "experimental", "value": "iden"} +static constexpr const char *kIden = "iden"; +/** + * EVDO Rev. B. + */ +// DEBUG: {"brief": "EVDO Rev. B", "deprecated": none, "id": "evdo_b", "note": none, "stability": +// "experimental", "value": "evdo_b"} +static constexpr const char *kEvdoB = "evdo_b"; +/** + * LTE. + */ +// DEBUG: {"brief": "LTE", "deprecated": none, "id": "lte", "note": none, "stability": +// "experimental", "value": "lte"} +static constexpr const char *kLte = "lte"; +/** + * EHRPD. + */ +// DEBUG: {"brief": "EHRPD", "deprecated": none, "id": "ehrpd", "note": none, "stability": +// "experimental", "value": "ehrpd"} +static constexpr const char *kEhrpd = "ehrpd"; +/** + * HSPAP. + */ +// DEBUG: {"brief": "HSPAP", "deprecated": none, "id": "hspap", "note": none, "stability": +// "experimental", "value": "hspap"} +static constexpr const char *kHspap = "hspap"; +/** + * GSM. + */ +// DEBUG: {"brief": "GSM", "deprecated": none, "id": "gsm", "note": none, "stability": +// "experimental", "value": "gsm"} +static constexpr const char *kGsm = "gsm"; +/** + * TD-SCDMA. + */ +// DEBUG: {"brief": "TD-SCDMA", "deprecated": none, "id": "td_scdma", "note": none, "stability": +// "experimental", "value": "td_scdma"} +static constexpr const char *kTdScdma = "td_scdma"; +/** + * IWLAN. + */ +// DEBUG: {"brief": "IWLAN", "deprecated": none, "id": "iwlan", "note": none, "stability": +// "experimental", "value": "iwlan"} +static constexpr const char *kIwlan = "iwlan"; +/** + * 5G NR (New Radio). + */ +// DEBUG: {"brief": "5G NR (New Radio)", "deprecated": none, "id": "nr", "note": none, "stability": +// "experimental", "value": "nr"} +static constexpr const char *kNr = "nr"; +/** + * 5G NRNSA (New Radio Non-Standalone). + */ +// DEBUG: {"brief": "5G NRNSA (New Radio Non-Standalone)", "deprecated": none, "id": "nrnsa", +// "note": none, "stability": "experimental", "value": "nrnsa"} +static constexpr const char *kNrnsa = "nrnsa"; +/** + * LTE CA. + */ +// DEBUG: {"brief": "LTE CA", "deprecated": none, "id": "lte_ca", "note": none, "stability": +// "experimental", "value": "lte_ca"} +static constexpr const char *kLteCa = "lte_ca"; +} // namespace NetworkConnectionSubtypeValues + +// DEBUG: {"brief": "The internet connection type.", "examples": "wifi", "name": +// "network.connection.type", "requirement_level": "recommended", "root_namespace": "network", +// "stability": "experimental", "type": {"allow_custom_values": true, "members": [{"brief": none, +// "deprecated": none, "id": "wifi", "note": none, "stability": "experimental", "value": "wifi"}, +// {"brief": none, "deprecated": none, "id": "wired", "note": none, "stability": "experimental", +// "value": "wired"}, {"brief": none, "deprecated": none, "id": "cell", "note": none, "stability": +// "experimental", "value": "cell"}, {"brief": none, "deprecated": none, "id": "unavailable", +// "note": none, "stability": "experimental", "value": "unavailable"}, {"brief": none, "deprecated": +// none, "id": "unknown", "note": none, "stability": "experimental", "value": "unknown"}]}} +namespace NetworkConnectionTypeValues +{ +/** + * wifi. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "wifi", "note": none, "stability": +// "experimental", "value": "wifi"} +static constexpr const char *kWifi = "wifi"; +/** + * wired. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "wired", "note": none, "stability": +// "experimental", "value": "wired"} +static constexpr const char *kWired = "wired"; +/** + * cell. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "cell", "note": none, "stability": +// "experimental", "value": "cell"} +static constexpr const char *kCell = "cell"; +/** + * unavailable. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "unavailable", "note": none, "stability": +// "experimental", "value": "unavailable"} +static constexpr const char *kUnavailable = "unavailable"; +/** + * unknown. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "unknown", "note": none, "stability": +// "experimental", "value": "unknown"} +static constexpr const char *kUnknown = "unknown"; +} // namespace NetworkConnectionTypeValues + +// DEBUG: {"brief": "The network IO operation direction.", "examples": ["transmit"], "name": +// "network.io.direction", "requirement_level": "recommended", "root_namespace": "network", +// "stability": "experimental", "type": {"allow_custom_values": true, "members": [{"brief": none, +// "deprecated": none, "id": "transmit", "note": none, "stability": "experimental", "value": +// "transmit"}, {"brief": none, "deprecated": none, "id": "receive", "note": none, "stability": +// "experimental", "value": "receive"}]}} +namespace NetworkIoDirectionValues +{ +/** + * transmit. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "transmit", "note": none, "stability": +// "experimental", "value": "transmit"} +static constexpr const char *kTransmit = "transmit"; +/** + * receive. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "receive", "note": none, "stability": +// "experimental", "value": "receive"} +static constexpr const char *kReceive = "receive"; +} // namespace NetworkIoDirectionValues + +// @deprecated(reason="Deprecated in favor of stable +// `opentelemetry.semconv.attributes.network_attributes.NetworkTransportValues`.") # type: ignore +// DEBUG: {"brief": "[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process +// communication method](https://wikipedia.org/wiki/Inter-process_communication).\n", "examples": +// ["tcp", "udp"], "name": "network.transport", "note": "The value SHOULD be normalized to +// lowercase.\n\nConsider always setting the transport when setting a port number, since\na port +// number is ambiguous without knowing the transport. For example\ndifferent processes could be +// listening on TCP port 12345 and UDP port 12345.\n", "requirement_level": "recommended", +// "root_namespace": "network", "stability": "stable", "type": {"allow_custom_values": true, +// "members": [{"brief": "TCP", "deprecated": none, "id": "tcp", "note": none, "stability": +// "stable", "value": "tcp"}, {"brief": "UDP", "deprecated": none, "id": "udp", "note": none, +// "stability": "stable", "value": "udp"}, {"brief": "Named or anonymous pipe.", "deprecated": none, +// "id": "pipe", "note": none, "stability": "stable", "value": "pipe"}, {"brief": "Unix domain +// socket", "deprecated": none, "id": "unix", "note": none, "stability": "stable", "value": "unix"}, +// {"brief": "QUIC", "deprecated": none, "id": "quic", "note": none, "stability": "experimental", +// "value": "quic"}]}} +namespace NetworkTransportValues +{ +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.network_attributes.NetworkTransportValues.kTcp @endcode. + */ +// DEBUG: {"brief": "TCP", "deprecated": none, "id": "tcp", "note": none, "stability": "stable", +// "value": "tcp"} +static constexpr const char *kTcp = "tcp"; +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.network_attributes.NetworkTransportValues.kUdp @endcode. + */ +// DEBUG: {"brief": "UDP", "deprecated": none, "id": "udp", "note": none, "stability": "stable", +// "value": "udp"} +static constexpr const char *kUdp = "udp"; +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.network_attributes.NetworkTransportValues.kPipe @endcode. + */ +// DEBUG: {"brief": "Named or anonymous pipe.", "deprecated": none, "id": "pipe", "note": none, +// "stability": "stable", "value": "pipe"} +static constexpr const char *kPipe = "pipe"; +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.network_attributes.NetworkTransportValues.kUnix @endcode. + */ +// DEBUG: {"brief": "Unix domain socket", "deprecated": none, "id": "unix", "note": none, +// "stability": "stable", "value": "unix"} +static constexpr const char *kUnix = "unix"; +/** + * QUIC. + */ +// DEBUG: {"brief": "QUIC", "deprecated": none, "id": "quic", "note": none, "stability": +// "experimental", "value": "quic"} +static constexpr const char *kQuic = "quic"; +} // namespace NetworkTransportValues + +// @deprecated(reason="Deprecated in favor of stable +// `opentelemetry.semconv.attributes.network_attributes.NetworkTypeValues`.") # type: ignore DEBUG: +// {"brief": "[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent.", +// "examples": ["ipv4", "ipv6"], "name": "network.type", "note": "The value SHOULD be normalized to +// lowercase.", "requirement_level": "recommended", "root_namespace": "network", "stability": +// "stable", "type": {"allow_custom_values": true, "members": [{"brief": "IPv4", "deprecated": none, +// "id": "ipv4", "note": none, "stability": "stable", "value": "ipv4"}, {"brief": "IPv6", +// "deprecated": none, "id": "ipv6", "note": none, "stability": "stable", "value": "ipv6"}]}} +namespace NetworkTypeValues +{ +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.network_attributes.NetworkTypeValues.kIpv4 @endcode. + */ +// DEBUG: {"brief": "IPv4", "deprecated": none, "id": "ipv4", "note": none, "stability": "stable", +// "value": "ipv4"} +static constexpr const char *kIpv4 = "ipv4"; +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.network_attributes.NetworkTypeValues.kIpv6 @endcode. + */ +// DEBUG: {"brief": "IPv6", "deprecated": none, "id": "ipv6", "note": none, "stability": "stable", +// "value": "ipv6"} +static constexpr const char *kIpv6 = "ipv6"; +} // namespace NetworkTypeValues + +} // namespace network +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/oci_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/oci_attributes.h new file mode 100644 index 0000000000..b57cad14bd --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/oci_attributes.h @@ -0,0 +1,38 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace oci +{ + +/** + * The digest of the OCI image manifest. For container images specifically is the digest by which + * the container image is known. Note: Follows OCI Image Manifest + * Specification, and specifically the Digest + * property. An example can be found in Example Image + * Manifest. + */ +static const char *kOciManifestDigest = "oci.manifest.digest"; + +} // namespace oci +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/opentracing_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/opentracing_attributes.h new file mode 100644 index 0000000000..25f197460c --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/opentracing_attributes.h @@ -0,0 +1,57 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace opentracing +{ + +/** + * Parent-child Reference type. + * Note: The causal relationship between a child Span and a parent Span. + */ +static const char *kOpentracingRefType = "opentracing.ref_type"; + +// DEBUG: {"brief": "Parent-child Reference type", "name": "opentracing.ref_type", "note": "The +// causal relationship between a child Span and a parent Span.\n", "requirement_level": +// "recommended", "root_namespace": "opentracing", "stability": "experimental", "type": +// {"allow_custom_values": true, "members": [{"brief": "The parent Span depends on the child Span in +// some capacity", "deprecated": none, "id": "child_of", "note": none, "stability": "experimental", +// "value": "child_of"}, {"brief": "The parent Span doesn't depend in any way on the result of the +// child Span", "deprecated": none, "id": "follows_from", "note": none, "stability": "experimental", +// "value": "follows_from"}]}} +namespace OpentracingRefTypeValues +{ +/** + * The parent Span depends on the child Span in some capacity. + */ +// DEBUG: {"brief": "The parent Span depends on the child Span in some capacity", "deprecated": +// none, "id": "child_of", "note": none, "stability": "experimental", "value": "child_of"} +static constexpr const char *kChildOf = "child_of"; +/** + * The parent Span doesn't depend in any way on the result of the child Span. + */ +// DEBUG: {"brief": "The parent Span doesn't depend in any way on the result of the child Span", +// "deprecated": none, "id": "follows_from", "note": none, "stability": "experimental", "value": +// "follows_from"} +static constexpr const char *kFollowsFrom = "follows_from"; +} // namespace OpentracingRefTypeValues + +} // namespace opentracing +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/os_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/os_attributes.h new file mode 100644 index 0000000000..fa50d310f6 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/os_attributes.h @@ -0,0 +1,141 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace os +{ + +/** + * Unique identifier for a particular build or compilation of the operating system. + */ +static const char *kOsBuildId = "os.build_id"; + +/** + * Human readable (not intended to be parsed) OS version information, like e.g. reported by @code + * ver @endcode or @code lsb_release -a @endcode commands. + */ +static const char *kOsDescription = "os.description"; + +/** + * Human readable operating system name. + */ +static const char *kOsName = "os.name"; + +/** + * The operating system type. + */ +static const char *kOsType = "os.type"; + +/** + * The version string of the operating system as defined in Version Attributes. + */ +static const char *kOsVersion = "os.version"; + +// DEBUG: {"brief": "The operating system type.\n", "name": "os.type", "requirement_level": +// "recommended", "root_namespace": "os", "stability": "experimental", "type": +// {"allow_custom_values": true, "members": [{"brief": "Microsoft Windows", "deprecated": none, +// "id": "windows", "note": none, "stability": "experimental", "value": "windows"}, {"brief": +// "Linux", "deprecated": none, "id": "linux", "note": none, "stability": "experimental", "value": +// "linux"}, {"brief": "Apple Darwin", "deprecated": none, "id": "darwin", "note": none, +// "stability": "experimental", "value": "darwin"}, {"brief": "FreeBSD", "deprecated": none, "id": +// "freebsd", "note": none, "stability": "experimental", "value": "freebsd"}, {"brief": "NetBSD", +// "deprecated": none, "id": "netbsd", "note": none, "stability": "experimental", "value": +// "netbsd"}, {"brief": "OpenBSD", "deprecated": none, "id": "openbsd", "note": none, "stability": +// "experimental", "value": "openbsd"}, {"brief": "DragonFly BSD", "deprecated": none, "id": +// "dragonflybsd", "note": none, "stability": "experimental", "value": "dragonflybsd"}, {"brief": +// "HP-UX (Hewlett Packard Unix)", "deprecated": none, "id": "hpux", "note": none, "stability": +// "experimental", "value": "hpux"}, {"brief": "AIX (Advanced Interactive eXecutive)", "deprecated": +// none, "id": "aix", "note": none, "stability": "experimental", "value": "aix"}, {"brief": "SunOS, +// Oracle Solaris", "deprecated": none, "id": "solaris", "note": none, "stability": "experimental", +// "value": "solaris"}, {"brief": "IBM z/OS", "deprecated": none, "id": "z_os", "note": none, +// "stability": "experimental", "value": "z_os"}]}} +namespace OsTypeValues +{ +/** + * Microsoft Windows. + */ +// DEBUG: {"brief": "Microsoft Windows", "deprecated": none, "id": "windows", "note": none, +// "stability": "experimental", "value": "windows"} +static constexpr const char *kWindows = "windows"; +/** + * Linux. + */ +// DEBUG: {"brief": "Linux", "deprecated": none, "id": "linux", "note": none, "stability": +// "experimental", "value": "linux"} +static constexpr const char *kLinux = "linux"; +/** + * Apple Darwin. + */ +// DEBUG: {"brief": "Apple Darwin", "deprecated": none, "id": "darwin", "note": none, "stability": +// "experimental", "value": "darwin"} +static constexpr const char *kDarwin = "darwin"; +/** + * FreeBSD. + */ +// DEBUG: {"brief": "FreeBSD", "deprecated": none, "id": "freebsd", "note": none, "stability": +// "experimental", "value": "freebsd"} +static constexpr const char *kFreebsd = "freebsd"; +/** + * NetBSD. + */ +// DEBUG: {"brief": "NetBSD", "deprecated": none, "id": "netbsd", "note": none, "stability": +// "experimental", "value": "netbsd"} +static constexpr const char *kNetbsd = "netbsd"; +/** + * OpenBSD. + */ +// DEBUG: {"brief": "OpenBSD", "deprecated": none, "id": "openbsd", "note": none, "stability": +// "experimental", "value": "openbsd"} +static constexpr const char *kOpenbsd = "openbsd"; +/** + * DragonFly BSD. + */ +// DEBUG: {"brief": "DragonFly BSD", "deprecated": none, "id": "dragonflybsd", "note": none, +// "stability": "experimental", "value": "dragonflybsd"} +static constexpr const char *kDragonflybsd = "dragonflybsd"; +/** + * HP-UX (Hewlett Packard Unix). + */ +// DEBUG: {"brief": "HP-UX (Hewlett Packard Unix)", "deprecated": none, "id": "hpux", "note": none, +// "stability": "experimental", "value": "hpux"} +static constexpr const char *kHpux = "hpux"; +/** + * AIX (Advanced Interactive eXecutive). + */ +// DEBUG: {"brief": "AIX (Advanced Interactive eXecutive)", "deprecated": none, "id": "aix", "note": +// none, "stability": "experimental", "value": "aix"} +static constexpr const char *kAix = "aix"; +/** + * SunOS, Oracle Solaris. + */ +// DEBUG: {"brief": "SunOS, Oracle Solaris", "deprecated": none, "id": "solaris", "note": none, +// "stability": "experimental", "value": "solaris"} +static constexpr const char *kSolaris = "solaris"; +/** + * IBM z/OS. + */ +// DEBUG: {"brief": "IBM z/OS", "deprecated": none, "id": "z_os", "note": none, "stability": +// "experimental", "value": "z_os"} +static constexpr const char *kZOs = "z_os"; +} // namespace OsTypeValues + +} // namespace os +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/otel_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/otel_attributes.h new file mode 100644 index 0000000000..a4d4832eb0 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/otel_attributes.h @@ -0,0 +1,88 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace otel +{ + +/** + * @Deprecated: use the @code otel.scope.name @endcode attribute. + */ +static const char *kOtelLibraryName = "otel.library.name"; + +/** + * @Deprecated: use the @code otel.scope.version @endcode attribute. + */ +static const char *kOtelLibraryVersion = "otel.library.version"; + +/** + * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.otel_attributes. + * @endcode. + */ +static const char *kOtelScopeName = "otel.scope.name"; + +/** + * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.otel_attributes. + * @endcode. + */ +static const char *kOtelScopeVersion = "otel.scope.version"; + +/** + * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.otel_attributes. + * @endcode. + */ +static const char *kOtelStatusCode = "otel.status_code"; + +/** + * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.otel_attributes. + * @endcode. + */ +static const char *kOtelStatusDescription = "otel.status_description"; + +// @deprecated(reason="Deprecated in favor of stable +// `opentelemetry.semconv.attributes.otel_attributes.OtelStatusCodeValues`.") # type: ignore DEBUG: +// {"brief": "Name of the code, either \"OK\" or \"ERROR\". MUST NOT be set if the status code is +// UNSET.", "name": "otel.status_code", "requirement_level": "recommended", "root_namespace": +// "otel", "stability": "stable", "type": {"allow_custom_values": true, "members": [{"brief": "The +// operation has been validated by an Application developer or Operator to have completed +// successfully.", "deprecated": none, "id": "ok", "note": none, "stability": "stable", "value": +// "OK"}, {"brief": "The operation contains an error.", "deprecated": none, "id": "error", "note": +// none, "stability": "stable", "value": "ERROR"}]}} +namespace OtelStatusCodeValues +{ +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.otel_attributes.OtelStatusCodeValues.kOk @endcode. + */ +// DEBUG: {"brief": "The operation has been validated by an Application developer or Operator to +// have completed successfully.", "deprecated": none, "id": "ok", "note": none, "stability": +// "stable", "value": "OK"} +static constexpr const char *kOk = "OK"; +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.otel_attributes.OtelStatusCodeValues.kError @endcode. + */ +// DEBUG: {"brief": "The operation contains an error.", "deprecated": none, "id": "error", "note": +// none, "stability": "stable", "value": "ERROR"} +static constexpr const char *kError = "ERROR"; +} // namespace OtelStatusCodeValues + +} // namespace otel +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/other_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/other_attributes.h new file mode 100644 index 0000000000..00cbba2786 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/other_attributes.h @@ -0,0 +1,55 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace other +{ + +/** + * @Deprecated: Replaced by @code db.client.connection.state @endcode. + */ +static const char *kState = "state"; + +// @deprecated(reason="The attribute state is deprecated - Replaced by +// `db.client.connection.state`") # type: ignore DEBUG: {"brief": "Deprecated, use +// `db.client.connection.state` instead.", "deprecated": "Replaced by +// `db.client.connection.state`.", "examples": ["idle"], "name": "state", "requirement_level": +// "recommended", "root_namespace": "other", "stability": "experimental", "type": +// {"allow_custom_values": true, "members": [{"brief": none, "deprecated": none, "id": "idle", +// "note": none, "stability": "experimental", "value": "idle"}, {"brief": none, "deprecated": none, +// "id": "used", "note": none, "stability": "experimental", "value": "used"}]}} +namespace StateValues +{ +/** + * idle. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "idle", "note": none, "stability": +// "experimental", "value": "idle"} +static constexpr const char *kIdle = "idle"; +/** + * used. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "used", "note": none, "stability": +// "experimental", "value": "used"} +static constexpr const char *kUsed = "used"; +} // namespace StateValues + +} // namespace other +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/peer_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/peer_attributes.h new file mode 100644 index 0000000000..c6a07788a6 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/peer_attributes.h @@ -0,0 +1,33 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace peer +{ + +/** + * The @code service.name @endcode of the remote + * service. SHOULD be equal to the actual @code service.name @endcode resource attribute of the + * remote service if any. + */ +static const char *kPeerService = "peer.service"; + +} // namespace peer +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/pool_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/pool_attributes.h new file mode 100644 index 0000000000..d034fb0e27 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/pool_attributes.h @@ -0,0 +1,31 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace pool +{ + +/** + * @Deprecated: Replaced by @code db.client.connection.pool.name @endcode. + */ +static const char *kPoolName = "pool.name"; + +} // namespace pool +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/process_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/process_attributes.h new file mode 100644 index 0000000000..a9a5f727de --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/process_attributes.h @@ -0,0 +1,251 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace process +{ + +/** + * The command used to launch the process (i.e. the command name). On Linux based systems, can be + * set to the zeroth string in @code proc/[pid]/cmdline @endcode. On Windows, can be set to the + * first parameter extracted from @code GetCommandLineW @endcode. + */ +static const char *kProcessCommand = "process.command"; + +/** + * All the command arguments (including the command/executable itself) as received by the process. + * On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according + * to the list of null-delimited strings extracted from @code proc/[pid]/cmdline @endcode. For + * libc-based executables, this would be the full argv vector passed to @code main @endcode. + */ +static const char *kProcessCommandArgs = "process.command_args"; + +/** + * The full command used to launch the process as a single string representing the full command. On + * Windows, can be set to the result of @code GetCommandLineW @endcode. Do not set this if you have + * to assemble it just for monitoring; use @code process.command_args @endcode instead. + */ +static const char *kProcessCommandLine = "process.command_line"; + +/** + * Specifies whether the context switches for this data point were voluntary or involuntary. + */ +static const char *kProcessContextSwitchType = "process.context_switch_type"; + +/** + * @Deprecated: Replaced by @code cpu.mode @endcode. + */ +static const char *kProcessCpuState = "process.cpu.state"; + +/** + * The date and time the process was created, in ISO 8601 format. + */ +static const char *kProcessCreationTime = "process.creation.time"; + +/** + * The name of the process executable. On Linux based systems, can be set to the @code Name @endcode + * in @code proc/[pid]/status @endcode. On Windows, can be set to the base name of @code + * GetProcessImageFileNameW @endcode. + */ +static const char *kProcessExecutableName = "process.executable.name"; + +/** + * The full path to the process executable. On Linux based systems, can be set to the target of + * @code proc/[pid]/exe @endcode. On Windows, can be set to the result of @code + * GetProcessImageFileNameW @endcode. + */ +static const char *kProcessExecutablePath = "process.executable.path"; + +/** + * The exit code of the process. + */ +static const char *kProcessExitCode = "process.exit.code"; + +/** + * The date and time the process exited, in ISO 8601 format. + */ +static const char *kProcessExitTime = "process.exit.time"; + +/** + * The PID of the process's group leader. This is also the process group ID (PGID) of the process. + */ +static const char *kProcessGroupLeaderPid = "process.group_leader.pid"; + +/** + * Whether the process is connected to an interactive shell. + */ +static const char *kProcessInteractive = "process.interactive"; + +/** + * The username of the user that owns the process. + */ +static const char *kProcessOwner = "process.owner"; + +/** + * The type of page fault for this data point. Type @code major @endcode is for major/hard page + * faults, and @code minor @endcode is for minor/soft page faults. + */ +static const char *kProcessPagingFaultType = "process.paging.fault_type"; + +/** + * Parent Process identifier (PPID). + */ +static const char *kProcessParentPid = "process.parent_pid"; + +/** + * Process identifier (PID). + */ +static const char *kProcessPid = "process.pid"; + +/** + * The real user ID (RUID) of the process. + */ +static const char *kProcessRealUserId = "process.real_user.id"; + +/** + * The username of the real user of the process. + */ +static const char *kProcessRealUserName = "process.real_user.name"; + +/** + * An additional description about the runtime of the process, for example a specific vendor + * customization of the runtime environment. + */ +static const char *kProcessRuntimeDescription = "process.runtime.description"; + +/** + * The name of the runtime of this process. + */ +static const char *kProcessRuntimeName = "process.runtime.name"; + +/** + * The version of the runtime of this process, as returned by the runtime without modification. + */ +static const char *kProcessRuntimeVersion = "process.runtime.version"; + +/** + * The saved user ID (SUID) of the process. + */ +static const char *kProcessSavedUserId = "process.saved_user.id"; + +/** + * The username of the saved user. + */ +static const char *kProcessSavedUserName = "process.saved_user.name"; + +/** + * The PID of the process's session leader. This is also the session ID (SID) of the process. + */ +static const char *kProcessSessionLeaderPid = "process.session_leader.pid"; + +/** + * The effective user ID (EUID) of the process. + */ +static const char *kProcessUserId = "process.user.id"; + +/** + * The username of the effective user of the process. + */ +static const char *kProcessUserName = "process.user.name"; + +/** + * Virtual process identifier. + * Note: The process ID within a PID namespace. This is not necessarily unique across all processes + * on the host but it is unique within the process namespace that the process exists within. + */ +static const char *kProcessVpid = "process.vpid"; + +// DEBUG: {"brief": "Specifies whether the context switches for this data point were voluntary or +// involuntary.", "name": "process.context_switch_type", "requirement_level": "recommended", +// "root_namespace": "process", "stability": "experimental", "type": {"allow_custom_values": true, +// "members": [{"brief": none, "deprecated": none, "id": "voluntary", "note": none, "stability": +// "experimental", "value": "voluntary"}, {"brief": none, "deprecated": none, "id": "involuntary", +// "note": none, "stability": "experimental", "value": "involuntary"}]}} +namespace ProcessContextSwitchTypeValues +{ +/** + * voluntary. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "voluntary", "note": none, "stability": +// "experimental", "value": "voluntary"} +static constexpr const char *kVoluntary = "voluntary"; +/** + * involuntary. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "involuntary", "note": none, "stability": +// "experimental", "value": "involuntary"} +static constexpr const char *kInvoluntary = "involuntary"; +} // namespace ProcessContextSwitchTypeValues + +// @deprecated(reason="The attribute process.cpu.state is deprecated - Replaced by `cpu.mode`") # +// type: ignore DEBUG: {"brief": "Deprecated, use `cpu.mode` instead.", "deprecated": "Replaced by +// `cpu.mode`", "name": "process.cpu.state", "requirement_level": "recommended", "root_namespace": +// "process", "stability": "experimental", "type": {"allow_custom_values": true, "members": +// [{"brief": none, "deprecated": none, "id": "system", "note": none, "stability": "experimental", +// "value": "system"}, {"brief": none, "deprecated": none, "id": "user", "note": none, "stability": +// "experimental", "value": "user"}, {"brief": none, "deprecated": none, "id": "wait", "note": none, +// "stability": "experimental", "value": "wait"}]}} +namespace ProcessCpuStateValues +{ +/** + * system. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "system", "note": none, "stability": +// "experimental", "value": "system"} +static constexpr const char *kSystem = "system"; +/** + * user. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "user", "note": none, "stability": +// "experimental", "value": "user"} +static constexpr const char *kUser = "user"; +/** + * wait. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "wait", "note": none, "stability": +// "experimental", "value": "wait"} +static constexpr const char *kWait = "wait"; +} // namespace ProcessCpuStateValues + +// DEBUG: {"brief": "The type of page fault for this data point. Type `major` is for major/hard page +// faults, and `minor` is for minor/soft page faults.\n", "name": "process.paging.fault_type", +// "requirement_level": "recommended", "root_namespace": "process", "stability": "experimental", +// "type": {"allow_custom_values": true, "members": [{"brief": none, "deprecated": none, "id": +// "major", "note": none, "stability": "experimental", "value": "major"}, {"brief": none, +// "deprecated": none, "id": "minor", "note": none, "stability": "experimental", "value": +// "minor"}]}} +namespace ProcessPagingFaultTypeValues +{ +/** + * major. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "major", "note": none, "stability": +// "experimental", "value": "major"} +static constexpr const char *kMajor = "major"; +/** + * minor. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "minor", "note": none, "stability": +// "experimental", "value": "minor"} +static constexpr const char *kMinor = "minor"; +} // namespace ProcessPagingFaultTypeValues + +} // namespace process +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/rpc_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/rpc_attributes.h new file mode 100644 index 0000000000..6fd706f126 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/rpc_attributes.h @@ -0,0 +1,466 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace rpc +{ + +/** + * The error codes of the Connect + * request. Error codes are always string values. + */ +static const char *kRpcConnectRpcErrorCode = "rpc.connect_rpc.error_code"; + +/** + * Connect request metadata, @code @endcode being the normalized Connect Metadata key + * (lowercase), the value being the metadata values. Note: Instrumentations SHOULD require an + * explicit configuration of which metadata values are to be captured. Including all request + * metadata values can be a security risk - explicit configuration helps avoid leaking sensitive + * information. + */ +static const char *kRpcConnectRpcRequestMetadata = "rpc.connect_rpc.request.metadata"; + +/** + * Connect response metadata, @code @endcode being the normalized Connect Metadata key + * (lowercase), the value being the metadata values. Note: Instrumentations SHOULD require an + * explicit configuration of which metadata values are to be captured. Including all response + * metadata values can be a security risk - explicit configuration helps avoid leaking sensitive + * information. + */ +static const char *kRpcConnectRpcResponseMetadata = "rpc.connect_rpc.response.metadata"; + +/** + * gRPC request metadata, @code @endcode being the normalized gRPC Metadata key (lowercase), + * the value being the metadata values. Note: Instrumentations SHOULD require an explicit + * configuration of which metadata values are to be captured. Including all request metadata values + * can be a security risk - explicit configuration helps avoid leaking sensitive information. + */ +static const char *kRpcGrpcRequestMetadata = "rpc.grpc.request.metadata"; + +/** + * gRPC response metadata, @code @endcode being the normalized gRPC Metadata key (lowercase), + * the value being the metadata values. Note: Instrumentations SHOULD require an explicit + * configuration of which metadata values are to be captured. Including all response metadata values + * can be a security risk - explicit configuration helps avoid leaking sensitive information. + */ +static const char *kRpcGrpcResponseMetadata = "rpc.grpc.response.metadata"; + +/** + * The numeric status + * code of the gRPC request. + */ +static const char *kRpcGrpcStatusCode = "rpc.grpc.status_code"; + +/** + * @code error.code @endcode property of response if it is an error response. + */ +static const char *kRpcJsonrpcErrorCode = "rpc.jsonrpc.error_code"; + +/** + * @code error.message @endcode property of response if it is an error response. + */ +static const char *kRpcJsonrpcErrorMessage = "rpc.jsonrpc.error_message"; + +/** + * @code id @endcode property of request or response. Since protocol allows id to be int, string, + * @code null @endcode or missing (for notifications), value is expected to be cast to string for + * simplicity. Use empty string in case of @code null @endcode value. Omit entirely if this is a + * notification. + */ +static const char *kRpcJsonrpcRequestId = "rpc.jsonrpc.request_id"; + +/** + * Protocol version as in @code jsonrpc @endcode property of request/response. Since JSON-RPC 1.0 + * doesn't specify this, the value can be omitted. + */ +static const char *kRpcJsonrpcVersion = "rpc.jsonrpc.version"; + +/** + * Compressed size of the message in bytes. + */ +static const char *kRpcMessageCompressedSize = "rpc.message.compressed_size"; + +/** + * MUST be calculated as two different counters starting from @code 1 @endcode one for sent messages + * and one for received message. Note: This way we guarantee that the values will be consistent + * between different implementations. + */ +static const char *kRpcMessageId = "rpc.message.id"; + +/** + * Whether this is a received or sent message. + */ +static const char *kRpcMessageType = "rpc.message.type"; + +/** + * Uncompressed size of the message in bytes. + */ +static const char *kRpcMessageUncompressedSize = "rpc.message.uncompressed_size"; + +/** + * The name of the (logical) method being called, must be equal to the $method part in the span + * name. Note: This is the logical name of the method from the RPC interface perspective, which can + * be different from the name of any implementing method/function. The @code code.function @endcode + * attribute may be used to store the latter (e.g., method actually executing the call on the server + * side, RPC client stub method on the client side). + */ +static const char *kRpcMethod = "rpc.method"; + +/** + * The full (logical) name of the service being called, including its package name, if applicable. + * Note: This is the logical name of the service from the RPC interface perspective, which can be + * different from the name of any implementing class. The @code code.namespace @endcode attribute + * may be used to store the latter (despite the attribute name, it may include a class name; e.g., + * class with method actually executing the call on the server side, RPC client stub class on the + * client side). + */ +static const char *kRpcService = "rpc.service"; + +/** + * A string identifying the remoting system. See below for a list of well-known identifiers. + */ +static const char *kRpcSystem = "rpc.system"; + +// DEBUG: {"brief": "The [error codes](https://connect.build/docs/protocol/#error-codes) of the +// Connect request. Error codes are always string values.", "name": "rpc.connect_rpc.error_code", +// "requirement_level": "recommended", "root_namespace": "rpc", "stability": "experimental", "type": +// {"allow_custom_values": true, "members": [{"brief": none, "deprecated": none, "id": "cancelled", +// "note": none, "stability": "experimental", "value": "cancelled"}, {"brief": none, "deprecated": +// none, "id": "unknown", "note": none, "stability": "experimental", "value": "unknown"}, {"brief": +// none, "deprecated": none, "id": "invalid_argument", "note": none, "stability": "experimental", +// "value": "invalid_argument"}, {"brief": none, "deprecated": none, "id": "deadline_exceeded", +// "note": none, "stability": "experimental", "value": "deadline_exceeded"}, {"brief": none, +// "deprecated": none, "id": "not_found", "note": none, "stability": "experimental", "value": +// "not_found"}, {"brief": none, "deprecated": none, "id": "already_exists", "note": none, +// "stability": "experimental", "value": "already_exists"}, {"brief": none, "deprecated": none, +// "id": "permission_denied", "note": none, "stability": "experimental", "value": +// "permission_denied"}, {"brief": none, "deprecated": none, "id": "resource_exhausted", "note": +// none, "stability": "experimental", "value": "resource_exhausted"}, {"brief": none, "deprecated": +// none, "id": "failed_precondition", "note": none, "stability": "experimental", "value": +// "failed_precondition"}, {"brief": none, "deprecated": none, "id": "aborted", "note": none, +// "stability": "experimental", "value": "aborted"}, {"brief": none, "deprecated": none, "id": +// "out_of_range", "note": none, "stability": "experimental", "value": "out_of_range"}, {"brief": +// none, "deprecated": none, "id": "unimplemented", "note": none, "stability": "experimental", +// "value": "unimplemented"}, {"brief": none, "deprecated": none, "id": "internal", "note": none, +// "stability": "experimental", "value": "internal"}, {"brief": none, "deprecated": none, "id": +// "unavailable", "note": none, "stability": "experimental", "value": "unavailable"}, {"brief": +// none, "deprecated": none, "id": "data_loss", "note": none, "stability": "experimental", "value": +// "data_loss"}, {"brief": none, "deprecated": none, "id": "unauthenticated", "note": none, +// "stability": "experimental", "value": "unauthenticated"}]}} +namespace RpcConnectRpcErrorCodeValues +{ +/** + * cancelled. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "cancelled", "note": none, "stability": +// "experimental", "value": "cancelled"} +static constexpr const char *kCancelled = "cancelled"; +/** + * unknown. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "unknown", "note": none, "stability": +// "experimental", "value": "unknown"} +static constexpr const char *kUnknown = "unknown"; +/** + * invalid_argument. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "invalid_argument", "note": none, "stability": +// "experimental", "value": "invalid_argument"} +static constexpr const char *kInvalidArgument = "invalid_argument"; +/** + * deadline_exceeded. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "deadline_exceeded", "note": none, "stability": +// "experimental", "value": "deadline_exceeded"} +static constexpr const char *kDeadlineExceeded = "deadline_exceeded"; +/** + * not_found. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "not_found", "note": none, "stability": +// "experimental", "value": "not_found"} +static constexpr const char *kNotFound = "not_found"; +/** + * already_exists. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "already_exists", "note": none, "stability": +// "experimental", "value": "already_exists"} +static constexpr const char *kAlreadyExists = "already_exists"; +/** + * permission_denied. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "permission_denied", "note": none, "stability": +// "experimental", "value": "permission_denied"} +static constexpr const char *kPermissionDenied = "permission_denied"; +/** + * resource_exhausted. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "resource_exhausted", "note": none, "stability": +// "experimental", "value": "resource_exhausted"} +static constexpr const char *kResourceExhausted = "resource_exhausted"; +/** + * failed_precondition. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "failed_precondition", "note": none, +// "stability": "experimental", "value": "failed_precondition"} +static constexpr const char *kFailedPrecondition = "failed_precondition"; +/** + * aborted. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "aborted", "note": none, "stability": +// "experimental", "value": "aborted"} +static constexpr const char *kAborted = "aborted"; +/** + * out_of_range. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "out_of_range", "note": none, "stability": +// "experimental", "value": "out_of_range"} +static constexpr const char *kOutOfRange = "out_of_range"; +/** + * unimplemented. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "unimplemented", "note": none, "stability": +// "experimental", "value": "unimplemented"} +static constexpr const char *kUnimplemented = "unimplemented"; +/** + * internal. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "internal", "note": none, "stability": +// "experimental", "value": "internal"} +static constexpr const char *kInternal = "internal"; +/** + * unavailable. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "unavailable", "note": none, "stability": +// "experimental", "value": "unavailable"} +static constexpr const char *kUnavailable = "unavailable"; +/** + * data_loss. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "data_loss", "note": none, "stability": +// "experimental", "value": "data_loss"} +static constexpr const char *kDataLoss = "data_loss"; +/** + * unauthenticated. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "unauthenticated", "note": none, "stability": +// "experimental", "value": "unauthenticated"} +static constexpr const char *kUnauthenticated = "unauthenticated"; +} // namespace RpcConnectRpcErrorCodeValues + +// DEBUG: {"brief": "The [numeric status +// code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request.", +// "name": "rpc.grpc.status_code", "requirement_level": "recommended", "root_namespace": "rpc", +// "stability": "experimental", "type": {"allow_custom_values": true, "members": [{"brief": "OK", +// "deprecated": none, "id": "ok", "note": none, "stability": "experimental", "value": 0}, {"brief": +// "CANCELLED", "deprecated": none, "id": "cancelled", "note": none, "stability": "experimental", +// "value": 1}, {"brief": "UNKNOWN", "deprecated": none, "id": "unknown", "note": none, "stability": +// "experimental", "value": 2}, {"brief": "INVALID_ARGUMENT", "deprecated": none, "id": +// "invalid_argument", "note": none, "stability": "experimental", "value": 3}, {"brief": +// "DEADLINE_EXCEEDED", "deprecated": none, "id": "deadline_exceeded", "note": none, "stability": +// "experimental", "value": 4}, {"brief": "NOT_FOUND", "deprecated": none, "id": "not_found", +// "note": none, "stability": "experimental", "value": 5}, {"brief": "ALREADY_EXISTS", "deprecated": +// none, "id": "already_exists", "note": none, "stability": "experimental", "value": 6}, {"brief": +// "PERMISSION_DENIED", "deprecated": none, "id": "permission_denied", "note": none, "stability": +// "experimental", "value": 7}, {"brief": "RESOURCE_EXHAUSTED", "deprecated": none, "id": +// "resource_exhausted", "note": none, "stability": "experimental", "value": 8}, {"brief": +// "FAILED_PRECONDITION", "deprecated": none, "id": "failed_precondition", "note": none, +// "stability": "experimental", "value": 9}, {"brief": "ABORTED", "deprecated": none, "id": +// "aborted", "note": none, "stability": "experimental", "value": 10}, {"brief": "OUT_OF_RANGE", +// "deprecated": none, "id": "out_of_range", "note": none, "stability": "experimental", "value": +// 11}, {"brief": "UNIMPLEMENTED", "deprecated": none, "id": "unimplemented", "note": none, +// "stability": "experimental", "value": 12}, {"brief": "INTERNAL", "deprecated": none, "id": +// "internal", "note": none, "stability": "experimental", "value": 13}, {"brief": "UNAVAILABLE", +// "deprecated": none, "id": "unavailable", "note": none, "stability": "experimental", "value": 14}, +// {"brief": "DATA_LOSS", "deprecated": none, "id": "data_loss", "note": none, "stability": +// "experimental", "value": 15}, {"brief": "UNAUTHENTICATED", "deprecated": none, "id": +// "unauthenticated", "note": none, "stability": "experimental", "value": 16}]}} +namespace RpcGrpcStatusCodeValues +{ +/** + * OK. + */ +// DEBUG: {"brief": "OK", "deprecated": none, "id": "ok", "note": none, "stability": "experimental", +// "value": 0} +static constexpr int kOk = 0; +/** + * CANCELLED. + */ +// DEBUG: {"brief": "CANCELLED", "deprecated": none, "id": "cancelled", "note": none, "stability": +// "experimental", "value": 1} +static constexpr int kCancelled = 1; +/** + * UNKNOWN. + */ +// DEBUG: {"brief": "UNKNOWN", "deprecated": none, "id": "unknown", "note": none, "stability": +// "experimental", "value": 2} +static constexpr int kUnknown = 2; +/** + * INVALID_ARGUMENT. + */ +// DEBUG: {"brief": "INVALID_ARGUMENT", "deprecated": none, "id": "invalid_argument", "note": none, +// "stability": "experimental", "value": 3} +static constexpr int kInvalidArgument = 3; +/** + * DEADLINE_EXCEEDED. + */ +// DEBUG: {"brief": "DEADLINE_EXCEEDED", "deprecated": none, "id": "deadline_exceeded", "note": +// none, "stability": "experimental", "value": 4} +static constexpr int kDeadlineExceeded = 4; +/** + * NOT_FOUND. + */ +// DEBUG: {"brief": "NOT_FOUND", "deprecated": none, "id": "not_found", "note": none, "stability": +// "experimental", "value": 5} +static constexpr int kNotFound = 5; +/** + * ALREADY_EXISTS. + */ +// DEBUG: {"brief": "ALREADY_EXISTS", "deprecated": none, "id": "already_exists", "note": none, +// "stability": "experimental", "value": 6} +static constexpr int kAlreadyExists = 6; +/** + * PERMISSION_DENIED. + */ +// DEBUG: {"brief": "PERMISSION_DENIED", "deprecated": none, "id": "permission_denied", "note": +// none, "stability": "experimental", "value": 7} +static constexpr int kPermissionDenied = 7; +/** + * RESOURCE_EXHAUSTED. + */ +// DEBUG: {"brief": "RESOURCE_EXHAUSTED", "deprecated": none, "id": "resource_exhausted", "note": +// none, "stability": "experimental", "value": 8} +static constexpr int kResourceExhausted = 8; +/** + * FAILED_PRECONDITION. + */ +// DEBUG: {"brief": "FAILED_PRECONDITION", "deprecated": none, "id": "failed_precondition", "note": +// none, "stability": "experimental", "value": 9} +static constexpr int kFailedPrecondition = 9; +/** + * ABORTED. + */ +// DEBUG: {"brief": "ABORTED", "deprecated": none, "id": "aborted", "note": none, "stability": +// "experimental", "value": 10} +static constexpr int kAborted = 10; +/** + * OUT_OF_RANGE. + */ +// DEBUG: {"brief": "OUT_OF_RANGE", "deprecated": none, "id": "out_of_range", "note": none, +// "stability": "experimental", "value": 11} +static constexpr int kOutOfRange = 11; +/** + * UNIMPLEMENTED. + */ +// DEBUG: {"brief": "UNIMPLEMENTED", "deprecated": none, "id": "unimplemented", "note": none, +// "stability": "experimental", "value": 12} +static constexpr int kUnimplemented = 12; +/** + * INTERNAL. + */ +// DEBUG: {"brief": "INTERNAL", "deprecated": none, "id": "internal", "note": none, "stability": +// "experimental", "value": 13} +static constexpr int kInternal = 13; +/** + * UNAVAILABLE. + */ +// DEBUG: {"brief": "UNAVAILABLE", "deprecated": none, "id": "unavailable", "note": none, +// "stability": "experimental", "value": 14} +static constexpr int kUnavailable = 14; +/** + * DATA_LOSS. + */ +// DEBUG: {"brief": "DATA_LOSS", "deprecated": none, "id": "data_loss", "note": none, "stability": +// "experimental", "value": 15} +static constexpr int kDataLoss = 15; +/** + * UNAUTHENTICATED. + */ +// DEBUG: {"brief": "UNAUTHENTICATED", "deprecated": none, "id": "unauthenticated", "note": none, +// "stability": "experimental", "value": 16} +static constexpr int kUnauthenticated = 16; +} // namespace RpcGrpcStatusCodeValues + +// DEBUG: {"brief": "Whether this is a received or sent message.", "name": "rpc.message.type", +// "requirement_level": "recommended", "root_namespace": "rpc", "stability": "experimental", "type": +// {"allow_custom_values": true, "members": [{"brief": none, "deprecated": none, "id": "sent", +// "note": none, "stability": "experimental", "value": "SENT"}, {"brief": none, "deprecated": none, +// "id": "received", "note": none, "stability": "experimental", "value": "RECEIVED"}]}} +namespace RpcMessageTypeValues +{ +/** + * sent. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "sent", "note": none, "stability": +// "experimental", "value": "SENT"} +static constexpr const char *kSent = "SENT"; +/** + * received. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "received", "note": none, "stability": +// "experimental", "value": "RECEIVED"} +static constexpr const char *kReceived = "RECEIVED"; +} // namespace RpcMessageTypeValues + +// DEBUG: {"brief": "A string identifying the remoting system. See below for a list of well-known +// identifiers.", "name": "rpc.system", "requirement_level": "recommended", "root_namespace": "rpc", +// "stability": "experimental", "type": {"allow_custom_values": true, "members": [{"brief": "gRPC", +// "deprecated": none, "id": "grpc", "note": none, "stability": "experimental", "value": "grpc"}, +// {"brief": "Java RMI", "deprecated": none, "id": "java_rmi", "note": none, "stability": +// "experimental", "value": "java_rmi"}, {"brief": ".NET WCF", "deprecated": none, "id": +// "dotnet_wcf", "note": none, "stability": "experimental", "value": "dotnet_wcf"}, {"brief": +// "Apache Dubbo", "deprecated": none, "id": "apache_dubbo", "note": none, "stability": +// "experimental", "value": "apache_dubbo"}, {"brief": "Connect RPC", "deprecated": none, "id": +// "connect_rpc", "note": none, "stability": "experimental", "value": "connect_rpc"}]}} +namespace RpcSystemValues +{ +/** + * gRPC. + */ +// DEBUG: {"brief": "gRPC", "deprecated": none, "id": "grpc", "note": none, "stability": +// "experimental", "value": "grpc"} +static constexpr const char *kGrpc = "grpc"; +/** + * Java RMI. + */ +// DEBUG: {"brief": "Java RMI", "deprecated": none, "id": "java_rmi", "note": none, "stability": +// "experimental", "value": "java_rmi"} +static constexpr const char *kJavaRmi = "java_rmi"; +/** + * .NET WCF. + */ +// DEBUG: {"brief": ".NET WCF", "deprecated": none, "id": "dotnet_wcf", "note": none, "stability": +// "experimental", "value": "dotnet_wcf"} +static constexpr const char *kDotnetWcf = "dotnet_wcf"; +/** + * Apache Dubbo. + */ +// DEBUG: {"brief": "Apache Dubbo", "deprecated": none, "id": "apache_dubbo", "note": none, +// "stability": "experimental", "value": "apache_dubbo"} +static constexpr const char *kApacheDubbo = "apache_dubbo"; +/** + * Connect RPC. + */ +// DEBUG: {"brief": "Connect RPC", "deprecated": none, "id": "connect_rpc", "note": none, +// "stability": "experimental", "value": "connect_rpc"} +static constexpr const char *kConnectRpc = "connect_rpc"; +} // namespace RpcSystemValues + +} // namespace rpc +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/server_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/server_attributes.h new file mode 100644 index 0000000000..ce9a19dd10 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/server_attributes.h @@ -0,0 +1,38 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace server +{ + +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.server_attributes. @endcode. + */ +static const char *kServerAddress = "server.address"; + +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.server_attributes. @endcode. + */ +static const char *kServerPort = "server.port"; + +} // namespace server +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/service_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/service_attributes.h new file mode 100644 index 0000000000..12d2a3028c --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/service_attributes.h @@ -0,0 +1,79 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace service +{ + +/** + * The string ID of the service instance. + * Note: MUST be unique for each instance of the same @code service.namespace,service.name @endcode + * pair (in other words + * @code service.namespace,service.name,service.instance.id @endcode triplet MUST be globally + * unique). The ID helps to distinguish instances of the same service that exist at the same time + * (e.g. instances of a horizontally scaled service).

Implementations, such as SDKs, are + * recommended to generate a random Version 1 or Version 4 RFC 4122 UUID, but are free to use an inherent + * unique ID as the source of this value if stability is desirable. In that case, the ID SHOULD be + * used as source of a UUID Version 5 and SHOULD use the following UUID as the namespace: @code + * 4d63009a-8d0f-11ee-aad7-4c796ed8e320 @endcode.

UUIDs are typically recommended, as only an + * opaque value for the purposes of identifying a service instance is needed. Similar to what can be + * seen in the man page for the @code /etc/machine-id + * @endcode file, the underlying data, such as pod name and namespace should be treated as + * confidential, being the user's choice to expose it or not via another resource attribute.

For + * applications running behind an application server (like unicorn), we do not recommend using one + * identifier for all processes participating in the application. Instead, it's recommended each + * division (e.g. a worker thread in unicorn) to have its own instance.id.

It's not recommended + * for a Collector to set @code service.instance.id @endcode if it can't unambiguously determine the + * service instance that is generating that telemetry. For instance, creating an UUID based on @code + * pod.name @endcode will likely be wrong, as the Collector might not know from which container + * within that pod the telemetry originated. However, Collectors can set the @code + * service.instance.id @endcode if they can unambiguously determine the service instance for that + * telemetry. This is typically the case for scraping receivers, as they know the target address and + * port. + */ +static const char *kServiceInstanceId = "service.instance.id"; + +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.service_attributes. @endcode. + */ +static const char *kServiceName = "service.name"; + +/** + * A namespace for @code service.name @endcode. + * Note: A string value having a meaning that helps to distinguish a group of services, for example + * the team name that owns a group of services. @code service.name @endcode is expected to be unique + * within the same namespace. If @code service.namespace @endcode is not specified in the Resource + * then @code service.name @endcode is expected to be unique for all services that have no explicit + * namespace defined (so the empty/unspecified namespace is simply one more valid namespace). + * Zero-length namespace string is assumed equal to unspecified namespace. + */ +static const char *kServiceNamespace = "service.namespace"; + +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.service_attributes. @endcode. + */ +static const char *kServiceVersion = "service.version"; + +} // namespace service +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/session_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/session_attributes.h new file mode 100644 index 0000000000..570469b5e1 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/session_attributes.h @@ -0,0 +1,36 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace session +{ + +/** + * A unique id to identify a session. + */ +static const char *kSessionId = "session.id"; + +/** + * The previous @code session.id @endcode for this user, when known. + */ +static const char *kSessionPreviousId = "session.previous_id"; + +} // namespace session +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/source_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/source_attributes.h new file mode 100644 index 0000000000..d29f25ecf8 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/source_attributes.h @@ -0,0 +1,39 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace source +{ + +/** + * Source address - domain name if available without reverse DNS lookup; otherwise, IP address or + * Unix domain socket name. Note: When observed from the destination side, and when communicating + * through an intermediary, @code source.address @endcode SHOULD represent the source address behind + * any intermediaries, for example proxies, if it's available. + */ +static const char *kSourceAddress = "source.address"; + +/** + * Source port number. + */ +static const char *kSourcePort = "source.port"; + +} // namespace source +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/system_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/system_attributes.h new file mode 100644 index 0000000000..6a62674cb4 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/system_attributes.h @@ -0,0 +1,519 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace system +{ + +/** + * The logical CPU number [0..n-1]. + */ +static const char *kSystemCpuLogicalNumber = "system.cpu.logical_number"; + +/** + * @Deprecated: Replaced by @code cpu.mode @endcode. + */ +static const char *kSystemCpuState = "system.cpu.state"; + +/** + * The device identifier. + */ +static const char *kSystemDevice = "system.device"; + +/** + * The filesystem mode. + */ +static const char *kSystemFilesystemMode = "system.filesystem.mode"; + +/** + * The filesystem mount path. + */ +static const char *kSystemFilesystemMountpoint = "system.filesystem.mountpoint"; + +/** + * The filesystem state. + */ +static const char *kSystemFilesystemState = "system.filesystem.state"; + +/** + * The filesystem type. + */ +static const char *kSystemFilesystemType = "system.filesystem.type"; + +/** + * The memory state. + */ +static const char *kSystemMemoryState = "system.memory.state"; + +/** + * A stateless protocol MUST NOT set this attribute. + */ +static const char *kSystemNetworkState = "system.network.state"; + +/** + * The paging access direction. + */ +static const char *kSystemPagingDirection = "system.paging.direction"; + +/** + * The memory paging state. + */ +static const char *kSystemPagingState = "system.paging.state"; + +/** + * The memory paging type. + */ +static const char *kSystemPagingType = "system.paging.type"; + +/** + * The process state, e.g., Linux Process State + * Codes. + */ +static const char *kSystemProcessStatus = "system.process.status"; + +/** + * @Deprecated: Replaced by @code system.process.status @endcode. + */ +static const char *kSystemProcessesStatus = "system.processes.status"; + +// @deprecated(reason="The attribute system.cpu.state is deprecated - Replaced by `cpu.mode`") # +// type: ignore DEBUG: {"brief": "Deprecated, use `cpu.mode` instead.", "deprecated": "Replaced by +// `cpu.mode`", "examples": ["idle", "interrupt"], "name": "system.cpu.state", "requirement_level": +// "recommended", "root_namespace": "system", "stability": "experimental", "type": +// {"allow_custom_values": true, "members": [{"brief": none, "deprecated": none, "id": "user", +// "note": none, "stability": "experimental", "value": "user"}, {"brief": none, "deprecated": none, +// "id": "system", "note": none, "stability": "experimental", "value": "system"}, {"brief": none, +// "deprecated": none, "id": "nice", "note": none, "stability": "experimental", "value": "nice"}, +// {"brief": none, "deprecated": none, "id": "idle", "note": none, "stability": "experimental", +// "value": "idle"}, {"brief": none, "deprecated": none, "id": "iowait", "note": none, "stability": +// "experimental", "value": "iowait"}, {"brief": none, "deprecated": none, "id": "interrupt", +// "note": none, "stability": "experimental", "value": "interrupt"}, {"brief": none, "deprecated": +// none, "id": "steal", "note": none, "stability": "experimental", "value": "steal"}]}} +namespace SystemCpuStateValues +{ +/** + * user. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "user", "note": none, "stability": +// "experimental", "value": "user"} +static constexpr const char *kUser = "user"; +/** + * system. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "system", "note": none, "stability": +// "experimental", "value": "system"} +static constexpr const char *kSystem = "system"; +/** + * nice. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "nice", "note": none, "stability": +// "experimental", "value": "nice"} +static constexpr const char *kNice = "nice"; +/** + * idle. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "idle", "note": none, "stability": +// "experimental", "value": "idle"} +static constexpr const char *kIdle = "idle"; +/** + * iowait. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "iowait", "note": none, "stability": +// "experimental", "value": "iowait"} +static constexpr const char *kIowait = "iowait"; +/** + * interrupt. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "interrupt", "note": none, "stability": +// "experimental", "value": "interrupt"} +static constexpr const char *kInterrupt = "interrupt"; +/** + * steal. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "steal", "note": none, "stability": +// "experimental", "value": "steal"} +static constexpr const char *kSteal = "steal"; +} // namespace SystemCpuStateValues + +// DEBUG: {"brief": "The filesystem state", "examples": ["used"], "name": "system.filesystem.state", +// "requirement_level": "recommended", "root_namespace": "system", "stability": "experimental", +// "type": {"allow_custom_values": true, "members": [{"brief": none, "deprecated": none, "id": +// "used", "note": none, "stability": "experimental", "value": "used"}, {"brief": none, +// "deprecated": none, "id": "free", "note": none, "stability": "experimental", "value": "free"}, +// {"brief": none, "deprecated": none, "id": "reserved", "note": none, "stability": "experimental", +// "value": "reserved"}]}} +namespace SystemFilesystemStateValues +{ +/** + * used. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "used", "note": none, "stability": +// "experimental", "value": "used"} +static constexpr const char *kUsed = "used"; +/** + * free. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "free", "note": none, "stability": +// "experimental", "value": "free"} +static constexpr const char *kFree = "free"; +/** + * reserved. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "reserved", "note": none, "stability": +// "experimental", "value": "reserved"} +static constexpr const char *kReserved = "reserved"; +} // namespace SystemFilesystemStateValues + +// DEBUG: {"brief": "The filesystem type", "examples": ["ext4"], "name": "system.filesystem.type", +// "requirement_level": "recommended", "root_namespace": "system", "stability": "experimental", +// "type": {"allow_custom_values": true, "members": [{"brief": none, "deprecated": none, "id": +// "fat32", "note": none, "stability": "experimental", "value": "fat32"}, {"brief": none, +// "deprecated": none, "id": "exfat", "note": none, "stability": "experimental", "value": "exfat"}, +// {"brief": none, "deprecated": none, "id": "ntfs", "note": none, "stability": "experimental", +// "value": "ntfs"}, {"brief": none, "deprecated": none, "id": "refs", "note": none, "stability": +// "experimental", "value": "refs"}, {"brief": none, "deprecated": none, "id": "hfsplus", "note": +// none, "stability": "experimental", "value": "hfsplus"}, {"brief": none, "deprecated": none, "id": +// "ext4", "note": none, "stability": "experimental", "value": "ext4"}]}} +namespace SystemFilesystemTypeValues +{ +/** + * fat32. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "fat32", "note": none, "stability": +// "experimental", "value": "fat32"} +static constexpr const char *kFat32 = "fat32"; +/** + * exfat. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "exfat", "note": none, "stability": +// "experimental", "value": "exfat"} +static constexpr const char *kExfat = "exfat"; +/** + * ntfs. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "ntfs", "note": none, "stability": +// "experimental", "value": "ntfs"} +static constexpr const char *kNtfs = "ntfs"; +/** + * refs. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "refs", "note": none, "stability": +// "experimental", "value": "refs"} +static constexpr const char *kRefs = "refs"; +/** + * hfsplus. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "hfsplus", "note": none, "stability": +// "experimental", "value": "hfsplus"} +static constexpr const char *kHfsplus = "hfsplus"; +/** + * ext4. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "ext4", "note": none, "stability": +// "experimental", "value": "ext4"} +static constexpr const char *kExt4 = "ext4"; +} // namespace SystemFilesystemTypeValues + +// DEBUG: {"brief": "The memory state", "examples": ["free", "cached"], "name": +// "system.memory.state", "requirement_level": "recommended", "root_namespace": "system", +// "stability": "experimental", "type": {"allow_custom_values": true, "members": [{"brief": none, +// "deprecated": none, "id": "used", "note": none, "stability": "experimental", "value": "used"}, +// {"brief": none, "deprecated": none, "id": "free", "note": none, "stability": "experimental", +// "value": "free"}, {"brief": none, "deprecated": "Removed, report shared memory usage with +// `metric.system.memory.shared` metric", "id": "shared", "note": none, "stability": "experimental", +// "value": "shared"}, {"brief": none, "deprecated": none, "id": "buffers", "note": none, +// "stability": "experimental", "value": "buffers"}, {"brief": none, "deprecated": none, "id": +// "cached", "note": none, "stability": "experimental", "value": "cached"}]}} +namespace SystemMemoryStateValues +{ +/** + * used. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "used", "note": none, "stability": +// "experimental", "value": "used"} +static constexpr const char *kUsed = "used"; +/** + * free. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "free", "note": none, "stability": +// "experimental", "value": "free"} +static constexpr const char *kFree = "free"; +/** + * @Deprecated: Removed, report shared memory usage with @code metric.system.memory.shared @endcode + * metric. + */ +// DEBUG: {"brief": none, "deprecated": "Removed, report shared memory usage with +// `metric.system.memory.shared` metric", "id": "shared", "note": none, "stability": "experimental", +// "value": "shared"} +static constexpr const char *kShared = "shared"; +/** + * buffers. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "buffers", "note": none, "stability": +// "experimental", "value": "buffers"} +static constexpr const char *kBuffers = "buffers"; +/** + * cached. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "cached", "note": none, "stability": +// "experimental", "value": "cached"} +static constexpr const char *kCached = "cached"; +} // namespace SystemMemoryStateValues + +// DEBUG: {"brief": "A stateless protocol MUST NOT set this attribute", "examples": ["close_wait"], +// "name": "system.network.state", "requirement_level": "recommended", "root_namespace": "system", +// "stability": "experimental", "type": {"allow_custom_values": true, "members": [{"brief": none, +// "deprecated": none, "id": "close", "note": none, "stability": "experimental", "value": "close"}, +// {"brief": none, "deprecated": none, "id": "close_wait", "note": none, "stability": +// "experimental", "value": "close_wait"}, {"brief": none, "deprecated": none, "id": "closing", +// "note": none, "stability": "experimental", "value": "closing"}, {"brief": none, "deprecated": +// none, "id": "delete", "note": none, "stability": "experimental", "value": "delete"}, {"brief": +// none, "deprecated": none, "id": "established", "note": none, "stability": "experimental", +// "value": "established"}, {"brief": none, "deprecated": none, "id": "fin_wait_1", "note": none, +// "stability": "experimental", "value": "fin_wait_1"}, {"brief": none, "deprecated": none, "id": +// "fin_wait_2", "note": none, "stability": "experimental", "value": "fin_wait_2"}, {"brief": none, +// "deprecated": none, "id": "last_ack", "note": none, "stability": "experimental", "value": +// "last_ack"}, {"brief": none, "deprecated": none, "id": "listen", "note": none, "stability": +// "experimental", "value": "listen"}, {"brief": none, "deprecated": none, "id": "syn_recv", "note": +// none, "stability": "experimental", "value": "syn_recv"}, {"brief": none, "deprecated": none, +// "id": "syn_sent", "note": none, "stability": "experimental", "value": "syn_sent"}, {"brief": +// none, "deprecated": none, "id": "time_wait", "note": none, "stability": "experimental", "value": +// "time_wait"}]}} +namespace SystemNetworkStateValues +{ +/** + * close. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "close", "note": none, "stability": +// "experimental", "value": "close"} +static constexpr const char *kClose = "close"; +/** + * close_wait. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "close_wait", "note": none, "stability": +// "experimental", "value": "close_wait"} +static constexpr const char *kCloseWait = "close_wait"; +/** + * closing. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "closing", "note": none, "stability": +// "experimental", "value": "closing"} +static constexpr const char *kClosing = "closing"; +/** + * delete. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "delete", "note": none, "stability": +// "experimental", "value": "delete"} +static constexpr const char *kDelete = "delete"; +/** + * established. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "established", "note": none, "stability": +// "experimental", "value": "established"} +static constexpr const char *kEstablished = "established"; +/** + * fin_wait_1. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "fin_wait_1", "note": none, "stability": +// "experimental", "value": "fin_wait_1"} +static constexpr const char *kFinWait1 = "fin_wait_1"; +/** + * fin_wait_2. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "fin_wait_2", "note": none, "stability": +// "experimental", "value": "fin_wait_2"} +static constexpr const char *kFinWait2 = "fin_wait_2"; +/** + * last_ack. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "last_ack", "note": none, "stability": +// "experimental", "value": "last_ack"} +static constexpr const char *kLastAck = "last_ack"; +/** + * listen. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "listen", "note": none, "stability": +// "experimental", "value": "listen"} +static constexpr const char *kListen = "listen"; +/** + * syn_recv. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "syn_recv", "note": none, "stability": +// "experimental", "value": "syn_recv"} +static constexpr const char *kSynRecv = "syn_recv"; +/** + * syn_sent. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "syn_sent", "note": none, "stability": +// "experimental", "value": "syn_sent"} +static constexpr const char *kSynSent = "syn_sent"; +/** + * time_wait. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "time_wait", "note": none, "stability": +// "experimental", "value": "time_wait"} +static constexpr const char *kTimeWait = "time_wait"; +} // namespace SystemNetworkStateValues + +// DEBUG: {"brief": "The paging access direction", "examples": ["in"], "name": +// "system.paging.direction", "requirement_level": "recommended", "root_namespace": "system", +// "stability": "experimental", "type": {"allow_custom_values": true, "members": [{"brief": none, +// "deprecated": none, "id": "in", "note": none, "stability": "experimental", "value": "in"}, +// {"brief": none, "deprecated": none, "id": "out", "note": none, "stability": "experimental", +// "value": "out"}]}} +namespace SystemPagingDirectionValues +{ +/** + * in. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "in", "note": none, "stability": "experimental", +// "value": "in"} +static constexpr const char *kIn = "in"; +/** + * out. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "out", "note": none, "stability": +// "experimental", "value": "out"} +static constexpr const char *kOut = "out"; +} // namespace SystemPagingDirectionValues + +// DEBUG: {"brief": "The memory paging state", "examples": ["free"], "name": "system.paging.state", +// "requirement_level": "recommended", "root_namespace": "system", "stability": "experimental", +// "type": {"allow_custom_values": true, "members": [{"brief": none, "deprecated": none, "id": +// "used", "note": none, "stability": "experimental", "value": "used"}, {"brief": none, +// "deprecated": none, "id": "free", "note": none, "stability": "experimental", "value": "free"}]}} +namespace SystemPagingStateValues +{ +/** + * used. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "used", "note": none, "stability": +// "experimental", "value": "used"} +static constexpr const char *kUsed = "used"; +/** + * free. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "free", "note": none, "stability": +// "experimental", "value": "free"} +static constexpr const char *kFree = "free"; +} // namespace SystemPagingStateValues + +// DEBUG: {"brief": "The memory paging type", "examples": ["minor"], "name": "system.paging.type", +// "requirement_level": "recommended", "root_namespace": "system", "stability": "experimental", +// "type": {"allow_custom_values": true, "members": [{"brief": none, "deprecated": none, "id": +// "major", "note": none, "stability": "experimental", "value": "major"}, {"brief": none, +// "deprecated": none, "id": "minor", "note": none, "stability": "experimental", "value": +// "minor"}]}} +namespace SystemPagingTypeValues +{ +/** + * major. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "major", "note": none, "stability": +// "experimental", "value": "major"} +static constexpr const char *kMajor = "major"; +/** + * minor. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "minor", "note": none, "stability": +// "experimental", "value": "minor"} +static constexpr const char *kMinor = "minor"; +} // namespace SystemPagingTypeValues + +// DEBUG: {"brief": "The process state, e.g., [Linux Process State +// Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES)\n", "examples": +// ["running"], "name": "system.process.status", "requirement_level": "recommended", +// "root_namespace": "system", "stability": "experimental", "type": {"allow_custom_values": true, +// "members": [{"brief": none, "deprecated": none, "id": "running", "note": none, "stability": +// "experimental", "value": "running"}, {"brief": none, "deprecated": none, "id": "sleeping", +// "note": none, "stability": "experimental", "value": "sleeping"}, {"brief": none, "deprecated": +// none, "id": "stopped", "note": none, "stability": "experimental", "value": "stopped"}, {"brief": +// none, "deprecated": none, "id": "defunct", "note": none, "stability": "experimental", "value": +// "defunct"}]}} +namespace SystemProcessStatusValues +{ +/** + * running. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "running", "note": none, "stability": +// "experimental", "value": "running"} +static constexpr const char *kRunning = "running"; +/** + * sleeping. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "sleeping", "note": none, "stability": +// "experimental", "value": "sleeping"} +static constexpr const char *kSleeping = "sleeping"; +/** + * stopped. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "stopped", "note": none, "stability": +// "experimental", "value": "stopped"} +static constexpr const char *kStopped = "stopped"; +/** + * defunct. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "defunct", "note": none, "stability": +// "experimental", "value": "defunct"} +static constexpr const char *kDefunct = "defunct"; +} // namespace SystemProcessStatusValues + +// @deprecated(reason="The attribute system.processes.status is deprecated - Replaced by +// `system.process.status`") # type: ignore DEBUG: {"brief": "Deprecated, use +// `system.process.status` instead.", "deprecated": "Replaced by `system.process.status`.", +// "examples": ["running"], "name": "system.processes.status", "requirement_level": "recommended", +// "root_namespace": "system", "stability": "experimental", "type": {"allow_custom_values": true, +// "members": [{"brief": none, "deprecated": none, "id": "running", "note": none, "stability": +// "experimental", "value": "running"}, {"brief": none, "deprecated": none, "id": "sleeping", +// "note": none, "stability": "experimental", "value": "sleeping"}, {"brief": none, "deprecated": +// none, "id": "stopped", "note": none, "stability": "experimental", "value": "stopped"}, {"brief": +// none, "deprecated": none, "id": "defunct", "note": none, "stability": "experimental", "value": +// "defunct"}]}} +namespace SystemProcessesStatusValues +{ +/** + * running. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "running", "note": none, "stability": +// "experimental", "value": "running"} +static constexpr const char *kRunning = "running"; +/** + * sleeping. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "sleeping", "note": none, "stability": +// "experimental", "value": "sleeping"} +static constexpr const char *kSleeping = "sleeping"; +/** + * stopped. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "stopped", "note": none, "stability": +// "experimental", "value": "stopped"} +static constexpr const char *kStopped = "stopped"; +/** + * defunct. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "defunct", "note": none, "stability": +// "experimental", "value": "defunct"} +static constexpr const char *kDefunct = "defunct"; +} // namespace SystemProcessesStatusValues + +} // namespace system +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/telemetry_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/telemetry_attributes.h new file mode 100644 index 0000000000..4f671a976f --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/telemetry_attributes.h @@ -0,0 +1,167 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace telemetry +{ + +/** + * The name of the auto instrumentation agent or distribution, if used. + * Note: Official auto instrumentation agents and distributions SHOULD set the @code + * telemetry.distro.name @endcode attribute to a string starting with @code opentelemetry- @endcode, + * e.g. @code opentelemetry-java-instrumentation @endcode. + */ +static const char *kTelemetryDistroName = "telemetry.distro.name"; + +/** + * The version string of the auto instrumentation agent or distribution, if used. + */ +static const char *kTelemetryDistroVersion = "telemetry.distro.version"; + +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.telemetry_attributes. @endcode. + */ +static const char *kTelemetrySdkLanguage = "telemetry.sdk.language"; + +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.telemetry_attributes. @endcode. + */ +static const char *kTelemetrySdkName = "telemetry.sdk.name"; + +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.telemetry_attributes. @endcode. + */ +static const char *kTelemetrySdkVersion = "telemetry.sdk.version"; + +// @deprecated(reason="Deprecated in favor of stable +// `opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues`.") # type: +// ignore DEBUG: {"brief": "The language of the telemetry SDK.\n", "name": "telemetry.sdk.language", +// "requirement_level": "required", "root_namespace": "telemetry", "stability": "stable", "type": +// {"allow_custom_values": true, "members": [{"brief": none, "deprecated": none, "id": "cpp", +// "note": none, "stability": "stable", "value": "cpp"}, {"brief": none, "deprecated": none, "id": +// "dotnet", "note": none, "stability": "stable", "value": "dotnet"}, {"brief": none, "deprecated": +// none, "id": "erlang", "note": none, "stability": "stable", "value": "erlang"}, {"brief": none, +// "deprecated": none, "id": "go", "note": none, "stability": "stable", "value": "go"}, {"brief": +// none, "deprecated": none, "id": "java", "note": none, "stability": "stable", "value": "java"}, +// {"brief": none, "deprecated": none, "id": "nodejs", "note": none, "stability": "stable", "value": +// "nodejs"}, {"brief": none, "deprecated": none, "id": "php", "note": none, "stability": "stable", +// "value": "php"}, {"brief": none, "deprecated": none, "id": "python", "note": none, "stability": +// "stable", "value": "python"}, {"brief": none, "deprecated": none, "id": "ruby", "note": none, +// "stability": "stable", "value": "ruby"}, {"brief": none, "deprecated": none, "id": "rust", +// "note": none, "stability": "stable", "value": "rust"}, {"brief": none, "deprecated": none, "id": +// "swift", "note": none, "stability": "stable", "value": "swift"}, {"brief": none, "deprecated": +// none, "id": "webjs", "note": none, "stability": "stable", "value": "webjs"}]}} +namespace TelemetrySdkLanguageValues +{ +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues.kCpp @endcode. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "cpp", "note": none, "stability": "stable", +// "value": "cpp"} +static constexpr const char *kCpp = "cpp"; +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues.kDotnet + * @endcode. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "dotnet", "note": none, "stability": "stable", +// "value": "dotnet"} +static constexpr const char *kDotnet = "dotnet"; +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues.kErlang + * @endcode. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "erlang", "note": none, "stability": "stable", +// "value": "erlang"} +static constexpr const char *kErlang = "erlang"; +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues.kGo @endcode. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "go", "note": none, "stability": "stable", +// "value": "go"} +static constexpr const char *kGo = "go"; +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues.kJava @endcode. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "java", "note": none, "stability": "stable", +// "value": "java"} +static constexpr const char *kJava = "java"; +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues.kNodejs + * @endcode. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "nodejs", "note": none, "stability": "stable", +// "value": "nodejs"} +static constexpr const char *kNodejs = "nodejs"; +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues.kPhp @endcode. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "php", "note": none, "stability": "stable", +// "value": "php"} +static constexpr const char *kPhp = "php"; +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues.kPython + * @endcode. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "python", "note": none, "stability": "stable", +// "value": "python"} +static constexpr const char *kPython = "python"; +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues.kRuby @endcode. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "ruby", "note": none, "stability": "stable", +// "value": "ruby"} +static constexpr const char *kRuby = "ruby"; +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues.kRust @endcode. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "rust", "note": none, "stability": "stable", +// "value": "rust"} +static constexpr const char *kRust = "rust"; +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues.kSwift @endcode. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "swift", "note": none, "stability": "stable", +// "value": "swift"} +static constexpr const char *kSwift = "swift"; +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues.kWebjs @endcode. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "webjs", "note": none, "stability": "stable", +// "value": "webjs"} +static constexpr const char *kWebjs = "webjs"; +} // namespace TelemetrySdkLanguageValues + +} // namespace telemetry +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/test_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/test_attributes.h new file mode 100644 index 0000000000..d67701b411 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/test_attributes.h @@ -0,0 +1,121 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace test +{ + +/** + * The fully qualified human readable name of the test case. + */ +static const char *kTestCaseName = "test.case.name"; + +/** + * The status of the actual test case result from test execution. + */ +static const char *kTestCaseResultStatus = "test.case.result.status"; + +/** + * The human readable name of a test suite. + */ +static const char *kTestSuiteName = "test.suite.name"; + +/** + * The status of the test suite run. + */ +static const char *kTestSuiteRunStatus = "test.suite.run.status"; + +// DEBUG: {"brief": "The status of the actual test case result from test execution.\n", "examples": +// ["pass", "fail"], "name": "test.case.result.status", "requirement_level": "recommended", +// "root_namespace": "test", "stability": "experimental", "type": {"allow_custom_values": true, +// "members": [{"brief": "pass", "deprecated": none, "id": "pass", "note": none, "stability": +// "experimental", "value": "pass"}, {"brief": "fail", "deprecated": none, "id": "fail", "note": +// none, "stability": "experimental", "value": "fail"}]}} +namespace TestCaseResultStatusValues +{ +/** + * pass. + */ +// DEBUG: {"brief": "pass", "deprecated": none, "id": "pass", "note": none, "stability": +// "experimental", "value": "pass"} +static constexpr const char *kPass = "pass"; +/** + * fail. + */ +// DEBUG: {"brief": "fail", "deprecated": none, "id": "fail", "note": none, "stability": +// "experimental", "value": "fail"} +static constexpr const char *kFail = "fail"; +} // namespace TestCaseResultStatusValues + +// DEBUG: {"brief": "The status of the test suite run.\n", "examples": ["success", "failure", +// "skipped", "aborted", "timed_out", "in_progress"], "name": "test.suite.run.status", +// "requirement_level": "recommended", "root_namespace": "test", "stability": "experimental", +// "type": {"allow_custom_values": true, "members": [{"brief": "success", "deprecated": none, "id": +// "success", "note": none, "stability": "experimental", "value": "success"}, {"brief": "failure", +// "deprecated": none, "id": "failure", "note": none, "stability": "experimental", "value": +// "failure"}, {"brief": "skipped", "deprecated": none, "id": "skipped", "note": none, "stability": +// "experimental", "value": "skipped"}, {"brief": "aborted", "deprecated": none, "id": "aborted", +// "note": none, "stability": "experimental", "value": "aborted"}, {"brief": "timed_out", +// "deprecated": none, "id": "timed_out", "note": none, "stability": "experimental", "value": +// "timed_out"}, {"brief": "in_progress", "deprecated": none, "id": "in_progress", "note": none, +// "stability": "experimental", "value": "in_progress"}]}} +namespace TestSuiteRunStatusValues +{ +/** + * success. + */ +// DEBUG: {"brief": "success", "deprecated": none, "id": "success", "note": none, "stability": +// "experimental", "value": "success"} +static constexpr const char *kSuccess = "success"; +/** + * failure. + */ +// DEBUG: {"brief": "failure", "deprecated": none, "id": "failure", "note": none, "stability": +// "experimental", "value": "failure"} +static constexpr const char *kFailure = "failure"; +/** + * skipped. + */ +// DEBUG: {"brief": "skipped", "deprecated": none, "id": "skipped", "note": none, "stability": +// "experimental", "value": "skipped"} +static constexpr const char *kSkipped = "skipped"; +/** + * aborted. + */ +// DEBUG: {"brief": "aborted", "deprecated": none, "id": "aborted", "note": none, "stability": +// "experimental", "value": "aborted"} +static constexpr const char *kAborted = "aborted"; +/** + * timed_out. + */ +// DEBUG: {"brief": "timed_out", "deprecated": none, "id": "timed_out", "note": none, "stability": +// "experimental", "value": "timed_out"} +static constexpr const char *kTimedOut = "timed_out"; +/** + * in_progress. + */ +// DEBUG: {"brief": "in_progress", "deprecated": none, "id": "in_progress", "note": none, +// "stability": "experimental", "value": "in_progress"} +static constexpr const char *kInProgress = "in_progress"; +} // namespace TestSuiteRunStatusValues + +} // namespace test +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/thread_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/thread_attributes.h new file mode 100644 index 0000000000..f81619f02d --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/thread_attributes.h @@ -0,0 +1,36 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace thread +{ + +/** + * Current "managed" thread ID (as opposed to OS thread ID). + */ +static const char *kThreadId = "thread.id"; + +/** + * Current thread name. + */ +static const char *kThreadName = "thread.name"; + +} // namespace thread +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/tls_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/tls_attributes.h new file mode 100644 index 0000000000..5fcf65f2e5 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/tls_attributes.h @@ -0,0 +1,229 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace tls +{ + +/** + * String indicating the cipher used during the + * current connection. Note: The values allowed for @code tls.cipher @endcode MUST be one of the + * @code Descriptions @endcode of the registered + * TLS Cipher Suits. + */ +static const char *kTlsCipher = "tls.cipher"; + +/** + * PEM-encoded stand-alone certificate offered by the client. This is usually mutually-exclusive of + * @code client.certificate_chain @endcode since this value also exists in that list. + */ +static const char *kTlsClientCertificate = "tls.client.certificate"; + +/** + * Array of PEM-encoded certificates that make up the certificate chain offered by the client. This + * is usually mutually-exclusive of @code client.certificate @endcode since that value should be the + * first certificate in the chain. + */ +static const char *kTlsClientCertificateChain = "tls.client.certificate_chain"; + +/** + * Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the + * client. For consistency with other hash values, this value should be formatted as an uppercase + * hash. + */ +static const char *kTlsClientHashMd5 = "tls.client.hash.md5"; + +/** + * Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by + * the client. For consistency with other hash values, this value should be formatted as an + * uppercase hash. + */ +static const char *kTlsClientHashSha1 = "tls.client.hash.sha1"; + +/** + * Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by + * the client. For consistency with other hash values, this value should be formatted as an + * uppercase hash. + */ +static const char *kTlsClientHashSha256 = "tls.client.hash.sha256"; + +/** + * Distinguished name of subject of the issuer of + * the x.509 certificate presented by the client. + */ +static const char *kTlsClientIssuer = "tls.client.issuer"; + +/** + * A hash that identifies clients based on how they perform an SSL/TLS handshake. + */ +static const char *kTlsClientJa3 = "tls.client.ja3"; + +/** + * Date/Time indicating when client certificate is no longer considered valid. + */ +static const char *kTlsClientNotAfter = "tls.client.not_after"; + +/** + * Date/Time indicating when client certificate is first considered valid. + */ +static const char *kTlsClientNotBefore = "tls.client.not_before"; + +/** + * @Deprecated: Replaced by `server.address. + */ +static const char *kTlsClientServerName = "tls.client.server_name"; + +/** + * Distinguished name of subject of the x.509 certificate presented by the client. + */ +static const char *kTlsClientSubject = "tls.client.subject"; + +/** + * Array of ciphers offered by the client during the client hello. + */ +static const char *kTlsClientSupportedCiphers = "tls.client.supported_ciphers"; + +/** + * String indicating the curve used for the given cipher, when applicable. + */ +static const char *kTlsCurve = "tls.curve"; + +/** + * Boolean flag indicating if the TLS negotiation was successful and transitioned to an encrypted + * tunnel. + */ +static const char *kTlsEstablished = "tls.established"; + +/** + * String indicating the protocol being tunneled. Per the values in the IANA + * registry, this string should be lower case. + */ +static const char *kTlsNextProtocol = "tls.next_protocol"; + +/** + * Normalized lowercase protocol name parsed from original string of the negotiated SSL/TLS + * protocol version. + */ +static const char *kTlsProtocolName = "tls.protocol.name"; + +/** + * Numeric part of the version parsed from the original string of the negotiated SSL/TLS + * protocol version. + */ +static const char *kTlsProtocolVersion = "tls.protocol.version"; + +/** + * Boolean flag indicating if this TLS connection was resumed from an existing TLS negotiation. + */ +static const char *kTlsResumed = "tls.resumed"; + +/** + * PEM-encoded stand-alone certificate offered by the server. This is usually mutually-exclusive of + * @code server.certificate_chain @endcode since this value also exists in that list. + */ +static const char *kTlsServerCertificate = "tls.server.certificate"; + +/** + * Array of PEM-encoded certificates that make up the certificate chain offered by the server. This + * is usually mutually-exclusive of @code server.certificate @endcode since that value should be the + * first certificate in the chain. + */ +static const char *kTlsServerCertificateChain = "tls.server.certificate_chain"; + +/** + * Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the + * server. For consistency with other hash values, this value should be formatted as an uppercase + * hash. + */ +static const char *kTlsServerHashMd5 = "tls.server.hash.md5"; + +/** + * Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by + * the server. For consistency with other hash values, this value should be formatted as an + * uppercase hash. + */ +static const char *kTlsServerHashSha1 = "tls.server.hash.sha1"; + +/** + * Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by + * the server. For consistency with other hash values, this value should be formatted as an + * uppercase hash. + */ +static const char *kTlsServerHashSha256 = "tls.server.hash.sha256"; + +/** + * Distinguished name of subject of the issuer of + * the x.509 certificate presented by the client. + */ +static const char *kTlsServerIssuer = "tls.server.issuer"; + +/** + * A hash that identifies servers based on how they perform an SSL/TLS handshake. + */ +static const char *kTlsServerJa3s = "tls.server.ja3s"; + +/** + * Date/Time indicating when server certificate is no longer considered valid. + */ +static const char *kTlsServerNotAfter = "tls.server.not_after"; + +/** + * Date/Time indicating when server certificate is first considered valid. + */ +static const char *kTlsServerNotBefore = "tls.server.not_before"; + +/** + * Distinguished name of subject of the x.509 certificate presented by the server. + */ +static const char *kTlsServerSubject = "tls.server.subject"; + +// DEBUG: {"brief": "Normalized lowercase protocol name parsed from original string of the +// negotiated [SSL/TLS protocol +// version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES)\n", +// "name": "tls.protocol.name", "requirement_level": "recommended", "root_namespace": "tls", +// "stability": "experimental", "type": {"allow_custom_values": true, "members": [{"brief": none, +// "deprecated": none, "id": "ssl", "note": none, "stability": "experimental", "value": "ssl"}, +// {"brief": none, "deprecated": none, "id": "tls", "note": none, "stability": "experimental", +// "value": "tls"}]}} +namespace TlsProtocolNameValues +{ +/** + * ssl. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "ssl", "note": none, "stability": +// "experimental", "value": "ssl"} +static constexpr const char *kSsl = "ssl"; +/** + * tls. + */ +// DEBUG: {"brief": none, "deprecated": none, "id": "tls", "note": none, "stability": +// "experimental", "value": "tls"} +static constexpr const char *kTls = "tls"; +} // namespace TlsProtocolNameValues + +} // namespace tls +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/url_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/url_attributes.h new file mode 100644 index 0000000000..ebfea2a01b --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/url_attributes.h @@ -0,0 +1,123 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace url +{ + +/** + * Domain extracted from the @code url.full @endcode, such as "opentelemetry.io". + * Note: In some cases a URL may refer to an IP and/or port directly, without a domain name. In this + * case, the IP address would go to the domain field. If the URL contains a literal IPv6 address enclosed by + * @code [ @endcode and @code ] @endcode, the @code [ @endcode and @code ] @endcode characters + * should also be captured in the domain field. + */ +static const char *kUrlDomain = "url.domain"; + +/** + * The file extension extracted from the @code url.full @endcode, excluding the leading dot. + * Note: The file extension is only set if it exists, as not every url has a file extension. When + * the file name has multiple extensions @code example.tar.gz @endcode, only the last one should be + * captured @code gz @endcode, not @code tar.gz @endcode. + */ +static const char *kUrlExtension = "url.extension"; + +/** + * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.url_attributes. + * @endcode. + */ +static const char *kUrlFragment = "url.fragment"; + +/** + * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.url_attributes. + * @endcode. + */ +static const char *kUrlFull = "url.full"; + +/** + * Unmodified original URL as seen in the event source. + * Note: In network monitoring, the observed URL may be a full URL, whereas in access logs, the URL + * is often just represented as a path. This field is meant to represent the URL as it was observed, + * complete or not. + * @code url.original @endcode might contain credentials passed via URL in form of @code + * https://username:password@www.example.com/ @endcode. In such case password and username SHOULD + * NOT be redacted and attribute's value SHOULD remain the same. + */ +static const char *kUrlOriginal = "url.original"; + +/** + * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.url_attributes. + * @endcode. + */ +static const char *kUrlPath = "url.path"; + +/** + * Port extracted from the @code url.full @endcode. + */ +static const char *kUrlPort = "url.port"; + +/** + * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.url_attributes. + * @endcode. + */ +static const char *kUrlQuery = "url.query"; + +/** + * The highest registered url domain, stripped of the subdomain. + * Note: This value can be determined precisely with the public + * suffix list. For example, the registered domain for @code foo.example.com @endcode is @code + * example.com @endcode. Trying to approximate this by simply taking the last two labels will not + * work well for TLDs such as @code co.uk @endcode. + */ +static const char *kUrlRegisteredDomain = "url.registered_domain"; + +/** + * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.url_attributes. + * @endcode. + */ +static const char *kUrlScheme = "url.scheme"; + +/** + * The subdomain portion of a fully qualified domain name includes all of the names except the host + * name under the registered_domain. In a partially qualified domain, or if the qualification level + * of the full name cannot be determined, subdomain contains all of the names below the registered + * domain. Note: The subdomain portion of @code www.east.mydomain.co.uk @endcode is @code east + * @endcode. If the domain has multiple levels of subdomain, such as @code sub2.sub1.example.com + * @endcode, the subdomain field should contain @code sub2.sub1 @endcode, with no trailing period. + */ +static const char *kUrlSubdomain = "url.subdomain"; + +/** + * The low-cardinality template of an absolute path reference. + */ +static const char *kUrlTemplate = "url.template"; + +/** + * The effective top level domain (eTLD), also known as the domain suffix, is the last part of the + * domain name. For example, the top level domain for example.com is @code com @endcode. Note: This + * value can be determined precisely with the public suffix + * list. + */ +static const char *kUrlTopLevelDomain = "url.top_level_domain"; + +} // namespace url +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/user_agent_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/user_agent_attributes.h new file mode 100644 index 0000000000..7daffb44d8 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/user_agent_attributes.h @@ -0,0 +1,51 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace user_agent +{ + +/** + * Name of the user-agent extracted from original. Usually refers to the browser's name. + * Note: Example of extracting browser's name from original + * string. In the case of using a user-agent for non-browser products, such as microservices with + * multiple names/versions inside the @code user_agent.original @endcode, the most significant name + * SHOULD be selected. In such a scenario it should align with @code user_agent.version @endcode. + */ +static const char *kUserAgentName = "user_agent.name"; + +/** + * @Deprecated in favor of stable :py:const:@code + * opentelemetry.semconv.attributes.user_agent_attributes. @endcode. + */ +static const char *kUserAgentOriginal = "user_agent.original"; + +/** + * Version of the user-agent extracted from original. Usually refers to the browser's version. + * Note: Example of extracting browser's version from + * original string. In the case of using a user-agent for non-browser products, such as + * microservices with multiple names/versions inside the @code user_agent.original @endcode, the + * most significant version SHOULD be selected. In such a scenario it should align with @code + * user_agent.name @endcode. + */ +static const char *kUserAgentVersion = "user_agent.version"; + +} // namespace user_agent +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/user_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/user_attributes.h new file mode 100644 index 0000000000..4c0e36c5c3 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/user_attributes.h @@ -0,0 +1,58 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace user +{ + +/** + * User email address. + */ +static const char *kUserEmail = "user.email"; + +/** + * User's full name. + */ +static const char *kUserFullName = "user.full_name"; + +/** + * Unique user hash to correlate information for a user in anonymized form. + * Note: Useful if @code user.id @endcode or @code user.name @endcode contain confidential + * information and cannot be used. + */ +static const char *kUserHash = "user.hash"; + +/** + * Unique identifier of the user. + */ +static const char *kUserId = "user.id"; + +/** + * Short name or login/username of the user. + */ +static const char *kUserName = "user.name"; + +/** + * Array of user roles at the time of the event. + */ +static const char *kUserRoles = "user.roles"; + +} // namespace user +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/vcs_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/vcs_attributes.h new file mode 100644 index 0000000000..9f5221d5e3 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/vcs_attributes.h @@ -0,0 +1,101 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace vcs +{ + +/** + * The ID of the change (pull request/merge request) if applicable. This is usually a unique (within + * repository) identifier generated by the VCS system. + */ +static const char *kVcsRepositoryChangeId = "vcs.repository.change.id"; + +/** + * The human readable title of the change (pull request/merge request). This title is often a brief + * summary of the change and may get merged in to a ref as the commit summary. + */ +static const char *kVcsRepositoryChangeTitle = "vcs.repository.change.title"; + +/** + * The name of the reference such as + * branch or tag in the repository. + */ +static const char *kVcsRepositoryRefName = "vcs.repository.ref.name"; + +/** + * The revision, literally revised + * version, The revision most often refers to a commit object in Git, or a revision number in + * SVN. Note: The revision can be a full hash value (see glossary), + * of the recorded change to a ref within a repository pointing to a + * commit commit object. It does + * not necessarily have to be a hash; it can simply define a + * revision number + * which is an integer that is monotonically increasing. In cases where + * it is identical to the @code ref.name @endcode, it SHOULD still be included. It is + * up to the implementer to decide which value to set as the revision + * based on the VCS system and situational context. + */ +static const char *kVcsRepositoryRefRevision = "vcs.repository.ref.revision"; + +/** + * The type of the reference in the + * repository. + */ +static const char *kVcsRepositoryRefType = "vcs.repository.ref.type"; + +/** + * The URL of the repository providing the complete + * address in order to locate and identify the repository. + */ +static const char *kVcsRepositoryUrlFull = "vcs.repository.url.full"; + +// DEBUG: {"brief": "The type of the [reference](https://git-scm.com/docs/gitglossary#def_ref) in +// the repository.\n", "examples": ["branch", "tag"], "name": "vcs.repository.ref.type", +// "requirement_level": "recommended", "root_namespace": "vcs", "stability": "experimental", "type": +// {"allow_custom_values": true, "members": [{"brief": +// "[branch](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefbranchabranch)", +// "deprecated": none, "id": "branch", "note": none, "stability": "experimental", "value": +// "branch"}, {"brief": +// "[tag](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddeftagatag)", +// "deprecated": none, "id": "tag", "note": none, "stability": "experimental", "value": "tag"}]}} +namespace VcsRepositoryRefTypeValues +{ +/** + * branch. + */ +// DEBUG: {"brief": +// "[branch](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefbranchabranch)", +// "deprecated": none, "id": "branch", "note": none, "stability": "experimental", "value": "branch"} +static constexpr const char *kBranch = "branch"; +/** + * tag. + */ +// DEBUG: {"brief": +// "[tag](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddeftagatag)", +// "deprecated": none, "id": "tag", "note": none, "stability": "experimental", "value": "tag"} +static constexpr const char *kTag = "tag"; +} // namespace VcsRepositoryRefTypeValues + +} // namespace vcs +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/attributes/webengine_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/webengine_attributes.h new file mode 100644 index 0000000000..27d68ad766 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/attributes/webengine_attributes.h @@ -0,0 +1,41 @@ + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace webengine +{ + +/** + * Additional description of the web engine (e.g. detailed version and edition information). + */ +static const char *kWebengineDescription = "webengine.description"; + +/** + * The name of the web engine. + */ +static const char *kWebengineName = "webengine.name"; + +/** + * The version of the web engine. + */ +static const char *kWebengineVersion = "webengine.version"; + +} // namespace webengine +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/trace/semantic_conventions.h b/api/include/opentelemetry/trace/semantic_conventions.h index fb26385fbc..f99075380f 100644 --- a/api/include/opentelemetry/trace/semantic_conventions.h +++ b/api/include/opentelemetry/trace/semantic_conventions.h @@ -3,6 +3,9 @@ * SPDX-License-Identifier: Apache-2.0 */ +// FIXME, DEBUG +#error "Die" + /* DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.h.j2 diff --git a/buildscripts/semantic-convention/generate.sh b/buildscripts/semantic-convention/generate.sh index cf8aa1d70c..2f291f06ed 100755 --- a/buildscripts/semantic-convention/generate.sh +++ b/buildscripts/semantic-convention/generate.sh @@ -15,27 +15,26 @@ ROOT_DIR="${SCRIPT_DIR}/../../" # freeze the spec & generator tools versions to make SemanticAttributes generation reproducible -# Repository up to 1.20.0: -# https://github.com/open-telemetry/opentelemetry-specification -# Repository from 1.21.0: -# https://github.com/open-telemetry/semantic-conventions +# repository: https://github.com/open-telemetry/semantic-conventions SEMCONV_VERSION=1.27.0 -# repository: https://github.com/open-telemetry/build-tools -GENERATOR_VERSION=0.25.0 +# repository: https://github.com/open-telemetry/weaver +WEAVER_VERSION=0.10.0 -SPEC_VERSION=v$SEMCONV_VERSION +SEMCONV_VERSION_TAG=v$SEMCONV_VERSION +WEAVER_VERSION_TAG=v$WEAVER_VERSION SCHEMA_URL=https://opentelemetry.io/schemas/$SEMCONV_VERSION +INCUBATING_DIR=incubating cd ${SCRIPT_DIR} -rm -rf tmp-semconv || true -mkdir tmp-semconv -cd tmp-semconv +rm -rf semantic-conventions || true +mkdir semantic-conventions +cd semantic-conventions git init git remote add origin https://github.com/open-telemetry/semantic-conventions.git -git fetch origin "$SPEC_VERSION" +git fetch origin "$SEMCONV_VERSION_TAG" git reset --hard FETCH_HEAD cd ${SCRIPT_DIR} @@ -52,41 +51,53 @@ if [ -x "$(command -v getenforce)" ]; then fi; fi -# echo "Help ..." - -# docker run --rm otel/semconvgen:$GENERATOR_VERSION -h - -echo "Generating semantic conventions for traces ..." - -docker run --rm \ - -v ${SCRIPT_DIR}/tmp-semconv/model:/source${USE_MOUNT_OPTION} \ - -v ${SCRIPT_DIR}/templates:/templates${USE_MOUNT_OPTION} \ - -v ${ROOT_DIR}/api/include/opentelemetry/trace/:/output${USE_MOUNT_OPTION} \ - otel/semconvgen:$GENERATOR_VERSION \ - --only span,event,attribute_group\ - -f /source code \ - --template /templates/SemanticAttributes.h.j2 \ - --output /output/semantic_conventions.h \ - -Dsemconv=trace \ - -Dclass=SemanticConventions \ - -DschemaUrl=$SCHEMA_URL \ - -Dnamespace_open="namespace trace {" \ - -Dnamespace_close="}" - -echo "Generating semantic conventions for resources ..." - -docker run --rm \ - -v ${SCRIPT_DIR}/tmp-semconv/model:/source${USE_MOUNT_OPTION} \ - -v ${SCRIPT_DIR}/templates:/templates${USE_MOUNT_OPTION} \ - -v ${ROOT_DIR}/sdk/include/opentelemetry/sdk/resource/:/output${USE_MOUNT_OPTION} \ - otel/semconvgen:$GENERATOR_VERSION \ - --only resource,attribute_group \ - -f /source code \ - --template /templates/SemanticAttributes.h.j2 \ - --output /output/semantic_conventions.h \ - -Dsemconv=resource \ - -Dclass=SemanticConventions \ - -DschemaUrl=$SCHEMA_URL \ - -Dnamespace_open="namespace sdk { namespace resource {" \ - -Dnamespace_close="} }" +# DOCKER +# ====== +# +# MY_UID=$(id -u) +# MY_GID=$(id -g) +# docker --user ${MY_UID}:${MY_GID} +# +# PODMAN +# ====== +# +# docker --user 0:0 + +generate() { + TARGET=$1 + OUTPUT=$2 + FILTER=$3 + docker run --rm --user 0:0 \ + -v ${SCRIPT_DIR}/semantic-conventions/model:/source${USE_MOUNT_OPTION} \ + -v ${SCRIPT_DIR}/templates:/templates${USE_MOUNT_OPTION} \ + -v ${ROOT_DIR}/wip/:/output${USE_MOUNT_OPTION} \ + otel/weaver:$WEAVER_VERSION_TAG \ + registry \ + generate \ + --registry=/source \ + --templates=/templates \ + ${TARGET} \ + /output/${TARGET} \ + --param output=${OUTPUT} \ + --param filter=${FILTER} +} + +# stable attributes and metrics +mkdir -p ${ROOT_DIR}/wip/attributes +mkdir -p ${ROOT_DIR}/wip/metrics +generate "./" "./" "stable" + +mkdir -p ${ROOT_DIR}/wip/${INCUBATING_DIR}/attributes +mkdir -p ${ROOT_DIR}/wip/${INCUBATING_DIR}/metrics +generate "./" "./${INCUBATING_DIR}/" "any" + +cp -r ${ROOT_DIR}/wip/attributes/*.h \ + ${ROOT_DIR}/api/include/opentelemetry/semconv/attributes +# cp -r ${ROOT_DIR}/wip/metrics/*.h \ +# ${ROOT_DIR}/api/include/opentelemetry/semconv/metrics + +cp -r ${ROOT_DIR}/wip/${INCUBATING_DIR}/attributes/*.h \ + ${ROOT_DIR}/api/include/opentelemetry/semconv/incubating/attributes +# cp -r ${ROOT_DIR}/wip/${INCUBATING_DIR}/metrics/*.h \ +# ${ROOT_DIR}/api/include/opentelemetry/semconv/incubating/metrics diff --git a/buildscripts/semantic-convention/templates/registry/common.j2 b/buildscripts/semantic-convention/templates/registry/common.j2 new file mode 100644 index 0000000000..99dcf1495d --- /dev/null +++ b/buildscripts/semantic-convention/templates/registry/common.j2 @@ -0,0 +1,34 @@ +{%- macro file_header() -%} +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +{% endmacro -%} + +{%- macro str_or_empty(str) -%} +{% if str is none %}{{""}}{% else %}{{str}}{% endif %} +{%- endmacro %} + +{%- macro remove_trailing_dots(str) -%} +{%- if str[-1:] == '.' -%}{{ remove_trailing_dots(str[:-1]) }}{%- else -%}{{ str }}{%- endif -%} +{%- endmacro -%} + +{%- macro comment_with_prefix(str, prefix) -%} +{{remove_trailing_dots(str | trim(' \n')) | comment_with_prefix(prefix) | replace("\\", "\\\\")}} +{%- endmacro %} + +{%- macro import_deprecated(semconv) -%} + {%- if (semconv | select("deprecated") | list | count > 0) or (ctx.filter == "any" and semconv | select("stable") | list | count > 0) -%} +from deprecated import deprecated + {%- endif -%} +{%- endmacro-%} diff --git a/buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 b/buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 new file mode 100644 index 0000000000..00472d906b --- /dev/null +++ b/buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 @@ -0,0 +1,118 @@ +{# + Copyright The OpenTelemetry Authors + SPDX-License-Identifier: Apache-2.0 + + This file is: + - a Jinja template, + - used to generate semantic conventions, + - using weaver. + + For doc on the template syntax: + https://jinja.palletsprojects.com/en/3.0.x/ + + For doc on the semantic conventions: + https://github.com/open-telemetry/semantic-conventions + + For doc on weaver: + https://github.com/open-telemetry/weaver +#} + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 + */ + +{% set file_name = ctx.output + (ctx.root_namespace | snake_case) ~ "_attributes.h" -%} +{{- template.set_file_name(file_name) -}} +{%- import 'common.j2' as c %} + +{% set attributes = ctx.attributes | list %} +{% set enum_attributes = attributes | select("enum") | rejectattr("name", "in", ctx.excluded_attributes) | list %} + +{%- macro attribute_namespace(ctx) -%} +{{ ctx.root_namespace | snake_case }} +{%- endmacro -%} + +{%- macro attribute_name(attribute) -%} +k{{ attribute.name | pascal_case }} +{%- endmacro -%} + +{%- macro attribute_type(attribute) -%} +{{ attribute.type | enum_type | map_text("cpp_types", "FIXME") }} +{%- endmacro -%} + +{%- macro enum_namespace_name(attribute) -%} +{{ attribute.name | pascal_case ~ "Values"}} +{%- endmacro -%} + +{%- macro enum_name(member) -%} +k{{ member.id | pascal_case }} +{%- endmacro -%} + +{%- macro stable_class_ref(const_name, separator) -%} +{{ctx.stable_package_name}}.{{ctx.root_namespace}}_attributes{{separator}}{{const_name}} +{%- endmacro %} + +{%- macro write_docstring(name, brief, note, deprecated, stability, multiline) -%} + {%- if c.str_or_empty(deprecated)|length -%} +{{prefix}}@Deprecated: {{c.comment_with_prefix(deprecated, "")}}. + {%- elif ctx.filter == "any" and stability == "stable" -%} +{{prefix}}@Deprecated in favor of stable :py:const:`{{stable_class_ref(name, '.')}}`. + {%- elif c.str_or_empty(brief)|length -%} +{{prefix}}{{c.comment_with_prefix(brief, "")}}. + {%- if c.str_or_empty(note)|length %} +{{prefix}}Note: {{c.comment_with_prefix(note, "")}}. + {%- endif -%} + {%- endif -%} +{%- endmacro -%} + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace {{ attribute_namespace(ctx) }} +{ + +{% for attribute in attributes %} +{% set cpp_attr_name = attribute_name(attribute) %} +{%- set multiline = attribute.name not in ctx.excluded_attributes -%} +{%- set doc_string = write_docstring(attr_name, attribute.brief, attribute.note, attribute.deprecated, attribute.stability, multiline)-%} +{%- set prefix = "" if multiline else "// " -%} +{{prefix}}{{doc_string | comment(ident=2) }} +{{prefix}}static const char *{{cpp_attr_name}} = "{{attribute.name}}"; +{% endfor %} + +{% for attribute in enum_attributes %}{%- set class_name = attribute.name | pascal_case ~ "Values" -%} +{% set cpp_enum_name = enum_namespace_name(attribute) %} +{% set cpp_enum_type = attribute_type(attribute) -%} +{%- if attribute is deprecated %} +// @deprecated(reason="The attribute {{attribute.name}} is deprecated - {{ c.comment_with_prefix(attribute.deprecated, "") }}") # type: ignore + {%- elif attribute.stability == "stable" and ctx.filter == "any" %} +// @deprecated(reason="Deprecated in favor of stable `{{stable_class_ref(class_name, '.')}}`.") # type: ignore + {%- endif %} +// DEBUG: {{ attribute }} +namespace {{cpp_enum_name}} +{ +{%- for member in attribute.type.members %} +{% set member_name = enum_name(member) -%} +{%- set doc_string=write_docstring(class_name + '.' + member_name, member.brief or member.id, "", member.deprecated, member.stability, false)-%} + {% if doc_string %}{{doc_string | comment(ident=2) }}{% endif %} + // DEBUG: {{ member }} + static constexpr {{cpp_enum_type}} {{member_name}} = {{ member.value | print_member_value }}; +{%- endfor %} +} +{% endfor %} + +} +} +OPENTELEMETRY_END_NAMESPACE + diff --git a/buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 b/buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 new file mode 100644 index 0000000000..49550cf538 --- /dev/null +++ b/buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 @@ -0,0 +1,96 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +{% set file_name = ctx.output + ctx.root_namespace | snake_case ~ "_metrics.py" -%} +{{- template.set_file_name(file_name) -}} + +{% import 'common.j2' as c -%} + +{%- macro stable_class_ref(const_name, separator) -%} +{{ctx.stable_package_name}}.{{ctx.root_namespace}}_metrics{{separator}}{{const_name}} +{%- endmacro %} + +{%- macro write_docstring(metric, const_name, prefix) -%} + {%- if metric is deprecated %} +{{prefix}}Deprecated: {{c.comment_with_prefix(metric.deprecated, prefix)}}. + {%- elif ctx.filter == "any" and metric.stability == "stable" %} +{{prefix}}Deprecated in favor of stable :py:const:`{{stable_class_ref(const_name, '.')}}`. + {%- else -%} + {%- if c.str_or_empty(metric.brief)|length %} +{{prefix}}{{c.comment_with_prefix(metric.brief, prefix)}} + {%- endif %} +{{prefix}}Instrument: {{ metric.instrument }} +{{prefix}}Unit: {{ metric.unit }} + {%- if c.str_or_empty(metric.note)|length %} +{{prefix}}Note: {{c.comment_with_prefix(metric.note, prefix)}}. + {%- endif -%} + {%- endif -%} +{%- endmacro -%} + +{%- macro import_instrument_classes(metrics) -%} + {% if ctx.filter == "any" %} +from opentelemetry.metrics import Meter + + {%- set instruments = ["counter", "histogram", "updowncounter"]-%} + {%- for i in instruments -%} + {%- if ctx.metrics | selectattr("instrument", "equalto", i) | list | count > 0 %} +from opentelemetry.metrics import {{i | map_text("py_instrument_to_type")}} + {%- endif -%} + {%- endfor-%} + + {%- if ctx.metrics | selectattr("instrument", "equalto", "gauge") | list | count > 0 %} +from typing import Callable, Generator, Iterable, Optional, Sequence, Union +from opentelemetry.metrics import CallbackOptions, ObservableGauge, Observation + +# pylint: disable=invalid-name +CallbackT = Union[ + Callable[[CallbackOptions], Iterable[Observation]], + Generator[Iterable[Observation], CallbackOptions, None], +] + {%- endif %} + + {%- endif -%} +{%- endmacro %} + +from typing import Final +{{ import_instrument_classes(filtered_metrics) }} + +{%- for metric in ctx.metrics %} +{% set const_name = metric.metric_name | screaming_snake_case %} +{{const_name}}: Final = "{{metric.metric_name}}" +{%- set doc_string=write_docstring(metric, const_name, "")-%}{%- if doc_string %} +"""{{doc_string}} +"""{% endif %} + +{% if ctx.filter == "any" %} +{% set metric_name = metric.metric_name | replace(".", "_") %} +{%- if metric.instrument == "gauge" %} +def create_{{ metric_name }}(meter: Meter, callbacks: Optional[Sequence[CallbackT]]) -> {{metric.instrument | map_text("py_instrument_to_type")}}: +{%- else %} +def create_{{ metric_name }}(meter: Meter) -> {{metric.instrument | map_text("py_instrument_to_type")}}: +{%- endif %} + {%- if c.str_or_empty(metric.brief) |length %} + """{{ c.comment_with_prefix(metric.brief, "") }}""" + {% endif -%} + return meter.create_{{ metric.instrument | map_text("py_instrument_to_factory")}}( + name={{ const_name }}, + {%- if metric.instrument == "gauge" %} + callbacks=callbacks, + {%- endif %} + description="{{ c.str_or_empty(metric.brief) }}", + unit="{{ metric.unit }}", + ) + {%- endif -%} + +{% endfor %} diff --git a/buildscripts/semantic-convention/templates/registry/weaver.yaml b/buildscripts/semantic-convention/templates/registry/weaver.yaml new file mode 100644 index 0000000000..29033fdc1e --- /dev/null +++ b/buildscripts/semantic-convention/templates/registry/weaver.yaml @@ -0,0 +1,78 @@ +params: + # excluded namespaces will not be generated + excluded_namespaces: [ios, aspnetcore, signalr, android, dotnet, jvm, kestrel, v8js, veightjs, go, nodejs] + + # excluded attributes will be commented out in the generated code + # this behavior is fully controlled by jinja templates + excluded_attributes: ["messaging.client_id"] + + stable_package_name: opentelemetry.semconv + +templates: + - pattern: semantic_attributes-h.j2 + filter: > + semconv_grouped_attributes({ + "exclude_root_namespace": $excluded_namespaces, + "exclude_stability": if $filter == "any" then [] else ["experimental"] end, + }) + | map({ + root_namespace: .root_namespace, + attributes: .attributes, + output: $output + "attributes/", + stable_package_name: $stable_package_name + ".attributes", + filter: $filter, + excluded_attributes: $excluded_attributes[] + }) + application_mode: each + - pattern: semantic_metrics-h.j2 + filter: > + semconv_grouped_metrics({ + "exclude_root_namespace": $excluded_namespaces, + "exclude_stability": if $filter == "any" then [] else ["experimental"] end, + }) + | map({ + root_namespace: .root_namespace, + metrics: .metrics, + output: $output + "metrics/", + stable_package_name: $stable_package_name + ".metrics", + filter: $filter + }) + application_mode: each + +text_maps: + cpp_types: + int: int + double: double + boolean: bool + string: const char * + string[]: const char *[] + template[string]: const char * + template[string[]]: const char *[] + + py_instrument_to_factory: + counter: counter + histogram: histogram + updowncounter: up_down_counter + gauge: observable_gauge + py_instrument_to_type: + counter: Counter + histogram: Histogram + updowncounter: UpDownCounter + gauge: ObservableGauge + +comment_formats: + cpp: + format: html + header: "/**" + prefix: " * " + footer: " */" + indent_type: Space + trim: true + remove_trailing_dots: false + enforce_trailing_dots: false + old_style_paragraph: true + omit_closing_li: false + inline_code_snippet: "@code {{code}} @endcode" + block_code_snippet: "@verbatim {{code}} @endverbatim" +default_comment_format: cpp + diff --git a/examples/grpc/client.cc b/examples/grpc/client.cc index 9ca41c6958..b8be0fec92 100644 --- a/examples/grpc/client.cc +++ b/examples/grpc/client.cc @@ -15,7 +15,8 @@ #include #include -#include "opentelemetry/trace/semantic_conventions.h" +#include "opentelemetry/semconv/attributes/network_attributes.h" +#include "opentelemetry/semconv/incubating/attributes/rpc_attributes.h" #include "tracer_common.h" using grpc::Channel; @@ -29,6 +30,7 @@ using grpc_example::GreetResponse; namespace { namespace context = opentelemetry::context; +namespace semconv = opentelemetry::semconv; using namespace opentelemetry::trace; class GreeterClient { @@ -47,14 +49,14 @@ class GreeterClient options.kind = SpanKind::kClient; std::string span_name = "GreeterClient/Greet"; - auto span = get_tracer("grpc")->StartSpan( - span_name, - {{SemanticConventions::kRpcSystem, "grpc"}, - {SemanticConventions::kRpcService, "grpc-example.GreetService"}, - {SemanticConventions::kRpcMethod, "Greet"}, - {SemanticConventions::kNetworkPeerAddress, ip}, - {SemanticConventions::kNetworkPeerPort, port}}, - options); + auto span = + get_tracer("grpc")->StartSpan(span_name, + {{semconv::rpc::kRpcSystem, "grpc"}, + {semconv::rpc::kRpcService, "grpc-example.GreetService"}, + {semconv::rpc::kRpcMethod, "Greet"}, + {semconv::network::kNetworkPeerAddress, ip}, + {semconv::network::kNetworkPeerPort, port}}, + options); auto scope = get_tracer("grpc-client")->WithActiveSpan(span); @@ -69,7 +71,7 @@ class GreeterClient if (status.ok()) { span->SetStatus(StatusCode::kOk); - span->SetAttribute(SemanticConventions::kRpcGrpcStatusCode, status.error_code()); + span->SetAttribute(semconv::rpc::kRpcGrpcStatusCode, status.error_code()); // Make sure to end your spans! span->End(); return response.response(); @@ -78,7 +80,7 @@ class GreeterClient { std::cout << status.error_code() << ": " << status.error_message() << '\n'; span->SetStatus(StatusCode::kError); - span->SetAttribute(SemanticConventions::kRpcGrpcStatusCode, status.error_code()); + span->SetAttribute(semconv::rpc::kRpcGrpcStatusCode, status.error_code()); // Make sure to end your spans! span->End(); return "RPC failed"; diff --git a/examples/grpc/server.cc b/examples/grpc/server.cc index 3c3fcede4f..1927257c71 100644 --- a/examples/grpc/server.cc +++ b/examples/grpc/server.cc @@ -7,8 +7,8 @@ # include "messages.grpc.pb.h" #endif +#include "opentelemetry/semconv/incubating/attributes/rpc_attributes.h" #include "opentelemetry/trace/context.h" -#include "opentelemetry/trace/semantic_conventions.h" #include "opentelemetry/trace/span_context_kv_iterable_view.h" #include "tracer_common.h" @@ -38,6 +38,7 @@ using SpanContext = opentelemetry::trace::SpanContext; using namespace opentelemetry::trace; namespace context = opentelemetry::context; +namespace semconv = opentelemetry::semconv; namespace { @@ -67,10 +68,10 @@ class GreeterServer final : public Greeter::Service std::string span_name = "GreeterService/Greet"; auto span = get_tracer("grpc")->StartSpan(span_name, - {{SemanticConventions::kRpcSystem, "grpc"}, - {SemanticConventions::kRpcService, "GreeterService"}, - {SemanticConventions::kRpcMethod, "Greet"}, - {SemanticConventions::kRpcGrpcStatusCode, 0}}, + {{semconv::rpc::kRpcSystem, "grpc"}, + {semconv::rpc::kRpcService, "GreeterService"}, + {semconv::rpc::kRpcMethod, "Greet"}, + {semconv::rpc::kRpcGrpcStatusCode, 0}}, options); auto scope = get_tracer("grpc")->WithActiveSpan(span); diff --git a/examples/http/client.cc b/examples/http/client.cc index 3a8486f55f..5230e0c425 100644 --- a/examples/http/client.cc +++ b/examples/http/client.cc @@ -3,7 +3,8 @@ #include "opentelemetry/ext/http/client/http_client_factory.h" #include "opentelemetry/ext/http/common/url_parser.h" -#include "opentelemetry/trace/semantic_conventions.h" +#include "opentelemetry/semconv/attributes/http_attributes.h" +#include "opentelemetry/semconv/attributes/url_attributes.h" #include "tracer_common.h" namespace @@ -13,6 +14,7 @@ using namespace opentelemetry::trace; namespace http_client = opentelemetry::ext::http::client; namespace context = opentelemetry::context; namespace nostd = opentelemetry::nostd; +namespace semconv = opentelemetry::semconv; void sendRequest(const std::string &url) { @@ -26,9 +28,9 @@ void sendRequest(const std::string &url) std::string span_name = url_parser.path_; auto span = get_tracer("http-client") ->StartSpan(span_name, - {{SemanticConventions::kUrlFull, url_parser.url_}, - {SemanticConventions::kUrlScheme, url_parser.scheme_}, - {SemanticConventions::kHttpRequestMethod, "GET"}}, + {{semconv::url::kUrlFull, url_parser.url_}, + {semconv::url::kUrlScheme, url_parser.scheme_}, + {semconv::http::kHttpRequestMethod, "GET"}}, options); auto scope = get_tracer("http-client")->WithActiveSpan(span); @@ -44,7 +46,7 @@ void sendRequest(const std::string &url) { // set span attributes auto status_code = result.GetResponse().GetStatusCode(); - span->SetAttribute(SemanticConventions::kHttpResponseStatusCode, status_code); + span->SetAttribute(semconv::http::kHttpResponseStatusCode, status_code); result.GetResponse().ForEachHeader( [&span](nostd::string_view header_name, nostd::string_view header_value) { span->SetAttribute("http.header." + std::string(header_name.data()), header_value); diff --git a/examples/http/server.cc b/examples/http/server.cc index 85cccc234d..415809e4a5 100644 --- a/examples/http/server.cc +++ b/examples/http/server.cc @@ -2,8 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 #include "server.h" +#include "opentelemetry/semconv/attributes/client_attributes.h" +#include "opentelemetry/semconv/attributes/server_attributes.h" +#include "opentelemetry/semconv/attributes/url_attributes.h" +#include "opentelemetry/semconv/incubating/attributes/http_attributes.h" #include "opentelemetry/trace/context.h" -#include "opentelemetry/trace/semantic_conventions.h" #include "tracer_common.h" #include @@ -14,6 +17,7 @@ namespace using namespace opentelemetry::trace; namespace context = opentelemetry::context; +namespace semconv = opentelemetry::semconv; uint16_t server_port = 8800; constexpr const char *server_name = "localhost"; @@ -40,13 +44,13 @@ class RequestHandler : public HTTP_SERVER_NS::HttpRequestCallback // start span with parent context extracted from http header auto span = get_tracer("http-server") ->StartSpan(span_name, - {{SemanticConventions::kServerAddress, server_name}, - {SemanticConventions::kServerPort, server_port}, - {SemanticConventions::kHttpRequestMethod, request.method}, - {SemanticConventions::kUrlScheme, "http"}, - {SemanticConventions::kHttpRequestBodySize, + {{semconv::server::kServerAddress, server_name}, + {semconv::server::kServerPort, server_port}, + {semconv::http::kHttpRequestMethod, request.method}, + {semconv::url::kUrlScheme, "http"}, + {semconv::http::kHttpRequestBodySize, static_cast(request.content.length())}, - {SemanticConventions::kClientAddress, request.client}}, + {semconv::client::kClientAddress, request.client}}, options); auto scope = get_tracer("http_server")->WithActiveSpan(span); diff --git a/exporters/otlp/test/otlp_log_recordable_test.cc b/exporters/otlp/test/otlp_log_recordable_test.cc index bcecbb8d8f..e5d6701e46 100644 --- a/exporters/otlp/test/otlp_log_recordable_test.cc +++ b/exporters/otlp/test/otlp_log_recordable_test.cc @@ -8,7 +8,6 @@ #include "opentelemetry/exporters/otlp/otlp_log_recordable.h" #include "opentelemetry/sdk/logs/read_write_log_record.h" #include "opentelemetry/sdk/resource/resource.h" -#include "opentelemetry/sdk/resource/semantic_conventions.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace exporter diff --git a/exporters/prometheus/src/exporter_utils.cc b/exporters/prometheus/src/exporter_utils.cc index 77fcd56ad2..c5de2b2c3f 100644 --- a/exporters/prometheus/src/exporter_utils.cc +++ b/exporters/prometheus/src/exporter_utils.cc @@ -16,12 +16,9 @@ #include "opentelemetry/common/macros.h" #include "opentelemetry/exporters/prometheus/exporter_utils.h" +#include "opentelemetry/sdk/common/global_log_handler.h" #include "opentelemetry/sdk/metrics/export/metric_producer.h" #include "opentelemetry/sdk/resource/resource.h" -#include "opentelemetry/sdk/resource/semantic_conventions.h" -#include "opentelemetry/trace/semantic_conventions.h" - -#include "opentelemetry/sdk/common/global_log_handler.h" namespace prometheus_client = ::prometheus; namespace metric_sdk = opentelemetry::sdk::metrics; diff --git a/exporters/zipkin/src/recordable.cc b/exporters/zipkin/src/recordable.cc index 69899e7fad..ac5c3f4fe3 100644 --- a/exporters/zipkin/src/recordable.cc +++ b/exporters/zipkin/src/recordable.cc @@ -21,7 +21,7 @@ #include "opentelemetry/sdk/common/attribute_utils.h" #include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" #include "opentelemetry/sdk/resource/resource.h" -#include "opentelemetry/sdk/resource/semantic_conventions.h" +#include "opentelemetry/semconv/attributes/service_attributes.h" #include "opentelemetry/trace/span_context.h" #include "opentelemetry/trace/span_id.h" #include "opentelemetry/trace/span_metadata.h" @@ -244,9 +244,9 @@ void Recordable::SetResource(const sdk::resource::Resource &resource) noexcept { // only service.name attribute is supported by specs as of now. auto attributes = resource.GetAttributes(); - if (attributes.find(SemanticConventions::kServiceName) != attributes.end()) + if (attributes.find(semconv::service::kServiceName) != attributes.end()) { - service_name_ = nostd::get(attributes[SemanticConventions::kServiceName]); + service_name_ = nostd::get(attributes[semconv::service::kServiceName]); } } diff --git a/opentracing-shim/include/opentelemetry/opentracingshim/shim_utils.h b/opentracing-shim/include/opentelemetry/opentracingshim/shim_utils.h index 871bed590f..d771e164e8 100644 --- a/opentracing-shim/include/opentelemetry/opentracingshim/shim_utils.h +++ b/opentracing-shim/include/opentelemetry/opentracingshim/shim_utils.h @@ -7,7 +7,7 @@ #include "opentelemetry/opentracingshim/span_context_shim.h" -#include "opentelemetry/trace/semantic_conventions.h" +#include "opentelemetry/semconv/incubating/attributes/opentracing_attributes.h" #include "opentelemetry/trace/tracer.h" #include "opentracing/tracer.h" @@ -93,7 +93,7 @@ class LinksIterable final : public opentelemetry::trace::SpanContextKeyValueIter callback) const noexcept override { using opentracing::SpanReferenceType; - using namespace opentelemetry::trace::SemanticConventions; + using namespace opentelemetry::semconv; using LinksList = std::initializer_list>; for (const auto &entry : refs_) @@ -102,18 +102,18 @@ class LinksIterable final : public opentelemetry::trace::SpanContextKeyValueIter if (entry.first == SpanReferenceType::ChildOfRef) { - span_kind = OpentracingRefTypeValues::kChildOf; + span_kind = opentracing::OpentracingRefTypeValues::kChildOf; } else if (entry.first == SpanReferenceType::FollowsFromRef) { - span_kind = OpentracingRefTypeValues::kFollowsFrom; + span_kind = opentracing::OpentracingRefTypeValues::kFollowsFrom; } auto context_shim = SpanContextShim::extractFrom(entry.second); if (context_shim && !span_kind.empty() && !callback(context_shim->context(), opentelemetry::common::KeyValueIterableView( - {{kOpentracingRefType, span_kind}}))) + {{opentracing::kOpentracingRefType, span_kind}}))) { return false; } diff --git a/opentracing-shim/src/span_shim.cc b/opentracing-shim/src/span_shim.cc index 7911277f78..28b16104a6 100644 --- a/opentracing-shim/src/span_shim.cc +++ b/opentracing-shim/src/span_shim.cc @@ -8,7 +8,7 @@ #include "opentelemetry/opentracingshim/span_context_shim.h" #include "opentelemetry/opentracingshim/tracer_shim.h" -#include "opentelemetry/trace/semantic_conventions.h" +#include "opentelemetry/semconv/attributes/exception_attributes.h" #include "opentelemetry/trace/span_metadata.h" #include "opentracing/ext/tags.h" @@ -134,15 +134,15 @@ void SpanShim::logImpl(nostd::span fields, { if (key == "error.kind") // - error.kind maps to exception.type. { - key = opentelemetry::trace::SemanticConventions::kExceptionType; + key = opentelemetry::semconv::exception::kExceptionType; } else if (key == "message") // - message maps to exception.message. { - key = opentelemetry::trace::SemanticConventions::kExceptionMessage; + key = opentelemetry::semconv::exception::kExceptionMessage; } else if (key == "stack") // - stack maps to exception.stacktrace. { - key = opentelemetry::trace::SemanticConventions::kExceptionStacktrace; + key = opentelemetry::semconv::exception::kExceptionStacktrace; } } diff --git a/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h b/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h index 9ff985be4d..020d9e78f4 100644 --- a/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h +++ b/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h @@ -3,6 +3,9 @@ * SPDX-License-Identifier: Apache-2.0 */ +// FIXME, DEBUG +#error "Die" + /* DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.h.j2 diff --git a/sdk/src/resource/resource.cc b/sdk/src/resource/resource.cc index 919624686d..84a9602264 100644 --- a/sdk/src/resource/resource.cc +++ b/sdk/src/resource/resource.cc @@ -8,8 +8,10 @@ #include "opentelemetry/nostd/variant.h" #include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/sdk/resource/resource_detector.h" -#include "opentelemetry/sdk/resource/semantic_conventions.h" #include "opentelemetry/sdk/version/version.h" +#include "opentelemetry/semconv/attributes/service_attributes.h" +#include "opentelemetry/semconv/attributes/telemetry_attributes.h" +#include "opentelemetry/semconv/incubating/attributes/process_attributes.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -36,16 +38,16 @@ Resource Resource::Create(const ResourceAttributes &attributes, const std::strin auto resource = Resource::GetDefault().Merge(otel_resource).Merge(Resource{attributes, schema_url}); - if (resource.attributes_.find(SemanticConventions::kServiceName) == resource.attributes_.end()) + if (resource.attributes_.find(semconv::service::kServiceName) == resource.attributes_.end()) { std::string default_service_name = "unknown_service"; auto it_process_executable_name = - resource.attributes_.find(SemanticConventions::kProcessExecutableName); + resource.attributes_.find(semconv::process::kProcessExecutableName); if (it_process_executable_name != resource.attributes_.end()) { default_service_name += ":" + nostd::get(it_process_executable_name->second); } - resource.attributes_[SemanticConventions::kServiceName] = default_service_name; + resource.attributes_[semconv::service::kServiceName] = default_service_name; } return resource; } @@ -59,9 +61,9 @@ Resource &Resource::GetEmpty() Resource &Resource::GetDefault() { static Resource default_resource( - {{SemanticConventions::kTelemetrySdkLanguage, "cpp"}, - {SemanticConventions::kTelemetrySdkName, "opentelemetry"}, - {SemanticConventions::kTelemetrySdkVersion, OPENTELEMETRY_SDK_VERSION}}, + {{semconv::telemetry::kTelemetrySdkLanguage, "cpp"}, + {semconv::telemetry::kTelemetrySdkName, "opentelemetry"}, + {semconv::telemetry::kTelemetrySdkVersion, OPENTELEMETRY_SDK_VERSION}}, std::string{}); return default_resource; } diff --git a/sdk/src/resource/resource_detector.cc b/sdk/src/resource/resource_detector.cc index b7c7c7e614..789dbb8017 100644 --- a/sdk/src/resource/resource_detector.cc +++ b/sdk/src/resource/resource_detector.cc @@ -4,7 +4,7 @@ #include "opentelemetry/sdk/resource/resource_detector.h" #include "opentelemetry/sdk/common/env_variables.h" #include "opentelemetry/sdk/resource/resource.h" -#include "opentelemetry/sdk/resource/semantic_conventions.h" +#include "opentelemetry/semconv/attributes/service_attributes.h" #include "opentelemetry/version.h" #include @@ -55,7 +55,7 @@ Resource OTELResourceDetector::Detect() noexcept if (service_name_exists) { - attributes[SemanticConventions::kServiceName] = service_name; + attributes[semconv::service::kServiceName] = service_name; } return Resource(attributes); diff --git a/sdk/test/resource/resource_test.cc b/sdk/test/resource/resource_test.cc index c15087e9b7..e627cc58a0 100644 --- a/sdk/test/resource/resource_test.cc +++ b/sdk/test/resource/resource_test.cc @@ -14,8 +14,9 @@ #include "opentelemetry/sdk/common/attribute_utils.h" #include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/sdk/resource/resource_detector.h" -#include "opentelemetry/sdk/resource/semantic_conventions.h" #include "opentelemetry/sdk/version/version.h" +#include "opentelemetry/semconv/attributes/service_attributes.h" +#include "opentelemetry/semconv/attributes/telemetry_attributes.h" #if defined(_MSC_VER) # include "opentelemetry/sdk/common/env_variables.h" @@ -24,7 +25,8 @@ using opentelemetry::sdk::common::unsetenv; #endif using namespace opentelemetry::sdk::resource; -namespace nostd = opentelemetry::nostd; +namespace nostd = opentelemetry::nostd; +namespace semconv = opentelemetry::semconv; class TestResource : public Resource { @@ -41,10 +43,10 @@ TEST(ResourceTest, create_without_servicename) {"service", "backend"}, {"version", static_cast(1)}, {"cost", 234.23}, - {SemanticConventions::kTelemetrySdkLanguage, "cpp"}, - {SemanticConventions::kTelemetrySdkName, "opentelemetry"}, - {SemanticConventions::kTelemetrySdkVersion, OPENTELEMETRY_SDK_VERSION}, - {SemanticConventions::kServiceName, "unknown_service"}}; + {semconv::telemetry::kTelemetrySdkLanguage, "cpp"}, + {semconv::telemetry::kTelemetrySdkName, "opentelemetry"}, + {semconv::telemetry::kTelemetrySdkVersion, OPENTELEMETRY_SDK_VERSION}, + {semconv::service::kServiceName, "unknown_service"}}; ResourceAttributes attributes = { {"service", "backend"}, {"version", static_cast(1)}, {"cost", 234.23}}; @@ -74,10 +76,10 @@ TEST(ResourceTest, create_with_servicename) ResourceAttributes expected_attributes = { {"version", static_cast(1)}, {"cost", 234.23}, - {SemanticConventions::kTelemetrySdkLanguage, "cpp"}, - {SemanticConventions::kTelemetrySdkName, "opentelemetry"}, - {SemanticConventions::kTelemetrySdkVersion, OPENTELEMETRY_SDK_VERSION}, - {SemanticConventions::kServiceName, "backend"}, + {semconv::telemetry::kTelemetrySdkLanguage, "cpp"}, + {semconv::telemetry::kTelemetrySdkName, "opentelemetry"}, + {semconv::telemetry::kTelemetrySdkVersion, OPENTELEMETRY_SDK_VERSION}, + {semconv::service::kServiceName, "backend"}, }; ResourceAttributes attributes = { {"service.name", "backend"}, {"version", static_cast(1)}, {"cost", 234.23}}; @@ -105,10 +107,10 @@ TEST(ResourceTest, create_with_servicename) TEST(ResourceTest, create_with_emptyatrributes) { ResourceAttributes expected_attributes = { - {SemanticConventions::kTelemetrySdkLanguage, "cpp"}, - {SemanticConventions::kTelemetrySdkName, "opentelemetry"}, - {SemanticConventions::kTelemetrySdkVersion, OPENTELEMETRY_SDK_VERSION}, - {SemanticConventions::kServiceName, "unknown_service"}, + {semconv::telemetry::kTelemetrySdkLanguage, "cpp"}, + {semconv::telemetry::kTelemetrySdkName, "opentelemetry"}, + {semconv::telemetry::kTelemetrySdkVersion, OPENTELEMETRY_SDK_VERSION}, + {semconv::service::kServiceName, "unknown_service"}, }; ResourceAttributes attributes = {}; auto resource = Resource::Create(attributes); From d289a7fbc78b003384c142181effbd41f0d0bebf Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Fri, 18 Oct 2024 00:02:40 +0200 Subject: [PATCH 02/16] WIP --- .../semconv/attributes/client_attributes.h | 11 +- .../semconv/attributes/error_attributes.h | 28 +- .../semconv/attributes/exception_attributes.h | 12 +- .../semconv/attributes/http_attributes.h | 105 +-- .../semconv/attributes/network_attributes.h | 86 +- .../semconv/attributes/otel_attributes.h | 24 +- .../semconv/attributes/server_attributes.h | 11 +- .../semconv/attributes/service_attributes.h | 9 +- .../semconv/attributes/telemetry_attributes.h | 89 +- .../semconv/attributes/url_attributes.h | 34 +- .../attributes/user_agent_attributes.h | 4 +- .../attributes/artifact_attributes.h | 25 +- .../incubating/attributes/aws_attributes.h | 154 ++-- .../incubating/attributes/az_attributes.h | 4 +- .../attributes/browser_attributes.h | 31 +- .../incubating/attributes/cicd_attributes.h | 36 +- .../incubating/attributes/client_attributes.h | 19 +- .../incubating/attributes/cloud_attributes.h | 273 ++---- .../attributes/cloudevents_attributes.h | 12 +- .../incubating/attributes/code_attributes.h | 14 +- .../attributes/container_attributes.h | 86 +- .../incubating/attributes/cpu_attributes.h | 59 +- .../incubating/attributes/db_attributes.h | 824 ++++++++---------- .../attributes/deployment_attributes.h | 49 +- .../attributes/destination_attributes.h | 10 +- .../incubating/attributes/device_attributes.h | 38 +- .../incubating/attributes/disk_attributes.h | 22 +- .../incubating/attributes/dns_attributes.h | 11 +- .../attributes/enduser_attributes.h | 26 +- .../incubating/attributes/error_attributes.h | 54 +- .../incubating/attributes/event_attributes.h | 7 +- .../attributes/exception_attributes.h | 37 +- .../incubating/attributes/faas_attributes.h | 154 ++-- .../attributes/feature_flag_attributes.h | 20 +- .../incubating/attributes/file_attributes.h | 17 +- .../incubating/attributes/gcp_attributes.h | 15 +- .../incubating/attributes/gen_ai_attributes.h | 146 ++-- .../attributes/graphql_attributes.h | 34 +- .../incubating/attributes/heroku_attributes.h | 14 +- .../incubating/attributes/host_attributes.h | 101 +-- .../incubating/attributes/http_attributes.h | 345 ++++---- .../incubating/attributes/k8s_attributes.h | 61 +- .../incubating/attributes/linux_attributes.h | 24 +- .../incubating/attributes/log_attributes.h | 49 +- .../attributes/message_attributes.h | 51 +- .../attributes/messaging_attributes.h | 434 +++++---- .../incubating/attributes/net_attributes.h | 185 ++-- .../attributes/network_attributes.h | 321 +++---- .../incubating/attributes/oci_attributes.h | 6 +- .../attributes/opentracing_attributes.h | 30 +- .../incubating/attributes/os_attributes.h | 87 +- .../incubating/attributes/otel_attributes.h | 57 +- .../incubating/attributes/other_attributes.h | 30 +- .../incubating/attributes/peer_attributes.h | 4 +- .../incubating/attributes/pool_attributes.h | 10 +- .../attributes/process_attributes.h | 123 ++- .../incubating/attributes/rpc_attributes.h | 333 +++---- .../incubating/attributes/server_attributes.h | 19 +- .../attributes/service_attributes.h | 33 +- .../attributes/session_attributes.h | 6 +- .../incubating/attributes/source_attributes.h | 10 +- .../incubating/attributes/system_attributes.h | 404 +++------ .../attributes/telemetry_attributes.h | 132 +-- .../incubating/attributes/test_attributes.h | 70 +- .../incubating/attributes/thread_attributes.h | 6 +- .../incubating/attributes/tls_attributes.h | 94 +- .../incubating/attributes/url_attributes.h | 86 +- .../attributes/user_agent_attributes.h | 30 +- .../incubating/attributes/user_attributes.h | 21 +- .../incubating/attributes/vcs_attributes.h | 37 +- .../attributes/webengine_attributes.h | 8 +- .../opentelemetry/semconv/schema_url.h | 24 + buildscripts/semantic-convention/generate.sh | 8 +- .../templates/registry/schema_url-h.j2 | 49 ++ .../registry/semantic_attributes-h.j2 | 117 +-- .../templates/registry/weaver.yaml | 15 + 76 files changed, 2517 insertions(+), 3507 deletions(-) create mode 100644 api/include/opentelemetry/semconv/schema_url.h create mode 100644 buildscripts/semantic-convention/templates/registry/schema_url-h.j2 diff --git a/api/include/opentelemetry/semconv/attributes/client_attributes.h b/api/include/opentelemetry/semconv/attributes/client_attributes.h index 80bc16407b..ec984cc406 100644 --- a/api/include/opentelemetry/semconv/attributes/client_attributes.h +++ b/api/include/opentelemetry/semconv/attributes/client_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -23,19 +21,20 @@ namespace client /** * 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 + * Unix domain socket name.

When observed from the server side, and when communicating through * an intermediary, @code client.address @endcode SHOULD represent the client address behind any * intermediaries, for example proxies, if it's available. */ -static const char *kClientAddress = "client.address"; +static constexpr const char *kClientAddress = "client.address"; /** * Client port number. - * Note: When observed from the server side, and when communicating through an intermediary, @code + *

+ * When observed from the server side, and when communicating through an intermediary, @code * client.port @endcode SHOULD represent the client port behind any intermediaries, for example * proxies, if it's available. */ -static const char *kClientPort = "client.port"; +static constexpr const char *kClientPort = "client.port"; } // namespace client } // namespace semconv diff --git a/api/include/opentelemetry/semconv/attributes/error_attributes.h b/api/include/opentelemetry/semconv/attributes/error_attributes.h index baf0335f0e..1b711ff112 100644 --- a/api/include/opentelemetry/semconv/attributes/error_attributes.h +++ b/api/include/opentelemetry/semconv/attributes/error_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -23,7 +21,8 @@ namespace error /** * Describes a class of error the operation ended with. - * Note: The @code error.type @endcode SHOULD be predictable, and SHOULD have low cardinality. + *

+ * The @code error.type @endcode SHOULD be predictable, and SHOULD have low cardinality. *

* When @code error.type @endcode is set to a type (e.g., an exception type), its * canonical class name identifying the type within the artifact SHOULD be used. @@ -42,34 +41,15 @@ namespace error * the domain-specific set or not. * */ -static const char *kErrorType = "error.type"; +static constexpr const char *kErrorType = "error.type"; -// DEBUG: {"brief": "Describes a class of error the operation ended with.\n", "examples": -// ["timeout", "java.net.UnknownHostException", "server_certificate_invalid", "500"], "name": -// "error.type", "note": "The `error.type` SHOULD be predictable, and SHOULD have low -// cardinality.\n\nWhen `error.type` is set to a type (e.g., an exception type), its\ncanonical -// class name identifying the type within the artifact SHOULD be used.\n\nInstrumentations SHOULD -// document the list of errors they report.\n\nThe cardinality of `error.type` within one -// instrumentation library SHOULD be low.\nTelemetry consumers that aggregate data from multiple -// instrumentation libraries and applications\nshould be prepared for `error.type` to have high -// cardinality at query time when no\nadditional filters are applied.\n\nIf the operation has -// completed successfully, instrumentations SHOULD NOT set `error.type`.\n\nIf a specific domain -// defines its own set of error identifiers (such as HTTP or gRPC status codes),\nit's RECOMMENDED -// to:\n\n* Use a domain-specific attribute\n* Set `error.type` to capture all errors, regardless of -// whether they are defined within the domain-specific set or not.\n", "requirement_level": -// "recommended", "root_namespace": "error", "stability": "stable", "type": {"allow_custom_values": -// true, "members": [{"brief": "A fallback error value to be used when the instrumentation doesn't -// define a custom value.\n", "deprecated": none, "id": "other", "note": none, "stability": -// "stable", "value": "_OTHER"}]}} namespace ErrorTypeValues { /** * A fallback error value to be used when the instrumentation doesn't define a custom value. */ -// DEBUG: {"brief": "A fallback error value to be used when the instrumentation doesn't define a -// custom value.\n", "deprecated": none, "id": "other", "note": none, "stability": "stable", -// "value": "_OTHER"} static constexpr const char *kOther = "_OTHER"; + } // namespace ErrorTypeValues } // namespace error diff --git a/api/include/opentelemetry/semconv/attributes/exception_attributes.h b/api/include/opentelemetry/semconv/attributes/exception_attributes.h index d700e99493..fdc19ac6d0 100644 --- a/api/include/opentelemetry/semconv/attributes/exception_attributes.h +++ b/api/include/opentelemetry/semconv/attributes/exception_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -23,7 +21,7 @@ namespace exception /** * 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. Note: An exception is considered to have escaped (or + * exception is escaping the scope of the span.

An exception is considered to have escaped (or * left) the scope of a span, if that span is ended while the exception is still logically "in * flight". This may be actually "in flight" in some languages (e.g. if the exception is passed to a * Context manager's @code __exit__ @endcode method in Python) but will usually be caught at the @@ -37,24 +35,24 @@ namespace exception * since the event might have been recorded at a time where it was not * clear whether the exception will escape. */ -static const char *kExceptionEscaped = "exception.escaped"; +static constexpr const char *kExceptionEscaped = "exception.escaped"; /** * The exception message. */ -static const char *kExceptionMessage = "exception.message"; +static constexpr const char *kExceptionMessage = "exception.message"; /** * A stacktrace as a string in the natural representation for the language runtime. The * representation is to be determined and documented by each language SIG. */ -static const char *kExceptionStacktrace = "exception.stacktrace"; +static constexpr const char *kExceptionStacktrace = "exception.stacktrace"; /** * 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. */ -static const char *kExceptionType = "exception.type"; +static constexpr const char *kExceptionType = "exception.type"; } // namespace exception } // namespace semconv diff --git a/api/include/opentelemetry/semconv/attributes/http_attributes.h b/api/include/opentelemetry/semconv/attributes/http_attributes.h index 7a9c45dc02..6011674e84 100644 --- a/api/include/opentelemetry/semconv/attributes/http_attributes.h +++ b/api/include/opentelemetry/semconv/attributes/http_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -23,7 +21,7 @@ namespace http /** * HTTP request headers, @code @endcode being the normalized HTTP Header name (lowercase), the - * value being the header values. Note: Instrumentations SHOULD require an explicit configuration of + * value being the header values.

Instrumentations SHOULD require an explicit configuration of * which headers are to be captured. Including all request headers can be a security risk - explicit * configuration helps avoid leaking sensitive information. The @code User-Agent @endcode header is * already captured in the @code user_agent.original @endcode attribute. Users MAY explicitly @@ -32,11 +30,12 @@ namespace http * containing a possibly comma-concatenated string, depending on the way the HTTP library provides * access to headers. */ -static const char *kHttpRequestHeader = "http.request.header"; +static constexpr const char *kHttpRequestHeader = "http.request.header"; /** * HTTP request method. - * Note: HTTP request method value SHOULD be "known" to the instrumentation. + *

+ * HTTP request method value SHOULD be "known" to the instrumentation. * By default, this convention defines "known" methods as the ones listed in RFC9110 and the PATCH method * defined in RFC5789.

If the HTTP @@ -53,140 +52,100 @@ static const char *kHttpRequestHeader = "http.request.header"; * instrumentations that do so, MUST also set @code http.request.method_original @endcode to the * original value. */ -static const char *kHttpRequestMethod = "http.request.method"; +static constexpr const char *kHttpRequestMethod = "http.request.method"; /** * Original HTTP method sent by the client in the request line. */ -static const char *kHttpRequestMethodOriginal = "http.request.method_original"; +static constexpr const char *kHttpRequestMethodOriginal = "http.request.method_original"; /** * The ordinal number of request resending attempt (for any reason, including redirects). - * Note: The resend count SHOULD be updated each time an HTTP request gets resent by the client, + *

+ * The resend count SHOULD be updated each time an HTTP request gets resent by the client, * regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 * Server Unavailable, network issues, or any other). */ -static const char *kHttpRequestResendCount = "http.request.resend_count"; +static constexpr const char *kHttpRequestResendCount = "http.request.resend_count"; /** * HTTP response headers, @code @endcode being the normalized HTTP Header name (lowercase), - * the value being the header values. Note: Instrumentations SHOULD require an explicit - * configuration of which headers are to be captured. Including all response headers can be a - * security risk - explicit configuration helps avoid leaking sensitive information. Users MAY - * explicitly configure instrumentations to capture them even though it is not recommended. The - * attribute value MUST consist of either multiple header values as an array of strings or a - * single-item array containing a possibly comma-concatenated string, depending on the way the HTTP - * library provides access to headers. - */ -static const char *kHttpResponseHeader = "http.response.header"; + * the value being the header values.

Instrumentations SHOULD require an explicit configuration + * of which headers are to be captured. Including all response headers can be a security risk - + * explicit configuration helps avoid leaking sensitive information. Users MAY explicitly configure + * instrumentations to capture them even though it is not recommended. The attribute value MUST + * consist of either multiple header values as an array of strings or a single-item array containing + * a possibly comma-concatenated string, depending on the way the HTTP library provides access to + * headers. + */ +static constexpr const char *kHttpResponseHeader = "http.response.header"; /** * HTTP response status code. */ -static const char *kHttpResponseStatusCode = "http.response.status_code"; +static constexpr const char *kHttpResponseStatusCode = "http.response.status_code"; /** * The matched route, that is, the path template in the format used by the respective server - * framework. Note: MUST NOT be populated when this is not supported by the HTTP server framework as + * framework.

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 if * there is one. */ -static const char *kHttpRoute = "http.route"; - -// DEBUG: {"brief": "HTTP request method.", "examples": ["GET", "POST", "HEAD"], "name": -// "http.request.method", "note": "HTTP request method value SHOULD be \"known\" to the -// instrumentation.\nBy default, this convention defines \"known\" methods as the ones listed in -// [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods)\nand the PATCH method defined -// in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html).\n\nIf the HTTP request method is not -// known to instrumentation, it MUST set the `http.request.method` attribute to `_OTHER`.\n\nIf the -// HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it MUST -// provide a way to override\nthe list of known HTTP methods. If this override is done via -// environment variable, then the environment variable MUST be -// named\nOTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of -// case-sensitive known HTTP methods\n(this list MUST be a full override of the default known -// method, it is not a list of known methods in addition to the defaults).\n\nHTTP method names are -// case-sensitive and `http.request.method` attribute value MUST match a known HTTP method name -// exactly.\nInstrumentations for specific web frameworks that consider HTTP methods to be case -// insensitive, SHOULD populate a canonical equivalent.\nTracing instrumentations that do so, MUST -// also set `http.request.method_original` to the original value.\n", "requirement_level": -// "recommended", "root_namespace": "http", "stability": "stable", "type": {"allow_custom_values": -// true, "members": [{"brief": "CONNECT method.", "deprecated": none, "id": "connect", "note": none, -// "stability": "stable", "value": "CONNECT"}, {"brief": "DELETE method.", "deprecated": none, "id": -// "delete", "note": none, "stability": "stable", "value": "DELETE"}, {"brief": "GET method.", -// "deprecated": none, "id": "get", "note": none, "stability": "stable", "value": "GET"}, {"brief": -// "HEAD method.", "deprecated": none, "id": "head", "note": none, "stability": "stable", "value": -// "HEAD"}, {"brief": "OPTIONS method.", "deprecated": none, "id": "options", "note": none, -// "stability": "stable", "value": "OPTIONS"}, {"brief": "PATCH method.", "deprecated": none, "id": -// "patch", "note": none, "stability": "stable", "value": "PATCH"}, {"brief": "POST method.", -// "deprecated": none, "id": "post", "note": none, "stability": "stable", "value": "POST"}, -// {"brief": "PUT method.", "deprecated": none, "id": "put", "note": none, "stability": "stable", -// "value": "PUT"}, {"brief": "TRACE method.", "deprecated": none, "id": "trace", "note": none, -// "stability": "stable", "value": "TRACE"}, {"brief": "Any HTTP method that the instrumentation has -// no prior knowledge of.", "deprecated": none, "id": "other", "note": none, "stability": "stable", -// "value": "_OTHER"}]}} +static constexpr const char *kHttpRoute = "http.route"; + namespace HttpRequestMethodValues { /** * CONNECT method. */ -// DEBUG: {"brief": "CONNECT method.", "deprecated": none, "id": "connect", "note": none, -// "stability": "stable", "value": "CONNECT"} static constexpr const char *kConnect = "CONNECT"; + /** * DELETE method. */ -// DEBUG: {"brief": "DELETE method.", "deprecated": none, "id": "delete", "note": none, "stability": -// "stable", "value": "DELETE"} static constexpr const char *kDelete = "DELETE"; + /** * GET method. */ -// DEBUG: {"brief": "GET method.", "deprecated": none, "id": "get", "note": none, "stability": -// "stable", "value": "GET"} static constexpr const char *kGet = "GET"; + /** * HEAD method. */ -// DEBUG: {"brief": "HEAD method.", "deprecated": none, "id": "head", "note": none, "stability": -// "stable", "value": "HEAD"} static constexpr const char *kHead = "HEAD"; + /** * OPTIONS method. */ -// DEBUG: {"brief": "OPTIONS method.", "deprecated": none, "id": "options", "note": none, -// "stability": "stable", "value": "OPTIONS"} static constexpr const char *kOptions = "OPTIONS"; + /** * PATCH method. */ -// DEBUG: {"brief": "PATCH method.", "deprecated": none, "id": "patch", "note": none, "stability": -// "stable", "value": "PATCH"} static constexpr const char *kPatch = "PATCH"; + /** * POST method. */ -// DEBUG: {"brief": "POST method.", "deprecated": none, "id": "post", "note": none, "stability": -// "stable", "value": "POST"} static constexpr const char *kPost = "POST"; + /** * PUT method. */ -// DEBUG: {"brief": "PUT method.", "deprecated": none, "id": "put", "note": none, "stability": -// "stable", "value": "PUT"} static constexpr const char *kPut = "PUT"; + /** * TRACE method. */ -// DEBUG: {"brief": "TRACE method.", "deprecated": none, "id": "trace", "note": none, "stability": -// "stable", "value": "TRACE"} static constexpr const char *kTrace = "TRACE"; + /** * Any HTTP method that the instrumentation has no prior knowledge of. */ -// DEBUG: {"brief": "Any HTTP method that the instrumentation has no prior knowledge of.", -// "deprecated": none, "id": "other", "note": none, "stability": "stable", "value": "_OTHER"} static constexpr const char *kOther = "_OTHER"; + } // namespace HttpRequestMethodValues } // namespace http diff --git a/api/include/opentelemetry/semconv/attributes/network_attributes.h b/api/include/opentelemetry/semconv/attributes/network_attributes.h index 73c777abad..7e965e6a6e 100644 --- a/api/include/opentelemetry/semconv/attributes/network_attributes.h +++ b/api/include/opentelemetry/semconv/attributes/network_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -24,123 +22,97 @@ namespace network /** * Local address of the network connection - IP address or Unix domain socket name. */ -static const char *kNetworkLocalAddress = "network.local.address"; +static constexpr const char *kNetworkLocalAddress = "network.local.address"; /** * Local port number of the network connection. */ -static const char *kNetworkLocalPort = "network.local.port"; +static constexpr const char *kNetworkLocalPort = "network.local.port"; /** * Peer address of the network connection - IP address or Unix domain socket name. */ -static const char *kNetworkPeerAddress = "network.peer.address"; +static constexpr const char *kNetworkPeerAddress = "network.peer.address"; /** * Peer port number of the network connection. */ -static const char *kNetworkPeerPort = "network.peer.port"; +static constexpr const char *kNetworkPeerPort = "network.peer.port"; /** * OSI application layer or non-OSI - * equivalent. Note: The value SHOULD be normalized to lowercase. + * equivalent.

The value SHOULD be normalized to lowercase. */ -static const char *kNetworkProtocolName = "network.protocol.name"; +static constexpr const char *kNetworkProtocolName = "network.protocol.name"; /** * The actual version of the protocol used for network communication. - * Note: If protocol version is subject to negotiation (for example using + * If protocol version is subject to negotiation (for example using ALPN), this attribute SHOULD be set to the * negotiated version. If the actual protocol version is not known, this attribute SHOULD NOT be * set. */ -static const char *kNetworkProtocolVersion = "network.protocol.version"; +static constexpr const char *kNetworkProtocolVersion = "network.protocol.version"; /** * OSI transport layer or inter-process communication - * method. Note: The value SHOULD be normalized to lowercase.

Consider always setting the + * method.

The value SHOULD be normalized to lowercase.

Consider always setting the * transport when setting a port number, since a port number is ambiguous without knowing the * transport. For example different processes could be listening on TCP port 12345 and UDP port * 12345. */ -static const char *kNetworkTransport = "network.transport"; +static constexpr const char *kNetworkTransport = "network.transport"; /** * OSI network layer or non-OSI equivalent. - * Note: The value SHOULD be normalized to lowercase. - */ -static const char *kNetworkType = "network.type"; - -// DEBUG: {"brief": "[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process -// communication method](https://wikipedia.org/wiki/Inter-process_communication).\n", "examples": -// ["tcp", "udp"], "name": "network.transport", "note": "The value SHOULD be normalized to -// lowercase.\n\nConsider always setting the transport when setting a port number, since\na port -// number is ambiguous without knowing the transport. For example\ndifferent processes could be -// listening on TCP port 12345 and UDP port 12345.\n", "requirement_level": "recommended", -// "root_namespace": "network", "stability": "stable", "type": {"allow_custom_values": true, -// "members": [{"brief": "TCP", "deprecated": none, "id": "tcp", "note": none, "stability": -// "stable", "value": "tcp"}, {"brief": "UDP", "deprecated": none, "id": "udp", "note": none, -// "stability": "stable", "value": "udp"}, {"brief": "Named or anonymous pipe.", "deprecated": none, -// "id": "pipe", "note": none, "stability": "stable", "value": "pipe"}, {"brief": "Unix domain -// socket", "deprecated": none, "id": "unix", "note": none, "stability": "stable", "value": "unix"}, -// {"brief": "QUIC", "deprecated": none, "id": "quic", "note": none, "stability": "experimental", -// "value": "quic"}]}} + *

+ * The value SHOULD be normalized to lowercase. + */ +static constexpr const char *kNetworkType = "network.type"; + namespace NetworkTransportValues { /** - * TCP. + * TCP */ -// DEBUG: {"brief": "TCP", "deprecated": none, "id": "tcp", "note": none, "stability": "stable", -// "value": "tcp"} static constexpr const char *kTcp = "tcp"; + /** - * UDP. + * UDP */ -// DEBUG: {"brief": "UDP", "deprecated": none, "id": "udp", "note": none, "stability": "stable", -// "value": "udp"} static constexpr const char *kUdp = "udp"; + /** * Named or anonymous pipe. */ -// DEBUG: {"brief": "Named or anonymous pipe.", "deprecated": none, "id": "pipe", "note": none, -// "stability": "stable", "value": "pipe"} static constexpr const char *kPipe = "pipe"; + /** - * Unix domain socket. + * Unix domain socket */ -// DEBUG: {"brief": "Unix domain socket", "deprecated": none, "id": "unix", "note": none, -// "stability": "stable", "value": "unix"} static constexpr const char *kUnix = "unix"; + /** - * QUIC. + * QUIC */ -// DEBUG: {"brief": "QUIC", "deprecated": none, "id": "quic", "note": none, "stability": -// "experimental", "value": "quic"} static constexpr const char *kQuic = "quic"; + } // namespace NetworkTransportValues -// DEBUG: {"brief": "[OSI network layer](https://osi-model.com/network-layer/) or non-OSI -// equivalent.", "examples": ["ipv4", "ipv6"], "name": "network.type", "note": "The value SHOULD be -// normalized to lowercase.", "requirement_level": "recommended", "root_namespace": "network", -// "stability": "stable", "type": {"allow_custom_values": true, "members": [{"brief": "IPv4", -// "deprecated": none, "id": "ipv4", "note": none, "stability": "stable", "value": "ipv4"}, -// {"brief": "IPv6", "deprecated": none, "id": "ipv6", "note": none, "stability": "stable", "value": -// "ipv6"}]}} namespace NetworkTypeValues { /** - * IPv4. + * IPv4 */ -// DEBUG: {"brief": "IPv4", "deprecated": none, "id": "ipv4", "note": none, "stability": "stable", -// "value": "ipv4"} static constexpr const char *kIpv4 = "ipv4"; + /** - * IPv6. + * IPv6 */ -// DEBUG: {"brief": "IPv6", "deprecated": none, "id": "ipv6", "note": none, "stability": "stable", -// "value": "ipv6"} static constexpr const char *kIpv6 = "ipv6"; + } // namespace NetworkTypeValues } // namespace network diff --git a/api/include/opentelemetry/semconv/attributes/otel_attributes.h b/api/include/opentelemetry/semconv/attributes/otel_attributes.h index 92f9f8600c..b92eff1dd4 100644 --- a/api/include/opentelemetry/semconv/attributes/otel_attributes.h +++ b/api/include/opentelemetry/semconv/attributes/otel_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -24,46 +22,36 @@ namespace otel /** * The name of the instrumentation scope - (@code InstrumentationScope.Name @endcode in OTLP). */ -static const char *kOtelScopeName = "otel.scope.name"; +static constexpr const char *kOtelScopeName = "otel.scope.name"; /** * The version of the instrumentation scope - (@code InstrumentationScope.Version @endcode in OTLP). */ -static const char *kOtelScopeVersion = "otel.scope.version"; +static constexpr const char *kOtelScopeVersion = "otel.scope.version"; /** * Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET. */ -static const char *kOtelStatusCode = "otel.status_code"; +static constexpr const char *kOtelStatusCode = "otel.status_code"; /** * Description of the Status if it has a value, otherwise not set. */ -static const char *kOtelStatusDescription = "otel.status_description"; +static constexpr const char *kOtelStatusDescription = "otel.status_description"; -// DEBUG: {"brief": "Name of the code, either \"OK\" or \"ERROR\". MUST NOT be set if the status -// code is UNSET.", "name": "otel.status_code", "requirement_level": "recommended", -// "root_namespace": "otel", "stability": "stable", "type": {"allow_custom_values": true, "members": -// [{"brief": "The operation has been validated by an Application developer or Operator to have -// completed successfully.", "deprecated": none, "id": "ok", "note": none, "stability": "stable", -// "value": "OK"}, {"brief": "The operation contains an error.", "deprecated": none, "id": "error", -// "note": none, "stability": "stable", "value": "ERROR"}]}} namespace OtelStatusCodeValues { /** * The operation has been validated by an Application developer or Operator to have completed * successfully. */ -// DEBUG: {"brief": "The operation has been validated by an Application developer or Operator to -// have completed successfully.", "deprecated": none, "id": "ok", "note": none, "stability": -// "stable", "value": "OK"} static constexpr const char *kOk = "OK"; + /** * The operation contains an error. */ -// DEBUG: {"brief": "The operation contains an error.", "deprecated": none, "id": "error", "note": -// none, "stability": "stable", "value": "ERROR"} static constexpr const char *kError = "ERROR"; + } // namespace OtelStatusCodeValues } // namespace otel diff --git a/api/include/opentelemetry/semconv/attributes/server_attributes.h b/api/include/opentelemetry/semconv/attributes/server_attributes.h index b12946b27b..21cb75d729 100644 --- a/api/include/opentelemetry/semconv/attributes/server_attributes.h +++ b/api/include/opentelemetry/semconv/attributes/server_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -23,19 +21,20 @@ namespace server /** * Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain - * socket name. Note: When observed from the client side, and when communicating through an + * socket name.

When observed from the client side, and when communicating through an * intermediary, @code server.address @endcode SHOULD represent the server address behind any * intermediaries, for example proxies, if it's available. */ -static const char *kServerAddress = "server.address"; +static constexpr const char *kServerAddress = "server.address"; /** * Server port number. - * Note: When observed from the client side, and when communicating through an intermediary, @code + *

+ * When observed from the client side, and when communicating through an intermediary, @code * server.port @endcode SHOULD represent the server port behind any intermediaries, for example * proxies, if it's available. */ -static const char *kServerPort = "server.port"; +static constexpr const char *kServerPort = "server.port"; } // namespace server } // namespace semconv diff --git a/api/include/opentelemetry/semconv/attributes/service_attributes.h b/api/include/opentelemetry/semconv/attributes/service_attributes.h index ab299fbb8d..e4c0dda17a 100644 --- a/api/include/opentelemetry/semconv/attributes/service_attributes.h +++ b/api/include/opentelemetry/semconv/attributes/service_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -23,19 +21,20 @@ namespace service /** * Logical name of the service. - * Note: MUST be the same for all instances of horizontally scaled services. If the value was not + *

+ * MUST be the same for all instances of horizontally scaled services. If the value was not * specified, SDKs MUST fallback to @code unknown_service: @endcode concatenated with @code process.executable.name @endcode, e.g. @code unknown_service:bash * @endcode. If @code process.executable.name @endcode is not available, the value MUST be set to * @code unknown_service @endcode. */ -static const char *kServiceName = "service.name"; +static constexpr const char *kServiceName = "service.name"; /** * The version string of the service API or implementation. The format is not defined by these * conventions. */ -static const char *kServiceVersion = "service.version"; +static constexpr const char *kServiceVersion = "service.version"; } // namespace service } // namespace semconv diff --git a/api/include/opentelemetry/semconv/attributes/telemetry_attributes.h b/api/include/opentelemetry/semconv/attributes/telemetry_attributes.h index 46c3b88f3a..7aa764cdaa 100644 --- a/api/include/opentelemetry/semconv/attributes/telemetry_attributes.h +++ b/api/include/opentelemetry/semconv/attributes/telemetry_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -24,11 +22,12 @@ namespace telemetry /** * The language of the telemetry SDK. */ -static const char *kTelemetrySdkLanguage = "telemetry.sdk.language"; +static constexpr const char *kTelemetrySdkLanguage = "telemetry.sdk.language"; /** * The name of the telemetry SDK as defined above. - * Note: The OpenTelemetry SDK MUST set the @code telemetry.sdk.name @endcode attribute to @code + *

+ * The OpenTelemetry SDK MUST set the @code telemetry.sdk.name @endcode attribute to @code * opentelemetry @endcode. If another SDK, like a fork or a vendor-provided implementation, is used, * this SDK MUST set the * @code telemetry.sdk.name @endcode attribute to the fully-qualified class or module name of this @@ -36,103 +35,75 @@ static const char *kTelemetrySdkLanguage = "telemetry.sdk.language"; * @code opentelemetry @endcode is reserved and MUST NOT be used in this case. All custom * identifiers SHOULD be stable across different versions of an implementation. */ -static const char *kTelemetrySdkName = "telemetry.sdk.name"; +static constexpr const char *kTelemetrySdkName = "telemetry.sdk.name"; /** * The version string of the telemetry SDK. */ -static const char *kTelemetrySdkVersion = "telemetry.sdk.version"; - -// DEBUG: {"brief": "The language of the telemetry SDK.\n", "name": "telemetry.sdk.language", -// "requirement_level": "required", "root_namespace": "telemetry", "stability": "stable", "type": -// {"allow_custom_values": true, "members": [{"brief": none, "deprecated": none, "id": "cpp", -// "note": none, "stability": "stable", "value": "cpp"}, {"brief": none, "deprecated": none, "id": -// "dotnet", "note": none, "stability": "stable", "value": "dotnet"}, {"brief": none, "deprecated": -// none, "id": "erlang", "note": none, "stability": "stable", "value": "erlang"}, {"brief": none, -// "deprecated": none, "id": "go", "note": none, "stability": "stable", "value": "go"}, {"brief": -// none, "deprecated": none, "id": "java", "note": none, "stability": "stable", "value": "java"}, -// {"brief": none, "deprecated": none, "id": "nodejs", "note": none, "stability": "stable", "value": -// "nodejs"}, {"brief": none, "deprecated": none, "id": "php", "note": none, "stability": "stable", -// "value": "php"}, {"brief": none, "deprecated": none, "id": "python", "note": none, "stability": -// "stable", "value": "python"}, {"brief": none, "deprecated": none, "id": "ruby", "note": none, -// "stability": "stable", "value": "ruby"}, {"brief": none, "deprecated": none, "id": "rust", -// "note": none, "stability": "stable", "value": "rust"}, {"brief": none, "deprecated": none, "id": -// "swift", "note": none, "stability": "stable", "value": "swift"}, {"brief": none, "deprecated": -// none, "id": "webjs", "note": none, "stability": "stable", "value": "webjs"}]}} +static constexpr const char *kTelemetrySdkVersion = "telemetry.sdk.version"; + namespace TelemetrySdkLanguageValues { /** - * cpp. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "cpp", "note": none, "stability": "stable", -// "value": "cpp"} static constexpr const char *kCpp = "cpp"; + /** - * dotnet. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "dotnet", "note": none, "stability": "stable", -// "value": "dotnet"} static constexpr const char *kDotnet = "dotnet"; + /** - * erlang. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "erlang", "note": none, "stability": "stable", -// "value": "erlang"} static constexpr const char *kErlang = "erlang"; + /** - * go. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "go", "note": none, "stability": "stable", -// "value": "go"} static constexpr const char *kGo = "go"; + /** - * java. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "java", "note": none, "stability": "stable", -// "value": "java"} static constexpr const char *kJava = "java"; + /** - * nodejs. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "nodejs", "note": none, "stability": "stable", -// "value": "nodejs"} static constexpr const char *kNodejs = "nodejs"; + /** - * php. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "php", "note": none, "stability": "stable", -// "value": "php"} static constexpr const char *kPhp = "php"; + /** - * python. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "python", "note": none, "stability": "stable", -// "value": "python"} static constexpr const char *kPython = "python"; + /** - * ruby. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "ruby", "note": none, "stability": "stable", -// "value": "ruby"} static constexpr const char *kRuby = "ruby"; + /** - * rust. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "rust", "note": none, "stability": "stable", -// "value": "rust"} static constexpr const char *kRust = "rust"; + /** - * swift. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "swift", "note": none, "stability": "stable", -// "value": "swift"} static constexpr const char *kSwift = "swift"; + /** - * webjs. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "webjs", "note": none, "stability": "stable", -// "value": "webjs"} static constexpr const char *kWebjs = "webjs"; + } // namespace TelemetrySdkLanguageValues } // namespace telemetry diff --git a/api/include/opentelemetry/semconv/attributes/url_attributes.h b/api/include/opentelemetry/semconv/attributes/url_attributes.h index 6d38114389..25ed5b03ab 100644 --- a/api/include/opentelemetry/semconv/attributes/url_attributes.h +++ b/api/include/opentelemetry/semconv/attributes/url_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -22,15 +20,15 @@ namespace url { /** - * The URI fragment component. + * The URI fragment component */ -static const char *kUrlFragment = "url.fragment"; +static constexpr const char *kUrlFragment = "url.fragment"; /** * Absolute URL describing a network resource according to RFC3986. Note: For network calls, URL usually - * has @code scheme://host[:port][path][?query][#fragment] @endcode format, where the fragment is - * not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless. + * href="https://www.rfc-editor.org/rfc/rfc3986">RFC3986

For network calls, URL usually has + * @code scheme://host[:port][path][?query][#fragment] @endcode format, where the fragment is not + * transmitted over HTTP, but if it is known, it SHOULD be included nevertheless. * @code url.full @endcode MUST NOT contain credentials passed via URL in form of @code * https://username:password@www.example.com/ @endcode. In such case username and password SHOULD be * redacted and attribute's value SHOULD be @code https://REDACTED:REDACTED@www.example.com/ @@ -39,27 +37,29 @@ static const char *kUrlFragment = "url.fragment"; * reconstructed). Sensitive content provided in @code url.full @endcode SHOULD be scrubbed when * instrumentations can identify it. */ -static const char *kUrlFull = "url.full"; +static constexpr const char *kUrlFull = "url.full"; /** - * The URI path component. - * Note: Sensitive content provided in @code url.path @endcode SHOULD be scrubbed when - * instrumentations can identify it. + * The URI path component + *

+ * Sensitive content provided in @code url.path @endcode SHOULD be scrubbed when instrumentations + * can identify it. */ -static const char *kUrlPath = "url.path"; +static constexpr const char *kUrlPath = "url.path"; /** - * The URI query component. - * Note: Sensitive content provided in @code url.query @endcode SHOULD be scrubbed when - * instrumentations can identify it. + * The URI query component + *

+ * Sensitive content provided in @code url.query @endcode SHOULD be scrubbed when instrumentations + * can identify it. */ -static const char *kUrlQuery = "url.query"; +static constexpr const char *kUrlQuery = "url.query"; /** * The URI scheme component * identifying the used protocol. */ -static const char *kUrlScheme = "url.scheme"; +static constexpr const char *kUrlScheme = "url.scheme"; } // namespace url } // namespace semconv diff --git a/api/include/opentelemetry/semconv/attributes/user_agent_attributes.h b/api/include/opentelemetry/semconv/attributes/user_agent_attributes.h index 4618d99500..dd1d493278 100644 --- a/api/include/opentelemetry/semconv/attributes/user_agent_attributes.h +++ b/api/include/opentelemetry/semconv/attributes/user_agent_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -25,7 +23,7 @@ namespace user_agent * Value of the HTTP * User-Agent header sent by the client. */ -static const char *kUserAgentOriginal = "user_agent.original"; +static constexpr const char *kUserAgentOriginal = "user_agent.original"; } // namespace user_agent } // namespace semconv diff --git a/api/include/opentelemetry/semconv/incubating/attributes/artifact_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/artifact_attributes.h index 9eeb5914c0..d3bb99f6e5 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/artifact_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/artifact_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -27,7 +25,7 @@ namespace artifact * href="https://slsa.dev/spec/v1.0/distributing-provenance#relationship-between-artifacts-and-attestations">SLSA * Relationship specification for more information. */ -static const char *kArtifactAttestationFilename = "artifact.attestation.filename"; +static constexpr const char *kArtifactAttestationFilename = "artifact.attestation.filename"; /** * The full hash value (see @@ -35,49 +33,48 @@ static const char *kArtifactAttestationFilename = "artifact.attestation.filename * refer to this as the digest. */ -static const char *kArtifactAttestationHash = "artifact.attestation.hash"; +static constexpr const char *kArtifactAttestationHash = "artifact.attestation.hash"; /** * The id of the build software attestation. */ -static const char *kArtifactAttestationId = "artifact.attestation.id"; +static constexpr const char *kArtifactAttestationId = "artifact.attestation.id"; /** * The human readable file name of the artifact, typically generated during build and release - * processes. Often includes the package name and version in the file name. Note: This file name can + * processes. Often includes the package name and version in the file name.

This file name can * also act as the Package Name * in cases where the package ecosystem maps accordingly. * Additionally, the artifact can be published for * others, but that is not a guarantee. */ -static const char *kArtifactFilename = "artifact.filename"; +static constexpr const char *kArtifactFilename = "artifact.filename"; /** * The full hash value (see * glossary), often found in checksum.txt on a release of the artifact and used to verify - * package integrity. Note: The specific algorithm used to create the cryptographic hash value is - * not defined. In situations where an artifact has multiple - * cryptographic hashes, it is up to the implementer to choose which - * hash value to set here; this should be the most secure hash algorithm + * package integrity.

The specific algorithm used to create the cryptographic hash value is not + * defined. In situations where an artifact has multiple cryptographic hashes, it is up to the + * implementer to choose which hash value to set here; this should be the most secure hash algorithm * that is suitable for the situation and consistent with the * corresponding attestation. The implementer can then provide the other * hash values through an additional set of attribute extensions as they * deem necessary. */ -static const char *kArtifactHash = "artifact.hash"; +static constexpr const char *kArtifactHash = "artifact.hash"; /** * The Package URL of the package artifact provides a * standard way to identify and locate the packaged artifact. */ -static const char *kArtifactPurl = "artifact.purl"; +static constexpr const char *kArtifactPurl = "artifact.purl"; /** * The version of the artifact. */ -static const char *kArtifactVersion = "artifact.version"; +static constexpr const char *kArtifactVersion = "artifact.version"; } // namespace artifact } // namespace semconv diff --git a/api/include/opentelemetry/semconv/incubating/attributes/aws_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/aws_attributes.h index 204a41f8e4..d0eaa6d08a 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/aws_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/aws_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -24,246 +22,256 @@ namespace aws /** * The JSON-serialized value of each item in the @code AttributeDefinitions @endcode request field. */ -static const char *kAwsDynamodbAttributeDefinitions = "aws.dynamodb.attribute_definitions"; +static constexpr const char *kAwsDynamodbAttributeDefinitions = + "aws.dynamodb.attribute_definitions"; /** * The value of the @code AttributesToGet @endcode request parameter. */ -static const char *kAwsDynamodbAttributesToGet = "aws.dynamodb.attributes_to_get"; +static constexpr const char *kAwsDynamodbAttributesToGet = "aws.dynamodb.attributes_to_get"; /** * The value of the @code ConsistentRead @endcode request parameter. */ -static const char *kAwsDynamodbConsistentRead = "aws.dynamodb.consistent_read"; +static constexpr const char *kAwsDynamodbConsistentRead = "aws.dynamodb.consistent_read"; /** * The JSON-serialized value of each item in the @code ConsumedCapacity @endcode response field. */ -static const char *kAwsDynamodbConsumedCapacity = "aws.dynamodb.consumed_capacity"; +static constexpr const char *kAwsDynamodbConsumedCapacity = "aws.dynamodb.consumed_capacity"; /** * The value of the @code Count @endcode response parameter. */ -static const char *kAwsDynamodbCount = "aws.dynamodb.count"; +static constexpr const char *kAwsDynamodbCount = "aws.dynamodb.count"; /** * The value of the @code ExclusiveStartTableName @endcode request parameter. */ -static const char *kAwsDynamodbExclusiveStartTable = "aws.dynamodb.exclusive_start_table"; +static constexpr const char *kAwsDynamodbExclusiveStartTable = "aws.dynamodb.exclusive_start_table"; /** * The JSON-serialized value of each item in the @code GlobalSecondaryIndexUpdates @endcode request * field. */ -static const char *kAwsDynamodbGlobalSecondaryIndexUpdates = +static constexpr const char *kAwsDynamodbGlobalSecondaryIndexUpdates = "aws.dynamodb.global_secondary_index_updates"; /** - * The JSON-serialized value of each item of the @code GlobalSecondaryIndexes @endcode request - * field. + * The JSON-serialized value of each item of the @code GlobalSecondaryIndexes @endcode request field */ -static const char *kAwsDynamodbGlobalSecondaryIndexes = "aws.dynamodb.global_secondary_indexes"; +static constexpr const char *kAwsDynamodbGlobalSecondaryIndexes = + "aws.dynamodb.global_secondary_indexes"; /** * The value of the @code IndexName @endcode request parameter. */ -static const char *kAwsDynamodbIndexName = "aws.dynamodb.index_name"; +static constexpr const char *kAwsDynamodbIndexName = "aws.dynamodb.index_name"; /** * The JSON-serialized value of the @code ItemCollectionMetrics @endcode response field. */ -static const char *kAwsDynamodbItemCollectionMetrics = "aws.dynamodb.item_collection_metrics"; +static constexpr const char *kAwsDynamodbItemCollectionMetrics = + "aws.dynamodb.item_collection_metrics"; /** * The value of the @code Limit @endcode request parameter. */ -static const char *kAwsDynamodbLimit = "aws.dynamodb.limit"; +static constexpr const char *kAwsDynamodbLimit = "aws.dynamodb.limit"; /** * The JSON-serialized value of each item of the @code LocalSecondaryIndexes @endcode request field. */ -static const char *kAwsDynamodbLocalSecondaryIndexes = "aws.dynamodb.local_secondary_indexes"; +static constexpr const char *kAwsDynamodbLocalSecondaryIndexes = + "aws.dynamodb.local_secondary_indexes"; /** * The value of the @code ProjectionExpression @endcode request parameter. */ -static const char *kAwsDynamodbProjection = "aws.dynamodb.projection"; +static constexpr const char *kAwsDynamodbProjection = "aws.dynamodb.projection"; /** * The value of the @code ProvisionedThroughput.ReadCapacityUnits @endcode request parameter. */ -static const char *kAwsDynamodbProvisionedReadCapacity = "aws.dynamodb.provisioned_read_capacity"; +static constexpr const char *kAwsDynamodbProvisionedReadCapacity = + "aws.dynamodb.provisioned_read_capacity"; /** * The value of the @code ProvisionedThroughput.WriteCapacityUnits @endcode request parameter. */ -static const char *kAwsDynamodbProvisionedWriteCapacity = "aws.dynamodb.provisioned_write_capacity"; +static constexpr const char *kAwsDynamodbProvisionedWriteCapacity = + "aws.dynamodb.provisioned_write_capacity"; /** * The value of the @code ScanIndexForward @endcode request parameter. */ -static const char *kAwsDynamodbScanForward = "aws.dynamodb.scan_forward"; +static constexpr const char *kAwsDynamodbScanForward = "aws.dynamodb.scan_forward"; /** * The value of the @code ScannedCount @endcode response parameter. */ -static const char *kAwsDynamodbScannedCount = "aws.dynamodb.scanned_count"; +static constexpr const char *kAwsDynamodbScannedCount = "aws.dynamodb.scanned_count"; /** * The value of the @code Segment @endcode request parameter. */ -static const char *kAwsDynamodbSegment = "aws.dynamodb.segment"; +static constexpr const char *kAwsDynamodbSegment = "aws.dynamodb.segment"; /** * The value of the @code Select @endcode request parameter. */ -static const char *kAwsDynamodbSelect = "aws.dynamodb.select"; +static constexpr const char *kAwsDynamodbSelect = "aws.dynamodb.select"; /** * The number of items in the @code TableNames @endcode response parameter. */ -static const char *kAwsDynamodbTableCount = "aws.dynamodb.table_count"; +static constexpr const char *kAwsDynamodbTableCount = "aws.dynamodb.table_count"; /** * The keys in the @code RequestItems @endcode object field. */ -static const char *kAwsDynamodbTableNames = "aws.dynamodb.table_names"; +static constexpr const char *kAwsDynamodbTableNames = "aws.dynamodb.table_names"; /** * The value of the @code TotalSegments @endcode request parameter. */ -static const char *kAwsDynamodbTotalSegments = "aws.dynamodb.total_segments"; +static constexpr const char *kAwsDynamodbTotalSegments = "aws.dynamodb.total_segments"; /** * The ARN of an ECS cluster. */ -static const char *kAwsEcsClusterArn = "aws.ecs.cluster.arn"; +static constexpr const char *kAwsEcsClusterArn = "aws.ecs.cluster.arn"; /** * The Amazon Resource Name (ARN) of an ECS * container instance. */ -static const char *kAwsEcsContainerArn = "aws.ecs.container.arn"; +static constexpr const char *kAwsEcsContainerArn = "aws.ecs.container.arn"; /** * The launch * type for an ECS task. */ -static const char *kAwsEcsLaunchtype = "aws.ecs.launchtype"; +static constexpr const char *kAwsEcsLaunchtype = "aws.ecs.launchtype"; /** * The ARN of a running ECS * task. */ -static const char *kAwsEcsTaskArn = "aws.ecs.task.arn"; +static constexpr const char *kAwsEcsTaskArn = "aws.ecs.task.arn"; /** * The family name of the ECS task * definition used to create the ECS task. */ -static const char *kAwsEcsTaskFamily = "aws.ecs.task.family"; +static constexpr const char *kAwsEcsTaskFamily = "aws.ecs.task.family"; /** * The ID of a running ECS task. The ID MUST be extracted from @code task.arn @endcode. */ -static const char *kAwsEcsTaskId = "aws.ecs.task.id"; +static constexpr const char *kAwsEcsTaskId = "aws.ecs.task.id"; /** * The revision for the task definition used to create the ECS task. */ -static const char *kAwsEcsTaskRevision = "aws.ecs.task.revision"; +static constexpr const char *kAwsEcsTaskRevision = "aws.ecs.task.revision"; /** * The ARN of an EKS cluster. */ -static const char *kAwsEksClusterArn = "aws.eks.cluster.arn"; +static constexpr const char *kAwsEksClusterArn = "aws.eks.cluster.arn"; /** * The full invoked ARN as provided on the @code Context @endcode passed to the function (@code * Lambda-Runtime-Invoked-Function-Arn @endcode header on the @code /runtime/invocation/next - * @endcode applicable). Note: This may be different from @code cloud.resource_id @endcode if an - * alias is involved. + * @endcode applicable).

This may be different from @code cloud.resource_id @endcode if an alias + * is involved. */ -static const char *kAwsLambdaInvokedArn = "aws.lambda.invoked_arn"; +static constexpr const char *kAwsLambdaInvokedArn = "aws.lambda.invoked_arn"; /** * The Amazon Resource Name(s) (ARN) of the AWS log group(s). - * Note: See the + * See the log * group ARN format documentation. */ -static const char *kAwsLogGroupArns = "aws.log.group.arns"; +static constexpr const char *kAwsLogGroupArns = "aws.log.group.arns"; /** * The name(s) of the AWS log group(s) an application is writing to. - * Note: Multiple log groups must be supported for cases like multi-container applications, where a - * single application has sidecar containers, and each write to their own log group. + *

+ * Multiple log groups must be supported for cases like multi-container applications, where a single + * application has sidecar containers, and each write to their own log group. */ -static const char *kAwsLogGroupNames = "aws.log.group.names"; +static constexpr const char *kAwsLogGroupNames = "aws.log.group.names"; /** * The ARN(s) of the AWS log stream(s). - * Note: See the + * See the log * stream ARN format documentation. One log group can contain several log streams, so these ARNs * necessarily identify both a log group and a log stream. */ -static const char *kAwsLogStreamArns = "aws.log.stream.arns"; +static constexpr const char *kAwsLogStreamArns = "aws.log.stream.arns"; /** * The name(s) of the AWS log stream(s) an application is writing to. */ -static const char *kAwsLogStreamNames = "aws.log.stream.names"; +static constexpr const char *kAwsLogStreamNames = "aws.log.stream.names"; /** * The AWS request ID as returned in the response headers @code x-amz-request-id @endcode or @code * x-amz-requestid @endcode. */ -static const char *kAwsRequestId = "aws.request_id"; +static constexpr const char *kAwsRequestId = "aws.request_id"; /** * The S3 bucket name the request refers to. Corresponds to the @code --bucket @endcode parameter of * the S3 API - * operations. Note: The @code bucket @endcode attribute is applicable to all S3 operations that + * operations.

The @code bucket @endcode attribute is applicable to all S3 operations that * reference a bucket, i.e. that require the bucket name as a mandatory parameter. This applies to * almost all S3 operations except @code list-buckets @endcode. */ -static const char *kAwsS3Bucket = "aws.s3.bucket"; +static constexpr const char *kAwsS3Bucket = "aws.s3.bucket"; /** * The source object (in the form @code bucket @endcode/@code key @endcode) for the copy operation. - * Note: The @code copy_source @endcode attribute applies to S3 copy operations and corresponds to - * the @code --copy-source @endcode parameter of the + * The @code copy_source @endcode attribute applies to S3 copy operations and corresponds to the + * @code --copy-source @endcode parameter of the copy-object * operation within the S3 API. This applies in particular to the following operations:

    *
  • copy-object
  • *
  • upload-part-copy.
  • + * href="https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html">upload-part-copy *
*/ -static const char *kAwsS3CopySource = "aws.s3.copy_source"; +static constexpr const char *kAwsS3CopySource = "aws.s3.copy_source"; /** * The delete request container that specifies the objects to be deleted. - * Note: The @code delete @endcode attribute is only applicable to the + * The @code delete @endcode attribute is only applicable to the delete-object * operation. The @code delete @endcode attribute corresponds to the @code --delete @endcode * parameter of the delete-objects * operation within the S3 API. */ -static const char *kAwsS3Delete = "aws.s3.delete"; +static constexpr const char *kAwsS3Delete = "aws.s3.delete"; /** * The S3 object key the request refers to. Corresponds to the @code --key @endcode parameter of the * S3 API - * operations. Note: The @code key @endcode attribute is applicable to all object-related S3 + * operations.

The @code key @endcode attribute is applicable to all object-related S3 * operations, i.e. that require the object key as a mandatory parameter. This applies in particular * to the following operations:

  • copy-object
  • @@ -290,15 +298,15 @@ static const char *kAwsS3Delete = "aws.s3.delete"; *
  • upload-part
  • *
  • upload-part-copy.
  • + * href="https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html">upload-part-copy *
*/ -static const char *kAwsS3Key = "aws.s3.key"; +static constexpr const char *kAwsS3Key = "aws.s3.key"; /** * The part number of the part being uploaded in a multipart-upload operation. This is a positive - * integer between 1 and 10,000. Note: The @code part_number @endcode attribute is only applicable - * to the The @code part_number @endcode attribute is only applicable to + * the upload-part * and upload-part-copy @@ -307,12 +315,13 @@ static const char *kAwsS3Key = "aws.s3.key"; * href="https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html">upload-part * operation within the S3 API. */ -static const char *kAwsS3PartNumber = "aws.s3.part_number"; +static constexpr const char *kAwsS3PartNumber = "aws.s3.part_number"; /** * Upload ID that identifies the multipart upload. - * Note: The @code upload_id @endcode attribute applies to S3 multipart-upload operations and - * corresponds to the @code --upload-id @endcode parameter of the + * The @code upload_id @endcode attribute applies to S3 multipart-upload operations and corresponds + * to the @code --upload-id @endcode parameter of the S3 API multipart * operations. This applies in particular to the following operations:

  • abort-multipart-upload
  • @@ -323,32 +332,23 @@ static const char *kAwsS3PartNumber = "aws.s3.part_number"; *
  • upload-part
  • *
  • upload-part-copy.
  • + * href="https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html">upload-part-copy *
*/ -static const char *kAwsS3UploadId = "aws.s3.upload_id"; +static constexpr const char *kAwsS3UploadId = "aws.s3.upload_id"; -// DEBUG: {"brief": "The [launch -// type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS -// task.\n", "name": "aws.ecs.launchtype", "requirement_level": "recommended", "root_namespace": -// "aws", "stability": "experimental", "type": {"allow_custom_values": true, "members": [{"brief": -// none, "deprecated": none, "id": "ec2", "note": none, "stability": "experimental", "value": -// "ec2"}, {"brief": none, "deprecated": none, "id": "fargate", "note": none, "stability": -// "experimental", "value": "fargate"}]}} namespace AwsEcsLaunchtypeValues { /** - * ec2. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "ec2", "note": none, "stability": -// "experimental", "value": "ec2"} static constexpr const char *kEc2 = "ec2"; + /** - * fargate. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "fargate", "note": none, "stability": -// "experimental", "value": "fargate"} static constexpr const char *kFargate = "fargate"; + } // namespace AwsEcsLaunchtypeValues } // namespace aws diff --git a/api/include/opentelemetry/semconv/incubating/attributes/az_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/az_attributes.h index 4198f52b91..5e12c82f7b 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/az_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/az_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -25,7 +23,7 @@ namespace az * The unique identifier of the service request. It's generated by the Azure service and returned * with the response. */ -static const char *kAzServiceRequestId = "az.service_request_id"; +static constexpr const char *kAzServiceRequestId = "az.service_request_id"; } // namespace az } // namespace semconv diff --git a/api/include/opentelemetry/semconv/incubating/attributes/browser_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/browser_attributes.h index 0f5b88b562..5ddb61eae5 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/browser_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/browser_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -22,31 +20,34 @@ namespace browser { /** - * Array of brand name and version separated by a space. - * Note: This value is intended to be taken from the + * This value is intended to be taken from the UA client hints API (@code * navigator.userAgentData.brands @endcode). */ -static const char *kBrowserBrands = "browser.brands"; +static constexpr const char *kBrowserBrands = "browser.brands"; /** - * Preferred language of the user using the browser. - * Note: This value is intended to be taken from the Navigator API @code navigator.language - * @endcode. + * Preferred language of the user using the browser + *

+ * This value is intended to be taken from the Navigator API @code navigator.language @endcode. */ -static const char *kBrowserLanguage = "browser.language"; +static constexpr const char *kBrowserLanguage = "browser.language"; /** - * A boolean that is true if the browser is running on a mobile device. - * Note: This value is intended to be taken from the + * This value is intended to be taken from the UA client hints API (@code * navigator.userAgentData.mobile @endcode). If unavailable, this attribute SHOULD be left unset. */ -static const char *kBrowserMobile = "browser.mobile"; +static constexpr const char *kBrowserMobile = "browser.mobile"; /** - * The platform on which the browser is running. - * Note: This value is intended to be taken from the + * This value is intended to be taken from the UA client hints API (@code * navigator.userAgentData.platform @endcode). If unavailable, the legacy @code navigator.platform * @endcode API SHOULD NOT be used instead and this attribute SHOULD be left unset in order for the @@ -57,7 +58,7 @@ static const char *kBrowserMobile = "browser.mobile"; * consistency, the values in the @code browser.platform @endcode attribute should capture the exact * value that the user agent provides. */ -static const char *kBrowserPlatform = "browser.platform"; +static constexpr const char *kBrowserPlatform = "browser.platform"; } // namespace browser } // namespace semconv diff --git a/api/include/opentelemetry/semconv/incubating/attributes/cicd_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/cicd_attributes.h index e2468fea60..246563a8e8 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/cicd_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/cicd_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -24,63 +22,53 @@ namespace cicd /** * The human readable name of the pipeline within a CI/CD system. */ -static const char *kCicdPipelineName = "cicd.pipeline.name"; +static constexpr const char *kCicdPipelineName = "cicd.pipeline.name"; /** * The unique identifier of a pipeline run within a CI/CD system. */ -static const char *kCicdPipelineRunId = "cicd.pipeline.run.id"; +static constexpr const char *kCicdPipelineRunId = "cicd.pipeline.run.id"; /** * The human readable name of a task within a pipeline. Task here most closely aligns with a computing process in a pipeline. * Other terms for tasks include commands, steps, and procedures. */ -static const char *kCicdPipelineTaskName = "cicd.pipeline.task.name"; +static constexpr const char *kCicdPipelineTaskName = "cicd.pipeline.task.name"; /** * The unique identifier of a task run within a pipeline. */ -static const char *kCicdPipelineTaskRunId = "cicd.pipeline.task.run.id"; +static constexpr const char *kCicdPipelineTaskRunId = "cicd.pipeline.task.run.id"; /** * The URL of the pipeline run providing the * complete address in order to locate and identify the pipeline run. */ -static const char *kCicdPipelineTaskRunUrlFull = "cicd.pipeline.task.run.url.full"; +static constexpr const char *kCicdPipelineTaskRunUrlFull = "cicd.pipeline.task.run.url.full"; /** * The type of the task within a pipeline. */ -static const char *kCicdPipelineTaskType = "cicd.pipeline.task.type"; +static constexpr const char *kCicdPipelineTaskType = "cicd.pipeline.task.type"; -// DEBUG: {"brief": "The type of the task within a pipeline.\n", "examples": ["build", "test", -// "deploy"], "name": "cicd.pipeline.task.type", "requirement_level": "recommended", -// "root_namespace": "cicd", "stability": "experimental", "type": {"allow_custom_values": true, -// "members": [{"brief": "build", "deprecated": none, "id": "build", "note": none, "stability": -// "experimental", "value": "build"}, {"brief": "test", "deprecated": none, "id": "test", "note": -// none, "stability": "experimental", "value": "test"}, {"brief": "deploy", "deprecated": none, -// "id": "deploy", "note": none, "stability": "experimental", "value": "deploy"}]}} namespace CicdPipelineTaskTypeValues { /** - * build. + * build */ -// DEBUG: {"brief": "build", "deprecated": none, "id": "build", "note": none, "stability": -// "experimental", "value": "build"} static constexpr const char *kBuild = "build"; + /** - * test. + * test */ -// DEBUG: {"brief": "test", "deprecated": none, "id": "test", "note": none, "stability": -// "experimental", "value": "test"} static constexpr const char *kTest = "test"; + /** - * deploy. + * deploy */ -// DEBUG: {"brief": "deploy", "deprecated": none, "id": "deploy", "note": none, "stability": -// "experimental", "value": "deploy"} static constexpr const char *kDeploy = "deploy"; + } // namespace CicdPipelineTaskTypeValues } // namespace cicd diff --git a/api/include/opentelemetry/semconv/incubating/attributes/client_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/client_attributes.h index f0f095f2c1..ec984cc406 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/client_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/client_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -22,16 +20,21 @@ namespace client { /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.client_attributes. @endcode. + * Client address - domain name if available without reverse DNS lookup; otherwise, IP address or + * Unix domain socket name.

When observed from the server side, and when communicating through + * an intermediary, @code client.address @endcode SHOULD represent the client address behind any + * intermediaries, for example proxies, if it's available. */ -static const char *kClientAddress = "client.address"; +static constexpr const char *kClientAddress = "client.address"; /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.client_attributes. @endcode. + * Client port number. + *

+ * When observed from the server side, and when communicating through an intermediary, @code + * client.port @endcode SHOULD represent the client port behind any intermediaries, for example + * proxies, if it's available. */ -static const char *kClientPort = "client.port"; +static constexpr const char *kClientPort = "client.port"; } // namespace client } // namespace semconv diff --git a/api/include/opentelemetry/semconv/incubating/attributes/cloud_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/cloud_attributes.h index 10ba825e5e..cd76489eba 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/cloud_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/cloud_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -24,36 +22,38 @@ namespace cloud /** * The cloud account ID the resource is assigned to. */ -static const char *kCloudAccountId = "cloud.account.id"; +static constexpr const char *kCloudAccountId = "cloud.account.id"; /** * Cloud regions often have multiple, isolated locations known as zones to increase availability. - * Availability zone represents the zone where the resource is running. Note: Availability zones are + * Availability zone represents the zone where the resource is running.

Availability zones are * called "zones" on Alibaba Cloud and Google Cloud. */ -static const char *kCloudAvailabilityZone = "cloud.availability_zone"; +static constexpr const char *kCloudAvailabilityZone = "cloud.availability_zone"; /** * The cloud platform in use. - * Note: The prefix of the service SHOULD match the one specified in @code cloud.provider @endcode. + *

+ * The prefix of the service SHOULD match the one specified in @code cloud.provider @endcode. */ -static const char *kCloudPlatform = "cloud.platform"; +static constexpr const char *kCloudPlatform = "cloud.platform"; /** * Name of the cloud provider. */ -static const char *kCloudProvider = "cloud.provider"; +static constexpr const char *kCloudProvider = "cloud.provider"; /** * The geographical region the resource is running. - * Note: Refer to your provider's docs to see the available regions, for example + * Refer to your provider's docs to see the available regions, for example Alibaba Cloud regions, AWS regions, Azure regions, Google Cloud regions, or Tencent Cloud regions. */ -static const char *kCloudRegion = "cloud.region"; +static constexpr const char *kCloudRegion = "cloud.region"; /** * Cloud provider-specific native identifier of the monitored cloud resource (e.g. an fully qualified * resource ID on Azure, a full resource - * name on GCP). Note: On some cloud providers, it may not be possible to determine the full ID - * at startup, so it may be necessary to set @code cloud.resource_id @endcode as a span attribute + * name on GCP)

On some cloud providers, it may not be possible to determine the full ID at + * startup, so it may be necessary to set @code cloud.resource_id @endcode as a span attribute * instead.

The exact value to use for @code cloud.resource_id @endcode depends on the cloud * provider. The following well-known definitions MUST be used if you set this attribute and they * apply:

  • AWS Lambda: The function *
*/ -static const char *kCloudResourceId = "cloud.resource_id"; - -// DEBUG: {"brief": "The cloud platform in use.\n", "name": "cloud.platform", "note": "The prefix of -// the service SHOULD match the one specified in `cloud.provider`.\n", "requirement_level": -// "recommended", "root_namespace": "cloud", "stability": "experimental", "type": -// {"allow_custom_values": true, "members": [{"brief": "Alibaba Cloud Elastic Compute Service", -// "deprecated": none, "id": "alibaba_cloud_ecs", "note": none, "stability": "experimental", -// "value": "alibaba_cloud_ecs"}, {"brief": "Alibaba Cloud Function Compute", "deprecated": none, -// "id": "alibaba_cloud_fc", "note": none, "stability": "experimental", "value": -// "alibaba_cloud_fc"}, {"brief": "Red Hat OpenShift on Alibaba Cloud", "deprecated": none, "id": -// "alibaba_cloud_openshift", "note": none, "stability": "experimental", "value": -// "alibaba_cloud_openshift"}, {"brief": "AWS Elastic Compute Cloud", "deprecated": none, "id": -// "aws_ec2", "note": none, "stability": "experimental", "value": "aws_ec2"}, {"brief": "AWS Elastic -// Container Service", "deprecated": none, "id": "aws_ecs", "note": none, "stability": -// "experimental", "value": "aws_ecs"}, {"brief": "AWS Elastic Kubernetes Service", "deprecated": -// none, "id": "aws_eks", "note": none, "stability": "experimental", "value": "aws_eks"}, {"brief": -// "AWS Lambda", "deprecated": none, "id": "aws_lambda", "note": none, "stability": "experimental", -// "value": "aws_lambda"}, {"brief": "AWS Elastic Beanstalk", "deprecated": none, "id": -// "aws_elastic_beanstalk", "note": none, "stability": "experimental", "value": -// "aws_elastic_beanstalk"}, {"brief": "AWS App Runner", "deprecated": none, "id": "aws_app_runner", -// "note": none, "stability": "experimental", "value": "aws_app_runner"}, {"brief": "Red Hat -// OpenShift on AWS (ROSA)", "deprecated": none, "id": "aws_openshift", "note": none, "stability": -// "experimental", "value": "aws_openshift"}, {"brief": "Azure Virtual Machines", "deprecated": -// none, "id": "azure_vm", "note": none, "stability": "experimental", "value": "azure_vm"}, -// {"brief": "Azure Container Apps", "deprecated": none, "id": "azure_container_apps", "note": none, -// "stability": "experimental", "value": "azure_container_apps"}, {"brief": "Azure Container -// Instances", "deprecated": none, "id": "azure_container_instances", "note": none, "stability": -// "experimental", "value": "azure_container_instances"}, {"brief": "Azure Kubernetes Service", -// "deprecated": none, "id": "azure_aks", "note": none, "stability": "experimental", "value": -// "azure_aks"}, {"brief": "Azure Functions", "deprecated": none, "id": "azure_functions", "note": -// none, "stability": "experimental", "value": "azure_functions"}, {"brief": "Azure App Service", -// "deprecated": none, "id": "azure_app_service", "note": none, "stability": "experimental", -// "value": "azure_app_service"}, {"brief": "Azure Red Hat OpenShift", "deprecated": none, "id": -// "azure_openshift", "note": none, "stability": "experimental", "value": "azure_openshift"}, -// {"brief": "Google Bare Metal Solution (BMS)", "deprecated": none, "id": -// "gcp_bare_metal_solution", "note": none, "stability": "experimental", "value": -// "gcp_bare_metal_solution"}, {"brief": "Google Cloud Compute Engine (GCE)", "deprecated": none, -// "id": "gcp_compute_engine", "note": none, "stability": "experimental", "value": -// "gcp_compute_engine"}, {"brief": "Google Cloud Run", "deprecated": none, "id": "gcp_cloud_run", -// "note": none, "stability": "experimental", "value": "gcp_cloud_run"}, {"brief": "Google Cloud -// Kubernetes Engine (GKE)", "deprecated": none, "id": "gcp_kubernetes_engine", "note": none, -// "stability": "experimental", "value": "gcp_kubernetes_engine"}, {"brief": "Google Cloud Functions -// (GCF)", "deprecated": none, "id": "gcp_cloud_functions", "note": none, "stability": -// "experimental", "value": "gcp_cloud_functions"}, {"brief": "Google Cloud App Engine (GAE)", -// "deprecated": none, "id": "gcp_app_engine", "note": none, "stability": "experimental", "value": -// "gcp_app_engine"}, {"brief": "Red Hat OpenShift on Google Cloud", "deprecated": none, "id": -// "gcp_openshift", "note": none, "stability": "experimental", "value": "gcp_openshift"}, {"brief": -// "Red Hat OpenShift on IBM Cloud", "deprecated": none, "id": "ibm_cloud_openshift", "note": none, -// "stability": "experimental", "value": "ibm_cloud_openshift"}, {"brief": "Tencent Cloud Cloud -// Virtual Machine (CVM)", "deprecated": none, "id": "tencent_cloud_cvm", "note": none, "stability": -// "experimental", "value": "tencent_cloud_cvm"}, {"brief": "Tencent Cloud Elastic Kubernetes -// Service (EKS)", "deprecated": none, "id": "tencent_cloud_eks", "note": none, "stability": -// "experimental", "value": "tencent_cloud_eks"}, {"brief": "Tencent Cloud Serverless Cloud Function -// (SCF)", "deprecated": none, "id": "tencent_cloud_scf", "note": none, "stability": "experimental", -// "value": "tencent_cloud_scf"}]}} +static constexpr const char *kCloudResourceId = "cloud.resource_id"; + namespace CloudPlatformValues { /** - * Alibaba Cloud Elastic Compute Service. + * Alibaba Cloud Elastic Compute Service */ -// DEBUG: {"brief": "Alibaba Cloud Elastic Compute Service", "deprecated": none, "id": -// "alibaba_cloud_ecs", "note": none, "stability": "experimental", "value": "alibaba_cloud_ecs"} static constexpr const char *kAlibabaCloudEcs = "alibaba_cloud_ecs"; + /** - * Alibaba Cloud Function Compute. + * Alibaba Cloud Function Compute */ -// DEBUG: {"brief": "Alibaba Cloud Function Compute", "deprecated": none, "id": "alibaba_cloud_fc", -// "note": none, "stability": "experimental", "value": "alibaba_cloud_fc"} static constexpr const char *kAlibabaCloudFc = "alibaba_cloud_fc"; + /** - * Red Hat OpenShift on Alibaba Cloud. + * Red Hat OpenShift on Alibaba Cloud */ -// DEBUG: {"brief": "Red Hat OpenShift on Alibaba Cloud", "deprecated": none, "id": -// "alibaba_cloud_openshift", "note": none, "stability": "experimental", "value": -// "alibaba_cloud_openshift"} static constexpr const char *kAlibabaCloudOpenshift = "alibaba_cloud_openshift"; + /** - * AWS Elastic Compute Cloud. + * AWS Elastic Compute Cloud */ -// DEBUG: {"brief": "AWS Elastic Compute Cloud", "deprecated": none, "id": "aws_ec2", "note": none, -// "stability": "experimental", "value": "aws_ec2"} static constexpr const char *kAwsEc2 = "aws_ec2"; + /** - * AWS Elastic Container Service. + * AWS Elastic Container Service */ -// DEBUG: {"brief": "AWS Elastic Container Service", "deprecated": none, "id": "aws_ecs", "note": -// none, "stability": "experimental", "value": "aws_ecs"} static constexpr const char *kAwsEcs = "aws_ecs"; + /** - * AWS Elastic Kubernetes Service. + * AWS Elastic Kubernetes Service */ -// DEBUG: {"brief": "AWS Elastic Kubernetes Service", "deprecated": none, "id": "aws_eks", "note": -// none, "stability": "experimental", "value": "aws_eks"} static constexpr const char *kAwsEks = "aws_eks"; + /** - * AWS Lambda. + * AWS Lambda */ -// DEBUG: {"brief": "AWS Lambda", "deprecated": none, "id": "aws_lambda", "note": none, "stability": -// "experimental", "value": "aws_lambda"} static constexpr const char *kAwsLambda = "aws_lambda"; + /** - * AWS Elastic Beanstalk. + * AWS Elastic Beanstalk */ -// DEBUG: {"brief": "AWS Elastic Beanstalk", "deprecated": none, "id": "aws_elastic_beanstalk", -// "note": none, "stability": "experimental", "value": "aws_elastic_beanstalk"} static constexpr const char *kAwsElasticBeanstalk = "aws_elastic_beanstalk"; + /** - * AWS App Runner. + * AWS App Runner */ -// DEBUG: {"brief": "AWS App Runner", "deprecated": none, "id": "aws_app_runner", "note": none, -// "stability": "experimental", "value": "aws_app_runner"} static constexpr const char *kAwsAppRunner = "aws_app_runner"; + /** - * Red Hat OpenShift on AWS (ROSA). + * Red Hat OpenShift on AWS (ROSA) */ -// DEBUG: {"brief": "Red Hat OpenShift on AWS (ROSA)", "deprecated": none, "id": "aws_openshift", -// "note": none, "stability": "experimental", "value": "aws_openshift"} static constexpr const char *kAwsOpenshift = "aws_openshift"; + /** - * Azure Virtual Machines. + * Azure Virtual Machines */ -// DEBUG: {"brief": "Azure Virtual Machines", "deprecated": none, "id": "azure_vm", "note": none, -// "stability": "experimental", "value": "azure_vm"} static constexpr const char *kAzureVm = "azure_vm"; + /** - * Azure Container Apps. + * Azure Container Apps */ -// DEBUG: {"brief": "Azure Container Apps", "deprecated": none, "id": "azure_container_apps", -// "note": none, "stability": "experimental", "value": "azure_container_apps"} static constexpr const char *kAzureContainerApps = "azure_container_apps"; + /** - * Azure Container Instances. + * Azure Container Instances */ -// DEBUG: {"brief": "Azure Container Instances", "deprecated": none, "id": -// "azure_container_instances", "note": none, "stability": "experimental", "value": -// "azure_container_instances"} static constexpr const char *kAzureContainerInstances = "azure_container_instances"; + /** - * Azure Kubernetes Service. + * Azure Kubernetes Service */ -// DEBUG: {"brief": "Azure Kubernetes Service", "deprecated": none, "id": "azure_aks", "note": none, -// "stability": "experimental", "value": "azure_aks"} static constexpr const char *kAzureAks = "azure_aks"; + /** - * Azure Functions. + * Azure Functions */ -// DEBUG: {"brief": "Azure Functions", "deprecated": none, "id": "azure_functions", "note": none, -// "stability": "experimental", "value": "azure_functions"} static constexpr const char *kAzureFunctions = "azure_functions"; + /** - * Azure App Service. + * Azure App Service */ -// DEBUG: {"brief": "Azure App Service", "deprecated": none, "id": "azure_app_service", "note": -// none, "stability": "experimental", "value": "azure_app_service"} static constexpr const char *kAzureAppService = "azure_app_service"; + /** - * Azure Red Hat OpenShift. + * Azure Red Hat OpenShift */ -// DEBUG: {"brief": "Azure Red Hat OpenShift", "deprecated": none, "id": "azure_openshift", "note": -// none, "stability": "experimental", "value": "azure_openshift"} static constexpr const char *kAzureOpenshift = "azure_openshift"; + /** - * Google Bare Metal Solution (BMS). + * Google Bare Metal Solution (BMS) */ -// DEBUG: {"brief": "Google Bare Metal Solution (BMS)", "deprecated": none, "id": -// "gcp_bare_metal_solution", "note": none, "stability": "experimental", "value": -// "gcp_bare_metal_solution"} static constexpr const char *kGcpBareMetalSolution = "gcp_bare_metal_solution"; + /** - * Google Cloud Compute Engine (GCE). + * Google Cloud Compute Engine (GCE) */ -// DEBUG: {"brief": "Google Cloud Compute Engine (GCE)", "deprecated": none, "id": -// "gcp_compute_engine", "note": none, "stability": "experimental", "value": "gcp_compute_engine"} static constexpr const char *kGcpComputeEngine = "gcp_compute_engine"; + /** - * Google Cloud Run. + * Google Cloud Run */ -// DEBUG: {"brief": "Google Cloud Run", "deprecated": none, "id": "gcp_cloud_run", "note": none, -// "stability": "experimental", "value": "gcp_cloud_run"} static constexpr const char *kGcpCloudRun = "gcp_cloud_run"; + /** - * Google Cloud Kubernetes Engine (GKE). + * Google Cloud Kubernetes Engine (GKE) */ -// DEBUG: {"brief": "Google Cloud Kubernetes Engine (GKE)", "deprecated": none, "id": -// "gcp_kubernetes_engine", "note": none, "stability": "experimental", "value": -// "gcp_kubernetes_engine"} static constexpr const char *kGcpKubernetesEngine = "gcp_kubernetes_engine"; + /** - * Google Cloud Functions (GCF). + * Google Cloud Functions (GCF) */ -// DEBUG: {"brief": "Google Cloud Functions (GCF)", "deprecated": none, "id": "gcp_cloud_functions", -// "note": none, "stability": "experimental", "value": "gcp_cloud_functions"} static constexpr const char *kGcpCloudFunctions = "gcp_cloud_functions"; + /** - * Google Cloud App Engine (GAE). + * Google Cloud App Engine (GAE) */ -// DEBUG: {"brief": "Google Cloud App Engine (GAE)", "deprecated": none, "id": "gcp_app_engine", -// "note": none, "stability": "experimental", "value": "gcp_app_engine"} static constexpr const char *kGcpAppEngine = "gcp_app_engine"; + /** - * Red Hat OpenShift on Google Cloud. + * Red Hat OpenShift on Google Cloud */ -// DEBUG: {"brief": "Red Hat OpenShift on Google Cloud", "deprecated": none, "id": "gcp_openshift", -// "note": none, "stability": "experimental", "value": "gcp_openshift"} static constexpr const char *kGcpOpenshift = "gcp_openshift"; + /** - * Red Hat OpenShift on IBM Cloud. + * Red Hat OpenShift on IBM Cloud */ -// DEBUG: {"brief": "Red Hat OpenShift on IBM Cloud", "deprecated": none, "id": -// "ibm_cloud_openshift", "note": none, "stability": "experimental", "value": "ibm_cloud_openshift"} static constexpr const char *kIbmCloudOpenshift = "ibm_cloud_openshift"; + /** - * Tencent Cloud Cloud Virtual Machine (CVM). + * Tencent Cloud Cloud Virtual Machine (CVM) */ -// DEBUG: {"brief": "Tencent Cloud Cloud Virtual Machine (CVM)", "deprecated": none, "id": -// "tencent_cloud_cvm", "note": none, "stability": "experimental", "value": "tencent_cloud_cvm"} static constexpr const char *kTencentCloudCvm = "tencent_cloud_cvm"; + /** - * Tencent Cloud Elastic Kubernetes Service (EKS). + * Tencent Cloud Elastic Kubernetes Service (EKS) */ -// DEBUG: {"brief": "Tencent Cloud Elastic Kubernetes Service (EKS)", "deprecated": none, "id": -// "tencent_cloud_eks", "note": none, "stability": "experimental", "value": "tencent_cloud_eks"} static constexpr const char *kTencentCloudEks = "tencent_cloud_eks"; + /** - * Tencent Cloud Serverless Cloud Function (SCF). + * Tencent Cloud Serverless Cloud Function (SCF) */ -// DEBUG: {"brief": "Tencent Cloud Serverless Cloud Function (SCF)", "deprecated": none, "id": -// "tencent_cloud_scf", "note": none, "stability": "experimental", "value": "tencent_cloud_scf"} static constexpr const char *kTencentCloudScf = "tencent_cloud_scf"; + } // namespace CloudPlatformValues -// DEBUG: {"brief": "Name of the cloud provider.\n", "name": "cloud.provider", "requirement_level": -// "recommended", "root_namespace": "cloud", "stability": "experimental", "type": -// {"allow_custom_values": true, "members": [{"brief": "Alibaba Cloud", "deprecated": none, "id": -// "alibaba_cloud", "note": none, "stability": "experimental", "value": "alibaba_cloud"}, {"brief": -// "Amazon Web Services", "deprecated": none, "id": "aws", "note": none, "stability": -// "experimental", "value": "aws"}, {"brief": "Microsoft Azure", "deprecated": none, "id": "azure", -// "note": none, "stability": "experimental", "value": "azure"}, {"brief": "Google Cloud Platform", -// "deprecated": none, "id": "gcp", "note": none, "stability": "experimental", "value": "gcp"}, -// {"brief": "Heroku Platform as a Service", "deprecated": none, "id": "heroku", "note": none, -// "stability": "experimental", "value": "heroku"}, {"brief": "IBM Cloud", "deprecated": none, "id": -// "ibm_cloud", "note": none, "stability": "experimental", "value": "ibm_cloud"}, {"brief": "Tencent -// Cloud", "deprecated": none, "id": "tencent_cloud", "note": none, "stability": "experimental", -// "value": "tencent_cloud"}]}} namespace CloudProviderValues { /** - * Alibaba Cloud. + * Alibaba Cloud */ -// DEBUG: {"brief": "Alibaba Cloud", "deprecated": none, "id": "alibaba_cloud", "note": none, -// "stability": "experimental", "value": "alibaba_cloud"} static constexpr const char *kAlibabaCloud = "alibaba_cloud"; + /** - * Amazon Web Services. + * Amazon Web Services */ -// DEBUG: {"brief": "Amazon Web Services", "deprecated": none, "id": "aws", "note": none, -// "stability": "experimental", "value": "aws"} static constexpr const char *kAws = "aws"; + /** - * Microsoft Azure. + * Microsoft Azure */ -// DEBUG: {"brief": "Microsoft Azure", "deprecated": none, "id": "azure", "note": none, "stability": -// "experimental", "value": "azure"} static constexpr const char *kAzure = "azure"; + /** - * Google Cloud Platform. + * Google Cloud Platform */ -// DEBUG: {"brief": "Google Cloud Platform", "deprecated": none, "id": "gcp", "note": none, -// "stability": "experimental", "value": "gcp"} static constexpr const char *kGcp = "gcp"; + /** - * Heroku Platform as a Service. + * Heroku Platform as a Service */ -// DEBUG: {"brief": "Heroku Platform as a Service", "deprecated": none, "id": "heroku", "note": -// none, "stability": "experimental", "value": "heroku"} static constexpr const char *kHeroku = "heroku"; + /** - * IBM Cloud. + * IBM Cloud */ -// DEBUG: {"brief": "IBM Cloud", "deprecated": none, "id": "ibm_cloud", "note": none, "stability": -// "experimental", "value": "ibm_cloud"} static constexpr const char *kIbmCloud = "ibm_cloud"; + /** - * Tencent Cloud. + * Tencent Cloud */ -// DEBUG: {"brief": "Tencent Cloud", "deprecated": none, "id": "tencent_cloud", "note": none, -// "stability": "experimental", "value": "tencent_cloud"} static constexpr const char *kTencentCloud = "tencent_cloud"; + } // namespace CloudProviderValues } // namespace cloud diff --git a/api/include/opentelemetry/semconv/incubating/attributes/cloudevents_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/cloudevents_attributes.h index ca70d2d2d9..363feed157 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/cloudevents_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/cloudevents_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -25,35 +23,35 @@ namespace cloudevents * The event_id * uniquely identifies the event. */ -static const char *kCloudeventsEventId = "cloudevents.event_id"; +static constexpr const char *kCloudeventsEventId = "cloudevents.event_id"; /** * The source * identifies the context in which an event happened. */ -static const char *kCloudeventsEventSource = "cloudevents.event_source"; +static constexpr const char *kCloudeventsEventSource = "cloudevents.event_source"; /** * The version of * the CloudEvents specification which the event uses. */ -static const char *kCloudeventsEventSpecVersion = "cloudevents.event_spec_version"; +static constexpr const char *kCloudeventsEventSpecVersion = "cloudevents.event_spec_version"; /** * The subject of * the event in the context of the event producer (identified by source). */ -static const char *kCloudeventsEventSubject = "cloudevents.event_subject"; +static constexpr const char *kCloudeventsEventSubject = "cloudevents.event_subject"; /** * The event_type * contains a value describing the type of event related to the originating occurrence. */ -static const char *kCloudeventsEventType = "cloudevents.event_type"; +static constexpr const char *kCloudeventsEventType = "cloudevents.event_type"; } // namespace cloudevents } // namespace semconv diff --git a/api/include/opentelemetry/semconv/incubating/attributes/code_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/code_attributes.h index 5a2fcdefd4..f2715e87b6 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/code_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/code_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -25,37 +23,37 @@ namespace code * The column number in @code code.filepath @endcode best representing the operation. It SHOULD * point within the code unit named in @code code.function @endcode. */ -static const char *kCodeColumn = "code.column"; +static constexpr const char *kCodeColumn = "code.column"; /** * The source code file name that identifies the code unit as uniquely as possible (preferably an * absolute file path). */ -static const char *kCodeFilepath = "code.filepath"; +static constexpr const char *kCodeFilepath = "code.filepath"; /** * The method or function name, or equivalent (usually rightmost part of the code unit's name). */ -static const char *kCodeFunction = "code.function"; +static constexpr const char *kCodeFunction = "code.function"; /** * The line number in @code code.filepath @endcode best representing the operation. It SHOULD point * within the code unit named in @code code.function @endcode. */ -static const char *kCodeLineno = "code.lineno"; +static constexpr const char *kCodeLineno = "code.lineno"; /** * The "namespace" within which @code code.function @endcode is defined. Usually the qualified class * or module name, such that @code code.namespace @endcode + some separator + @code code.function * @endcode form a unique identifier for the code unit. */ -static const char *kCodeNamespace = "code.namespace"; +static constexpr const char *kCodeNamespace = "code.namespace"; /** * A stacktrace as a string in the natural representation for the language runtime. The * representation is to be determined and documented by each language SIG. */ -static const char *kCodeStacktrace = "code.stacktrace"; +static constexpr const char *kCodeStacktrace = "code.stacktrace"; } // namespace code } // namespace semconv diff --git a/api/include/opentelemetry/semconv/incubating/attributes/container_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/container_attributes.h index beb5bf684a..5bd1118c3b 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/container_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/container_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -23,37 +21,43 @@ namespace container /** * The command used to run the container (i.e. the command name). - * Note: If using embedded credentials or sensitive data, it is recommended to remove them to - * prevent potential leakage. + *

+ * If using embedded credentials or sensitive data, it is recommended to remove them to prevent + * potential leakage. */ -static const char *kContainerCommand = "container.command"; +static constexpr const char *kContainerCommand = "container.command"; /** - * All the command arguments (including the command/executable itself) run by the container. [2]. + * All the command arguments (including the command/executable itself) run by the container. [2] */ -static const char *kContainerCommandArgs = "container.command_args"; +static constexpr const char *kContainerCommandArgs = "container.command_args"; /** - * The full command run by the container as a single string representing the full command. [2]. + * The full command run by the container as a single string representing the full command. [2] */ -static const char *kContainerCommandLine = "container.command_line"; +static constexpr const char *kContainerCommandLine = "container.command_line"; /** - * @Deprecated: Replaced by @code cpu.mode @endcode. + * Deprecated, use @code cpu.mode @endcode instead. + *

+ * @deprecated + * Replaced by @code cpu.mode @endcode */ -static const char *kContainerCpuState = "container.cpu.state"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kContainerCpuState = "container.cpu.state"; /** * Container ID. Usually a UUID, as for example used to identify Docker * containers. The UUID might be abbreviated. */ -static const char *kContainerId = "container.id"; +static constexpr const char *kContainerId = "container.id"; /** * Runtime specific image identifier. Usually a hash algorithm followed by a UUID. - * Note: Docker defines a sha256 of the image id; @code container.image.id @endcode corresponds to - * the @code Image @endcode field from the Docker container inspect + * Docker defines a sha256 of the image id; @code container.image.id @endcode corresponds to the + * @code Image @endcode field from the Docker container inspect API * endpoint. K8s defines a link to the container registry repository with digest @code "imageID": * "registry.azurecr.io @@ -62,22 +66,22 @@ static const char *kContainerId = "container.id"; * Consider using @code oci.manifest.digest @endcode if it is important to identify the same image * in different environments/runtimes. */ -static const char *kContainerImageId = "container.image.id"; +static constexpr const char *kContainerImageId = "container.image.id"; /** * Name of the image the container was built on. */ -static const char *kContainerImageName = "container.image.name"; +static constexpr const char *kContainerImageName = "container.image.name"; /** * Repo digests of the container image as provided by the container runtime. - * Note: Docker and - * + * Docker + * and CRI * report those under the @code RepoDigests @endcode field. */ -static const char *kContainerImageRepoDigests = "container.image.repo_digests"; +static constexpr const char *kContainerImageRepoDigests = "container.image.repo_digests"; /** * Container image tags. An example can be found in . Should be only the @code @endcode section of the full name for example from * @code registry.example.com/my-org/my-image: @endcode. */ -static const char *kContainerImageTags = "container.image.tags"; +static constexpr const char *kContainerImageTags = "container.image.tags"; /** * Container labels, @code @endcode being the label name, the value being the label value. */ -static const char *kContainerLabel = "container.label"; +static constexpr const char *kContainerLabel = "container.label"; /** - * @Deprecated: Replaced by @code container.label @endcode. + * Deprecated, use @code container.label @endcode instead. + *

+ * @deprecated + * Replaced by @code container.label @endcode. */ -static const char *kContainerLabels = "container.labels"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kContainerLabels = "container.labels"; /** * Container name used by container runtime. */ -static const char *kContainerName = "container.name"; +static constexpr const char *kContainerName = "container.name"; /** * The container runtime managing this container. */ -static const char *kContainerRuntime = "container.runtime"; - -// @deprecated(reason="The attribute container.cpu.state is deprecated - Replaced by `cpu.mode`") # -// type: ignore DEBUG: {"brief": "Deprecated, use `cpu.mode` instead.", "deprecated": "Replaced by -// `cpu.mode`", "examples": ["user", "kernel"], "name": "container.cpu.state", "requirement_level": -// "recommended", "root_namespace": "container", "stability": "experimental", "type": -// {"allow_custom_values": true, "members": [{"brief": "When tasks of the cgroup are in user mode -// (Linux). When all container processes are in user mode (Windows).", "deprecated": none, "id": -// "user", "note": none, "stability": "experimental", "value": "user"}, {"brief": "When CPU is used -// by the system (host OS)", "deprecated": none, "id": "system", "note": none, "stability": -// "experimental", "value": "system"}, {"brief": "When tasks of the cgroup are in kernel mode -// (Linux). When all container processes are in kernel mode (Windows).", "deprecated": none, "id": -// "kernel", "note": none, "stability": "experimental", "value": "kernel"}]}} +static constexpr const char *kContainerRuntime = "container.runtime"; + namespace ContainerCpuStateValues { /** * When tasks of the cgroup are in user mode (Linux). When all container processes are in user mode * (Windows). */ -// DEBUG: {"brief": "When tasks of the cgroup are in user mode (Linux). When all container processes -// are in user mode (Windows).", "deprecated": none, "id": "user", "note": none, "stability": -// "experimental", "value": "user"} static constexpr const char *kUser = "user"; + /** - * When CPU is used by the system (host OS). + * When CPU is used by the system (host OS) */ -// DEBUG: {"brief": "When CPU is used by the system (host OS)", "deprecated": none, "id": "system", -// "note": none, "stability": "experimental", "value": "system"} static constexpr const char *kSystem = "system"; + /** * When tasks of the cgroup are in kernel mode (Linux). When all container processes are in kernel * mode (Windows). */ -// DEBUG: {"brief": "When tasks of the cgroup are in kernel mode (Linux). When all container -// processes are in kernel mode (Windows).", "deprecated": none, "id": "kernel", "note": none, -// "stability": "experimental", "value": "kernel"} static constexpr const char *kKernel = "kernel"; + } // namespace ContainerCpuStateValues } // namespace container diff --git a/api/include/opentelemetry/semconv/incubating/attributes/cpu_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/cpu_attributes.h index 7298e3929c..b5ca637e31 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/cpu_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/cpu_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -22,73 +20,52 @@ namespace cpu { /** - * The mode of the CPU. + * The mode of the CPU */ -static const char *kCpuMode = "cpu.mode"; +static constexpr const char *kCpuMode = "cpu.mode"; -// DEBUG: {"brief": "The mode of the CPU", "examples": ["user", "system"], "name": "cpu.mode", -// "requirement_level": "recommended", "root_namespace": "cpu", "stability": "experimental", "type": -// {"allow_custom_values": true, "members": [{"brief": none, "deprecated": none, "id": "user", -// "note": none, "stability": "experimental", "value": "user"}, {"brief": none, "deprecated": none, -// "id": "system", "note": none, "stability": "experimental", "value": "system"}, {"brief": none, -// "deprecated": none, "id": "nice", "note": none, "stability": "experimental", "value": "nice"}, -// {"brief": none, "deprecated": none, "id": "idle", "note": none, "stability": "experimental", -// "value": "idle"}, {"brief": none, "deprecated": none, "id": "iowait", "note": none, "stability": -// "experimental", "value": "iowait"}, {"brief": none, "deprecated": none, "id": "interrupt", -// "note": none, "stability": "experimental", "value": "interrupt"}, {"brief": none, "deprecated": -// none, "id": "steal", "note": none, "stability": "experimental", "value": "steal"}, {"brief": -// none, "deprecated": none, "id": "kernel", "note": none, "stability": "experimental", "value": -// "kernel"}]}} namespace CpuModeValues { /** - * user. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "user", "note": none, "stability": -// "experimental", "value": "user"} static constexpr const char *kUser = "user"; + /** - * system. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "system", "note": none, "stability": -// "experimental", "value": "system"} static constexpr const char *kSystem = "system"; + /** - * nice. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "nice", "note": none, "stability": -// "experimental", "value": "nice"} static constexpr const char *kNice = "nice"; + /** - * idle. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "idle", "note": none, "stability": -// "experimental", "value": "idle"} static constexpr const char *kIdle = "idle"; + /** - * iowait. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "iowait", "note": none, "stability": -// "experimental", "value": "iowait"} static constexpr const char *kIowait = "iowait"; + /** - * interrupt. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "interrupt", "note": none, "stability": -// "experimental", "value": "interrupt"} static constexpr const char *kInterrupt = "interrupt"; + /** - * steal. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "steal", "note": none, "stability": -// "experimental", "value": "steal"} static constexpr const char *kSteal = "steal"; + /** - * kernel. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "kernel", "note": none, "stability": -// "experimental", "value": "kernel"} static constexpr const char *kKernel = "kernel"; + } // namespace CpuModeValues } // namespace cpu diff --git a/api/include/opentelemetry/semconv/incubating/attributes/db_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/db_attributes.h index 19137c8747..940f88b7da 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/db_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/db_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -25,39 +23,43 @@ namespace db * The consistency level of the query. Based on consistency values from CQL. */ -static const char *kDbCassandraConsistencyLevel = "db.cassandra.consistency_level"; +static constexpr const char *kDbCassandraConsistencyLevel = "db.cassandra.consistency_level"; /** * The data center of the coordinating node for a query. */ -static const char *kDbCassandraCoordinatorDc = "db.cassandra.coordinator.dc"; +static constexpr const char *kDbCassandraCoordinatorDc = "db.cassandra.coordinator.dc"; /** * The ID of the coordinating node for a query. */ -static const char *kDbCassandraCoordinatorId = "db.cassandra.coordinator.id"; +static constexpr const char *kDbCassandraCoordinatorId = "db.cassandra.coordinator.id"; /** * Whether or not the query is idempotent. */ -static const char *kDbCassandraIdempotence = "db.cassandra.idempotence"; +static constexpr const char *kDbCassandraIdempotence = "db.cassandra.idempotence"; /** * The fetch size used for paging, i.e. how many rows will be returned at once. */ -static const char *kDbCassandraPageSize = "db.cassandra.page_size"; +static constexpr const char *kDbCassandraPageSize = "db.cassandra.page_size"; /** * The number of times a query was speculatively executed. Not set or @code 0 @endcode if the query * was not executed speculatively. */ -static const char *kDbCassandraSpeculativeExecutionCount = +static constexpr const char *kDbCassandraSpeculativeExecutionCount = "db.cassandra.speculative_execution_count"; /** - * @Deprecated: Replaced by @code db.collection.name @endcode. + * Deprecated, use @code db.collection.name @endcode instead. + *

+ * @deprecated + * Replaced by @code db.collection.name @endcode. */ -static const char *kDbCassandraTable = "db.cassandra.table"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kDbCassandraTable = "db.cassandra.table"; /** * The name of the connection pool; unique within the instrumented application. In case the @@ -67,173 +69,222 @@ static const char *kDbCassandraTable = "db.cassandra.table"; * as @code server.address:server.port/db.namespace @endcode. Instrumentations that generate * connection pool name following different patterns SHOULD document it. */ -static const char *kDbClientConnectionPoolName = "db.client.connection.pool.name"; +static constexpr const char *kDbClientConnectionPoolName = "db.client.connection.pool.name"; /** - * The state of a connection in the pool. + * The state of a connection in the pool */ -static const char *kDbClientConnectionState = "db.client.connection.state"; +static constexpr const char *kDbClientConnectionState = "db.client.connection.state"; /** - * @Deprecated: Replaced by @code db.client.connection.pool.name @endcode. + * Deprecated, use @code db.client.connection.pool.name @endcode instead. + *

+ * @deprecated + * Replaced by @code db.client.connection.pool.name @endcode. */ -static const char *kDbClientConnectionsPoolName = "db.client.connections.pool.name"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kDbClientConnectionsPoolName = "db.client.connections.pool.name"; /** - * @Deprecated: Replaced by @code db.client.connection.state @endcode. + * Deprecated, use @code db.client.connection.state @endcode instead. + *

+ * @deprecated + * Replaced by @code db.client.connection.state @endcode. */ -static const char *kDbClientConnectionsState = "db.client.connections.state"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kDbClientConnectionsState = "db.client.connections.state"; /** * The name of a collection (table, container) within the database. - * Note: It is RECOMMENDED to capture the value as provided by the application without attempting to - * do any case normalization. If the collection name is parsed from the query text, it SHOULD be the + *

+ * It is RECOMMENDED to capture the value as provided by the application without attempting to do + * any case normalization. If the collection name is parsed from the query text, it SHOULD be the * first collection name found in the query and it SHOULD match the value provided in the query text * including any schema and database name prefix. For batch operations, if the individual operations * are known to have the same collection name then that collection name SHOULD be used, otherwise * @code db.collection.name @endcode SHOULD NOT be captured. */ -static const char *kDbCollectionName = "db.collection.name"; +static constexpr const char *kDbCollectionName = "db.collection.name"; /** - * @Deprecated: "Replaced by @code server.address @endcode and @code server.port @endcode.". + * Deprecated, use @code server.address @endcode, @code server.port @endcode attributes instead. + *

+ * @deprecated + * "Replaced by @code server.address @endcode and @code server.port @endcode." */ -static const char *kDbConnectionString = "db.connection_string"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kDbConnectionString = "db.connection_string"; /** * Unique Cosmos client instance id. */ -static const char *kDbCosmosdbClientId = "db.cosmosdb.client_id"; +static constexpr const char *kDbCosmosdbClientId = "db.cosmosdb.client_id"; /** * Cosmos client connection mode. */ -static const char *kDbCosmosdbConnectionMode = "db.cosmosdb.connection_mode"; +static constexpr const char *kDbCosmosdbConnectionMode = "db.cosmosdb.connection_mode"; /** - * @Deprecated: Replaced by @code db.collection.name @endcode. + * Deprecated, use @code db.collection.name @endcode instead. + *

+ * @deprecated + * Replaced by @code db.collection.name @endcode. */ -static const char *kDbCosmosdbContainer = "db.cosmosdb.container"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kDbCosmosdbContainer = "db.cosmosdb.container"; /** * CosmosDB Operation Type. */ -static const char *kDbCosmosdbOperationType = "db.cosmosdb.operation_type"; +static constexpr const char *kDbCosmosdbOperationType = "db.cosmosdb.operation_type"; /** - * RU consumed for that operation. + * RU consumed for that operation */ -static const char *kDbCosmosdbRequestCharge = "db.cosmosdb.request_charge"; +static constexpr const char *kDbCosmosdbRequestCharge = "db.cosmosdb.request_charge"; /** - * Request payload size in bytes. + * Request payload size in bytes */ -static const char *kDbCosmosdbRequestContentLength = "db.cosmosdb.request_content_length"; +static constexpr const char *kDbCosmosdbRequestContentLength = "db.cosmosdb.request_content_length"; /** * Cosmos DB status code. */ -static const char *kDbCosmosdbStatusCode = "db.cosmosdb.status_code"; +static constexpr const char *kDbCosmosdbStatusCode = "db.cosmosdb.status_code"; /** * Cosmos DB sub status code. */ -static const char *kDbCosmosdbSubStatusCode = "db.cosmosdb.sub_status_code"; +static constexpr const char *kDbCosmosdbSubStatusCode = "db.cosmosdb.sub_status_code"; /** - * @Deprecated: Replaced by @code db.namespace @endcode. + * Deprecated, use @code db.namespace @endcode instead. + *

+ * @deprecated + * Replaced by @code db.namespace @endcode. */ -static const char *kDbElasticsearchClusterName = "db.elasticsearch.cluster.name"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kDbElasticsearchClusterName = "db.elasticsearch.cluster.name"; /** * Represents the human-readable identifier of the node/instance to which a request was routed. */ -static const char *kDbElasticsearchNodeName = "db.elasticsearch.node.name"; +static constexpr const char *kDbElasticsearchNodeName = "db.elasticsearch.node.name"; /** * A dynamic value in the url path. - * Note: Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span - * attributes in the format @code db.elasticsearch.path_parts. @endcode, where @code - * @endcode is the url path part name. The implementation SHOULD reference the + * Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in + * the format @code db.elasticsearch.path_parts. @endcode, where @code @endcode is the + * url path part name. The implementation SHOULD reference the elasticsearch * schema in order to map the path part values to their names. */ -static const char *kDbElasticsearchPathParts = "db.elasticsearch.path_parts"; +static constexpr const char *kDbElasticsearchPathParts = "db.elasticsearch.path_parts"; /** - * @Deprecated: Deprecated, no general replacement at this time. For Elasticsearch, use @code + * Deprecated, no general replacement at this time. For Elasticsearch, use @code + * db.elasticsearch.node.name @endcode instead.

+ * @deprecated + * Deprecated, no general replacement at this time. For Elasticsearch, use @code * db.elasticsearch.node.name @endcode instead. */ -static const char *kDbInstanceId = "db.instance.id"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kDbInstanceId = "db.instance.id"; /** - * @Deprecated: Removed as not used. + * Removed, no replacement at this time. + *

+ * @deprecated + * Removed as not used. */ -static const char *kDbJdbcDriverClassname = "db.jdbc.driver_classname"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kDbJdbcDriverClassname = "db.jdbc.driver_classname"; /** - * @Deprecated: Replaced by @code db.collection.name @endcode. + * Deprecated, use @code db.collection.name @endcode instead. + *

+ * @deprecated + * Replaced by @code db.collection.name @endcode. */ -static const char *kDbMongodbCollection = "db.mongodb.collection"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kDbMongodbCollection = "db.mongodb.collection"; /** - * @Deprecated: Deprecated, no replacement at this time. + * Deprecated, SQL Server instance is now populated as a part of @code db.namespace @endcode + * attribute.

+ * @deprecated + * Deprecated, no replacement at this time. */ -static const char *kDbMssqlInstanceName = "db.mssql.instance_name"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kDbMssqlInstanceName = "db.mssql.instance_name"; /** - * @Deprecated: Replaced by @code db.namespace @endcode. + * Deprecated, use @code db.namespace @endcode instead. + *

+ * @deprecated + * Replaced by @code db.namespace @endcode. */ -static const char *kDbName = "db.name"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kDbName = "db.name"; /** * The name of the database, fully qualified within the server address and port. - * Note: If a database system has multiple namespace components, they SHOULD be concatenated - * (potentially using database system specific conventions) from most general to most specific - * namespace component, and more specific namespaces SHOULD NOT be captured without the more general + *

+ * If a database system has multiple namespace components, they SHOULD be concatenated (potentially + * using database system specific conventions) from most general to most specific namespace + * component, and more specific namespaces SHOULD NOT be captured without the more general * namespaces, to ensure that "startswith" queries for the more general namespaces will be valid. * Semantic conventions for individual database systems SHOULD document what @code db.namespace * @endcode means in the context of that system. It is RECOMMENDED to capture the value as provided * by the application without attempting to do any case normalization. */ -static const char *kDbNamespace = "db.namespace"; +static constexpr const char *kDbNamespace = "db.namespace"; /** - * @Deprecated: Replaced by @code db.operation.name @endcode. + * Deprecated, use @code db.operation.name @endcode instead. + *

+ * @deprecated + * Replaced by @code db.operation.name @endcode. */ -static const char *kDbOperation = "db.operation"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kDbOperation = "db.operation"; /** * The number of queries included in a batch operation. Note: Operations - * are only considered batches when they contain two or more operations, and so @code + * href="/docs/database/database-spans.md#batch-operations">batch operation.

Operations are + * only considered batches when they contain two or more operations, and so @code * db.operation.batch.size @endcode SHOULD never be @code 1 @endcode. */ -static const char *kDbOperationBatchSize = "db.operation.batch.size"; +static constexpr const char *kDbOperationBatchSize = "db.operation.batch.size"; /** * The name of the operation or command being executed. - * Note: It is RECOMMENDED to capture the value as provided by the application without attempting to - * do any case normalization. If the operation name is parsed from the query text, it SHOULD be the + *

+ * It is RECOMMENDED to capture the value as provided by the application without attempting to do + * any case normalization. If the operation name is parsed from the query text, it SHOULD be the * first operation name found in the query. For batch operations, if the individual operations are * known to have the same operation name then that operation name SHOULD be used prepended by @code * BATCH @endcode, otherwise @code db.operation.name @endcode SHOULD be @code BATCH @endcode or * some other database system specific term if more applicable. */ -static const char *kDbOperationName = "db.operation.name"; +static constexpr const char *kDbOperationName = "db.operation.name"; /** * A query parameter used in @code db.query.text @endcode, with @code @endcode being the - * parameter name, and the attribute value being a string representation of the parameter value. - * Note: Query parameters should only be captured when @code db.query.text @endcode is parameterized - * with placeholders. If a parameter has no name and instead is referenced only by index, then @code + * parameter name, and the attribute value being a string representation of the parameter value.

+ * Query parameters should only be captured when @code db.query.text @endcode is parameterized with + * placeholders. If a parameter has no name and instead is referenced only by index, then @code * @endcode SHOULD be the 0-based index. */ -static const char *kDbQueryParameter = "db.query.parameter"; +static constexpr const char *kDbQueryParameter = "db.query.parameter"; /** * The database query being executed. - * Note: For sanitization see + * For sanitization see Sanitization of @code * db.query.text @endcode. For batch operations, if the individual operations are known to have * the same query text then that query text SHOULD be used, otherwise all of the individual query @@ -243,720 +294,525 @@ static const char *kDbQueryParameter = "db.query.parameter"; * sensitive data will be passed as parameter values, and the benefit to observability of capturing * the static part of the query text by default outweighs the risk. */ -static const char *kDbQueryText = "db.query.text"; +static constexpr const char *kDbQueryText = "db.query.text"; /** - * @Deprecated: Replaced by @code db.namespace @endcode. + * Deprecated, use @code db.namespace @endcode instead. + *

+ * @deprecated + * Replaced by @code db.namespace @endcode. */ -static const char *kDbRedisDatabaseIndex = "db.redis.database_index"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kDbRedisDatabaseIndex = "db.redis.database_index"; /** - * @Deprecated: Replaced by @code db.collection.name @endcode. + * Deprecated, use @code db.collection.name @endcode instead. + *

+ * @deprecated + * Replaced by @code db.collection.name @endcode. */ -static const char *kDbSqlTable = "db.sql.table"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kDbSqlTable = "db.sql.table"; /** - * @Deprecated: Replaced by @code db.query.text @endcode. + * The database statement being executed. + *

+ * @deprecated + * Replaced by @code db.query.text @endcode. */ -static const char *kDbStatement = "db.statement"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kDbStatement = "db.statement"; /** * The database management system (DBMS) product as identified by the client instrumentation. - * Note: The actual DBMS may differ from the one identified by the client. For example, when using + *

+ * The actual DBMS may differ from the one identified by the client. For example, when using * PostgreSQL client libraries to connect to a CockroachDB, the @code db.system @endcode is set to * @code postgresql @endcode based on the instrumentation's best knowledge. */ -static const char *kDbSystem = "db.system"; - -/** - * @Deprecated: No replacement at this time. - */ -static const char *kDbUser = "db.user"; - -// DEBUG: {"brief": "The consistency level of the query. Based on consistency values from -// [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html).\n", -// "name": "db.cassandra.consistency_level", "requirement_level": "recommended", "root_namespace": -// "db", "stability": "experimental", "type": {"allow_custom_values": true, "members": [{"brief": -// none, "deprecated": none, "id": "all", "note": none, "stability": "experimental", "value": -// "all"}, {"brief": none, "deprecated": none, "id": "each_quorum", "note": none, "stability": -// "experimental", "value": "each_quorum"}, {"brief": none, "deprecated": none, "id": "quorum", -// "note": none, "stability": "experimental", "value": "quorum"}, {"brief": none, "deprecated": -// none, "id": "local_quorum", "note": none, "stability": "experimental", "value": "local_quorum"}, -// {"brief": none, "deprecated": none, "id": "one", "note": none, "stability": "experimental", -// "value": "one"}, {"brief": none, "deprecated": none, "id": "two", "note": none, "stability": -// "experimental", "value": "two"}, {"brief": none, "deprecated": none, "id": "three", "note": none, -// "stability": "experimental", "value": "three"}, {"brief": none, "deprecated": none, "id": -// "local_one", "note": none, "stability": "experimental", "value": "local_one"}, {"brief": none, -// "deprecated": none, "id": "any", "note": none, "stability": "experimental", "value": "any"}, -// {"brief": none, "deprecated": none, "id": "serial", "note": none, "stability": "experimental", -// "value": "serial"}, {"brief": none, "deprecated": none, "id": "local_serial", "note": none, -// "stability": "experimental", "value": "local_serial"}]}} +static constexpr const char *kDbSystem = "db.system"; + +/** + * Deprecated, no replacement at this time. + *

+ * @deprecated + * No replacement at this time. + */ +OPENTELEMETRY_DEPRECATED +static constexpr const char *kDbUser = "db.user"; + namespace DbCassandraConsistencyLevelValues { /** - * all. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "all", "note": none, "stability": -// "experimental", "value": "all"} static constexpr const char *kAll = "all"; + /** - * each_quorum. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "each_quorum", "note": none, "stability": -// "experimental", "value": "each_quorum"} static constexpr const char *kEachQuorum = "each_quorum"; + /** - * quorum. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "quorum", "note": none, "stability": -// "experimental", "value": "quorum"} static constexpr const char *kQuorum = "quorum"; + /** - * local_quorum. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "local_quorum", "note": none, "stability": -// "experimental", "value": "local_quorum"} static constexpr const char *kLocalQuorum = "local_quorum"; + /** - * one. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "one", "note": none, "stability": -// "experimental", "value": "one"} static constexpr const char *kOne = "one"; + /** - * two. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "two", "note": none, "stability": -// "experimental", "value": "two"} static constexpr const char *kTwo = "two"; + /** - * three. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "three", "note": none, "stability": -// "experimental", "value": "three"} static constexpr const char *kThree = "three"; + /** - * local_one. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "local_one", "note": none, "stability": -// "experimental", "value": "local_one"} static constexpr const char *kLocalOne = "local_one"; + /** - * any. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "any", "note": none, "stability": -// "experimental", "value": "any"} static constexpr const char *kAny = "any"; + /** - * serial. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "serial", "note": none, "stability": -// "experimental", "value": "serial"} static constexpr const char *kSerial = "serial"; + /** - * local_serial. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "local_serial", "note": none, "stability": -// "experimental", "value": "local_serial"} static constexpr const char *kLocalSerial = "local_serial"; + } // namespace DbCassandraConsistencyLevelValues -// DEBUG: {"brief": "The state of a connection in the pool", "examples": ["idle"], "name": -// "db.client.connection.state", "requirement_level": "recommended", "root_namespace": "db", -// "stability": "experimental", "type": {"allow_custom_values": true, "members": [{"brief": none, -// "deprecated": none, "id": "idle", "note": none, "stability": "experimental", "value": "idle"}, -// {"brief": none, "deprecated": none, "id": "used", "note": none, "stability": "experimental", -// "value": "used"}]}} namespace DbClientConnectionStateValues { /** - * idle. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "idle", "note": none, "stability": -// "experimental", "value": "idle"} static constexpr const char *kIdle = "idle"; + /** - * used. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "used", "note": none, "stability": -// "experimental", "value": "used"} static constexpr const char *kUsed = "used"; + } // namespace DbClientConnectionStateValues -// @deprecated(reason="The attribute db.client.connections.state is deprecated - Replaced by -// `db.client.connection.state`") # type: ignore DEBUG: {"brief": "Deprecated, use -// `db.client.connection.state` instead.", "deprecated": "Replaced by -// `db.client.connection.state`.", "examples": ["idle"], "name": "db.client.connections.state", -// "requirement_level": "recommended", "root_namespace": "db", "stability": "experimental", "type": -// {"allow_custom_values": true, "members": [{"brief": none, "deprecated": none, "id": "idle", -// "note": none, "stability": "experimental", "value": "idle"}, {"brief": none, "deprecated": none, -// "id": "used", "note": none, "stability": "experimental", "value": "used"}]}} namespace DbClientConnectionsStateValues { /** - * idle. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "idle", "note": none, "stability": -// "experimental", "value": "idle"} static constexpr const char *kIdle = "idle"; + /** - * used. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "used", "note": none, "stability": -// "experimental", "value": "used"} static constexpr const char *kUsed = "used"; + } // namespace DbClientConnectionsStateValues -// DEBUG: {"brief": "Cosmos client connection mode.", "name": "db.cosmosdb.connection_mode", -// "requirement_level": "recommended", "root_namespace": "db", "stability": "experimental", "type": -// {"allow_custom_values": true, "members": [{"brief": "Gateway (HTTP) connections mode", -// "deprecated": none, "id": "gateway", "note": none, "stability": "experimental", "value": -// "gateway"}, {"brief": "Direct connection.", "deprecated": none, "id": "direct", "note": none, -// "stability": "experimental", "value": "direct"}]}} namespace DbCosmosdbConnectionModeValues { /** - * Gateway (HTTP) connections mode. + * Gateway (HTTP) connections mode */ -// DEBUG: {"brief": "Gateway (HTTP) connections mode", "deprecated": none, "id": "gateway", "note": -// none, "stability": "experimental", "value": "gateway"} static constexpr const char *kGateway = "gateway"; + /** * Direct connection. */ -// DEBUG: {"brief": "Direct connection.", "deprecated": none, "id": "direct", "note": none, -// "stability": "experimental", "value": "direct"} static constexpr const char *kDirect = "direct"; + } // namespace DbCosmosdbConnectionModeValues -// DEBUG: {"brief": "CosmosDB Operation Type.", "name": "db.cosmosdb.operation_type", -// "requirement_level": "recommended", "root_namespace": "db", "stability": "experimental", "type": -// {"allow_custom_values": true, "members": [{"brief": none, "deprecated": none, "id": "invalid", -// "note": none, "stability": "experimental", "value": "Invalid"}, {"brief": none, "deprecated": -// none, "id": "create", "note": none, "stability": "experimental", "value": "Create"}, {"brief": -// none, "deprecated": none, "id": "patch", "note": none, "stability": "experimental", "value": -// "Patch"}, {"brief": none, "deprecated": none, "id": "read", "note": none, "stability": -// "experimental", "value": "Read"}, {"brief": none, "deprecated": none, "id": "read_feed", "note": -// none, "stability": "experimental", "value": "ReadFeed"}, {"brief": none, "deprecated": none, -// "id": "delete", "note": none, "stability": "experimental", "value": "Delete"}, {"brief": none, -// "deprecated": none, "id": "replace", "note": none, "stability": "experimental", "value": -// "Replace"}, {"brief": none, "deprecated": none, "id": "execute", "note": none, "stability": -// "experimental", "value": "Execute"}, {"brief": none, "deprecated": none, "id": "query", "note": -// none, "stability": "experimental", "value": "Query"}, {"brief": none, "deprecated": none, "id": -// "head", "note": none, "stability": "experimental", "value": "Head"}, {"brief": none, -// "deprecated": none, "id": "head_feed", "note": none, "stability": "experimental", "value": -// "HeadFeed"}, {"brief": none, "deprecated": none, "id": "upsert", "note": none, "stability": -// "experimental", "value": "Upsert"}, {"brief": none, "deprecated": none, "id": "batch", "note": -// none, "stability": "experimental", "value": "Batch"}, {"brief": none, "deprecated": none, "id": -// "query_plan", "note": none, "stability": "experimental", "value": "QueryPlan"}, {"brief": none, -// "deprecated": none, "id": "execute_javascript", "note": none, "stability": "experimental", -// "value": "ExecuteJavaScript"}]}} namespace DbCosmosdbOperationTypeValues { /** - * invalid. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "invalid", "note": none, "stability": -// "experimental", "value": "Invalid"} static constexpr const char *kInvalid = "Invalid"; + /** - * create. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "create", "note": none, "stability": -// "experimental", "value": "Create"} static constexpr const char *kCreate = "Create"; + /** - * patch. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "patch", "note": none, "stability": -// "experimental", "value": "Patch"} static constexpr const char *kPatch = "Patch"; + /** - * read. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "read", "note": none, "stability": -// "experimental", "value": "Read"} static constexpr const char *kRead = "Read"; + /** - * read_feed. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "read_feed", "note": none, "stability": -// "experimental", "value": "ReadFeed"} static constexpr const char *kReadFeed = "ReadFeed"; + /** - * delete. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "delete", "note": none, "stability": -// "experimental", "value": "Delete"} static constexpr const char *kDelete = "Delete"; + /** - * replace. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "replace", "note": none, "stability": -// "experimental", "value": "Replace"} static constexpr const char *kReplace = "Replace"; + /** - * execute. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "execute", "note": none, "stability": -// "experimental", "value": "Execute"} static constexpr const char *kExecute = "Execute"; + /** - * query. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "query", "note": none, "stability": -// "experimental", "value": "Query"} static constexpr const char *kQuery = "Query"; + /** - * head. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "head", "note": none, "stability": -// "experimental", "value": "Head"} static constexpr const char *kHead = "Head"; + /** - * head_feed. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "head_feed", "note": none, "stability": -// "experimental", "value": "HeadFeed"} static constexpr const char *kHeadFeed = "HeadFeed"; + /** - * upsert. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "upsert", "note": none, "stability": -// "experimental", "value": "Upsert"} static constexpr const char *kUpsert = "Upsert"; + /** - * batch. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "batch", "note": none, "stability": -// "experimental", "value": "Batch"} static constexpr const char *kBatch = "Batch"; + /** - * query_plan. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "query_plan", "note": none, "stability": -// "experimental", "value": "QueryPlan"} static constexpr const char *kQueryPlan = "QueryPlan"; + /** - * execute_javascript. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "execute_javascript", "note": none, "stability": -// "experimental", "value": "ExecuteJavaScript"} static constexpr const char *kExecuteJavascript = "ExecuteJavaScript"; + } // namespace DbCosmosdbOperationTypeValues -// DEBUG: {"brief": "The database management system (DBMS) product as identified by the client -// instrumentation.", "name": "db.system", "note": "The actual DBMS may differ from the one -// identified by the client. For example, when using PostgreSQL client libraries to connect to a -// CockroachDB, the `db.system` is set to `postgresql` based on the instrumentation's best -// knowledge.\n", "requirement_level": "recommended", "root_namespace": "db", "stability": -// "experimental", "type": {"allow_custom_values": true, "members": [{"brief": "Some other SQL -// database. Fallback only. See notes.", "deprecated": none, "id": "other_sql", "note": none, -// "stability": "experimental", "value": "other_sql"}, {"brief": "Adabas (Adaptable Database -// System)", "deprecated": none, "id": "adabas", "note": none, "stability": "experimental", "value": -// "adabas"}, {"brief": "Deprecated, use `intersystems_cache` instead.", "deprecated": "Replaced by -// `intersystems_cache`.", "id": "cache", "note": none, "stability": "experimental", "value": -// "cache"}, {"brief": "InterSystems Caché", "deprecated": none, "id": "intersystems_cache", "note": -// none, "stability": "experimental", "value": "intersystems_cache"}, {"brief": "Apache Cassandra", -// "deprecated": none, "id": "cassandra", "note": none, "stability": "experimental", "value": -// "cassandra"}, {"brief": "ClickHouse", "deprecated": none, "id": "clickhouse", "note": none, -// "stability": "experimental", "value": "clickhouse"}, {"brief": "Deprecated, use `other_sql` -// instead.", "deprecated": "Replaced by `other_sql`.", "id": "cloudscape", "note": none, -// "stability": "experimental", "value": "cloudscape"}, {"brief": "CockroachDB", "deprecated": none, -// "id": "cockroachdb", "note": none, "stability": "experimental", "value": "cockroachdb"}, -// {"brief": "Deprecated, no replacement at this time.", "deprecated": "Removed.", "id": -// "coldfusion", "note": none, "stability": "experimental", "value": "coldfusion"}, {"brief": -// "Microsoft Azure Cosmos DB", "deprecated": none, "id": "cosmosdb", "note": none, "stability": -// "experimental", "value": "cosmosdb"}, {"brief": "Couchbase", "deprecated": none, "id": -// "couchbase", "note": none, "stability": "experimental", "value": "couchbase"}, {"brief": -// "CouchDB", "deprecated": none, "id": "couchdb", "note": none, "stability": "experimental", -// "value": "couchdb"}, {"brief": "IBM Db2", "deprecated": none, "id": "db2", "note": none, -// "stability": "experimental", "value": "db2"}, {"brief": "Apache Derby", "deprecated": none, "id": -// "derby", "note": none, "stability": "experimental", "value": "derby"}, {"brief": "Amazon -// DynamoDB", "deprecated": none, "id": "dynamodb", "note": none, "stability": "experimental", -// "value": "dynamodb"}, {"brief": "EnterpriseDB", "deprecated": none, "id": "edb", "note": none, -// "stability": "experimental", "value": "edb"}, {"brief": "Elasticsearch", "deprecated": none, -// "id": "elasticsearch", "note": none, "stability": "experimental", "value": "elasticsearch"}, -// {"brief": "FileMaker", "deprecated": none, "id": "filemaker", "note": none, "stability": -// "experimental", "value": "filemaker"}, {"brief": "Firebird", "deprecated": none, "id": -// "firebird", "note": none, "stability": "experimental", "value": "firebird"}, {"brief": -// "Deprecated, use `other_sql` instead.", "deprecated": "Replaced by `other_sql`.", "id": -// "firstsql", "note": none, "stability": "experimental", "value": "firstsql"}, {"brief": "Apache -// Geode", "deprecated": none, "id": "geode", "note": none, "stability": "experimental", "value": -// "geode"}, {"brief": "H2", "deprecated": none, "id": "h2", "note": none, "stability": -// "experimental", "value": "h2"}, {"brief": "SAP HANA", "deprecated": none, "id": "hanadb", "note": -// none, "stability": "experimental", "value": "hanadb"}, {"brief": "Apache HBase", "deprecated": -// none, "id": "hbase", "note": none, "stability": "experimental", "value": "hbase"}, {"brief": -// "Apache Hive", "deprecated": none, "id": "hive", "note": none, "stability": "experimental", -// "value": "hive"}, {"brief": "HyperSQL DataBase", "deprecated": none, "id": "hsqldb", "note": -// none, "stability": "experimental", "value": "hsqldb"}, {"brief": "InfluxDB", "deprecated": none, -// "id": "influxdb", "note": none, "stability": "experimental", "value": "influxdb"}, {"brief": -// "Informix", "deprecated": none, "id": "informix", "note": none, "stability": "experimental", -// "value": "informix"}, {"brief": "Ingres", "deprecated": none, "id": "ingres", "note": none, -// "stability": "experimental", "value": "ingres"}, {"brief": "InstantDB", "deprecated": none, "id": -// "instantdb", "note": none, "stability": "experimental", "value": "instantdb"}, {"brief": -// "InterBase", "deprecated": none, "id": "interbase", "note": none, "stability": "experimental", -// "value": "interbase"}, {"brief": "MariaDB", "deprecated": none, "id": "mariadb", "note": none, -// "stability": "experimental", "value": "mariadb"}, {"brief": "SAP MaxDB", "deprecated": none, -// "id": "maxdb", "note": none, "stability": "experimental", "value": "maxdb"}, {"brief": -// "Memcached", "deprecated": none, "id": "memcached", "note": none, "stability": "experimental", -// "value": "memcached"}, {"brief": "MongoDB", "deprecated": none, "id": "mongodb", "note": none, -// "stability": "experimental", "value": "mongodb"}, {"brief": "Microsoft SQL Server", "deprecated": -// none, "id": "mssql", "note": none, "stability": "experimental", "value": "mssql"}, {"brief": -// "Deprecated, Microsoft SQL Server Compact is discontinued.", "deprecated": "Removed, use -// `other_sql` instead.", "id": "mssqlcompact", "note": none, "stability": "experimental", "value": -// "mssqlcompact"}, {"brief": "MySQL", "deprecated": none, "id": "mysql", "note": none, "stability": -// "experimental", "value": "mysql"}, {"brief": "Neo4j", "deprecated": none, "id": "neo4j", "note": -// none, "stability": "experimental", "value": "neo4j"}, {"brief": "Netezza", "deprecated": none, -// "id": "netezza", "note": none, "stability": "experimental", "value": "netezza"}, {"brief": -// "OpenSearch", "deprecated": none, "id": "opensearch", "note": none, "stability": "experimental", -// "value": "opensearch"}, {"brief": "Oracle Database", "deprecated": none, "id": "oracle", "note": -// none, "stability": "experimental", "value": "oracle"}, {"brief": "Pervasive PSQL", "deprecated": -// none, "id": "pervasive", "note": none, "stability": "experimental", "value": "pervasive"}, -// {"brief": "PointBase", "deprecated": none, "id": "pointbase", "note": none, "stability": -// "experimental", "value": "pointbase"}, {"brief": "PostgreSQL", "deprecated": none, "id": -// "postgresql", "note": none, "stability": "experimental", "value": "postgresql"}, {"brief": -// "Progress Database", "deprecated": none, "id": "progress", "note": none, "stability": -// "experimental", "value": "progress"}, {"brief": "Redis", "deprecated": none, "id": "redis", -// "note": none, "stability": "experimental", "value": "redis"}, {"brief": "Amazon Redshift", -// "deprecated": none, "id": "redshift", "note": none, "stability": "experimental", "value": -// "redshift"}, {"brief": "Cloud Spanner", "deprecated": none, "id": "spanner", "note": none, -// "stability": "experimental", "value": "spanner"}, {"brief": "SQLite", "deprecated": none, "id": -// "sqlite", "note": none, "stability": "experimental", "value": "sqlite"}, {"brief": "Sybase", -// "deprecated": none, "id": "sybase", "note": none, "stability": "experimental", "value": -// "sybase"}, {"brief": "Teradata", "deprecated": none, "id": "teradata", "note": none, "stability": -// "experimental", "value": "teradata"}, {"brief": "Trino", "deprecated": none, "id": "trino", -// "note": none, "stability": "experimental", "value": "trino"}, {"brief": "Vertica", "deprecated": -// none, "id": "vertica", "note": none, "stability": "experimental", "value": "vertica"}]}} namespace DbSystemValues { /** * Some other SQL database. Fallback only. See notes. */ -// DEBUG: {"brief": "Some other SQL database. Fallback only. See notes.", "deprecated": none, "id": -// "other_sql", "note": none, "stability": "experimental", "value": "other_sql"} static constexpr const char *kOtherSql = "other_sql"; + /** - * Adabas (Adaptable Database System). + * Adabas (Adaptable Database System) */ -// DEBUG: {"brief": "Adabas (Adaptable Database System)", "deprecated": none, "id": "adabas", -// "note": none, "stability": "experimental", "value": "adabas"} static constexpr const char *kAdabas = "adabas"; + /** - * @Deprecated: Replaced by @code intersystems_cache @endcode. + * Deprecated, use @code intersystems_cache @endcode instead. + *

+ * @deprecated + * Replaced by @code intersystems_cache @endcode. */ -// DEBUG: {"brief": "Deprecated, use `intersystems_cache` instead.", "deprecated": "Replaced by -// `intersystems_cache`.", "id": "cache", "note": none, "stability": "experimental", "value": -// "cache"} +OPENTELEMETRY_DEPRECATED static constexpr const char *kCache = "cache"; + /** - * InterSystems Caché. + * InterSystems Caché */ -// DEBUG: {"brief": "InterSystems Caché", "deprecated": none, "id": "intersystems_cache", "note": -// none, "stability": "experimental", "value": "intersystems_cache"} static constexpr const char *kIntersystemsCache = "intersystems_cache"; + /** - * Apache Cassandra. + * Apache Cassandra */ -// DEBUG: {"brief": "Apache Cassandra", "deprecated": none, "id": "cassandra", "note": none, -// "stability": "experimental", "value": "cassandra"} static constexpr const char *kCassandra = "cassandra"; + /** - * ClickHouse. + * ClickHouse */ -// DEBUG: {"brief": "ClickHouse", "deprecated": none, "id": "clickhouse", "note": none, "stability": -// "experimental", "value": "clickhouse"} static constexpr const char *kClickhouse = "clickhouse"; + /** - * @Deprecated: Replaced by @code other_sql @endcode. + * Deprecated, use @code other_sql @endcode instead. + *

+ * @deprecated + * Replaced by @code other_sql @endcode. */ -// DEBUG: {"brief": "Deprecated, use `other_sql` instead.", "deprecated": "Replaced by -// `other_sql`.", "id": "cloudscape", "note": none, "stability": "experimental", "value": -// "cloudscape"} +OPENTELEMETRY_DEPRECATED static constexpr const char *kCloudscape = "cloudscape"; + /** - * CockroachDB. + * CockroachDB */ -// DEBUG: {"brief": "CockroachDB", "deprecated": none, "id": "cockroachdb", "note": none, -// "stability": "experimental", "value": "cockroachdb"} static constexpr const char *kCockroachdb = "cockroachdb"; + /** - * @Deprecated: Removed. + * Deprecated, no replacement at this time. + *

+ * @deprecated + * Removed. */ -// DEBUG: {"brief": "Deprecated, no replacement at this time.", "deprecated": "Removed.", "id": -// "coldfusion", "note": none, "stability": "experimental", "value": "coldfusion"} +OPENTELEMETRY_DEPRECATED static constexpr const char *kColdfusion = "coldfusion"; + /** - * Microsoft Azure Cosmos DB. + * Microsoft Azure Cosmos DB */ -// DEBUG: {"brief": "Microsoft Azure Cosmos DB", "deprecated": none, "id": "cosmosdb", "note": none, -// "stability": "experimental", "value": "cosmosdb"} static constexpr const char *kCosmosdb = "cosmosdb"; + /** - * Couchbase. + * Couchbase */ -// DEBUG: {"brief": "Couchbase", "deprecated": none, "id": "couchbase", "note": none, "stability": -// "experimental", "value": "couchbase"} static constexpr const char *kCouchbase = "couchbase"; + /** - * CouchDB. + * CouchDB */ -// DEBUG: {"brief": "CouchDB", "deprecated": none, "id": "couchdb", "note": none, "stability": -// "experimental", "value": "couchdb"} static constexpr const char *kCouchdb = "couchdb"; + /** - * IBM Db2. + * IBM Db2 */ -// DEBUG: {"brief": "IBM Db2", "deprecated": none, "id": "db2", "note": none, "stability": -// "experimental", "value": "db2"} static constexpr const char *kDb2 = "db2"; + /** - * Apache Derby. + * Apache Derby */ -// DEBUG: {"brief": "Apache Derby", "deprecated": none, "id": "derby", "note": none, "stability": -// "experimental", "value": "derby"} static constexpr const char *kDerby = "derby"; + /** - * Amazon DynamoDB. + * Amazon DynamoDB */ -// DEBUG: {"brief": "Amazon DynamoDB", "deprecated": none, "id": "dynamodb", "note": none, -// "stability": "experimental", "value": "dynamodb"} static constexpr const char *kDynamodb = "dynamodb"; + /** - * EnterpriseDB. + * EnterpriseDB */ -// DEBUG: {"brief": "EnterpriseDB", "deprecated": none, "id": "edb", "note": none, "stability": -// "experimental", "value": "edb"} static constexpr const char *kEdb = "edb"; + /** - * Elasticsearch. + * Elasticsearch */ -// DEBUG: {"brief": "Elasticsearch", "deprecated": none, "id": "elasticsearch", "note": none, -// "stability": "experimental", "value": "elasticsearch"} static constexpr const char *kElasticsearch = "elasticsearch"; + /** - * FileMaker. + * FileMaker */ -// DEBUG: {"brief": "FileMaker", "deprecated": none, "id": "filemaker", "note": none, "stability": -// "experimental", "value": "filemaker"} static constexpr const char *kFilemaker = "filemaker"; + /** - * Firebird. + * Firebird */ -// DEBUG: {"brief": "Firebird", "deprecated": none, "id": "firebird", "note": none, "stability": -// "experimental", "value": "firebird"} static constexpr const char *kFirebird = "firebird"; + /** - * @Deprecated: Replaced by @code other_sql @endcode. + * Deprecated, use @code other_sql @endcode instead. + *

+ * @deprecated + * Replaced by @code other_sql @endcode. */ -// DEBUG: {"brief": "Deprecated, use `other_sql` instead.", "deprecated": "Replaced by -// `other_sql`.", "id": "firstsql", "note": none, "stability": "experimental", "value": "firstsql"} +OPENTELEMETRY_DEPRECATED static constexpr const char *kFirstsql = "firstsql"; + /** - * Apache Geode. + * Apache Geode */ -// DEBUG: {"brief": "Apache Geode", "deprecated": none, "id": "geode", "note": none, "stability": -// "experimental", "value": "geode"} static constexpr const char *kGeode = "geode"; + /** - * H2. + * H2 */ -// DEBUG: {"brief": "H2", "deprecated": none, "id": "h2", "note": none, "stability": "experimental", -// "value": "h2"} static constexpr const char *kH2 = "h2"; + /** - * SAP HANA. + * SAP HANA */ -// DEBUG: {"brief": "SAP HANA", "deprecated": none, "id": "hanadb", "note": none, "stability": -// "experimental", "value": "hanadb"} static constexpr const char *kHanadb = "hanadb"; + /** - * Apache HBase. + * Apache HBase */ -// DEBUG: {"brief": "Apache HBase", "deprecated": none, "id": "hbase", "note": none, "stability": -// "experimental", "value": "hbase"} static constexpr const char *kHbase = "hbase"; + /** - * Apache Hive. + * Apache Hive */ -// DEBUG: {"brief": "Apache Hive", "deprecated": none, "id": "hive", "note": none, "stability": -// "experimental", "value": "hive"} static constexpr const char *kHive = "hive"; + /** - * HyperSQL DataBase. + * HyperSQL DataBase */ -// DEBUG: {"brief": "HyperSQL DataBase", "deprecated": none, "id": "hsqldb", "note": none, -// "stability": "experimental", "value": "hsqldb"} static constexpr const char *kHsqldb = "hsqldb"; + /** - * InfluxDB. + * InfluxDB */ -// DEBUG: {"brief": "InfluxDB", "deprecated": none, "id": "influxdb", "note": none, "stability": -// "experimental", "value": "influxdb"} static constexpr const char *kInfluxdb = "influxdb"; + /** - * Informix. + * Informix */ -// DEBUG: {"brief": "Informix", "deprecated": none, "id": "informix", "note": none, "stability": -// "experimental", "value": "informix"} static constexpr const char *kInformix = "informix"; + /** - * Ingres. + * Ingres */ -// DEBUG: {"brief": "Ingres", "deprecated": none, "id": "ingres", "note": none, "stability": -// "experimental", "value": "ingres"} static constexpr const char *kIngres = "ingres"; + /** - * InstantDB. + * InstantDB */ -// DEBUG: {"brief": "InstantDB", "deprecated": none, "id": "instantdb", "note": none, "stability": -// "experimental", "value": "instantdb"} static constexpr const char *kInstantdb = "instantdb"; + /** - * InterBase. + * InterBase */ -// DEBUG: {"brief": "InterBase", "deprecated": none, "id": "interbase", "note": none, "stability": -// "experimental", "value": "interbase"} static constexpr const char *kInterbase = "interbase"; + /** - * MariaDB. + * MariaDB */ -// DEBUG: {"brief": "MariaDB", "deprecated": none, "id": "mariadb", "note": none, "stability": -// "experimental", "value": "mariadb"} static constexpr const char *kMariadb = "mariadb"; + /** - * SAP MaxDB. + * SAP MaxDB */ -// DEBUG: {"brief": "SAP MaxDB", "deprecated": none, "id": "maxdb", "note": none, "stability": -// "experimental", "value": "maxdb"} static constexpr const char *kMaxdb = "maxdb"; + /** - * Memcached. + * Memcached */ -// DEBUG: {"brief": "Memcached", "deprecated": none, "id": "memcached", "note": none, "stability": -// "experimental", "value": "memcached"} static constexpr const char *kMemcached = "memcached"; + /** - * MongoDB. + * MongoDB */ -// DEBUG: {"brief": "MongoDB", "deprecated": none, "id": "mongodb", "note": none, "stability": -// "experimental", "value": "mongodb"} static constexpr const char *kMongodb = "mongodb"; + /** - * Microsoft SQL Server. + * Microsoft SQL Server */ -// DEBUG: {"brief": "Microsoft SQL Server", "deprecated": none, "id": "mssql", "note": none, -// "stability": "experimental", "value": "mssql"} static constexpr const char *kMssql = "mssql"; + /** - * @Deprecated: Removed, use @code other_sql @endcode instead. + * Deprecated, Microsoft SQL Server Compact is discontinued. + *

+ * @deprecated + * Removed, use @code other_sql @endcode instead. */ -// DEBUG: {"brief": "Deprecated, Microsoft SQL Server Compact is discontinued.", "deprecated": -// "Removed, use `other_sql` instead.", "id": "mssqlcompact", "note": none, "stability": -// "experimental", "value": "mssqlcompact"} +OPENTELEMETRY_DEPRECATED static constexpr const char *kMssqlcompact = "mssqlcompact"; + /** - * MySQL. + * MySQL */ -// DEBUG: {"brief": "MySQL", "deprecated": none, "id": "mysql", "note": none, "stability": -// "experimental", "value": "mysql"} static constexpr const char *kMysql = "mysql"; + /** - * Neo4j. + * Neo4j */ -// DEBUG: {"brief": "Neo4j", "deprecated": none, "id": "neo4j", "note": none, "stability": -// "experimental", "value": "neo4j"} static constexpr const char *kNeo4j = "neo4j"; + /** - * Netezza. + * Netezza */ -// DEBUG: {"brief": "Netezza", "deprecated": none, "id": "netezza", "note": none, "stability": -// "experimental", "value": "netezza"} static constexpr const char *kNetezza = "netezza"; + /** - * OpenSearch. + * OpenSearch */ -// DEBUG: {"brief": "OpenSearch", "deprecated": none, "id": "opensearch", "note": none, "stability": -// "experimental", "value": "opensearch"} static constexpr const char *kOpensearch = "opensearch"; + /** - * Oracle Database. + * Oracle Database */ -// DEBUG: {"brief": "Oracle Database", "deprecated": none, "id": "oracle", "note": none, -// "stability": "experimental", "value": "oracle"} static constexpr const char *kOracle = "oracle"; + /** - * Pervasive PSQL. + * Pervasive PSQL */ -// DEBUG: {"brief": "Pervasive PSQL", "deprecated": none, "id": "pervasive", "note": none, -// "stability": "experimental", "value": "pervasive"} static constexpr const char *kPervasive = "pervasive"; + /** - * PointBase. + * PointBase */ -// DEBUG: {"brief": "PointBase", "deprecated": none, "id": "pointbase", "note": none, "stability": -// "experimental", "value": "pointbase"} static constexpr const char *kPointbase = "pointbase"; + /** - * PostgreSQL. + * PostgreSQL */ -// DEBUG: {"brief": "PostgreSQL", "deprecated": none, "id": "postgresql", "note": none, "stability": -// "experimental", "value": "postgresql"} static constexpr const char *kPostgresql = "postgresql"; + /** - * Progress Database. + * Progress Database */ -// DEBUG: {"brief": "Progress Database", "deprecated": none, "id": "progress", "note": none, -// "stability": "experimental", "value": "progress"} static constexpr const char *kProgress = "progress"; + /** - * Redis. + * Redis */ -// DEBUG: {"brief": "Redis", "deprecated": none, "id": "redis", "note": none, "stability": -// "experimental", "value": "redis"} static constexpr const char *kRedis = "redis"; + /** - * Amazon Redshift. + * Amazon Redshift */ -// DEBUG: {"brief": "Amazon Redshift", "deprecated": none, "id": "redshift", "note": none, -// "stability": "experimental", "value": "redshift"} static constexpr const char *kRedshift = "redshift"; + /** - * Cloud Spanner. + * Cloud Spanner */ -// DEBUG: {"brief": "Cloud Spanner", "deprecated": none, "id": "spanner", "note": none, "stability": -// "experimental", "value": "spanner"} static constexpr const char *kSpanner = "spanner"; + /** - * SQLite. + * SQLite */ -// DEBUG: {"brief": "SQLite", "deprecated": none, "id": "sqlite", "note": none, "stability": -// "experimental", "value": "sqlite"} static constexpr const char *kSqlite = "sqlite"; + /** - * Sybase. + * Sybase */ -// DEBUG: {"brief": "Sybase", "deprecated": none, "id": "sybase", "note": none, "stability": -// "experimental", "value": "sybase"} static constexpr const char *kSybase = "sybase"; + /** - * Teradata. + * Teradata */ -// DEBUG: {"brief": "Teradata", "deprecated": none, "id": "teradata", "note": none, "stability": -// "experimental", "value": "teradata"} static constexpr const char *kTeradata = "teradata"; + /** - * Trino. + * Trino */ -// DEBUG: {"brief": "Trino", "deprecated": none, "id": "trino", "note": none, "stability": -// "experimental", "value": "trino"} static constexpr const char *kTrino = "trino"; + /** - * Vertica. + * Vertica */ -// DEBUG: {"brief": "Vertica", "deprecated": none, "id": "vertica", "note": none, "stability": -// "experimental", "value": "vertica"} static constexpr const char *kVertica = "vertica"; + } // namespace DbSystemValues } // namespace db diff --git a/api/include/opentelemetry/semconv/incubating/attributes/deployment_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/deployment_attributes.h index bd4a557c34..9c4594b7f3 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/deployment_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/deployment_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -22,58 +20,55 @@ namespace deployment { /** - * @Deprecated: Deprecated, use @code deployment.environment.name @endcode instead. + * 'Deprecated, use @code deployment.environment.name @endcode instead.' + *

+ * @deprecated + * Deprecated, use @code deployment.environment.name @endcode instead. */ -static const char *kDeploymentEnvironment = "deployment.environment"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kDeploymentEnvironment = "deployment.environment"; /** * Name of the deployment - * environment (aka deployment tier). Note: @code deployment.environment.name @endcode does not - * affect the uniqueness constraints defined through the @code service.namespace @endcode, @code - * service.name @endcode and @code service.instance.id @endcode resource attributes. This implies - * that resources carrying the following attribute combinations MUST be considered to be identifying - * the same service:

  • @code service.name=frontend @endcode, @code - * deployment.environment.name=production @endcode
  • @code service.name=frontend @endcode, - * @code deployment.environment.name=staging @endcode.
  • + * environment (aka deployment tier).

    + * @code deployment.environment.name @endcode does not affect the uniqueness constraints defined + * through the @code service.namespace @endcode, @code service.name @endcode and @code + * service.instance.id @endcode resource attributes. This implies that resources carrying the + * following attribute combinations MUST be considered to be identifying the same service:

      + *
    • @code service.name=frontend @endcode, @code deployment.environment.name=production + * @endcode
    • @code service.name=frontend @endcode, @code deployment.environment.name=staging + * @endcode.
    • *
    */ -static const char *kDeploymentEnvironmentName = "deployment.environment.name"; +static constexpr const char *kDeploymentEnvironmentName = "deployment.environment.name"; /** * The id of the deployment. */ -static const char *kDeploymentId = "deployment.id"; +static constexpr const char *kDeploymentId = "deployment.id"; /** * The name of the deployment. */ -static const char *kDeploymentName = "deployment.name"; +static constexpr const char *kDeploymentName = "deployment.name"; /** * The status of the deployment. */ -static const char *kDeploymentStatus = "deployment.status"; +static constexpr const char *kDeploymentStatus = "deployment.status"; -// DEBUG: {"brief": "The status of the deployment.\n", "name": "deployment.status", -// "requirement_level": "recommended", "root_namespace": "deployment", "stability": "experimental", -// "type": {"allow_custom_values": true, "members": [{"brief": "failed", "deprecated": none, "id": -// "failed", "note": none, "stability": "experimental", "value": "failed"}, {"brief": "succeeded", -// "deprecated": none, "id": "succeeded", "note": none, "stability": "experimental", "value": -// "succeeded"}]}} namespace DeploymentStatusValues { /** - * failed. + * failed */ -// DEBUG: {"brief": "failed", "deprecated": none, "id": "failed", "note": none, "stability": -// "experimental", "value": "failed"} static constexpr const char *kFailed = "failed"; + /** - * succeeded. + * succeeded */ -// DEBUG: {"brief": "succeeded", "deprecated": none, "id": "succeeded", "note": none, "stability": -// "experimental", "value": "succeeded"} static constexpr const char *kSucceeded = "succeeded"; + } // namespace DeploymentStatusValues } // namespace deployment diff --git a/api/include/opentelemetry/semconv/incubating/attributes/destination_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/destination_attributes.h index 65b9bc5e1e..5069fc03b7 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/destination_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/destination_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -23,16 +21,16 @@ namespace destination /** * Destination address - domain name if available without reverse DNS lookup; otherwise, IP address - * or Unix domain socket name. Note: When observed from the source side, and when communicating + * or Unix domain socket name.

    When observed from the source side, and when communicating * through an intermediary, @code destination.address @endcode SHOULD represent the destination * address behind any intermediaries, for example proxies, if it's available. */ -static const char *kDestinationAddress = "destination.address"; +static constexpr const char *kDestinationAddress = "destination.address"; /** - * Destination port number. + * Destination port number */ -static const char *kDestinationPort = "destination.port"; +static constexpr const char *kDestinationPort = "destination.port"; } // namespace destination } // namespace semconv diff --git a/api/include/opentelemetry/semconv/incubating/attributes/device_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/device_attributes.h index d47a154239..c2c80f5fd2 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/device_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/device_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -22,10 +20,11 @@ namespace device { /** - * A unique identifier representing the device. - * Note: The device identifier MUST only be defined using the values outlined below. This value is - * not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this - * value MUST be equal to the + * The device identifier MUST only be defined using the values outlined below. This value is not an + * advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value + * MUST be equal to the vendor * identifier. On Android (Java or Kotlin), this value MUST be equal to the Firebase * Installation ID or a globally unique UUID which is persisted across sessions in your application. @@ -35,29 +34,32 @@ namespace device * which can identify a user. GDPR and data protection laws may apply, ensure you do your own due * diligence. */ -static const char *kDeviceId = "device.id"; +static constexpr const char *kDeviceId = "device.id"; /** - * The name of the device manufacturer. - * Note: The Android OS provides this field via + * The Android OS provides this field via Build. iOS apps * SHOULD hardcode the value @code Apple @endcode. */ -static const char *kDeviceManufacturer = "device.manufacturer"; +static constexpr const char *kDeviceManufacturer = "device.manufacturer"; /** - * The model identifier for the device. - * Note: It's recommended this value represents a machine-readable version of the model identifier - * rather than the market or consumer-friendly name of the device. + * The model identifier for the device + *

    + * It's recommended this value represents a machine-readable version of the model identifier rather + * than the market or consumer-friendly name of the device. */ -static const char *kDeviceModelIdentifier = "device.model.identifier"; +static constexpr const char *kDeviceModelIdentifier = "device.model.identifier"; /** - * The marketing name for the device model. - * Note: It's recommended this value represents a human-readable version of the device model rather - * than a machine-readable alternative. + * The marketing name for the device model + *

    + * It's recommended this value represents a human-readable version of the device model rather than a + * machine-readable alternative. */ -static const char *kDeviceModelName = "device.model.name"; +static constexpr const char *kDeviceModelName = "device.model.name"; } // namespace device } // namespace semconv diff --git a/api/include/opentelemetry/semconv/incubating/attributes/disk_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/disk_attributes.h index d13ba63473..ff938a9612 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/disk_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/disk_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -24,28 +22,20 @@ namespace disk /** * The disk IO operation direction. */ -static const char *kDiskIoDirection = "disk.io.direction"; - -// DEBUG: {"brief": "The disk IO operation direction.", "examples": ["read"], "name": -// "disk.io.direction", "requirement_level": "recommended", "root_namespace": "disk", "stability": -// "experimental", "type": {"allow_custom_values": true, "members": [{"brief": none, "deprecated": -// none, "id": "read", "note": none, "stability": "experimental", "value": "read"}, {"brief": none, -// "deprecated": none, "id": "write", "note": none, "stability": "experimental", "value": -// "write"}]}} +static constexpr const char *kDiskIoDirection = "disk.io.direction"; + namespace DiskIoDirectionValues { /** - * read. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "read", "note": none, "stability": -// "experimental", "value": "read"} static constexpr const char *kRead = "read"; + /** - * write. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "write", "note": none, "stability": -// "experimental", "value": "write"} static constexpr const char *kWrite = "write"; + } // namespace DiskIoDirectionValues } // namespace disk diff --git a/api/include/opentelemetry/semconv/incubating/attributes/dns_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/dns_attributes.h index b146b1d657..b835e2a73a 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/dns_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/dns_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -23,12 +21,13 @@ namespace dns /** * The name being queried. - * Note: If the name field contains non-printable characters (below 32 or above 126), those - * characters should be represented as escaped base 10 integers (\DDD). Back slashes and quotes - * should be escaped. Tabs, carriage returns, and line feeds should be converted to \t, \r, and \n + *

    + * If the name field contains non-printable characters (below 32 or above 126), those characters + * should be represented as escaped base 10 integers (\DDD). Back slashes and quotes should be + * escaped. Tabs, carriage returns, and line feeds should be converted to \t, \r, and \n * respectively. */ -static const char *kDnsQuestionName = "dns.question.name"; +static constexpr const char *kDnsQuestionName = "dns.question.name"; } // namespace dns } // namespace semconv diff --git a/api/include/opentelemetry/semconv/incubating/attributes/enduser_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/enduser_attributes.h index 5b1b438146..217d5dd414 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/enduser_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/enduser_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -22,19 +20,31 @@ namespace enduser { /** - * @Deprecated: Replaced by @code user.id @endcode attribute. + * Deprecated, use @code user.id @endcode instead. + *

    + * @deprecated + * Replaced by @code user.id @endcode attribute. */ -static const char *kEnduserId = "enduser.id"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kEnduserId = "enduser.id"; /** - * @Deprecated: Replaced by @code user.roles @endcode attribute. + * Deprecated, use @code user.roles @endcode instead. + *

    + * @deprecated + * Replaced by @code user.roles @endcode attribute. */ -static const char *kEnduserRole = "enduser.role"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kEnduserRole = "enduser.role"; /** - * @Deprecated: Removed. + * Deprecated, no replacement at this time. + *

    + * @deprecated + * Removed. */ -static const char *kEnduserScope = "enduser.scope"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kEnduserScope = "enduser.scope"; } // namespace enduser } // namespace semconv diff --git a/api/include/opentelemetry/semconv/incubating/attributes/error_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/error_attributes.h index 22b7505a53..1b711ff112 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/error_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/error_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -22,40 +20,36 @@ namespace error { /** - * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.error_attributes. - * @endcode. + * Describes a class of error the operation ended with. + *

    + * The @code error.type @endcode SHOULD be predictable, and SHOULD have low cardinality. + *

    + * When @code error.type @endcode is set to a type (e.g., an exception type), its + * canonical class name identifying the type within the artifact SHOULD be used. + *

    + * Instrumentations SHOULD document the list of errors they report. + *

    + * The cardinality of @code error.type @endcode within one instrumentation library SHOULD be low. + * Telemetry consumers that aggregate data from multiple instrumentation libraries and applications + * should be prepared for @code error.type @endcode to have high cardinality at query time when no + * additional filters are applied. + *

    + * If the operation has completed successfully, instrumentations SHOULD NOT set @code error.type + * @endcode.

    If a specific domain defines its own set of error identifiers (such as HTTP or gRPC + * status codes), it's RECOMMENDED to:

    • Use a domain-specific attribute
    • Set + * @code error.type @endcode to capture all errors, regardless of whether they are defined within + * the domain-specific set or not.
    • + *
    */ -static const char *kErrorType = "error.type"; - -// @deprecated(reason="Deprecated in favor of stable -// `opentelemetry.semconv.attributes.error_attributes.ErrorTypeValues`.") # type: ignore DEBUG: -// {"brief": "Describes a class of error the operation ended with.\n", "examples": ["timeout", -// "java.net.UnknownHostException", "server_certificate_invalid", "500"], "name": "error.type", -// "note": "The `error.type` SHOULD be predictable, and SHOULD have low cardinality.\n\nWhen -// `error.type` is set to a type (e.g., an exception type), its\ncanonical class name identifying -// the type within the artifact SHOULD be used.\n\nInstrumentations SHOULD document the list of -// errors they report.\n\nThe cardinality of `error.type` within one instrumentation library SHOULD -// be low.\nTelemetry consumers that aggregate data from multiple instrumentation libraries and -// applications\nshould be prepared for `error.type` to have high cardinality at query time when -// no\nadditional filters are applied.\n\nIf the operation has completed successfully, -// instrumentations SHOULD NOT set `error.type`.\n\nIf a specific domain defines its own set of -// error identifiers (such as HTTP or gRPC status codes),\nit's RECOMMENDED to:\n\n* Use a -// domain-specific attribute\n* Set `error.type` to capture all errors, regardless of whether they -// are defined within the domain-specific set or not.\n", "requirement_level": "recommended", -// "root_namespace": "error", "stability": "stable", "type": {"allow_custom_values": true, -// "members": [{"brief": "A fallback error value to be used when the instrumentation doesn't define -// a custom value.\n", "deprecated": none, "id": "other", "note": none, "stability": "stable", -// "value": "_OTHER"}]}} +static constexpr const char *kErrorType = "error.type"; + namespace ErrorTypeValues { /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.error_attributes.ErrorTypeValues.kOther @endcode. + * A fallback error value to be used when the instrumentation doesn't define a custom value. */ -// DEBUG: {"brief": "A fallback error value to be used when the instrumentation doesn't define a -// custom value.\n", "deprecated": none, "id": "other", "note": none, "stability": "stable", -// "value": "_OTHER"} static constexpr const char *kOther = "_OTHER"; + } // namespace ErrorTypeValues } // namespace error diff --git a/api/include/opentelemetry/semconv/incubating/attributes/event_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/event_attributes.h index 49d5a29ea7..c2faa437cf 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/event_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/event_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -23,12 +21,13 @@ namespace event /** * Identifies the class / type of event. - * Note: Event names are subject to the same rules as + * Event names are subject to the same rules as attribute names. Notably, event names are namespaced * to avoid collisions and provide a clean separation of semantics for events in separate domains * like browser, mobile, and kubernetes. */ -static const char *kEventName = "event.name"; +static constexpr const char *kEventName = "event.name"; } // namespace event } // namespace semconv diff --git a/api/include/opentelemetry/semconv/incubating/attributes/exception_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/exception_attributes.h index 7f351b7ab6..fdc19ac6d0 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/exception_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/exception_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -22,28 +20,39 @@ namespace exception { /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.exception_attributes. @endcode. + * 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.

    An exception is considered to have escaped (or + * left) the scope of a span, if that span is ended while the exception is still logically "in + * flight". This may be actually "in flight" in some languages (e.g. if the exception is passed to a + * Context manager's @code __exit__ @endcode method in Python) but will usually be caught at the + * point of recording the exception in most languages.

    It is usually not possible to determine + * at the point where an exception is thrown whether it will escape the scope of a span. However, it + * is trivial to know that an exception will escape, if one checks for an active exception just + * before ending the span, as done in the example + * for recording span exceptions.

    It follows that an exception may still escape the scope of + * the span even if the @code exception.escaped @endcode attribute was not set or set to false, + * since the event might have been recorded at a time where it was not + * clear whether the exception will escape. */ -static const char *kExceptionEscaped = "exception.escaped"; +static constexpr const char *kExceptionEscaped = "exception.escaped"; /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.exception_attributes. @endcode. + * The exception message. */ -static const char *kExceptionMessage = "exception.message"; +static constexpr const char *kExceptionMessage = "exception.message"; /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.exception_attributes. @endcode. + * A stacktrace as a string in the natural representation for the language runtime. The + * representation is to be determined and documented by each language SIG. */ -static const char *kExceptionStacktrace = "exception.stacktrace"; +static constexpr const char *kExceptionStacktrace = "exception.stacktrace"; /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.exception_attributes. @endcode. + * 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. */ -static const char *kExceptionType = "exception.type"; +static constexpr const char *kExceptionType = "exception.type"; } // namespace exception } // namespace semconv diff --git a/api/include/opentelemetry/semconv/incubating/attributes/faas_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/faas_attributes.h index 3e1a2bd6c3..ed9076ec39 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/faas_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/faas_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -25,83 +23,87 @@ namespace faas * A boolean that is true if the serverless function is executed for the first time (aka * cold-start). */ -static const char *kFaasColdstart = "faas.coldstart"; +static constexpr const char *kFaasColdstart = "faas.coldstart"; /** * A string containing the schedule period as Cron * Expression. */ -static const char *kFaasCron = "faas.cron"; +static constexpr const char *kFaasCron = "faas.cron"; /** * The name of the source on which the triggering operation was performed. For example, in Cloud * Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. */ -static const char *kFaasDocumentCollection = "faas.document.collection"; +static constexpr const char *kFaasDocumentCollection = "faas.document.collection"; /** * The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the * name of the file, and in Cosmos DB the table name. */ -static const char *kFaasDocumentName = "faas.document.name"; +static constexpr const char *kFaasDocumentName = "faas.document.name"; /** * Describes the type of the operation that was performed on the data. */ -static const char *kFaasDocumentOperation = "faas.document.operation"; +static constexpr const char *kFaasDocumentOperation = "faas.document.operation"; /** * A string containing the time when the data was accessed in the ISO 8601 format expressed in UTC. */ -static const char *kFaasDocumentTime = "faas.document.time"; +static constexpr const char *kFaasDocumentTime = "faas.document.time"; /** * The execution environment ID as a string, that will be potentially reused for other invocations - * to the same function/function version. Note: * AWS Lambda: Use the (full) log - * stream name. + * to the same function/function version.

    • AWS Lambda: Use the (full) + * log stream name.
    • + *
    */ -static const char *kFaasInstance = "faas.instance"; +static constexpr const char *kFaasInstance = "faas.instance"; /** * The invocation ID of the current function invocation. */ -static const char *kFaasInvocationId = "faas.invocation_id"; +static constexpr const char *kFaasInvocationId = "faas.invocation_id"; /** * The name of the invoked function. - * Note: SHOULD be equal to the @code faas.name @endcode resource attribute of the invoked function. + *

    + * SHOULD be equal to the @code faas.name @endcode resource attribute of the invoked function. */ -static const char *kFaasInvokedName = "faas.invoked_name"; +static constexpr const char *kFaasInvokedName = "faas.invoked_name"; /** * The cloud provider of the invoked function. - * Note: SHOULD be equal to the @code cloud.provider @endcode resource attribute of the invoked - * function. + *

    + * SHOULD be equal to the @code cloud.provider @endcode resource attribute of the invoked function. */ -static const char *kFaasInvokedProvider = "faas.invoked_provider"; +static constexpr const char *kFaasInvokedProvider = "faas.invoked_provider"; /** * The cloud region of the invoked function. - * Note: SHOULD be equal to the @code cloud.region @endcode resource attribute of the invoked - * function. + *

    + * SHOULD be equal to the @code cloud.region @endcode resource attribute of the invoked function. */ -static const char *kFaasInvokedRegion = "faas.invoked_region"; +static constexpr const char *kFaasInvokedRegion = "faas.invoked_region"; /** * The amount of memory available to the serverless function converted to Bytes. - * Note: It's recommended to set this attribute since e.g. too little memory can easily stop a Java - * AWS Lambda function from working correctly. On AWS Lambda, the environment variable @code + *

    + * It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS + * Lambda function from working correctly. On AWS Lambda, the environment variable @code * AWS_LAMBDA_FUNCTION_MEMORY_SIZE @endcode provides this information (which must be multiplied by * 1,048,576). */ -static const char *kFaasMaxMemory = "faas.max_memory"; +static constexpr const char *kFaasMaxMemory = "faas.max_memory"; /** * The name of the single function that this runtime instance executes. - * Note: This is the name of the function as configured/deployed on the FaaS + *

    + * This is the name of the function as configured/deployed on the FaaS * platform and is usually different from the name of the callback * function (which may be stored in the * @code code.namespace @endcode/@code @@ -115,23 +117,24 @@ static const char *kFaasMaxMemory = "faas.max_memory"; * @code cloud.resource_id @endcode attribute). *

*/ -static const char *kFaasName = "faas.name"; +static constexpr const char *kFaasName = "faas.name"; /** * A string containing the function invocation time in the ISO 8601 format expressed in UTC. */ -static const char *kFaasTime = "faas.time"; +static constexpr const char *kFaasTime = "faas.time"; /** * Type of the trigger which caused this function invocation. */ -static const char *kFaasTrigger = "faas.trigger"; +static constexpr const char *kFaasTrigger = "faas.trigger"; /** * The immutable version of the function being executed. - * Note: Depending on the cloud provider and platform, use: + *

+ * Depending on the cloud provider and platform, use: *

*

    *
  • AWS Lambda: The *
*/ -static const char *kFaasVersion = "faas.version"; - -// DEBUG: {"brief": "Describes the type of the operation that was performed on the data.", "name": -// "faas.document.operation", "requirement_level": "recommended", "root_namespace": "faas", -// "stability": "experimental", "type": {"allow_custom_values": true, "members": [{"brief": "When a -// new object is created.", "deprecated": none, "id": "insert", "note": none, "stability": -// "experimental", "value": "insert"}, {"brief": "When an object is modified.", "deprecated": none, -// "id": "edit", "note": none, "stability": "experimental", "value": "edit"}, {"brief": "When an -// object is deleted.", "deprecated": none, "id": "delete", "note": none, "stability": -// "experimental", "value": "delete"}]}} +static constexpr const char *kFaasVersion = "faas.version"; + namespace FaasDocumentOperationValues { /** * When a new object is created. */ -// DEBUG: {"brief": "When a new object is created.", "deprecated": none, "id": "insert", "note": -// none, "stability": "experimental", "value": "insert"} static constexpr const char *kInsert = "insert"; + /** * When an object is modified. */ -// DEBUG: {"brief": "When an object is modified.", "deprecated": none, "id": "edit", "note": none, -// "stability": "experimental", "value": "edit"} static constexpr const char *kEdit = "edit"; + /** * When an object is deleted. */ -// DEBUG: {"brief": "When an object is deleted.", "deprecated": none, "id": "delete", "note": none, -// "stability": "experimental", "value": "delete"} static constexpr const char *kDelete = "delete"; + } // namespace FaasDocumentOperationValues -// DEBUG: {"brief": "The cloud provider of the invoked function.\n", "name": -// "faas.invoked_provider", "note": "SHOULD be equal to the `cloud.provider` resource attribute of -// the invoked function.\n", "requirement_level": "recommended", "root_namespace": "faas", -// "stability": "experimental", "type": {"allow_custom_values": true, "members": [{"brief": "Alibaba -// Cloud", "deprecated": none, "id": "alibaba_cloud", "note": none, "stability": "experimental", -// "value": "alibaba_cloud"}, {"brief": "Amazon Web Services", "deprecated": none, "id": "aws", -// "note": none, "stability": "experimental", "value": "aws"}, {"brief": "Microsoft Azure", -// "deprecated": none, "id": "azure", "note": none, "stability": "experimental", "value": "azure"}, -// {"brief": "Google Cloud Platform", "deprecated": none, "id": "gcp", "note": none, "stability": -// "experimental", "value": "gcp"}, {"brief": "Tencent Cloud", "deprecated": none, "id": -// "tencent_cloud", "note": none, "stability": "experimental", "value": "tencent_cloud"}]}} namespace FaasInvokedProviderValues { /** - * Alibaba Cloud. + * Alibaba Cloud */ -// DEBUG: {"brief": "Alibaba Cloud", "deprecated": none, "id": "alibaba_cloud", "note": none, -// "stability": "experimental", "value": "alibaba_cloud"} static constexpr const char *kAlibabaCloud = "alibaba_cloud"; + /** - * Amazon Web Services. + * Amazon Web Services */ -// DEBUG: {"brief": "Amazon Web Services", "deprecated": none, "id": "aws", "note": none, -// "stability": "experimental", "value": "aws"} static constexpr const char *kAws = "aws"; + /** - * Microsoft Azure. + * Microsoft Azure */ -// DEBUG: {"brief": "Microsoft Azure", "deprecated": none, "id": "azure", "note": none, "stability": -// "experimental", "value": "azure"} static constexpr const char *kAzure = "azure"; + /** - * Google Cloud Platform. + * Google Cloud Platform */ -// DEBUG: {"brief": "Google Cloud Platform", "deprecated": none, "id": "gcp", "note": none, -// "stability": "experimental", "value": "gcp"} static constexpr const char *kGcp = "gcp"; + /** - * Tencent Cloud. + * Tencent Cloud */ -// DEBUG: {"brief": "Tencent Cloud", "deprecated": none, "id": "tencent_cloud", "note": none, -// "stability": "experimental", "value": "tencent_cloud"} static constexpr const char *kTencentCloud = "tencent_cloud"; + } // namespace FaasInvokedProviderValues -// DEBUG: {"brief": "Type of the trigger which caused this function invocation.\n", "name": -// "faas.trigger", "requirement_level": "recommended", "root_namespace": "faas", "stability": -// "experimental", "type": {"allow_custom_values": true, "members": [{"brief": "A response to some -// data source operation such as a database or filesystem read/write", "deprecated": none, "id": -// "datasource", "note": none, "stability": "experimental", "value": "datasource"}, {"brief": "To -// provide an answer to an inbound HTTP request", "deprecated": none, "id": "http", "note": none, -// "stability": "experimental", "value": "http"}, {"brief": "A function is set to be executed when -// messages are sent to a messaging system", "deprecated": none, "id": "pubsub", "note": none, -// "stability": "experimental", "value": "pubsub"}, {"brief": "A function is scheduled to be -// executed regularly", "deprecated": none, "id": "timer", "note": none, "stability": -// "experimental", "value": "timer"}, {"brief": "If none of the others apply", "deprecated": none, -// "id": "other", "note": none, "stability": "experimental", "value": "other"}]}} namespace FaasTriggerValues { /** - * A response to some data source operation such as a database or filesystem read/write. + * A response to some data source operation such as a database or filesystem read/write */ -// DEBUG: {"brief": "A response to some data source operation such as a database or filesystem -// read/write", "deprecated": none, "id": "datasource", "note": none, "stability": "experimental", -// "value": "datasource"} static constexpr const char *kDatasource = "datasource"; + /** - * To provide an answer to an inbound HTTP request. + * To provide an answer to an inbound HTTP request */ -// DEBUG: {"brief": "To provide an answer to an inbound HTTP request", "deprecated": none, "id": -// "http", "note": none, "stability": "experimental", "value": "http"} static constexpr const char *kHttp = "http"; + /** - * A function is set to be executed when messages are sent to a messaging system. + * A function is set to be executed when messages are sent to a messaging system */ -// DEBUG: {"brief": "A function is set to be executed when messages are sent to a messaging system", -// "deprecated": none, "id": "pubsub", "note": none, "stability": "experimental", "value": "pubsub"} static constexpr const char *kPubsub = "pubsub"; + /** - * A function is scheduled to be executed regularly. + * A function is scheduled to be executed regularly */ -// DEBUG: {"brief": "A function is scheduled to be executed regularly", "deprecated": none, "id": -// "timer", "note": none, "stability": "experimental", "value": "timer"} static constexpr const char *kTimer = "timer"; + /** - * If none of the others apply. + * If none of the others apply */ -// DEBUG: {"brief": "If none of the others apply", "deprecated": none, "id": "other", "note": none, -// "stability": "experimental", "value": "other"} static constexpr const char *kOther = "other"; + } // namespace FaasTriggerValues } // namespace faas diff --git a/api/include/opentelemetry/semconv/incubating/attributes/feature_flag_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/feature_flag_attributes.h index a3c784511c..3cd8b8eb2c 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/feature_flag_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/feature_flag_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -24,23 +22,25 @@ namespace feature_flag /** * The unique identifier of the feature flag. */ -static const char *kFeatureFlagKey = "feature_flag.key"; +static constexpr const char *kFeatureFlagKey = "feature_flag.key"; /** * The name of the service provider that performs the flag evaluation. */ -static const char *kFeatureFlagProviderName = "feature_flag.provider_name"; +static constexpr const char *kFeatureFlagProviderName = "feature_flag.provider_name"; /** * SHOULD be a semantic identifier for a value. If one is unavailable, a stringified version of the - * value can be used. Note: A semantic identifier, commonly referred to as a variant, provides a - * means for referring to a value without including the value itself. This can provide additional - * context for understanding the meaning behind a value. For example, the variant @code red @endcode - * maybe be used for the value @code #c05543 @endcode.

A stringified version of the value can be - * used in situations where a semantic identifier is unavailable. String representation of the value + * value can be used.

A semantic identifier, commonly referred to as a variant, provides a means + * for referring to a value without including the value itself. This can + * provide additional context for understanding the meaning behind a value. + * For example, the variant @code red @endcode maybe be used for the value @code #c05543 @endcode. + *

+ * A stringified version of the value can be used in situations where a + * semantic identifier is unavailable. String representation of the value * should be determined by the implementer. */ -static const char *kFeatureFlagVariant = "feature_flag.variant"; +static constexpr const char *kFeatureFlagVariant = "feature_flag.variant"; } // namespace feature_flag } // namespace semconv diff --git a/api/include/opentelemetry/semconv/incubating/attributes/file_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/file_attributes.h index e77d0c6c6e..eb65a811ec 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/file_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/file_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -24,30 +22,31 @@ namespace file /** * Directory where the file is located. It should include the drive letter, when appropriate. */ -static const char *kFileDirectory = "file.directory"; +static constexpr const char *kFileDirectory = "file.directory"; /** * File extension, excluding the leading dot. - * Note: When the file name has multiple extensions (example.tar.gz), only the last one should be - * captured ("gz", not "tar.gz"). + *

+ * When the file name has multiple extensions (example.tar.gz), only the last one should be captured + * ("gz", not "tar.gz"). */ -static const char *kFileExtension = "file.extension"; +static constexpr const char *kFileExtension = "file.extension"; /** * Name of the file including the extension, without the directory. */ -static const char *kFileName = "file.name"; +static constexpr const char *kFileName = "file.name"; /** * Full path to the file, including the file name. It should include the drive letter, when * appropriate. */ -static const char *kFilePath = "file.path"; +static constexpr const char *kFilePath = "file.path"; /** * File size in bytes. */ -static const char *kFileSize = "file.size"; +static constexpr const char *kFileSize = "file.size"; } // namespace file } // namespace semconv diff --git a/api/include/opentelemetry/semconv/incubating/attributes/gcp_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/gcp_attributes.h index 3902f3eb01..53518251bb 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/gcp_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/gcp_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -23,11 +21,12 @@ namespace gcp /** * Identifies the Google Cloud service for which the official client library is intended. - * Note: Intended to be a stable identifier for Google Cloud client libraries that is uniform across + *

+ * Intended to be a stable identifier for Google Cloud client libraries that is uniform across * implementation languages. The value should be derived from the canonical service domain for the * service; for example, 'foo.googleapis.com' should result in a value of 'foo'. */ -static const char *kGcpClientService = "gcp.client.service"; +static constexpr const char *kGcpClientService = "gcp.client.service"; /** * The name of the Cloud Run @code * CLOUD_RUN_EXECUTION @endcode environment variable. */ -static const char *kGcpCloudRunJobExecution = "gcp.cloud_run.job.execution"; +static constexpr const char *kGcpCloudRunJobExecution = "gcp.cloud_run.job.execution"; /** * The index for a task within an execution as provided by the @code * CLOUD_RUN_TASK_INDEX @endcode environment variable. */ -static const char *kGcpCloudRunJobTaskIndex = "gcp.cloud_run.job.task_index"; +static constexpr const char *kGcpCloudRunJobTaskIndex = "gcp.cloud_run.job.task_index"; /** * The hostname of a GCE instance. This is the full value of the default or custom hostname. */ -static const char *kGcpGceInstanceHostname = "gcp.gce.instance.hostname"; +static constexpr const char *kGcpGceInstanceHostname = "gcp.gce.instance.hostname"; /** * The instance name of a GCE instance. This is the value provided by @code host.name @endcode, the @@ -58,7 +57,7 @@ static const char *kGcpGceInstanceHostname = "gcp.gce.instance.hostname"; * href="https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names">default * internal DNS name. */ -static const char *kGcpGceInstanceName = "gcp.gce.instance.name"; +static constexpr const char *kGcpGceInstanceName = "gcp.gce.instance.name"; } // namespace gcp } // namespace semconv diff --git a/api/include/opentelemetry/semconv/incubating/attributes/gen_ai_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/gen_ai_attributes.h index f05802adff..03f2eebc2c 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/gen_ai_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/gen_ai_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -23,85 +21,89 @@ namespace gen_ai /** * The full response received from the GenAI model. - * Note: It's RECOMMENDED to format completions as JSON string matching OpenAI messages format. + *

+ * It's RECOMMENDED to format completions as JSON string matching OpenAI messages format */ -static const char *kGenAiCompletion = "gen_ai.completion"; +static constexpr const char *kGenAiCompletion = "gen_ai.completion"; /** * The name of the operation being performed. - * Note: If one of the predefined values applies, but specific system uses a different name it's + *

+ * If one of the predefined values applies, but specific system uses a different name it's * RECOMMENDED to document it in the semantic conventions for specific GenAI system and use * system-specific name in the instrumentation. If a different name is not documented, * instrumentation libraries SHOULD use applicable predefined value. */ -static const char *kGenAiOperationName = "gen_ai.operation.name"; +static constexpr const char *kGenAiOperationName = "gen_ai.operation.name"; /** * The full prompt sent to the GenAI model. - * Note: It's RECOMMENDED to format prompts as JSON string matching OpenAI messages format. + *

+ * It's RECOMMENDED to format prompts as JSON string matching OpenAI messages format */ -static const char *kGenAiPrompt = "gen_ai.prompt"; +static constexpr const char *kGenAiPrompt = "gen_ai.prompt"; /** * The frequency penalty setting for the GenAI request. */ -static const char *kGenAiRequestFrequencyPenalty = "gen_ai.request.frequency_penalty"; +static constexpr const char *kGenAiRequestFrequencyPenalty = "gen_ai.request.frequency_penalty"; /** * The maximum number of tokens the model generates for a request. */ -static const char *kGenAiRequestMaxTokens = "gen_ai.request.max_tokens"; +static constexpr const char *kGenAiRequestMaxTokens = "gen_ai.request.max_tokens"; /** * The name of the GenAI model a request is being made to. */ -static const char *kGenAiRequestModel = "gen_ai.request.model"; +static constexpr const char *kGenAiRequestModel = "gen_ai.request.model"; /** * The presence penalty setting for the GenAI request. */ -static const char *kGenAiRequestPresencePenalty = "gen_ai.request.presence_penalty"; +static constexpr const char *kGenAiRequestPresencePenalty = "gen_ai.request.presence_penalty"; /** * List of sequences that the model will use to stop generating further tokens. */ -static const char *kGenAiRequestStopSequences = "gen_ai.request.stop_sequences"; +static constexpr const char *kGenAiRequestStopSequences = "gen_ai.request.stop_sequences"; /** * The temperature setting for the GenAI request. */ -static const char *kGenAiRequestTemperature = "gen_ai.request.temperature"; +static constexpr const char *kGenAiRequestTemperature = "gen_ai.request.temperature"; /** * The top_k sampling setting for the GenAI request. */ -static const char *kGenAiRequestTopK = "gen_ai.request.top_k"; +static constexpr const char *kGenAiRequestTopK = "gen_ai.request.top_k"; /** * The top_p sampling setting for the GenAI request. */ -static const char *kGenAiRequestTopP = "gen_ai.request.top_p"; +static constexpr const char *kGenAiRequestTopP = "gen_ai.request.top_p"; /** * Array of reasons the model stopped generating tokens, corresponding to each generation received. */ -static const char *kGenAiResponseFinishReasons = "gen_ai.response.finish_reasons"; +static constexpr const char *kGenAiResponseFinishReasons = "gen_ai.response.finish_reasons"; /** * The unique identifier for the completion. */ -static const char *kGenAiResponseId = "gen_ai.response.id"; +static constexpr const char *kGenAiResponseId = "gen_ai.response.id"; /** * The name of the model that generated the response. */ -static const char *kGenAiResponseModel = "gen_ai.response.model"; +static constexpr const char *kGenAiResponseModel = "gen_ai.response.model"; /** * The Generative AI product as identified by the client or server instrumentation. - * Note: The @code gen_ai.system @endcode describes a family of GenAI models with specific model + *

+ * The @code gen_ai.system @endcode describes a family of GenAI models with specific model * identified by @code gen_ai.request.model @endcode and @code gen_ai.response.model @endcode * attributes.

The actual GenAI product may differ from the one identified by the client. For * example, when using OpenAI client libraries to communicate with Mistral, the @code gen_ai.system @@ -109,130 +111,94 @@ static const char *kGenAiResponseModel = "gen_ai.response.model"; * custom model, a custom friendly name SHOULD be used. If none of these options apply, the @code * gen_ai.system @endcode SHOULD be set to @code _OTHER @endcode. */ -static const char *kGenAiSystem = "gen_ai.system"; +static constexpr const char *kGenAiSystem = "gen_ai.system"; /** * The type of token being counted. */ -static const char *kGenAiTokenType = "gen_ai.token.type"; +static constexpr const char *kGenAiTokenType = "gen_ai.token.type"; /** - * @Deprecated: Replaced by @code gen_ai.usage.output_tokens @endcode attribute. + * Deprecated, use @code gen_ai.usage.output_tokens @endcode instead. + *

+ * @deprecated + * Replaced by @code gen_ai.usage.output_tokens @endcode attribute. */ -static const char *kGenAiUsageCompletionTokens = "gen_ai.usage.completion_tokens"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kGenAiUsageCompletionTokens = "gen_ai.usage.completion_tokens"; /** * The number of tokens used in the GenAI input (prompt). */ -static const char *kGenAiUsageInputTokens = "gen_ai.usage.input_tokens"; +static constexpr const char *kGenAiUsageInputTokens = "gen_ai.usage.input_tokens"; /** * The number of tokens used in the GenAI response (completion). */ -static const char *kGenAiUsageOutputTokens = "gen_ai.usage.output_tokens"; +static constexpr const char *kGenAiUsageOutputTokens = "gen_ai.usage.output_tokens"; /** - * @Deprecated: Replaced by @code gen_ai.usage.input_tokens @endcode attribute. + * Deprecated, use @code gen_ai.usage.input_tokens @endcode instead. + *

+ * @deprecated + * Replaced by @code gen_ai.usage.input_tokens @endcode attribute. */ -static const char *kGenAiUsagePromptTokens = "gen_ai.usage.prompt_tokens"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kGenAiUsagePromptTokens = "gen_ai.usage.prompt_tokens"; -// DEBUG: {"brief": "The name of the operation being performed.", "name": "gen_ai.operation.name", -// "note": "If one of the predefined values applies, but specific system uses a different name it's -// RECOMMENDED to document it in the semantic conventions for specific GenAI system and use -// system-specific name in the instrumentation. If a different name is not documented, -// instrumentation libraries SHOULD use applicable predefined value.\n", "requirement_level": -// "recommended", "root_namespace": "gen_ai", "stability": "experimental", "type": -// {"allow_custom_values": true, "members": [{"brief": "Chat completion operation such as [OpenAI -// Chat API](https://platform.openai.com/docs/api-reference/chat)", "deprecated": none, "id": -// "chat", "note": none, "stability": "experimental", "value": "chat"}, {"brief": "Text completions -// operation such as [OpenAI Completions API -// (Legacy)](https://platform.openai.com/docs/api-reference/completions)", "deprecated": none, "id": -// "text_completion", "note": none, "stability": "experimental", "value": "text_completion"}]}} namespace GenAiOperationNameValues { /** * Chat completion operation such as OpenAI Chat API. + * href="https://platform.openai.com/docs/api-reference/chat">OpenAI Chat API */ -// DEBUG: {"brief": "Chat completion operation such as [OpenAI Chat -// API](https://platform.openai.com/docs/api-reference/chat)", "deprecated": none, "id": "chat", -// "note": none, "stability": "experimental", "value": "chat"} static constexpr const char *kChat = "chat"; + /** * Text completions operation such as OpenAI Completions API - * (Legacy). + * (Legacy) */ -// DEBUG: {"brief": "Text completions operation such as [OpenAI Completions API -// (Legacy)](https://platform.openai.com/docs/api-reference/completions)", "deprecated": none, "id": -// "text_completion", "note": none, "stability": "experimental", "value": "text_completion"} static constexpr const char *kTextCompletion = "text_completion"; + } // namespace GenAiOperationNameValues -// DEBUG: {"brief": "The Generative AI product as identified by the client or server -// instrumentation.", "examples": "openai", "name": "gen_ai.system", "note": "The `gen_ai.system` -// describes a family of GenAI models with specific model identified\nby `gen_ai.request.model` and -// `gen_ai.response.model` attributes.\n\nThe actual GenAI product may differ from the one -// identified by the client.\nFor example, when using OpenAI client libraries to communicate with -// Mistral, the `gen_ai.system`\nis set to `openai` based on the instrumentation's best -// knowledge.\n\nFor custom model, a custom friendly name SHOULD be used.\nIf none of these options -// apply, the `gen_ai.system` SHOULD be set to `_OTHER`.\n", "requirement_level": "recommended", -// "root_namespace": "gen_ai", "stability": "experimental", "type": {"allow_custom_values": true, -// "members": [{"brief": "OpenAI", "deprecated": none, "id": "openai", "note": none, "stability": -// "experimental", "value": "openai"}, {"brief": "Vertex AI", "deprecated": none, "id": "vertex_ai", -// "note": none, "stability": "experimental", "value": "vertex_ai"}, {"brief": "Anthropic", -// "deprecated": none, "id": "anthropic", "note": none, "stability": "experimental", "value": -// "anthropic"}, {"brief": "Cohere", "deprecated": none, "id": "cohere", "note": none, "stability": -// "experimental", "value": "cohere"}]}} namespace GenAiSystemValues { /** - * OpenAI. + * OpenAI */ -// DEBUG: {"brief": "OpenAI", "deprecated": none, "id": "openai", "note": none, "stability": -// "experimental", "value": "openai"} static constexpr const char *kOpenai = "openai"; + /** - * Vertex AI. + * Vertex AI */ -// DEBUG: {"brief": "Vertex AI", "deprecated": none, "id": "vertex_ai", "note": none, "stability": -// "experimental", "value": "vertex_ai"} static constexpr const char *kVertexAi = "vertex_ai"; + /** - * Anthropic. + * Anthropic */ -// DEBUG: {"brief": "Anthropic", "deprecated": none, "id": "anthropic", "note": none, "stability": -// "experimental", "value": "anthropic"} static constexpr const char *kAnthropic = "anthropic"; + /** - * Cohere. + * Cohere */ -// DEBUG: {"brief": "Cohere", "deprecated": none, "id": "cohere", "note": none, "stability": -// "experimental", "value": "cohere"} static constexpr const char *kCohere = "cohere"; + } // namespace GenAiSystemValues -// DEBUG: {"brief": "The type of token being counted.", "examples": ["input", "output"], "name": -// "gen_ai.token.type", "requirement_level": "recommended", "root_namespace": "gen_ai", "stability": -// "experimental", "type": {"allow_custom_values": true, "members": [{"brief": "Input tokens -// (prompt, input, etc.)", "deprecated": none, "id": "input", "note": none, "stability": -// "experimental", "value": "input"}, {"brief": "Output tokens (completion, response, etc.)", -// "deprecated": none, "id": "completion", "note": none, "stability": "experimental", "value": -// "output"}]}} namespace GenAiTokenTypeValues { /** - * Input tokens (prompt, input, etc.). + * Input tokens (prompt, input, etc.) */ -// DEBUG: {"brief": "Input tokens (prompt, input, etc.)", "deprecated": none, "id": "input", "note": -// none, "stability": "experimental", "value": "input"} static constexpr const char *kInput = "input"; + /** - * Output tokens (completion, response, etc.). + * Output tokens (completion, response, etc.) */ -// DEBUG: {"brief": "Output tokens (completion, response, etc.)", "deprecated": none, "id": -// "completion", "note": none, "stability": "experimental", "value": "output"} static constexpr const char *kCompletion = "output"; + } // namespace GenAiTokenTypeValues } // namespace gen_ai diff --git a/api/include/opentelemetry/semconv/incubating/attributes/graphql_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/graphql_attributes.h index 77aa8c9731..fe899d1c69 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/graphql_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/graphql_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -23,48 +21,38 @@ namespace graphql /** * The GraphQL document being executed. - * Note: The value may be sanitized to exclude sensitive information. + *

+ * The value may be sanitized to exclude sensitive information. */ -static const char *kGraphqlDocument = "graphql.document"; +static constexpr const char *kGraphqlDocument = "graphql.document"; /** * The name of the operation being executed. */ -static const char *kGraphqlOperationName = "graphql.operation.name"; +static constexpr const char *kGraphqlOperationName = "graphql.operation.name"; /** * The type of the operation being executed. */ -static const char *kGraphqlOperationType = "graphql.operation.type"; +static constexpr const char *kGraphqlOperationType = "graphql.operation.type"; -// DEBUG: {"brief": "The type of the operation being executed.", "examples": ["query", "mutation", -// "subscription"], "name": "graphql.operation.type", "requirement_level": "recommended", -// "root_namespace": "graphql", "stability": "experimental", "type": {"allow_custom_values": true, -// "members": [{"brief": "GraphQL query", "deprecated": none, "id": "query", "note": none, -// "stability": "experimental", "value": "query"}, {"brief": "GraphQL mutation", "deprecated": none, -// "id": "mutation", "note": none, "stability": "experimental", "value": "mutation"}, {"brief": -// "GraphQL subscription", "deprecated": none, "id": "subscription", "note": none, "stability": -// "experimental", "value": "subscription"}]}} namespace GraphqlOperationTypeValues { /** - * GraphQL query. + * GraphQL query */ -// DEBUG: {"brief": "GraphQL query", "deprecated": none, "id": "query", "note": none, "stability": -// "experimental", "value": "query"} static constexpr const char *kQuery = "query"; + /** - * GraphQL mutation. + * GraphQL mutation */ -// DEBUG: {"brief": "GraphQL mutation", "deprecated": none, "id": "mutation", "note": none, -// "stability": "experimental", "value": "mutation"} static constexpr const char *kMutation = "mutation"; + /** - * GraphQL subscription. + * GraphQL subscription */ -// DEBUG: {"brief": "GraphQL subscription", "deprecated": none, "id": "subscription", "note": none, -// "stability": "experimental", "value": "subscription"} static constexpr const char *kSubscription = "subscription"; + } // namespace GraphqlOperationTypeValues } // namespace graphql diff --git a/api/include/opentelemetry/semconv/incubating/attributes/heroku_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/heroku_attributes.h index 3854c0f60b..a16bd33161 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/heroku_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/heroku_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -22,19 +20,19 @@ namespace heroku { /** - * Unique identifier for the application. + * Unique identifier for the application */ -static const char *kHerokuAppId = "heroku.app.id"; +static constexpr const char *kHerokuAppId = "heroku.app.id"; /** - * Commit hash for the current release. + * Commit hash for the current release */ -static const char *kHerokuReleaseCommit = "heroku.release.commit"; +static constexpr const char *kHerokuReleaseCommit = "heroku.release.commit"; /** - * Time and date the release was created. + * Time and date the release was created */ -static const char *kHerokuReleaseCreationTimestamp = "heroku.release.creation_timestamp"; +static constexpr const char *kHerokuReleaseCreationTimestamp = "heroku.release.creation_timestamp"; } // namespace heroku } // namespace semconv diff --git a/api/include/opentelemetry/semconv/incubating/attributes/host_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/host_attributes.h index 216b14216b..e608bd5d46 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/host_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/host_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -24,155 +22,136 @@ namespace host /** * The CPU architecture the host system is running on. */ -static const char *kHostArch = "host.arch"; +static constexpr const char *kHostArch = "host.arch"; /** * The amount of level 2 memory cache available to the processor (in Bytes). */ -static const char *kHostCpuCacheL2Size = "host.cpu.cache.l2.size"; +static constexpr const char *kHostCpuCacheL2Size = "host.cpu.cache.l2.size"; /** * Family or generation of the CPU. */ -static const char *kHostCpuFamily = "host.cpu.family"; +static constexpr const char *kHostCpuFamily = "host.cpu.family"; /** * Model identifier. It provides more granular information about the CPU, distinguishing it from * other CPUs within the same family. */ -static const char *kHostCpuModelId = "host.cpu.model.id"; +static constexpr const char *kHostCpuModelId = "host.cpu.model.id"; /** * Model designation of the processor. */ -static const char *kHostCpuModelName = "host.cpu.model.name"; +static constexpr const char *kHostCpuModelName = "host.cpu.model.name"; /** * Stepping or core revisions. */ -static const char *kHostCpuStepping = "host.cpu.stepping"; +static constexpr const char *kHostCpuStepping = "host.cpu.stepping"; /** * Processor manufacturer identifier. A maximum 12-character string. - * Note: CPUID command returns the vendor ID string in - * EBX, EDX and ECX registers. Writing these to memory in this order results in a 12-character - * string. + *

+ * CPUID command returns the vendor ID string in EBX, EDX + * and ECX registers. Writing these to memory in this order results in a 12-character string. */ -static const char *kHostCpuVendorId = "host.cpu.vendor.id"; +static constexpr const char *kHostCpuVendorId = "host.cpu.vendor.id"; /** * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For * non-containerized systems, this should be the @code machine-id @endcode. See the table below for * the sources to use to determine the @code machine-id @endcode based on operating system. */ -static const char *kHostId = "host.id"; +static constexpr const char *kHostId = "host.id"; /** * VM image ID or host OS image ID. For Cloud, this value is from the provider. */ -static const char *kHostImageId = "host.image.id"; +static constexpr const char *kHostImageId = "host.image.id"; /** * Name of the VM image or OS install the host was instantiated from. */ -static const char *kHostImageName = "host.image.name"; +static constexpr const char *kHostImageName = "host.image.name"; /** * The version string of the VM image or host OS as defined in Version Attributes. */ -static const char *kHostImageVersion = "host.image.version"; +static constexpr const char *kHostImageVersion = "host.image.version"; /** * Available IP addresses of the host, excluding loopback interfaces. - * Note: IPv4 Addresses MUST be specified in dotted-quad notation. IPv6 addresses MUST be specified - * in the RFC 5952 format. + *

+ * IPv4 Addresses MUST be specified in dotted-quad notation. IPv6 addresses MUST be specified in the + * RFC 5952 format. */ -static const char *kHostIp = "host.ip"; +static constexpr const char *kHostIp = "host.ip"; /** * Available MAC addresses of the host, excluding loopback interfaces. - * Note: MAC Addresses MUST be represented in + * MAC Addresses MUST be represented in IEEE RA * hexadecimal form: as hyphen-separated octets in uppercase hexadecimal form from most to least * significant. */ -static const char *kHostMac = "host.mac"; +static constexpr const char *kHostMac = "host.mac"; /** * Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully * qualified hostname, or another name specified by the user. */ -static const char *kHostName = "host.name"; +static constexpr const char *kHostName = "host.name"; /** * Type of host. For Cloud, this must be the machine type. */ -static const char *kHostType = "host.type"; - -// DEBUG: {"brief": "The CPU architecture the host system is running on.\n", "name": "host.arch", -// "requirement_level": "recommended", "root_namespace": "host", "stability": "experimental", -// "type": {"allow_custom_values": true, "members": [{"brief": "AMD64", "deprecated": none, "id": -// "amd64", "note": none, "stability": "experimental", "value": "amd64"}, {"brief": "ARM32", -// "deprecated": none, "id": "arm32", "note": none, "stability": "experimental", "value": "arm32"}, -// {"brief": "ARM64", "deprecated": none, "id": "arm64", "note": none, "stability": "experimental", -// "value": "arm64"}, {"brief": "Itanium", "deprecated": none, "id": "ia64", "note": none, -// "stability": "experimental", "value": "ia64"}, {"brief": "32-bit PowerPC", "deprecated": none, -// "id": "ppc32", "note": none, "stability": "experimental", "value": "ppc32"}, {"brief": "64-bit -// PowerPC", "deprecated": none, "id": "ppc64", "note": none, "stability": "experimental", "value": -// "ppc64"}, {"brief": "IBM z/Architecture", "deprecated": none, "id": "s390x", "note": none, -// "stability": "experimental", "value": "s390x"}, {"brief": "32-bit x86", "deprecated": none, "id": -// "x86", "note": none, "stability": "experimental", "value": "x86"}]}} +static constexpr const char *kHostType = "host.type"; + namespace HostArchValues { /** - * AMD64. + * AMD64 */ -// DEBUG: {"brief": "AMD64", "deprecated": none, "id": "amd64", "note": none, "stability": -// "experimental", "value": "amd64"} static constexpr const char *kAmd64 = "amd64"; + /** - * ARM32. + * ARM32 */ -// DEBUG: {"brief": "ARM32", "deprecated": none, "id": "arm32", "note": none, "stability": -// "experimental", "value": "arm32"} static constexpr const char *kArm32 = "arm32"; + /** - * ARM64. + * ARM64 */ -// DEBUG: {"brief": "ARM64", "deprecated": none, "id": "arm64", "note": none, "stability": -// "experimental", "value": "arm64"} static constexpr const char *kArm64 = "arm64"; + /** - * Itanium. + * Itanium */ -// DEBUG: {"brief": "Itanium", "deprecated": none, "id": "ia64", "note": none, "stability": -// "experimental", "value": "ia64"} static constexpr const char *kIa64 = "ia64"; + /** - * 32-bit PowerPC. + * 32-bit PowerPC */ -// DEBUG: {"brief": "32-bit PowerPC", "deprecated": none, "id": "ppc32", "note": none, "stability": -// "experimental", "value": "ppc32"} static constexpr const char *kPpc32 = "ppc32"; + /** - * 64-bit PowerPC. + * 64-bit PowerPC */ -// DEBUG: {"brief": "64-bit PowerPC", "deprecated": none, "id": "ppc64", "note": none, "stability": -// "experimental", "value": "ppc64"} static constexpr const char *kPpc64 = "ppc64"; + /** - * IBM z/Architecture. + * IBM z/Architecture */ -// DEBUG: {"brief": "IBM z/Architecture", "deprecated": none, "id": "s390x", "note": none, -// "stability": "experimental", "value": "s390x"} static constexpr const char *kS390x = "s390x"; + /** - * 32-bit x86. + * 32-bit x86 */ -// DEBUG: {"brief": "32-bit x86", "deprecated": none, "id": "x86", "note": none, "stability": -// "experimental", "value": "x86"} static constexpr const char *kX86 = "x86"; + } // namespace HostArchValues } // namespace host diff --git a/api/include/opentelemetry/semconv/incubating/attributes/http_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/http_attributes.h index 5450f06f92..3e06e4e925 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/http_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/http_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -22,30 +20,46 @@ namespace http { /** - * @Deprecated: Replaced by @code client.address @endcode. + * Deprecated, use @code client.address @endcode instead. + *

+ * @deprecated + * Replaced by @code client.address @endcode. */ -static const char *kHttpClientIp = "http.client_ip"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kHttpClientIp = "http.client_ip"; /** * State of the HTTP connection in the HTTP connection pool. */ -static const char *kHttpConnectionState = "http.connection.state"; +static constexpr const char *kHttpConnectionState = "http.connection.state"; /** - * @Deprecated: Replaced by @code network.protocol.name @endcode. + * Deprecated, use @code network.protocol.name @endcode instead. + *

+ * @deprecated + * Replaced by @code network.protocol.name @endcode. */ -static const char *kHttpFlavor = "http.flavor"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kHttpFlavor = "http.flavor"; /** - * @Deprecated: Replaced by one of @code server.address @endcode, @code client.address @endcode or - * @code http.request.header.host @endcode, depending on the usage. + * Deprecated, use one of @code server.address @endcode, @code client.address @endcode or @code + * http.request.header.host @endcode instead, depending on the usage.

+ * @deprecated + * Replaced by one of @code server.address @endcode, @code client.address @endcode or @code + * http.request.header.host @endcode, depending on the usage. */ -static const char *kHttpHost = "http.host"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kHttpHost = "http.host"; /** - * @Deprecated: Replaced by @code http.request.method @endcode. + * Deprecated, use @code http.request.method @endcode instead. + *

+ * @deprecated + * Replaced by @code http.request.method @endcode. */ -static const char *kHttpMethod = "http.method"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kHttpMethod = "http.method"; /** * The size of the request payload body in bytes. This is the number of bytes transferred excluding @@ -53,48 +67,81 @@ static const char *kHttpMethod = "http.method"; * href="https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length">Content-Length * header. For requests using transport encoding, this should be the compressed size. */ -static const char *kHttpRequestBodySize = "http.request.body.size"; +static constexpr const char *kHttpRequestBodySize = "http.request.body.size"; /** - * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.http_attributes. - * @endcode. + * HTTP request headers, @code @endcode being the normalized HTTP Header name (lowercase), the + * value being the header values.

Instrumentations SHOULD require an explicit configuration of + * which headers are to be captured. Including all request headers can be a security risk - explicit + * configuration helps avoid leaking sensitive information. The @code User-Agent @endcode header is + * already captured in the @code user_agent.original @endcode attribute. Users MAY explicitly + * configure instrumentations to capture them even though it is not recommended. The attribute value + * MUST consist of either multiple header values as an array of strings or a single-item array + * containing a possibly comma-concatenated string, depending on the way the HTTP library provides + * access to headers. */ -static const char *kHttpRequestHeader = "http.request.header"; +static constexpr const char *kHttpRequestHeader = "http.request.header"; /** - * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.http_attributes. - * @endcode. + * HTTP request method. + *

+ * HTTP request method value SHOULD be "known" to the instrumentation. + * By default, this convention defines "known" methods as the ones listed in RFC9110 and the PATCH method + * defined in RFC5789.

If the HTTP + * request method is not known to instrumentation, it MUST set the @code http.request.method + * @endcode attribute to @code _OTHER @endcode.

If the HTTP instrumentation could end up + * converting valid HTTP request methods to @code _OTHER @endcode, then it MUST provide a way to + * override the list of known HTTP methods. If this override is done via environment variable, then + * the environment variable MUST be named OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a + * comma-separated list of case-sensitive known HTTP methods (this list MUST be a full override of + * the default known method, it is not a list of known methods in addition to the defaults).

+ * HTTP method names are case-sensitive and @code http.request.method @endcode 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 @code http.request.method_original @endcode to the + * original value. */ -static const char *kHttpRequestMethod = "http.request.method"; +static constexpr const char *kHttpRequestMethod = "http.request.method"; /** - * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.http_attributes. - * @endcode. + * Original HTTP method sent by the client in the request line. */ -static const char *kHttpRequestMethodOriginal = "http.request.method_original"; +static constexpr const char *kHttpRequestMethodOriginal = "http.request.method_original"; /** - * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.http_attributes. - * @endcode. + * The ordinal number of request resending attempt (for any reason, including redirects). + *

+ * The resend count SHOULD be updated each time an HTTP request gets resent by the client, + * regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 + * Server Unavailable, network issues, or any other). */ -static const char *kHttpRequestResendCount = "http.request.resend_count"; +static constexpr const char *kHttpRequestResendCount = "http.request.resend_count"; /** * 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. */ -static const char *kHttpRequestSize = "http.request.size"; +static constexpr const char *kHttpRequestSize = "http.request.size"; /** - * @Deprecated: Replaced by @code http.request.header.content-length @endcode. + * Deprecated, use @code http.request.header.content-length @endcode instead. + *

+ * @deprecated + * Replaced by @code http.request.header.content-length @endcode. */ -static const char *kHttpRequestContentLength = "http.request_content_length"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kHttpRequestContentLength = "http.request_content_length"; /** - * @Deprecated: Replaced by @code http.request.body.size @endcode. + * Deprecated, use @code http.request.body.size @endcode instead. + *

+ * @deprecated + * Replaced by @code http.request.body.size @endcode. */ -static const char *kHttpRequestContentLengthUncompressed = +OPENTELEMETRY_DEPRECATED +static constexpr const char *kHttpRequestContentLengthUncompressed = "http.request_content_length_uncompressed"; /** @@ -103,254 +150,214 @@ static const char *kHttpRequestContentLengthUncompressed = * href="https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length">Content-Length * header. For requests using transport encoding, this should be the compressed size. */ -static const char *kHttpResponseBodySize = "http.response.body.size"; +static constexpr const char *kHttpResponseBodySize = "http.response.body.size"; /** - * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.http_attributes. - * @endcode. + * HTTP response headers, @code @endcode being the normalized HTTP Header name (lowercase), + * the value being the header values.

Instrumentations SHOULD require an explicit configuration + * of which headers are to be captured. Including all response headers can be a security risk - + * explicit configuration helps avoid leaking sensitive information. Users MAY explicitly configure + * instrumentations to capture them even though it is not recommended. The attribute value MUST + * consist of either multiple header values as an array of strings or a single-item array containing + * a possibly comma-concatenated string, depending on the way the HTTP library provides access to + * headers. */ -static const char *kHttpResponseHeader = "http.response.header"; +static constexpr const char *kHttpResponseHeader = "http.response.header"; /** * 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. */ -static const char *kHttpResponseSize = "http.response.size"; +static constexpr const char *kHttpResponseSize = "http.response.size"; /** - * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.http_attributes. - * @endcode. + * HTTP response status code. */ -static const char *kHttpResponseStatusCode = "http.response.status_code"; +static constexpr const char *kHttpResponseStatusCode = "http.response.status_code"; /** - * @Deprecated: Replaced by @code http.response.header.content-length @endcode. + * Deprecated, use @code http.response.header.content-length @endcode instead. + *

+ * @deprecated + * Replaced by @code http.response.header.content-length @endcode. */ -static const char *kHttpResponseContentLength = "http.response_content_length"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kHttpResponseContentLength = "http.response_content_length"; /** - * @Deprecated: Replace by @code http.response.body.size @endcode. + * Deprecated, use @code http.response.body.size @endcode instead. + *

+ * @deprecated + * Replace by @code http.response.body.size @endcode. */ -static const char *kHttpResponseContentLengthUncompressed = +OPENTELEMETRY_DEPRECATED +static constexpr const char *kHttpResponseContentLengthUncompressed = "http.response_content_length_uncompressed"; /** - * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.http_attributes. - * @endcode. + * The matched route, that is, the path template in the format used by the respective server + * framework.

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 if + * there is one. */ -static const char *kHttpRoute = "http.route"; +static constexpr const char *kHttpRoute = "http.route"; /** - * @Deprecated: Replaced by @code url.scheme @endcode instead. + * Deprecated, use @code url.scheme @endcode instead. + *

+ * @deprecated + * Replaced by @code url.scheme @endcode instead. */ -static const char *kHttpScheme = "http.scheme"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kHttpScheme = "http.scheme"; /** - * @Deprecated: Replaced by @code server.address @endcode. + * Deprecated, use @code server.address @endcode instead. + *

+ * @deprecated + * Replaced by @code server.address @endcode. */ -static const char *kHttpServerName = "http.server_name"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kHttpServerName = "http.server_name"; /** - * @Deprecated: Replaced by @code http.response.status_code @endcode. + * Deprecated, use @code http.response.status_code @endcode instead. + *

+ * @deprecated + * Replaced by @code http.response.status_code @endcode. */ -static const char *kHttpStatusCode = "http.status_code"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kHttpStatusCode = "http.status_code"; /** - * @Deprecated: Split to @code url.path @endcode and `url.query. + * Deprecated, use @code url.path @endcode and @code url.query @endcode instead. + *

+ * @deprecated + * Split to @code url.path @endcode and `url.query. */ -static const char *kHttpTarget = "http.target"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kHttpTarget = "http.target"; /** - * @Deprecated: Replaced by @code url.full @endcode. + * Deprecated, use @code url.full @endcode instead. + *

+ * @deprecated + * Replaced by @code url.full @endcode. */ -static const char *kHttpUrl = "http.url"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kHttpUrl = "http.url"; /** - * @Deprecated: Replaced by @code user_agent.original @endcode. + * Deprecated, use @code user_agent.original @endcode instead. + *

+ * @deprecated + * Replaced by @code user_agent.original @endcode. */ -static const char *kHttpUserAgent = "http.user_agent"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kHttpUserAgent = "http.user_agent"; -// DEBUG: {"brief": "State of the HTTP connection in the HTTP connection pool.", "examples": -// ["active", "idle"], "name": "http.connection.state", "requirement_level": "recommended", -// "root_namespace": "http", "stability": "experimental", "type": {"allow_custom_values": true, -// "members": [{"brief": "active state.", "deprecated": none, "id": "active", "note": none, -// "stability": "experimental", "value": "active"}, {"brief": "idle state.", "deprecated": none, -// "id": "idle", "note": none, "stability": "experimental", "value": "idle"}]}} namespace HttpConnectionStateValues { /** * active state. */ -// DEBUG: {"brief": "active state.", "deprecated": none, "id": "active", "note": none, "stability": -// "experimental", "value": "active"} static constexpr const char *kActive = "active"; + /** * idle state. */ -// DEBUG: {"brief": "idle state.", "deprecated": none, "id": "idle", "note": none, "stability": -// "experimental", "value": "idle"} static constexpr const char *kIdle = "idle"; + } // namespace HttpConnectionStateValues -// @deprecated(reason="The attribute http.flavor is deprecated - Replaced by -// `network.protocol.name`") # type: ignore DEBUG: {"brief": "Deprecated, use -// `network.protocol.name` instead.", "deprecated": "Replaced by `network.protocol.name`.", "name": -// "http.flavor", "requirement_level": "recommended", "root_namespace": "http", "stability": -// "experimental", "type": {"allow_custom_values": true, "members": [{"brief": "HTTP/1.0", -// "deprecated": none, "id": "http_1_0", "note": none, "stability": "experimental", "value": "1.0"}, -// {"brief": "HTTP/1.1", "deprecated": none, "id": "http_1_1", "note": none, "stability": -// "experimental", "value": "1.1"}, {"brief": "HTTP/2", "deprecated": none, "id": "http_2_0", -// "note": none, "stability": "experimental", "value": "2.0"}, {"brief": "HTTP/3", "deprecated": -// none, "id": "http_3_0", "note": none, "stability": "experimental", "value": "3.0"}, {"brief": -// "SPDY protocol.", "deprecated": none, "id": "spdy", "note": none, "stability": "experimental", -// "value": "SPDY"}, {"brief": "QUIC protocol.", "deprecated": none, "id": "quic", "note": none, -// "stability": "experimental", "value": "QUIC"}]}} namespace HttpFlavorValues { /** - * HTTP/1.0. + * HTTP/1.0 */ -// DEBUG: {"brief": "HTTP/1.0", "deprecated": none, "id": "http_1_0", "note": none, "stability": -// "experimental", "value": "1.0"} static constexpr const char *kHttp10 = "1.0"; + /** - * HTTP/1.1. + * HTTP/1.1 */ -// DEBUG: {"brief": "HTTP/1.1", "deprecated": none, "id": "http_1_1", "note": none, "stability": -// "experimental", "value": "1.1"} static constexpr const char *kHttp11 = "1.1"; + /** - * HTTP/2. + * HTTP/2 */ -// DEBUG: {"brief": "HTTP/2", "deprecated": none, "id": "http_2_0", "note": none, "stability": -// "experimental", "value": "2.0"} static constexpr const char *kHttp20 = "2.0"; + /** - * HTTP/3. + * HTTP/3 */ -// DEBUG: {"brief": "HTTP/3", "deprecated": none, "id": "http_3_0", "note": none, "stability": -// "experimental", "value": "3.0"} static constexpr const char *kHttp30 = "3.0"; + /** * SPDY protocol. */ -// DEBUG: {"brief": "SPDY protocol.", "deprecated": none, "id": "spdy", "note": none, "stability": -// "experimental", "value": "SPDY"} static constexpr const char *kSpdy = "SPDY"; + /** * QUIC protocol. */ -// DEBUG: {"brief": "QUIC protocol.", "deprecated": none, "id": "quic", "note": none, "stability": -// "experimental", "value": "QUIC"} static constexpr const char *kQuic = "QUIC"; + } // namespace HttpFlavorValues -// @deprecated(reason="Deprecated in favor of stable -// `opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues`.") # type: ignore -// DEBUG: {"brief": "HTTP request method.", "examples": ["GET", "POST", "HEAD"], "name": -// "http.request.method", "note": "HTTP request method value SHOULD be \"known\" to the -// instrumentation.\nBy default, this convention defines \"known\" methods as the ones listed in -// [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods)\nand the PATCH method defined -// in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html).\n\nIf the HTTP request method is not -// known to instrumentation, it MUST set the `http.request.method` attribute to `_OTHER`.\n\nIf the -// HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it MUST -// provide a way to override\nthe list of known HTTP methods. If this override is done via -// environment variable, then the environment variable MUST be -// named\nOTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of -// case-sensitive known HTTP methods\n(this list MUST be a full override of the default known -// method, it is not a list of known methods in addition to the defaults).\n\nHTTP method names are -// case-sensitive and `http.request.method` attribute value MUST match a known HTTP method name -// exactly.\nInstrumentations for specific web frameworks that consider HTTP methods to be case -// insensitive, SHOULD populate a canonical equivalent.\nTracing instrumentations that do so, MUST -// also set `http.request.method_original` to the original value.\n", "requirement_level": -// "recommended", "root_namespace": "http", "stability": "stable", "type": {"allow_custom_values": -// true, "members": [{"brief": "CONNECT method.", "deprecated": none, "id": "connect", "note": none, -// "stability": "stable", "value": "CONNECT"}, {"brief": "DELETE method.", "deprecated": none, "id": -// "delete", "note": none, "stability": "stable", "value": "DELETE"}, {"brief": "GET method.", -// "deprecated": none, "id": "get", "note": none, "stability": "stable", "value": "GET"}, {"brief": -// "HEAD method.", "deprecated": none, "id": "head", "note": none, "stability": "stable", "value": -// "HEAD"}, {"brief": "OPTIONS method.", "deprecated": none, "id": "options", "note": none, -// "stability": "stable", "value": "OPTIONS"}, {"brief": "PATCH method.", "deprecated": none, "id": -// "patch", "note": none, "stability": "stable", "value": "PATCH"}, {"brief": "POST method.", -// "deprecated": none, "id": "post", "note": none, "stability": "stable", "value": "POST"}, -// {"brief": "PUT method.", "deprecated": none, "id": "put", "note": none, "stability": "stable", -// "value": "PUT"}, {"brief": "TRACE method.", "deprecated": none, "id": "trace", "note": none, -// "stability": "stable", "value": "TRACE"}, {"brief": "Any HTTP method that the instrumentation has -// no prior knowledge of.", "deprecated": none, "id": "other", "note": none, "stability": "stable", -// "value": "_OTHER"}]}} namespace HttpRequestMethodValues { /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues.kConnect @endcode. + * CONNECT method. */ -// DEBUG: {"brief": "CONNECT method.", "deprecated": none, "id": "connect", "note": none, -// "stability": "stable", "value": "CONNECT"} static constexpr const char *kConnect = "CONNECT"; + /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues.kDelete @endcode. + * DELETE method. */ -// DEBUG: {"brief": "DELETE method.", "deprecated": none, "id": "delete", "note": none, "stability": -// "stable", "value": "DELETE"} static constexpr const char *kDelete = "DELETE"; + /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues.kGet @endcode. + * GET method. */ -// DEBUG: {"brief": "GET method.", "deprecated": none, "id": "get", "note": none, "stability": -// "stable", "value": "GET"} static constexpr const char *kGet = "GET"; + /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues.kHead @endcode. + * HEAD method. */ -// DEBUG: {"brief": "HEAD method.", "deprecated": none, "id": "head", "note": none, "stability": -// "stable", "value": "HEAD"} static constexpr const char *kHead = "HEAD"; + /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues.kOptions @endcode. + * OPTIONS method. */ -// DEBUG: {"brief": "OPTIONS method.", "deprecated": none, "id": "options", "note": none, -// "stability": "stable", "value": "OPTIONS"} static constexpr const char *kOptions = "OPTIONS"; + /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues.kPatch @endcode. + * PATCH method. */ -// DEBUG: {"brief": "PATCH method.", "deprecated": none, "id": "patch", "note": none, "stability": -// "stable", "value": "PATCH"} static constexpr const char *kPatch = "PATCH"; + /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues.kPost @endcode. + * POST method. */ -// DEBUG: {"brief": "POST method.", "deprecated": none, "id": "post", "note": none, "stability": -// "stable", "value": "POST"} static constexpr const char *kPost = "POST"; + /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues.kPut @endcode. + * PUT method. */ -// DEBUG: {"brief": "PUT method.", "deprecated": none, "id": "put", "note": none, "stability": -// "stable", "value": "PUT"} static constexpr const char *kPut = "PUT"; + /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues.kTrace @endcode. + * TRACE method. */ -// DEBUG: {"brief": "TRACE method.", "deprecated": none, "id": "trace", "note": none, "stability": -// "stable", "value": "TRACE"} static constexpr const char *kTrace = "TRACE"; + /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues.kOther @endcode. + * Any HTTP method that the instrumentation has no prior knowledge of. */ -// DEBUG: {"brief": "Any HTTP method that the instrumentation has no prior knowledge of.", -// "deprecated": none, "id": "other", "note": none, "stability": "stable", "value": "_OTHER"} static constexpr const char *kOther = "_OTHER"; + } // namespace HttpRequestMethodValues } // namespace http diff --git a/api/include/opentelemetry/semconv/incubating/attributes/k8s_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/k8s_attributes.h index b6f21a38ad..2d51d057c7 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/k8s_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/k8s_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -24,11 +22,12 @@ namespace k8s /** * The name of the cluster. */ -static const char *kK8sClusterName = "k8s.cluster.name"; +static constexpr const char *kK8sClusterName = "k8s.cluster.name"; /** * A pseudo-ID for the cluster, set to the UID of the @code kube-system @endcode namespace. - * Note: K8s doesn't have support for obtaining a cluster ID. If this is ever + *

+ * K8s doesn't have support for obtaining a cluster ID. If this is ever * added, we will recommend collecting the @code k8s.cluster.uid @endcode through the * official APIs. In the meantime, we are able to use the @code uid @endcode of the * @code kube-system @endcode namespace as a proxy for cluster ID. Read on for the @@ -50,127 +49,131 @@ static const char *kK8sClusterName = "k8s.cluster.name"; * Therefore, UIDs between clusters should be extremely unlikely to * conflict. */ -static const char *kK8sClusterUid = "k8s.cluster.uid"; +static constexpr const char *kK8sClusterUid = "k8s.cluster.uid"; /** * The name of the Container from Pod specification, must be unique within a Pod. Container runtime * usually uses different globally unique name (@code container.name @endcode). */ -static const char *kK8sContainerName = "k8s.container.name"; +static constexpr const char *kK8sContainerName = "k8s.container.name"; /** * Number of times the container was restarted. This attribute can be used to identify a particular * container (running or stopped) within a container spec. */ -static const char *kK8sContainerRestartCount = "k8s.container.restart_count"; +static constexpr const char *kK8sContainerRestartCount = "k8s.container.restart_count"; /** * Last terminated reason of the Container. */ -static const char *kK8sContainerStatusLastTerminatedReason = +static constexpr const char *kK8sContainerStatusLastTerminatedReason = "k8s.container.status.last_terminated_reason"; /** * The name of the CronJob. */ -static const char *kK8sCronjobName = "k8s.cronjob.name"; +static constexpr const char *kK8sCronjobName = "k8s.cronjob.name"; /** * The UID of the CronJob. */ -static const char *kK8sCronjobUid = "k8s.cronjob.uid"; +static constexpr const char *kK8sCronjobUid = "k8s.cronjob.uid"; /** * The name of the DaemonSet. */ -static const char *kK8sDaemonsetName = "k8s.daemonset.name"; +static constexpr const char *kK8sDaemonsetName = "k8s.daemonset.name"; /** * The UID of the DaemonSet. */ -static const char *kK8sDaemonsetUid = "k8s.daemonset.uid"; +static constexpr const char *kK8sDaemonsetUid = "k8s.daemonset.uid"; /** * The name of the Deployment. */ -static const char *kK8sDeploymentName = "k8s.deployment.name"; +static constexpr const char *kK8sDeploymentName = "k8s.deployment.name"; /** * The UID of the Deployment. */ -static const char *kK8sDeploymentUid = "k8s.deployment.uid"; +static constexpr const char *kK8sDeploymentUid = "k8s.deployment.uid"; /** * The name of the Job. */ -static const char *kK8sJobName = "k8s.job.name"; +static constexpr const char *kK8sJobName = "k8s.job.name"; /** * The UID of the Job. */ -static const char *kK8sJobUid = "k8s.job.uid"; +static constexpr const char *kK8sJobUid = "k8s.job.uid"; /** * The name of the namespace that the pod is running in. */ -static const char *kK8sNamespaceName = "k8s.namespace.name"; +static constexpr const char *kK8sNamespaceName = "k8s.namespace.name"; /** * The name of the Node. */ -static const char *kK8sNodeName = "k8s.node.name"; +static constexpr const char *kK8sNodeName = "k8s.node.name"; /** * The UID of the Node. */ -static const char *kK8sNodeUid = "k8s.node.uid"; +static constexpr const char *kK8sNodeUid = "k8s.node.uid"; /** * The annotation key-value pairs placed on the Pod, the @code @endcode being the annotation * name, the value being the annotation value. */ -static const char *kK8sPodAnnotation = "k8s.pod.annotation"; +static constexpr const char *kK8sPodAnnotation = "k8s.pod.annotation"; /** * The label key-value pairs placed on the Pod, the @code @endcode being the label name, the * value being the label value. */ -static const char *kK8sPodLabel = "k8s.pod.label"; +static constexpr const char *kK8sPodLabel = "k8s.pod.label"; /** - * @Deprecated: Replaced by @code k8s.pod.label @endcode. + * Deprecated, use @code k8s.pod.label @endcode instead. + *

+ * @deprecated + * Replaced by @code k8s.pod.label @endcode. */ -static const char *kK8sPodLabels = "k8s.pod.labels"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kK8sPodLabels = "k8s.pod.labels"; /** * The name of the Pod. */ -static const char *kK8sPodName = "k8s.pod.name"; +static constexpr const char *kK8sPodName = "k8s.pod.name"; /** * The UID of the Pod. */ -static const char *kK8sPodUid = "k8s.pod.uid"; +static constexpr const char *kK8sPodUid = "k8s.pod.uid"; /** * The name of the ReplicaSet. */ -static const char *kK8sReplicasetName = "k8s.replicaset.name"; +static constexpr const char *kK8sReplicasetName = "k8s.replicaset.name"; /** * The UID of the ReplicaSet. */ -static const char *kK8sReplicasetUid = "k8s.replicaset.uid"; +static constexpr const char *kK8sReplicasetUid = "k8s.replicaset.uid"; /** * The name of the StatefulSet. */ -static const char *kK8sStatefulsetName = "k8s.statefulset.name"; +static constexpr const char *kK8sStatefulsetName = "k8s.statefulset.name"; /** * The UID of the StatefulSet. */ -static const char *kK8sStatefulsetUid = "k8s.statefulset.uid"; +static constexpr const char *kK8sStatefulsetUid = "k8s.statefulset.uid"; } // namespace k8s } // namespace semconv diff --git a/api/include/opentelemetry/semconv/incubating/attributes/linux_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/linux_attributes.h index 19f5a5af24..024e2b60e6 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/linux_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/linux_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -22,30 +20,22 @@ namespace linux { /** - * The Linux Slab memory state. + * The Linux Slab memory state */ -static const char *kLinuxMemorySlabState = "linux.memory.slab.state"; - -// DEBUG: {"brief": "The Linux Slab memory state", "examples": ["reclaimable", "unreclaimable"], -// "name": "linux.memory.slab.state", "requirement_level": "recommended", "root_namespace": "linux", -// "stability": "experimental", "type": {"allow_custom_values": true, "members": [{"brief": none, -// "deprecated": none, "id": "reclaimable", "note": none, "stability": "experimental", "value": -// "reclaimable"}, {"brief": none, "deprecated": none, "id": "unreclaimable", "note": none, -// "stability": "experimental", "value": "unreclaimable"}]}} +static constexpr const char *kLinuxMemorySlabState = "linux.memory.slab.state"; + namespace LinuxMemorySlabStateValues { /** - * reclaimable. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "reclaimable", "note": none, "stability": -// "experimental", "value": "reclaimable"} static constexpr const char *kReclaimable = "reclaimable"; + /** - * unreclaimable. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "unreclaimable", "note": none, "stability": -// "experimental", "value": "unreclaimable"} static constexpr const char *kUnreclaimable = "unreclaimable"; + } // namespace LinuxMemorySlabStateValues } // namespace linux diff --git a/api/include/opentelemetry/semconv/incubating/attributes/log_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/log_attributes.h index 3b455bf23c..6bda8a4d31 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/log_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/log_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -24,66 +22,59 @@ namespace log /** * The basename of the file. */ -static const char *kLogFileName = "log.file.name"; +static constexpr const char *kLogFileName = "log.file.name"; /** * The basename of the file, with symlinks resolved. */ -static const char *kLogFileNameResolved = "log.file.name_resolved"; +static constexpr const char *kLogFileNameResolved = "log.file.name_resolved"; /** * The full path to the file. */ -static const char *kLogFilePath = "log.file.path"; +static constexpr const char *kLogFilePath = "log.file.path"; /** * The full path to the file, with symlinks resolved. */ -static const char *kLogFilePathResolved = "log.file.path_resolved"; +static constexpr const char *kLogFilePathResolved = "log.file.path_resolved"; /** * The stream associated with the log. See below for a list of well-known values. */ -static const char *kLogIostream = "log.iostream"; +static constexpr const char *kLogIostream = "log.iostream"; /** * The complete orignal Log Record. - * Note: This value MAY be added when processing a Log Record which was originally transmitted as a - * string or equivalent data type AND the Body field of the Log Record does not contain the same - * value. (e.g. a syslog or a log record read from a file.). + *

+ * This value MAY be added when processing a Log Record which was originally transmitted as a string + * or equivalent data type AND the Body field of the Log Record does not contain the same value. + * (e.g. a syslog or a log record read from a file.) */ -static const char *kLogRecordOriginal = "log.record.original"; +static constexpr const char *kLogRecordOriginal = "log.record.original"; /** * A unique identifier for the Log Record. - * Note: If an id is provided, other log records with the same id will be considered duplicates and - * can be removed safely. This means, that two distinguishable log records MUST have different - * values. The id MAY be an Universally Unique - * Lexicographically Sortable Identifier (ULID), but other identifiers (e.g. UUID) may be used - * as needed. + *

+ * If an id is provided, other log records with the same id will be considered duplicates and can be + * removed safely. This means, that two distinguishable log records MUST have different values. The + * id MAY be an Universally Unique Lexicographically Sortable + * Identifier (ULID), but other identifiers (e.g. UUID) may be used as needed. */ -static const char *kLogRecordUid = "log.record.uid"; +static constexpr const char *kLogRecordUid = "log.record.uid"; -// DEBUG: {"brief": "The stream associated with the log. See below for a list of well-known -// values.\n", "name": "log.iostream", "requirement_level": "recommended", "root_namespace": "log", -// "stability": "experimental", "type": {"allow_custom_values": true, "members": [{"brief": "Logs -// from stdout stream", "deprecated": none, "id": "stdout", "note": none, "stability": -// "experimental", "value": "stdout"}, {"brief": "Events from stderr stream", "deprecated": none, -// "id": "stderr", "note": none, "stability": "experimental", "value": "stderr"}]}} namespace LogIostreamValues { /** - * Logs from stdout stream. + * Logs from stdout stream */ -// DEBUG: {"brief": "Logs from stdout stream", "deprecated": none, "id": "stdout", "note": none, -// "stability": "experimental", "value": "stdout"} static constexpr const char *kStdout = "stdout"; + /** - * Events from stderr stream. + * Events from stderr stream */ -// DEBUG: {"brief": "Events from stderr stream", "deprecated": none, "id": "stderr", "note": none, -// "stability": "experimental", "value": "stderr"} static constexpr const char *kStderr = "stderr"; + } // namespace LogIostreamValues } // namespace log diff --git a/api/include/opentelemetry/semconv/incubating/attributes/message_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/message_attributes.h index 6ce682415f..508a1e58f6 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/message_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/message_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -22,46 +20,53 @@ namespace message { /** - * @Deprecated: Replaced by @code rpc.message.compressed_size @endcode. + * Deprecated, use @code rpc.message.compressed_size @endcode instead. + *

+ * @deprecated + * Replaced by @code rpc.message.compressed_size @endcode. */ -static const char *kMessageCompressedSize = "message.compressed_size"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kMessageCompressedSize = "message.compressed_size"; /** - * @Deprecated: Replaced by @code rpc.message.id @endcode. + * Deprecated, use @code rpc.message.id @endcode instead. + *

+ * @deprecated + * Replaced by @code rpc.message.id @endcode. */ -static const char *kMessageId = "message.id"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kMessageId = "message.id"; /** - * @Deprecated: Replaced by @code rpc.message.type @endcode. + * Deprecated, use @code rpc.message.type @endcode instead. + *

+ * @deprecated + * Replaced by @code rpc.message.type @endcode. */ -static const char *kMessageType = "message.type"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kMessageType = "message.type"; /** - * @Deprecated: Replaced by @code rpc.message.uncompressed_size @endcode. + * Deprecated, use @code rpc.message.uncompressed_size @endcode instead. + *

+ * @deprecated + * Replaced by @code rpc.message.uncompressed_size @endcode. */ -static const char *kMessageUncompressedSize = "message.uncompressed_size"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kMessageUncompressedSize = "message.uncompressed_size"; -// @deprecated(reason="The attribute message.type is deprecated - Replaced by `rpc.message.type`") -// # type: ignore DEBUG: {"brief": "Deprecated, use `rpc.message.type` instead.", "deprecated": -// "Replaced by `rpc.message.type`.", "name": "message.type", "requirement_level": "recommended", -// "root_namespace": "message", "stability": "experimental", "type": {"allow_custom_values": true, -// "members": [{"brief": none, "deprecated": none, "id": "sent", "note": none, "stability": -// "experimental", "value": "SENT"}, {"brief": none, "deprecated": none, "id": "received", "note": -// none, "stability": "experimental", "value": "RECEIVED"}]}} namespace MessageTypeValues { /** - * sent. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "sent", "note": none, "stability": -// "experimental", "value": "SENT"} static constexpr const char *kSent = "SENT"; + /** - * received. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "received", "note": none, "stability": -// "experimental", "value": "RECEIVED"} static constexpr const char *kReceived = "RECEIVED"; + } // namespace MessageTypeValues } // namespace message diff --git a/api/include/opentelemetry/semconv/incubating/attributes/messaging_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/messaging_attributes.h index 77b6e7a7de..c5f07fe241 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/messaging_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/messaging_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -23,260 +21,320 @@ namespace messaging /** * The number of messages sent, received, or processed in the scope of the batching operation. - * Note: Instrumentations SHOULD NOT set @code messaging.batch.message_count @endcode on spans that + *

+ * Instrumentations SHOULD NOT set @code messaging.batch.message_count @endcode on spans that * operate with a single message. When a messaging client library supports both batch and * single-message API for the same operation, instrumentations SHOULD use @code * messaging.batch.message_count @endcode for batching APIs and SHOULD NOT use it for single-message * APIs. */ -static const char *kMessagingBatchMessageCount = "messaging.batch.message_count"; +static constexpr const char *kMessagingBatchMessageCount = "messaging.batch.message_count"; /** * A unique identifier for the client that consumes or produces a message. */ -static const char *kMessagingClientId = "messaging.client.id"; +static constexpr const char *kMessagingClientId = "messaging.client.id"; -// /** -*@Deprecated : Replaced by @code messaging.client.id @endcode.* / - // static const char *kMessagingClientId = "messaging.client_id"; +#if 0 +// Excluded attribute: +/** + * Deprecated, use @code messaging.client.id @endcode instead. + *

+ * @deprecated + * Replaced by @code messaging.client.id @endcode. + */ +OPENTELEMETRY_DEPRECATED +static constexpr const char *kMessagingClientId + = "messaging.client_id"; +#endif - /** - * The name of the consumer group with which a consumer is associated. - * Note: Semantic conventions for individual messaging systems SHOULD document whether @code - * messaging.consumer.group.name @endcode is applicable and what it means in the context of that - * system. - */ - static const char *kMessagingConsumerGroupName = "messaging.consumer.group.name"; +/** + * The name of the consumer group with which a consumer is associated. + *

+ * Semantic conventions for individual messaging systems SHOULD document whether @code + * messaging.consumer.group.name @endcode is applicable and what it means in the context of that + * system. + */ +static constexpr const char *kMessagingConsumerGroupName = "messaging.consumer.group.name"; /** * A boolean that is true if the message destination is anonymous (could be unnamed or have * auto-generated name). */ -static const char *kMessagingDestinationAnonymous = "messaging.destination.anonymous"; +static constexpr const char *kMessagingDestinationAnonymous = "messaging.destination.anonymous"; /** - * The message destination name. - * Note: Destination name SHOULD uniquely identify a specific queue, topic or other entity within - * the broker. If the broker doesn't have such notion, the destination name SHOULD uniquely identify - * the broker. + * The message destination name + *

+ * Destination name SHOULD uniquely identify a specific queue, topic or other entity within the + * broker. If the broker doesn't have such notion, the destination name SHOULD uniquely identify the + * broker. */ -static const char *kMessagingDestinationName = "messaging.destination.name"; +static constexpr const char *kMessagingDestinationName = "messaging.destination.name"; /** * The identifier of the partition messages are sent to or received from, unique within the @code * messaging.destination.name @endcode. */ -static const char *kMessagingDestinationPartitionId = "messaging.destination.partition.id"; +static constexpr const char *kMessagingDestinationPartitionId = + "messaging.destination.partition.id"; /** * The name of the destination subscription from which a message is consumed. - * Note: Semantic conventions for individual messaging systems SHOULD document whether @code + *

+ * Semantic conventions for individual messaging systems SHOULD document whether @code * messaging.destination.subscription.name @endcode is applicable and what it means in the context * of that system. */ -static const char *kMessagingDestinationSubscriptionName = +static constexpr const char *kMessagingDestinationSubscriptionName = "messaging.destination.subscription.name"; /** - * Low cardinality representation of the messaging destination name. - * Note: Destination names could be constructed from templates. An example would be a destination - * name involving a user name or product id. Although the destination name in this case is of high + * Low cardinality representation of the messaging destination name + *

+ * Destination names could be constructed from templates. An example would be a destination name + * involving a user name or product id. Although the destination name in this case is of high * cardinality, the underlying template is of low cardinality and can be effectively used for * grouping and aggregation. */ -static const char *kMessagingDestinationTemplate = "messaging.destination.template"; +static constexpr const char *kMessagingDestinationTemplate = "messaging.destination.template"; /** * A boolean that is true if the message destination is temporary and might not exist anymore after * messages are processed. */ -static const char *kMessagingDestinationTemporary = "messaging.destination.temporary"; +static constexpr const char *kMessagingDestinationTemporary = "messaging.destination.temporary"; /** - * @Deprecated: No replacement at this time. + * Deprecated, no replacement at this time. + *

+ * @deprecated + * No replacement at this time. */ -static const char *kMessagingDestinationPublishAnonymous = +OPENTELEMETRY_DEPRECATED +static constexpr const char *kMessagingDestinationPublishAnonymous = "messaging.destination_publish.anonymous"; /** - * @Deprecated: No replacement at this time. + * Deprecated, no replacement at this time. + *

+ * @deprecated + * No replacement at this time. */ -static const char *kMessagingDestinationPublishName = "messaging.destination_publish.name"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kMessagingDestinationPublishName = + "messaging.destination_publish.name"; /** - * @Deprecated: Replaced by @code messaging.consumer.group.name @endcode. + * Deprecated, use @code messaging.consumer.group.name @endcode instead. + *

+ * @deprecated + * Replaced by @code messaging.consumer.group.name @endcode. */ -static const char *kMessagingEventhubsConsumerGroup = "messaging.eventhubs.consumer.group"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kMessagingEventhubsConsumerGroup = + "messaging.eventhubs.consumer.group"; /** * The UTC epoch seconds at which the message has been accepted and stored in the entity. */ -static const char *kMessagingEventhubsMessageEnqueuedTime = +static constexpr const char *kMessagingEventhubsMessageEnqueuedTime = "messaging.eventhubs.message.enqueued_time"; /** * The ack deadline in seconds set for the modify ack deadline request. */ -static const char *kMessagingGcpPubsubMessageAckDeadline = +static constexpr const char *kMessagingGcpPubsubMessageAckDeadline = "messaging.gcp_pubsub.message.ack_deadline"; /** * The ack id for a given message. */ -static const char *kMessagingGcpPubsubMessageAckId = "messaging.gcp_pubsub.message.ack_id"; +static constexpr const char *kMessagingGcpPubsubMessageAckId = + "messaging.gcp_pubsub.message.ack_id"; /** * The delivery attempt for a given message. */ -static const char *kMessagingGcpPubsubMessageDeliveryAttempt = +static constexpr const char *kMessagingGcpPubsubMessageDeliveryAttempt = "messaging.gcp_pubsub.message.delivery_attempt"; /** * The ordering key for a given message. If the attribute is not present, the message does not have * an ordering key. */ -static const char *kMessagingGcpPubsubMessageOrderingKey = +static constexpr const char *kMessagingGcpPubsubMessageOrderingKey = "messaging.gcp_pubsub.message.ordering_key"; /** - * @Deprecated: Replaced by @code messaging.consumer.group.name @endcode. + * Deprecated, use @code messaging.consumer.group.name @endcode instead. + *

+ * @deprecated + * Replaced by @code messaging.consumer.group.name @endcode. */ -static const char *kMessagingKafkaConsumerGroup = "messaging.kafka.consumer.group"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kMessagingKafkaConsumerGroup = "messaging.kafka.consumer.group"; /** - * @Deprecated: Replaced by @code messaging.destination.partition.id @endcode. + * Deprecated, use @code messaging.destination.partition.id @endcode instead. + *

+ * @deprecated + * Replaced by @code messaging.destination.partition.id @endcode. */ -static const char *kMessagingKafkaDestinationPartition = "messaging.kafka.destination.partition"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kMessagingKafkaDestinationPartition = + "messaging.kafka.destination.partition"; /** * Message keys in Kafka are used for grouping alike messages to ensure they're processed on the * same partition. They differ from @code messaging.message.id @endcode in that they're not unique. - * If the key is @code null @endcode, the attribute MUST NOT be set. Note: If the key type is not + * If the key is @code null @endcode, the attribute MUST NOT be set.

If the key type is not * string, it's string representation has to be supplied for the attribute. If the key has no * unambiguous, canonical string form, don't include its value. */ -static const char *kMessagingKafkaMessageKey = "messaging.kafka.message.key"; +static constexpr const char *kMessagingKafkaMessageKey = "messaging.kafka.message.key"; /** - * @Deprecated: Replaced by @code messaging.kafka.offset @endcode. + * Deprecated, use @code messaging.kafka.offset @endcode instead. + *

+ * @deprecated + * Replaced by @code messaging.kafka.offset @endcode. */ -static const char *kMessagingKafkaMessageOffset = "messaging.kafka.message.offset"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kMessagingKafkaMessageOffset = "messaging.kafka.message.offset"; /** * A boolean that is true if the message is a tombstone. */ -static const char *kMessagingKafkaMessageTombstone = "messaging.kafka.message.tombstone"; +static constexpr const char *kMessagingKafkaMessageTombstone = "messaging.kafka.message.tombstone"; /** * The offset of a record in the corresponding Kafka partition. */ -static const char *kMessagingKafkaOffset = "messaging.kafka.offset"; +static constexpr const char *kMessagingKafkaOffset = "messaging.kafka.offset"; /** * The size of the message body in bytes. - * Note: This can refer to both the compressed or uncompressed body size. If both sizes are known, - * the uncompressed body size should be used. + *

+ * This can refer to both the compressed or uncompressed body size. If both sizes are known, the + * uncompressed body size should be used. */ -static const char *kMessagingMessageBodySize = "messaging.message.body.size"; +static constexpr const char *kMessagingMessageBodySize = "messaging.message.body.size"; /** * The conversation ID identifying the conversation to which the message belongs, represented as a * string. Sometimes called "Correlation ID". */ -static const char *kMessagingMessageConversationId = "messaging.message.conversation_id"; +static constexpr const char *kMessagingMessageConversationId = "messaging.message.conversation_id"; /** * The size of the message body and metadata in bytes. - * Note: This can refer to both the compressed or uncompressed size. If both sizes are known, the + *

+ * This can refer to both the compressed or uncompressed size. If both sizes are known, the * uncompressed size should be used. */ -static const char *kMessagingMessageEnvelopeSize = "messaging.message.envelope.size"; +static constexpr const char *kMessagingMessageEnvelopeSize = "messaging.message.envelope.size"; /** * A value used by the messaging system as an identifier for the message, represented as a string. */ -static const char *kMessagingMessageId = "messaging.message.id"; +static constexpr const char *kMessagingMessageId = "messaging.message.id"; /** - * @Deprecated: Replaced by @code messaging.operation.type @endcode. + * Deprecated, use @code messaging.operation.type @endcode instead. + *

+ * @deprecated + * Replaced by @code messaging.operation.type @endcode. */ -static const char *kMessagingOperation = "messaging.operation"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kMessagingOperation = "messaging.operation"; /** * The system-specific name of the messaging operation. */ -static const char *kMessagingOperationName = "messaging.operation.name"; +static constexpr const char *kMessagingOperationName = "messaging.operation.name"; /** * A string identifying the type of the messaging operation. - * Note: If a custom value is used, it MUST be of low cardinality. + *

+ * If a custom value is used, it MUST be of low cardinality. */ -static const char *kMessagingOperationType = "messaging.operation.type"; +static constexpr const char *kMessagingOperationType = "messaging.operation.type"; /** * RabbitMQ message routing key. */ -static const char *kMessagingRabbitmqDestinationRoutingKey = +static constexpr const char *kMessagingRabbitmqDestinationRoutingKey = "messaging.rabbitmq.destination.routing_key"; /** - * RabbitMQ message delivery tag. + * RabbitMQ message delivery tag */ -static const char *kMessagingRabbitmqMessageDeliveryTag = "messaging.rabbitmq.message.delivery_tag"; +static constexpr const char *kMessagingRabbitmqMessageDeliveryTag = + "messaging.rabbitmq.message.delivery_tag"; /** - * @Deprecated: Replaced by @code messaging.consumer.group.name @endcode on the consumer spans. No - * replacement for producer spans. + * Deprecated, use @code messaging.consumer.group.name @endcode instead. + *

+ * @deprecated + * Replaced by @code messaging.consumer.group.name @endcode on the consumer spans. No replacement + * for producer spans. */ -static const char *kMessagingRocketmqClientGroup = "messaging.rocketmq.client_group"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kMessagingRocketmqClientGroup = "messaging.rocketmq.client_group"; /** * Model of message consumption. This only applies to consumer spans. */ -static const char *kMessagingRocketmqConsumptionModel = "messaging.rocketmq.consumption_model"; +static constexpr const char *kMessagingRocketmqConsumptionModel = + "messaging.rocketmq.consumption_model"; /** * The delay time level for delay message, which determines the message delay time. */ -static const char *kMessagingRocketmqMessageDelayTimeLevel = +static constexpr const char *kMessagingRocketmqMessageDelayTimeLevel = "messaging.rocketmq.message.delay_time_level"; /** * The timestamp in milliseconds that the delay message is expected to be delivered to consumer. */ -static const char *kMessagingRocketmqMessageDeliveryTimestamp = +static constexpr const char *kMessagingRocketmqMessageDeliveryTimestamp = "messaging.rocketmq.message.delivery_timestamp"; /** * It is essential for FIFO message. Messages that belong to the same message group are always * processed one by one within the same consumer group. */ -static const char *kMessagingRocketmqMessageGroup = "messaging.rocketmq.message.group"; +static constexpr const char *kMessagingRocketmqMessageGroup = "messaging.rocketmq.message.group"; /** * Key(s) of message, another way to mark message besides message id. */ -static const char *kMessagingRocketmqMessageKeys = "messaging.rocketmq.message.keys"; +static constexpr const char *kMessagingRocketmqMessageKeys = "messaging.rocketmq.message.keys"; /** * The secondary classifier of message besides topic. */ -static const char *kMessagingRocketmqMessageTag = "messaging.rocketmq.message.tag"; +static constexpr const char *kMessagingRocketmqMessageTag = "messaging.rocketmq.message.tag"; /** * Type of message. */ -static const char *kMessagingRocketmqMessageType = "messaging.rocketmq.message.type"; +static constexpr const char *kMessagingRocketmqMessageType = "messaging.rocketmq.message.type"; /** * Namespace of RocketMQ resources, resources in different namespaces are individual. */ -static const char *kMessagingRocketmqNamespace = "messaging.rocketmq.namespace"; +static constexpr const char *kMessagingRocketmqNamespace = "messaging.rocketmq.namespace"; /** - * @Deprecated: Replaced by @code messaging.servicebus.destination.subscription_name @endcode. + * Deprecated, use @code messaging.servicebus.destination.subscription_name @endcode instead. + *

+ * @deprecated + * Replaced by @code messaging.servicebus.destination.subscription_name @endcode. */ -static const char *kMessagingServicebusDestinationSubscriptionName = +OPENTELEMETRY_DEPRECATED +static constexpr const char *kMessagingServicebusDestinationSubscriptionName = "messaging.servicebus.destination.subscription_name"; /** @@ -284,48 +342,30 @@ static const char *kMessagingServicebusDestinationSubscriptionName = * href="https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock">settlement * type. */ -static const char *kMessagingServicebusDispositionStatus = +static constexpr const char *kMessagingServicebusDispositionStatus = "messaging.servicebus.disposition_status"; /** * Number of deliveries that have been attempted for this message. */ -static const char *kMessagingServicebusMessageDeliveryCount = +static constexpr const char *kMessagingServicebusMessageDeliveryCount = "messaging.servicebus.message.delivery_count"; /** * The UTC epoch seconds at which the message has been accepted and stored in the entity. */ -static const char *kMessagingServicebusMessageEnqueuedTime = +static constexpr const char *kMessagingServicebusMessageEnqueuedTime = "messaging.servicebus.message.enqueued_time"; /** * The messaging system as identified by the client instrumentation. - * Note: The actual messaging system may differ from the one known by the client. For example, when - * using Kafka client libraries to communicate with Azure Event Hubs, the @code messaging.system - * @endcode is set to @code kafka @endcode based on the instrumentation's best knowledge. - */ -static const char *kMessagingSystem = "messaging.system"; - -// DEBUG: {"brief": "A string identifying the type of the messaging operation.\n", "name": -// "messaging.operation.type", "note": "If a custom value is used, it MUST be of low cardinality.", -// "requirement_level": "recommended", "root_namespace": "messaging", "stability": "experimental", -// "type": {"allow_custom_values": true, "members": [{"brief": "One or more messages are provided -// for publishing to an intermediary. If a single message is published, the context of the -// \"Publish\" span can be used as the creation context and no \"Create\" span needs to be -// created.\n", "deprecated": none, "id": "publish", "note": none, "stability": "experimental", -// "value": "publish"}, {"brief": "A message is created. \"Create\" spans always refer to a single -// message and are used to provide a unique creation context for messages in batch publishing -// scenarios.\n", "deprecated": none, "id": "create", "note": none, "stability": "experimental", -// "value": "create"}, {"brief": "One or more messages are requested by a consumer. This operation -// refers to pull-based scenarios, where consumers explicitly call methods of messaging SDKs to -// receive messages.\n", "deprecated": none, "id": "receive", "note": none, "stability": -// "experimental", "value": "receive"}, {"brief": "One or more messages are processed by a -// consumer.\n", "deprecated": none, "id": "process", "note": none, "stability": "experimental", -// "value": "process"}, {"brief": "One or more messages are settled.\n", "deprecated": none, "id": -// "settle", "note": none, "stability": "experimental", "value": "settle"}, {"brief": "Deprecated. -// Use `process` instead.", "deprecated": "Replaced by `process`.", "id": "deliver", "note": none, -// "stability": "experimental", "value": "deliver"}]}} + *

+ * The actual messaging system may differ from the one known by the client. For example, when using + * Kafka client libraries to communicate with Azure Event Hubs, the @code messaging.system @endcode + * is set to @code kafka @endcode based on the instrumentation's best knowledge. + */ +static constexpr const char *kMessagingSystem = "messaging.system"; + namespace MessagingOperationTypeValues { /** @@ -333,236 +373,160 @@ namespace MessagingOperationTypeValues * published, the context of the "Publish" span can be used as the creation context and no "Create" * span needs to be created. */ -// DEBUG: {"brief": "One or more messages are provided for publishing to an intermediary. If a -// single message is published, the context of the \"Publish\" span can be used as the creation -// context and no \"Create\" span needs to be created.\n", "deprecated": none, "id": "publish", -// "note": none, "stability": "experimental", "value": "publish"} static constexpr const char *kPublish = "publish"; + /** * A message is created. "Create" spans always refer to a single message and are used to provide a * unique creation context for messages in batch publishing scenarios. */ -// DEBUG: {"brief": "A message is created. \"Create\" spans always refer to a single message and are -// used to provide a unique creation context for messages in batch publishing scenarios.\n", -// "deprecated": none, "id": "create", "note": none, "stability": "experimental", "value": "create"} static constexpr const char *kCreate = "create"; + /** * One or more messages are requested by a consumer. This operation refers to pull-based scenarios, * where consumers explicitly call methods of messaging SDKs to receive messages. */ -// DEBUG: {"brief": "One or more messages are requested by a consumer. This operation refers to -// pull-based scenarios, where consumers explicitly call methods of messaging SDKs to receive -// messages.\n", "deprecated": none, "id": "receive", "note": none, "stability": "experimental", -// "value": "receive"} static constexpr const char *kReceive = "receive"; + /** * One or more messages are processed by a consumer. */ -// DEBUG: {"brief": "One or more messages are processed by a consumer.\n", "deprecated": none, "id": -// "process", "note": none, "stability": "experimental", "value": "process"} static constexpr const char *kProcess = "process"; + /** * One or more messages are settled. */ -// DEBUG: {"brief": "One or more messages are settled.\n", "deprecated": none, "id": "settle", -// "note": none, "stability": "experimental", "value": "settle"} static constexpr const char *kSettle = "settle"; + /** - * @Deprecated: Replaced by @code process @endcode. + * Deprecated. Use @code process @endcode instead. + *

+ * @deprecated + * Replaced by @code process @endcode. */ -// DEBUG: {"brief": "Deprecated. Use `process` instead.", "deprecated": "Replaced by `process`.", -// "id": "deliver", "note": none, "stability": "experimental", "value": "deliver"} +OPENTELEMETRY_DEPRECATED static constexpr const char *kDeliver = "deliver"; + } // namespace MessagingOperationTypeValues -// DEBUG: {"brief": "Model of message consumption. This only applies to consumer spans.\n", "name": -// "messaging.rocketmq.consumption_model", "requirement_level": "recommended", "root_namespace": -// "messaging", "stability": "experimental", "type": {"allow_custom_values": true, "members": -// [{"brief": "Clustering consumption model", "deprecated": none, "id": "clustering", "note": none, -// "stability": "experimental", "value": "clustering"}, {"brief": "Broadcasting consumption model", -// "deprecated": none, "id": "broadcasting", "note": none, "stability": "experimental", "value": -// "broadcasting"}]}} namespace MessagingRocketmqConsumptionModelValues { /** - * Clustering consumption model. + * Clustering consumption model */ -// DEBUG: {"brief": "Clustering consumption model", "deprecated": none, "id": "clustering", "note": -// none, "stability": "experimental", "value": "clustering"} static constexpr const char *kClustering = "clustering"; + /** - * Broadcasting consumption model. + * Broadcasting consumption model */ -// DEBUG: {"brief": "Broadcasting consumption model", "deprecated": none, "id": "broadcasting", -// "note": none, "stability": "experimental", "value": "broadcasting"} static constexpr const char *kBroadcasting = "broadcasting"; + } // namespace MessagingRocketmqConsumptionModelValues -// DEBUG: {"brief": "Type of message.\n", "name": "messaging.rocketmq.message.type", -// "requirement_level": "recommended", "root_namespace": "messaging", "stability": "experimental", -// "type": {"allow_custom_values": true, "members": [{"brief": "Normal message", "deprecated": none, -// "id": "normal", "note": none, "stability": "experimental", "value": "normal"}, {"brief": "FIFO -// message", "deprecated": none, "id": "fifo", "note": none, "stability": "experimental", "value": -// "fifo"}, {"brief": "Delay message", "deprecated": none, "id": "delay", "note": none, "stability": -// "experimental", "value": "delay"}, {"brief": "Transaction message", "deprecated": none, "id": -// "transaction", "note": none, "stability": "experimental", "value": "transaction"}]}} namespace MessagingRocketmqMessageTypeValues { /** - * Normal message. + * Normal message */ -// DEBUG: {"brief": "Normal message", "deprecated": none, "id": "normal", "note": none, "stability": -// "experimental", "value": "normal"} static constexpr const char *kNormal = "normal"; + /** - * FIFO message. + * FIFO message */ -// DEBUG: {"brief": "FIFO message", "deprecated": none, "id": "fifo", "note": none, "stability": -// "experimental", "value": "fifo"} static constexpr const char *kFifo = "fifo"; + /** - * Delay message. + * Delay message */ -// DEBUG: {"brief": "Delay message", "deprecated": none, "id": "delay", "note": none, "stability": -// "experimental", "value": "delay"} static constexpr const char *kDelay = "delay"; + /** - * Transaction message. + * Transaction message */ -// DEBUG: {"brief": "Transaction message", "deprecated": none, "id": "transaction", "note": none, -// "stability": "experimental", "value": "transaction"} static constexpr const char *kTransaction = "transaction"; + } // namespace MessagingRocketmqMessageTypeValues -// DEBUG: {"brief": "Describes the [settlement -// type](https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock).\n", -// "name": "messaging.servicebus.disposition_status", "requirement_level": "recommended", -// "root_namespace": "messaging", "stability": "experimental", "type": {"allow_custom_values": true, -// "members": [{"brief": "Message is completed", "deprecated": none, "id": "complete", "note": none, -// "stability": "experimental", "value": "complete"}, {"brief": "Message is abandoned", -// "deprecated": none, "id": "abandon", "note": none, "stability": "experimental", "value": -// "abandon"}, {"brief": "Message is sent to dead letter queue", "deprecated": none, "id": -// "dead_letter", "note": none, "stability": "experimental", "value": "dead_letter"}, {"brief": -// "Message is deferred", "deprecated": none, "id": "defer", "note": none, "stability": -// "experimental", "value": "defer"}]}} namespace MessagingServicebusDispositionStatusValues { /** - * Message is completed. + * Message is completed */ -// DEBUG: {"brief": "Message is completed", "deprecated": none, "id": "complete", "note": none, -// "stability": "experimental", "value": "complete"} static constexpr const char *kComplete = "complete"; + /** - * Message is abandoned. + * Message is abandoned */ -// DEBUG: {"brief": "Message is abandoned", "deprecated": none, "id": "abandon", "note": none, -// "stability": "experimental", "value": "abandon"} static constexpr const char *kAbandon = "abandon"; + /** - * Message is sent to dead letter queue. + * Message is sent to dead letter queue */ -// DEBUG: {"brief": "Message is sent to dead letter queue", "deprecated": none, "id": "dead_letter", -// "note": none, "stability": "experimental", "value": "dead_letter"} static constexpr const char *kDeadLetter = "dead_letter"; + /** - * Message is deferred. + * Message is deferred */ -// DEBUG: {"brief": "Message is deferred", "deprecated": none, "id": "defer", "note": none, -// "stability": "experimental", "value": "defer"} static constexpr const char *kDefer = "defer"; + } // namespace MessagingServicebusDispositionStatusValues -// DEBUG: {"brief": "The messaging system as identified by the client instrumentation.", "name": -// "messaging.system", "note": "The actual messaging system may differ from the one known by the -// client. For example, when using Kafka client libraries to communicate with Azure Event Hubs, the -// `messaging.system` is set to `kafka` based on the instrumentation's best knowledge.\n", -// "requirement_level": "recommended", "root_namespace": "messaging", "stability": "experimental", -// "type": {"allow_custom_values": true, "members": [{"brief": "Apache ActiveMQ", "deprecated": -// none, "id": "activemq", "note": none, "stability": "experimental", "value": "activemq"}, -// {"brief": "Amazon Simple Queue Service (SQS)", "deprecated": none, "id": "aws_sqs", "note": none, -// "stability": "experimental", "value": "aws_sqs"}, {"brief": "Azure Event Grid", "deprecated": -// none, "id": "eventgrid", "note": none, "stability": "experimental", "value": "eventgrid"}, -// {"brief": "Azure Event Hubs", "deprecated": none, "id": "eventhubs", "note": none, "stability": -// "experimental", "value": "eventhubs"}, {"brief": "Azure Service Bus", "deprecated": none, "id": -// "servicebus", "note": none, "stability": "experimental", "value": "servicebus"}, {"brief": -// "Google Cloud Pub/Sub", "deprecated": none, "id": "gcp_pubsub", "note": none, "stability": -// "experimental", "value": "gcp_pubsub"}, {"brief": "Java Message Service", "deprecated": none, -// "id": "jms", "note": none, "stability": "experimental", "value": "jms"}, {"brief": "Apache -// Kafka", "deprecated": none, "id": "kafka", "note": none, "stability": "experimental", "value": -// "kafka"}, {"brief": "RabbitMQ", "deprecated": none, "id": "rabbitmq", "note": none, "stability": -// "experimental", "value": "rabbitmq"}, {"brief": "Apache RocketMQ", "deprecated": none, "id": -// "rocketmq", "note": none, "stability": "experimental", "value": "rocketmq"}, {"brief": "Apache -// Pulsar", "deprecated": none, "id": "pulsar", "note": none, "stability": "experimental", "value": -// "pulsar"}]}} namespace MessagingSystemValues { /** - * Apache ActiveMQ. + * Apache ActiveMQ */ -// DEBUG: {"brief": "Apache ActiveMQ", "deprecated": none, "id": "activemq", "note": none, -// "stability": "experimental", "value": "activemq"} static constexpr const char *kActivemq = "activemq"; + /** - * Amazon Simple Queue Service (SQS). + * Amazon Simple Queue Service (SQS) */ -// DEBUG: {"brief": "Amazon Simple Queue Service (SQS)", "deprecated": none, "id": "aws_sqs", -// "note": none, "stability": "experimental", "value": "aws_sqs"} static constexpr const char *kAwsSqs = "aws_sqs"; + /** - * Azure Event Grid. + * Azure Event Grid */ -// DEBUG: {"brief": "Azure Event Grid", "deprecated": none, "id": "eventgrid", "note": none, -// "stability": "experimental", "value": "eventgrid"} static constexpr const char *kEventgrid = "eventgrid"; + /** - * Azure Event Hubs. + * Azure Event Hubs */ -// DEBUG: {"brief": "Azure Event Hubs", "deprecated": none, "id": "eventhubs", "note": none, -// "stability": "experimental", "value": "eventhubs"} static constexpr const char *kEventhubs = "eventhubs"; + /** - * Azure Service Bus. + * Azure Service Bus */ -// DEBUG: {"brief": "Azure Service Bus", "deprecated": none, "id": "servicebus", "note": none, -// "stability": "experimental", "value": "servicebus"} static constexpr const char *kServicebus = "servicebus"; + /** - * Google Cloud Pub/Sub. + * Google Cloud Pub/Sub */ -// DEBUG: {"brief": "Google Cloud Pub/Sub", "deprecated": none, "id": "gcp_pubsub", "note": none, -// "stability": "experimental", "value": "gcp_pubsub"} static constexpr const char *kGcpPubsub = "gcp_pubsub"; + /** - * Java Message Service. + * Java Message Service */ -// DEBUG: {"brief": "Java Message Service", "deprecated": none, "id": "jms", "note": none, -// "stability": "experimental", "value": "jms"} static constexpr const char *kJms = "jms"; + /** - * Apache Kafka. + * Apache Kafka */ -// DEBUG: {"brief": "Apache Kafka", "deprecated": none, "id": "kafka", "note": none, "stability": -// "experimental", "value": "kafka"} static constexpr const char *kKafka = "kafka"; + /** - * RabbitMQ. + * RabbitMQ */ -// DEBUG: {"brief": "RabbitMQ", "deprecated": none, "id": "rabbitmq", "note": none, "stability": -// "experimental", "value": "rabbitmq"} static constexpr const char *kRabbitmq = "rabbitmq"; + /** - * Apache RocketMQ. + * Apache RocketMQ */ -// DEBUG: {"brief": "Apache RocketMQ", "deprecated": none, "id": "rocketmq", "note": none, -// "stability": "experimental", "value": "rocketmq"} static constexpr const char *kRocketmq = "rocketmq"; + /** - * Apache Pulsar. + * Apache Pulsar */ -// DEBUG: {"brief": "Apache Pulsar", "deprecated": none, "id": "pulsar", "note": none, "stability": -// "experimental", "value": "pulsar"} static constexpr const char *kPulsar = "pulsar"; + } // namespace MessagingSystemValues } // namespace messaging diff --git a/api/include/opentelemetry/semconv/incubating/attributes/net_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/net_attributes.h index e340a3501e..9562299223 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/net_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/net_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -22,161 +20,188 @@ namespace net { /** - * @Deprecated: Replaced by @code network.local.address @endcode. + * Deprecated, use @code network.local.address @endcode. + *

+ * @deprecated + * Replaced by @code network.local.address @endcode. */ -static const char *kNetHostIp = "net.host.ip"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kNetHostIp = "net.host.ip"; /** - * @Deprecated: Replaced by @code server.address @endcode. + * Deprecated, use @code server.address @endcode. + *

+ * @deprecated + * Replaced by @code server.address @endcode. */ -static const char *kNetHostName = "net.host.name"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kNetHostName = "net.host.name"; /** - * @Deprecated: Replaced by @code server.port @endcode. + * Deprecated, use @code server.port @endcode. + *

+ * @deprecated + * Replaced by @code server.port @endcode. */ -static const char *kNetHostPort = "net.host.port"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kNetHostPort = "net.host.port"; /** - * @Deprecated: Replaced by @code network.peer.address @endcode. + * Deprecated, use @code network.peer.address @endcode. + *

+ * @deprecated + * Replaced by @code network.peer.address @endcode. */ -static const char *kNetPeerIp = "net.peer.ip"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kNetPeerIp = "net.peer.ip"; /** - * @Deprecated: Replaced by @code server.address @endcode on client spans and @code client.address - * @endcode on server spans. + * Deprecated, use @code server.address @endcode on client spans and @code client.address @endcode + * on server spans.

+ * @deprecated + * Replaced by @code server.address @endcode on client spans and @code client.address @endcode on + * server spans. */ -static const char *kNetPeerName = "net.peer.name"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kNetPeerName = "net.peer.name"; /** - * @Deprecated: Replaced by @code server.port @endcode on client spans and @code client.port - * @endcode on server spans. + * Deprecated, use @code server.port @endcode on client spans and @code client.port @endcode on + * server spans.

+ * @deprecated + * Replaced by @code server.port @endcode on client spans and @code client.port @endcode on server + * spans. */ -static const char *kNetPeerPort = "net.peer.port"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kNetPeerPort = "net.peer.port"; /** - * @Deprecated: Replaced by @code network.protocol.name @endcode. + * Deprecated, use @code network.protocol.name @endcode. + *

+ * @deprecated + * Replaced by @code network.protocol.name @endcode. */ -static const char *kNetProtocolName = "net.protocol.name"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kNetProtocolName = "net.protocol.name"; /** - * @Deprecated: Replaced by @code network.protocol.version @endcode. + * Deprecated, use @code network.protocol.version @endcode. + *

+ * @deprecated + * Replaced by @code network.protocol.version @endcode. */ -static const char *kNetProtocolVersion = "net.protocol.version"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kNetProtocolVersion = "net.protocol.version"; /** - * @Deprecated: Split to @code network.transport @endcode and @code network.type @endcode. + * Deprecated, use @code network.transport @endcode and @code network.type @endcode. + *

+ * @deprecated + * Split to @code network.transport @endcode and @code network.type @endcode. */ -static const char *kNetSockFamily = "net.sock.family"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kNetSockFamily = "net.sock.family"; /** - * @Deprecated: Replaced by @code network.local.address @endcode. + * Deprecated, use @code network.local.address @endcode. + *

+ * @deprecated + * Replaced by @code network.local.address @endcode. */ -static const char *kNetSockHostAddr = "net.sock.host.addr"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kNetSockHostAddr = "net.sock.host.addr"; /** - * @Deprecated: Replaced by @code network.local.port @endcode. + * Deprecated, use @code network.local.port @endcode. + *

+ * @deprecated + * Replaced by @code network.local.port @endcode. */ -static const char *kNetSockHostPort = "net.sock.host.port"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kNetSockHostPort = "net.sock.host.port"; /** - * @Deprecated: Replaced by @code network.peer.address @endcode. + * Deprecated, use @code network.peer.address @endcode. + *

+ * @deprecated + * Replaced by @code network.peer.address @endcode. */ -static const char *kNetSockPeerAddr = "net.sock.peer.addr"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kNetSockPeerAddr = "net.sock.peer.addr"; /** - * @Deprecated: Removed. + * Deprecated, no replacement at this time. + *

+ * @deprecated + * Removed. */ -static const char *kNetSockPeerName = "net.sock.peer.name"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kNetSockPeerName = "net.sock.peer.name"; /** - * @Deprecated: Replaced by @code network.peer.port @endcode. + * Deprecated, use @code network.peer.port @endcode. + *

+ * @deprecated + * Replaced by @code network.peer.port @endcode. */ -static const char *kNetSockPeerPort = "net.sock.peer.port"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kNetSockPeerPort = "net.sock.peer.port"; /** - * @Deprecated: Replaced by @code network.transport @endcode. + * Deprecated, use @code network.transport @endcode. + *

+ * @deprecated + * Replaced by @code network.transport @endcode. */ -static const char *kNetTransport = "net.transport"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kNetTransport = "net.transport"; -// @deprecated(reason="The attribute net.sock.family is deprecated - Split to `network.transport` -// and `network.type`") # type: ignore DEBUG: {"brief": "Deprecated, use `network.transport` and -// `network.type`.", "deprecated": "Split to `network.transport` and `network.type`.", "name": -// "net.sock.family", "requirement_level": "recommended", "root_namespace": "net", "stability": -// "experimental", "type": {"allow_custom_values": true, "members": [{"brief": "IPv4 address", -// "deprecated": none, "id": "inet", "note": none, "stability": "experimental", "value": "inet"}, -// {"brief": "IPv6 address", "deprecated": none, "id": "inet6", "note": none, "stability": -// "experimental", "value": "inet6"}, {"brief": "Unix domain socket path", "deprecated": none, "id": -// "unix", "note": none, "stability": "experimental", "value": "unix"}]}} namespace NetSockFamilyValues { /** - * IPv4 address. + * IPv4 address */ -// DEBUG: {"brief": "IPv4 address", "deprecated": none, "id": "inet", "note": none, "stability": -// "experimental", "value": "inet"} static constexpr const char *kInet = "inet"; + /** - * IPv6 address. + * IPv6 address */ -// DEBUG: {"brief": "IPv6 address", "deprecated": none, "id": "inet6", "note": none, "stability": -// "experimental", "value": "inet6"} static constexpr const char *kInet6 = "inet6"; + /** - * Unix domain socket path. + * Unix domain socket path */ -// DEBUG: {"brief": "Unix domain socket path", "deprecated": none, "id": "unix", "note": none, -// "stability": "experimental", "value": "unix"} static constexpr const char *kUnix = "unix"; + } // namespace NetSockFamilyValues -// @deprecated(reason="The attribute net.transport is deprecated - Replaced by `network.transport`") -// # type: ignore DEBUG: {"brief": "Deprecated, use `network.transport`.", "deprecated": "Replaced -// by `network.transport`.", "name": "net.transport", "requirement_level": "recommended", -// "root_namespace": "net", "stability": "experimental", "type": {"allow_custom_values": true, -// "members": [{"brief": none, "deprecated": none, "id": "ip_tcp", "note": none, "stability": -// "experimental", "value": "ip_tcp"}, {"brief": none, "deprecated": none, "id": "ip_udp", "note": -// none, "stability": "experimental", "value": "ip_udp"}, {"brief": "Named or anonymous pipe.", -// "deprecated": none, "id": "pipe", "note": none, "stability": "experimental", "value": "pipe"}, -// {"brief": "In-process communication.", "deprecated": none, "id": "inproc", "note": "Signals that -// there is only in-process communication not using a \"real\" network protocol in cases where -// network attributes would normally be expected. Usually all other network attributes can be left -// out in that case.\n", "stability": "experimental", "value": "inproc"}, {"brief": "Something else -// (non IP-based).", "deprecated": none, "id": "other", "note": none, "stability": "experimental", -// "value": "other"}]}} namespace NetTransportValues { /** - * ip_tcp. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "ip_tcp", "note": none, "stability": -// "experimental", "value": "ip_tcp"} static constexpr const char *kIpTcp = "ip_tcp"; + /** - * ip_udp. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "ip_udp", "note": none, "stability": -// "experimental", "value": "ip_udp"} static constexpr const char *kIpUdp = "ip_udp"; + /** * Named or anonymous pipe. */ -// DEBUG: {"brief": "Named or anonymous pipe.", "deprecated": none, "id": "pipe", "note": none, -// "stability": "experimental", "value": "pipe"} static constexpr const char *kPipe = "pipe"; + /** * In-process communication. */ -// DEBUG: {"brief": "In-process communication.", "deprecated": none, "id": "inproc", "note": -// "Signals that there is only in-process communication not using a \"real\" network protocol in -// cases where network attributes would normally be expected. Usually all other network attributes -// can be left out in that case.\n", "stability": "experimental", "value": "inproc"} static constexpr const char *kInproc = "inproc"; + /** * Something else (non IP-based). */ -// DEBUG: {"brief": "Something else (non IP-based).", "deprecated": none, "id": "other", "note": -// none, "stability": "experimental", "value": "other"} static constexpr const char *kOther = "other"; + } // namespace NetTransportValues } // namespace net diff --git a/api/include/opentelemetry/semconv/incubating/attributes/network_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/network_attributes.h index c01e5c5ab7..ea855c5735 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/network_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/network_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -24,392 +22,285 @@ namespace network /** * The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. */ -static const char *kNetworkCarrierIcc = "network.carrier.icc"; +static constexpr const char *kNetworkCarrierIcc = "network.carrier.icc"; /** * The mobile carrier country code. */ -static const char *kNetworkCarrierMcc = "network.carrier.mcc"; +static constexpr const char *kNetworkCarrierMcc = "network.carrier.mcc"; /** * The mobile carrier network code. */ -static const char *kNetworkCarrierMnc = "network.carrier.mnc"; +static constexpr const char *kNetworkCarrierMnc = "network.carrier.mnc"; /** * The name of the mobile carrier. */ -static const char *kNetworkCarrierName = "network.carrier.name"; +static constexpr const char *kNetworkCarrierName = "network.carrier.name"; /** * 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. */ -static const char *kNetworkConnectionSubtype = "network.connection.subtype"; +static constexpr const char *kNetworkConnectionSubtype = "network.connection.subtype"; /** * The internet connection type. */ -static const char *kNetworkConnectionType = "network.connection.type"; +static constexpr const char *kNetworkConnectionType = "network.connection.type"; /** * The network IO operation direction. */ -static const char *kNetworkIoDirection = "network.io.direction"; +static constexpr const char *kNetworkIoDirection = "network.io.direction"; /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.network_attributes. @endcode. + * Local address of the network connection - IP address or Unix domain socket name. */ -static const char *kNetworkLocalAddress = "network.local.address"; +static constexpr const char *kNetworkLocalAddress = "network.local.address"; /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.network_attributes. @endcode. + * Local port number of the network connection. */ -static const char *kNetworkLocalPort = "network.local.port"; +static constexpr const char *kNetworkLocalPort = "network.local.port"; /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.network_attributes. @endcode. + * Peer address of the network connection - IP address or Unix domain socket name. */ -static const char *kNetworkPeerAddress = "network.peer.address"; +static constexpr const char *kNetworkPeerAddress = "network.peer.address"; /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.network_attributes. @endcode. + * Peer port number of the network connection. */ -static const char *kNetworkPeerPort = "network.peer.port"; +static constexpr const char *kNetworkPeerPort = "network.peer.port"; /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.network_attributes. @endcode. + * OSI application layer or non-OSI + * equivalent.

The value SHOULD be normalized to lowercase. */ -static const char *kNetworkProtocolName = "network.protocol.name"; +static constexpr const char *kNetworkProtocolName = "network.protocol.name"; /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.network_attributes. @endcode. + * The actual version of the protocol used for network communication. + *

+ * If protocol version is subject to negotiation (for example using ALPN), this attribute SHOULD be set to the + * negotiated version. If the actual protocol version is not known, this attribute SHOULD NOT be + * set. */ -static const char *kNetworkProtocolVersion = "network.protocol.version"; +static constexpr const char *kNetworkProtocolVersion = "network.protocol.version"; /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.network_attributes. @endcode. + * OSI transport layer or inter-process communication + * method.

The value SHOULD be normalized to lowercase.

Consider always setting the + * transport when setting a port number, since a port number is ambiguous without knowing the + * transport. For example different processes could be listening on TCP port 12345 and UDP port + * 12345. */ -static const char *kNetworkTransport = "network.transport"; +static constexpr const char *kNetworkTransport = "network.transport"; /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.network_attributes. @endcode. + * OSI network layer or non-OSI equivalent. + *

+ * The value SHOULD be normalized to lowercase. */ -static const char *kNetworkType = "network.type"; +static constexpr const char *kNetworkType = "network.type"; -// DEBUG: {"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", "name": "network.connection.subtype", "requirement_level": -// "recommended", "root_namespace": "network", "stability": "experimental", "type": -// {"allow_custom_values": true, "members": [{"brief": "GPRS", "deprecated": none, "id": "gprs", -// "note": none, "stability": "experimental", "value": "gprs"}, {"brief": "EDGE", "deprecated": -// none, "id": "edge", "note": none, "stability": "experimental", "value": "edge"}, {"brief": -// "UMTS", "deprecated": none, "id": "umts", "note": none, "stability": "experimental", "value": -// "umts"}, {"brief": "CDMA", "deprecated": none, "id": "cdma", "note": none, "stability": -// "experimental", "value": "cdma"}, {"brief": "EVDO Rel. 0", "deprecated": none, "id": "evdo_0", -// "note": none, "stability": "experimental", "value": "evdo_0"}, {"brief": "EVDO Rev. A", -// "deprecated": none, "id": "evdo_a", "note": none, "stability": "experimental", "value": -// "evdo_a"}, {"brief": "CDMA2000 1XRTT", "deprecated": none, "id": "cdma2000_1xrtt", "note": none, -// "stability": "experimental", "value": "cdma2000_1xrtt"}, {"brief": "HSDPA", "deprecated": none, -// "id": "hsdpa", "note": none, "stability": "experimental", "value": "hsdpa"}, {"brief": "HSUPA", -// "deprecated": none, "id": "hsupa", "note": none, "stability": "experimental", "value": "hsupa"}, -// {"brief": "HSPA", "deprecated": none, "id": "hspa", "note": none, "stability": "experimental", -// "value": "hspa"}, {"brief": "IDEN", "deprecated": none, "id": "iden", "note": none, "stability": -// "experimental", "value": "iden"}, {"brief": "EVDO Rev. B", "deprecated": none, "id": "evdo_b", -// "note": none, "stability": "experimental", "value": "evdo_b"}, {"brief": "LTE", "deprecated": -// none, "id": "lte", "note": none, "stability": "experimental", "value": "lte"}, {"brief": "EHRPD", -// "deprecated": none, "id": "ehrpd", "note": none, "stability": "experimental", "value": "ehrpd"}, -// {"brief": "HSPAP", "deprecated": none, "id": "hspap", "note": none, "stability": "experimental", -// "value": "hspap"}, {"brief": "GSM", "deprecated": none, "id": "gsm", "note": none, "stability": -// "experimental", "value": "gsm"}, {"brief": "TD-SCDMA", "deprecated": none, "id": "td_scdma", -// "note": none, "stability": "experimental", "value": "td_scdma"}, {"brief": "IWLAN", "deprecated": -// none, "id": "iwlan", "note": none, "stability": "experimental", "value": "iwlan"}, {"brief": "5G -// NR (New Radio)", "deprecated": none, "id": "nr", "note": none, "stability": "experimental", -// "value": "nr"}, {"brief": "5G NRNSA (New Radio Non-Standalone)", "deprecated": none, "id": -// "nrnsa", "note": none, "stability": "experimental", "value": "nrnsa"}, {"brief": "LTE CA", -// "deprecated": none, "id": "lte_ca", "note": none, "stability": "experimental", "value": -// "lte_ca"}]}} namespace NetworkConnectionSubtypeValues { /** - * GPRS. + * GPRS */ -// DEBUG: {"brief": "GPRS", "deprecated": none, "id": "gprs", "note": none, "stability": -// "experimental", "value": "gprs"} static constexpr const char *kGprs = "gprs"; + /** - * EDGE. + * EDGE */ -// DEBUG: {"brief": "EDGE", "deprecated": none, "id": "edge", "note": none, "stability": -// "experimental", "value": "edge"} static constexpr const char *kEdge = "edge"; + /** - * UMTS. + * UMTS */ -// DEBUG: {"brief": "UMTS", "deprecated": none, "id": "umts", "note": none, "stability": -// "experimental", "value": "umts"} static constexpr const char *kUmts = "umts"; + /** - * CDMA. + * CDMA */ -// DEBUG: {"brief": "CDMA", "deprecated": none, "id": "cdma", "note": none, "stability": -// "experimental", "value": "cdma"} static constexpr const char *kCdma = "cdma"; + /** - * EVDO Rel. 0. + * EVDO Rel. 0 */ -// DEBUG: {"brief": "EVDO Rel. 0", "deprecated": none, "id": "evdo_0", "note": none, "stability": -// "experimental", "value": "evdo_0"} static constexpr const char *kEvdo0 = "evdo_0"; + /** - * EVDO Rev. A. + * EVDO Rev. A */ -// DEBUG: {"brief": "EVDO Rev. A", "deprecated": none, "id": "evdo_a", "note": none, "stability": -// "experimental", "value": "evdo_a"} static constexpr const char *kEvdoA = "evdo_a"; + /** - * CDMA2000 1XRTT. + * CDMA2000 1XRTT */ -// DEBUG: {"brief": "CDMA2000 1XRTT", "deprecated": none, "id": "cdma2000_1xrtt", "note": none, -// "stability": "experimental", "value": "cdma2000_1xrtt"} static constexpr const char *kCdma20001xrtt = "cdma2000_1xrtt"; + /** - * HSDPA. + * HSDPA */ -// DEBUG: {"brief": "HSDPA", "deprecated": none, "id": "hsdpa", "note": none, "stability": -// "experimental", "value": "hsdpa"} static constexpr const char *kHsdpa = "hsdpa"; + /** - * HSUPA. + * HSUPA */ -// DEBUG: {"brief": "HSUPA", "deprecated": none, "id": "hsupa", "note": none, "stability": -// "experimental", "value": "hsupa"} static constexpr const char *kHsupa = "hsupa"; + /** - * HSPA. + * HSPA */ -// DEBUG: {"brief": "HSPA", "deprecated": none, "id": "hspa", "note": none, "stability": -// "experimental", "value": "hspa"} static constexpr const char *kHspa = "hspa"; + /** - * IDEN. + * IDEN */ -// DEBUG: {"brief": "IDEN", "deprecated": none, "id": "iden", "note": none, "stability": -// "experimental", "value": "iden"} static constexpr const char *kIden = "iden"; + /** - * EVDO Rev. B. + * EVDO Rev. B */ -// DEBUG: {"brief": "EVDO Rev. B", "deprecated": none, "id": "evdo_b", "note": none, "stability": -// "experimental", "value": "evdo_b"} static constexpr const char *kEvdoB = "evdo_b"; + /** - * LTE. + * LTE */ -// DEBUG: {"brief": "LTE", "deprecated": none, "id": "lte", "note": none, "stability": -// "experimental", "value": "lte"} static constexpr const char *kLte = "lte"; + /** - * EHRPD. + * EHRPD */ -// DEBUG: {"brief": "EHRPD", "deprecated": none, "id": "ehrpd", "note": none, "stability": -// "experimental", "value": "ehrpd"} static constexpr const char *kEhrpd = "ehrpd"; + /** - * HSPAP. + * HSPAP */ -// DEBUG: {"brief": "HSPAP", "deprecated": none, "id": "hspap", "note": none, "stability": -// "experimental", "value": "hspap"} static constexpr const char *kHspap = "hspap"; + /** - * GSM. + * GSM */ -// DEBUG: {"brief": "GSM", "deprecated": none, "id": "gsm", "note": none, "stability": -// "experimental", "value": "gsm"} static constexpr const char *kGsm = "gsm"; + /** - * TD-SCDMA. + * TD-SCDMA */ -// DEBUG: {"brief": "TD-SCDMA", "deprecated": none, "id": "td_scdma", "note": none, "stability": -// "experimental", "value": "td_scdma"} static constexpr const char *kTdScdma = "td_scdma"; + /** - * IWLAN. + * IWLAN */ -// DEBUG: {"brief": "IWLAN", "deprecated": none, "id": "iwlan", "note": none, "stability": -// "experimental", "value": "iwlan"} static constexpr const char *kIwlan = "iwlan"; + /** - * 5G NR (New Radio). + * 5G NR (New Radio) */ -// DEBUG: {"brief": "5G NR (New Radio)", "deprecated": none, "id": "nr", "note": none, "stability": -// "experimental", "value": "nr"} static constexpr const char *kNr = "nr"; + /** - * 5G NRNSA (New Radio Non-Standalone). + * 5G NRNSA (New Radio Non-Standalone) */ -// DEBUG: {"brief": "5G NRNSA (New Radio Non-Standalone)", "deprecated": none, "id": "nrnsa", -// "note": none, "stability": "experimental", "value": "nrnsa"} static constexpr const char *kNrnsa = "nrnsa"; + /** - * LTE CA. + * LTE CA */ -// DEBUG: {"brief": "LTE CA", "deprecated": none, "id": "lte_ca", "note": none, "stability": -// "experimental", "value": "lte_ca"} static constexpr const char *kLteCa = "lte_ca"; + } // namespace NetworkConnectionSubtypeValues -// DEBUG: {"brief": "The internet connection type.", "examples": "wifi", "name": -// "network.connection.type", "requirement_level": "recommended", "root_namespace": "network", -// "stability": "experimental", "type": {"allow_custom_values": true, "members": [{"brief": none, -// "deprecated": none, "id": "wifi", "note": none, "stability": "experimental", "value": "wifi"}, -// {"brief": none, "deprecated": none, "id": "wired", "note": none, "stability": "experimental", -// "value": "wired"}, {"brief": none, "deprecated": none, "id": "cell", "note": none, "stability": -// "experimental", "value": "cell"}, {"brief": none, "deprecated": none, "id": "unavailable", -// "note": none, "stability": "experimental", "value": "unavailable"}, {"brief": none, "deprecated": -// none, "id": "unknown", "note": none, "stability": "experimental", "value": "unknown"}]}} namespace NetworkConnectionTypeValues { /** - * wifi. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "wifi", "note": none, "stability": -// "experimental", "value": "wifi"} static constexpr const char *kWifi = "wifi"; + /** - * wired. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "wired", "note": none, "stability": -// "experimental", "value": "wired"} static constexpr const char *kWired = "wired"; + /** - * cell. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "cell", "note": none, "stability": -// "experimental", "value": "cell"} static constexpr const char *kCell = "cell"; + /** - * unavailable. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "unavailable", "note": none, "stability": -// "experimental", "value": "unavailable"} static constexpr const char *kUnavailable = "unavailable"; + /** - * unknown. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "unknown", "note": none, "stability": -// "experimental", "value": "unknown"} static constexpr const char *kUnknown = "unknown"; + } // namespace NetworkConnectionTypeValues -// DEBUG: {"brief": "The network IO operation direction.", "examples": ["transmit"], "name": -// "network.io.direction", "requirement_level": "recommended", "root_namespace": "network", -// "stability": "experimental", "type": {"allow_custom_values": true, "members": [{"brief": none, -// "deprecated": none, "id": "transmit", "note": none, "stability": "experimental", "value": -// "transmit"}, {"brief": none, "deprecated": none, "id": "receive", "note": none, "stability": -// "experimental", "value": "receive"}]}} namespace NetworkIoDirectionValues { /** - * transmit. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "transmit", "note": none, "stability": -// "experimental", "value": "transmit"} static constexpr const char *kTransmit = "transmit"; + /** - * receive. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "receive", "note": none, "stability": -// "experimental", "value": "receive"} static constexpr const char *kReceive = "receive"; + } // namespace NetworkIoDirectionValues -// @deprecated(reason="Deprecated in favor of stable -// `opentelemetry.semconv.attributes.network_attributes.NetworkTransportValues`.") # type: ignore -// DEBUG: {"brief": "[OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process -// communication method](https://wikipedia.org/wiki/Inter-process_communication).\n", "examples": -// ["tcp", "udp"], "name": "network.transport", "note": "The value SHOULD be normalized to -// lowercase.\n\nConsider always setting the transport when setting a port number, since\na port -// number is ambiguous without knowing the transport. For example\ndifferent processes could be -// listening on TCP port 12345 and UDP port 12345.\n", "requirement_level": "recommended", -// "root_namespace": "network", "stability": "stable", "type": {"allow_custom_values": true, -// "members": [{"brief": "TCP", "deprecated": none, "id": "tcp", "note": none, "stability": -// "stable", "value": "tcp"}, {"brief": "UDP", "deprecated": none, "id": "udp", "note": none, -// "stability": "stable", "value": "udp"}, {"brief": "Named or anonymous pipe.", "deprecated": none, -// "id": "pipe", "note": none, "stability": "stable", "value": "pipe"}, {"brief": "Unix domain -// socket", "deprecated": none, "id": "unix", "note": none, "stability": "stable", "value": "unix"}, -// {"brief": "QUIC", "deprecated": none, "id": "quic", "note": none, "stability": "experimental", -// "value": "quic"}]}} namespace NetworkTransportValues { /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.network_attributes.NetworkTransportValues.kTcp @endcode. + * TCP */ -// DEBUG: {"brief": "TCP", "deprecated": none, "id": "tcp", "note": none, "stability": "stable", -// "value": "tcp"} static constexpr const char *kTcp = "tcp"; + /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.network_attributes.NetworkTransportValues.kUdp @endcode. + * UDP */ -// DEBUG: {"brief": "UDP", "deprecated": none, "id": "udp", "note": none, "stability": "stable", -// "value": "udp"} static constexpr const char *kUdp = "udp"; + /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.network_attributes.NetworkTransportValues.kPipe @endcode. + * Named or anonymous pipe. */ -// DEBUG: {"brief": "Named or anonymous pipe.", "deprecated": none, "id": "pipe", "note": none, -// "stability": "stable", "value": "pipe"} static constexpr const char *kPipe = "pipe"; + /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.network_attributes.NetworkTransportValues.kUnix @endcode. + * Unix domain socket */ -// DEBUG: {"brief": "Unix domain socket", "deprecated": none, "id": "unix", "note": none, -// "stability": "stable", "value": "unix"} static constexpr const char *kUnix = "unix"; + /** - * QUIC. + * QUIC */ -// DEBUG: {"brief": "QUIC", "deprecated": none, "id": "quic", "note": none, "stability": -// "experimental", "value": "quic"} static constexpr const char *kQuic = "quic"; + } // namespace NetworkTransportValues -// @deprecated(reason="Deprecated in favor of stable -// `opentelemetry.semconv.attributes.network_attributes.NetworkTypeValues`.") # type: ignore DEBUG: -// {"brief": "[OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent.", -// "examples": ["ipv4", "ipv6"], "name": "network.type", "note": "The value SHOULD be normalized to -// lowercase.", "requirement_level": "recommended", "root_namespace": "network", "stability": -// "stable", "type": {"allow_custom_values": true, "members": [{"brief": "IPv4", "deprecated": none, -// "id": "ipv4", "note": none, "stability": "stable", "value": "ipv4"}, {"brief": "IPv6", -// "deprecated": none, "id": "ipv6", "note": none, "stability": "stable", "value": "ipv6"}]}} namespace NetworkTypeValues { /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.network_attributes.NetworkTypeValues.kIpv4 @endcode. + * IPv4 */ -// DEBUG: {"brief": "IPv4", "deprecated": none, "id": "ipv4", "note": none, "stability": "stable", -// "value": "ipv4"} static constexpr const char *kIpv4 = "ipv4"; + /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.network_attributes.NetworkTypeValues.kIpv6 @endcode. + * IPv6 */ -// DEBUG: {"brief": "IPv6", "deprecated": none, "id": "ipv6", "note": none, "stability": "stable", -// "value": "ipv6"} static constexpr const char *kIpv6 = "ipv6"; + } // namespace NetworkTypeValues } // namespace network diff --git a/api/include/opentelemetry/semconv/incubating/attributes/oci_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/oci_attributes.h index b57cad14bd..ade92d35c8 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/oci_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/oci_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -23,7 +21,7 @@ namespace oci /** * The digest of the OCI image manifest. For container images specifically is the digest by which - * the container image is known. Note: Follows Follows OCI Image Manifest * Specification, and specifically the Digest @@ -31,7 +29,7 @@ namespace oci * href="https://docs.docker.com/registry/spec/manifest-v2-2/#example-image-manifest">Example Image * Manifest. */ -static const char *kOciManifestDigest = "oci.manifest.digest"; +static constexpr const char *kOciManifestDigest = "oci.manifest.digest"; } // namespace oci } // namespace semconv diff --git a/api/include/opentelemetry/semconv/incubating/attributes/opentracing_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/opentracing_attributes.h index 25f197460c..159645e76b 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/opentracing_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/opentracing_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -22,34 +20,24 @@ namespace opentracing { /** - * Parent-child Reference type. - * Note: The causal relationship between a child Span and a parent Span. + * Parent-child Reference type + *

+ * The causal relationship between a child Span and a parent Span. */ -static const char *kOpentracingRefType = "opentracing.ref_type"; - -// DEBUG: {"brief": "Parent-child Reference type", "name": "opentracing.ref_type", "note": "The -// causal relationship between a child Span and a parent Span.\n", "requirement_level": -// "recommended", "root_namespace": "opentracing", "stability": "experimental", "type": -// {"allow_custom_values": true, "members": [{"brief": "The parent Span depends on the child Span in -// some capacity", "deprecated": none, "id": "child_of", "note": none, "stability": "experimental", -// "value": "child_of"}, {"brief": "The parent Span doesn't depend in any way on the result of the -// child Span", "deprecated": none, "id": "follows_from", "note": none, "stability": "experimental", -// "value": "follows_from"}]}} +static constexpr const char *kOpentracingRefType = "opentracing.ref_type"; + namespace OpentracingRefTypeValues { /** - * The parent Span depends on the child Span in some capacity. + * The parent Span depends on the child Span in some capacity */ -// DEBUG: {"brief": "The parent Span depends on the child Span in some capacity", "deprecated": -// none, "id": "child_of", "note": none, "stability": "experimental", "value": "child_of"} static constexpr const char *kChildOf = "child_of"; + /** - * The parent Span doesn't depend in any way on the result of the child Span. + * The parent Span doesn't depend in any way on the result of the child Span */ -// DEBUG: {"brief": "The parent Span doesn't depend in any way on the result of the child Span", -// "deprecated": none, "id": "follows_from", "note": none, "stability": "experimental", "value": -// "follows_from"} static constexpr const char *kFollowsFrom = "follows_from"; + } // namespace OpentracingRefTypeValues } // namespace opentracing diff --git a/api/include/opentelemetry/semconv/incubating/attributes/os_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/os_attributes.h index fa50d310f6..807deaaf92 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/os_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/os_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -24,116 +22,87 @@ namespace os /** * Unique identifier for a particular build or compilation of the operating system. */ -static const char *kOsBuildId = "os.build_id"; +static constexpr const char *kOsBuildId = "os.build_id"; /** * Human readable (not intended to be parsed) OS version information, like e.g. reported by @code * ver @endcode or @code lsb_release -a @endcode commands. */ -static const char *kOsDescription = "os.description"; +static constexpr const char *kOsDescription = "os.description"; /** * Human readable operating system name. */ -static const char *kOsName = "os.name"; +static constexpr const char *kOsName = "os.name"; /** * The operating system type. */ -static const char *kOsType = "os.type"; +static constexpr const char *kOsType = "os.type"; /** * The version string of the operating system as defined in Version Attributes. */ -static const char *kOsVersion = "os.version"; - -// DEBUG: {"brief": "The operating system type.\n", "name": "os.type", "requirement_level": -// "recommended", "root_namespace": "os", "stability": "experimental", "type": -// {"allow_custom_values": true, "members": [{"brief": "Microsoft Windows", "deprecated": none, -// "id": "windows", "note": none, "stability": "experimental", "value": "windows"}, {"brief": -// "Linux", "deprecated": none, "id": "linux", "note": none, "stability": "experimental", "value": -// "linux"}, {"brief": "Apple Darwin", "deprecated": none, "id": "darwin", "note": none, -// "stability": "experimental", "value": "darwin"}, {"brief": "FreeBSD", "deprecated": none, "id": -// "freebsd", "note": none, "stability": "experimental", "value": "freebsd"}, {"brief": "NetBSD", -// "deprecated": none, "id": "netbsd", "note": none, "stability": "experimental", "value": -// "netbsd"}, {"brief": "OpenBSD", "deprecated": none, "id": "openbsd", "note": none, "stability": -// "experimental", "value": "openbsd"}, {"brief": "DragonFly BSD", "deprecated": none, "id": -// "dragonflybsd", "note": none, "stability": "experimental", "value": "dragonflybsd"}, {"brief": -// "HP-UX (Hewlett Packard Unix)", "deprecated": none, "id": "hpux", "note": none, "stability": -// "experimental", "value": "hpux"}, {"brief": "AIX (Advanced Interactive eXecutive)", "deprecated": -// none, "id": "aix", "note": none, "stability": "experimental", "value": "aix"}, {"brief": "SunOS, -// Oracle Solaris", "deprecated": none, "id": "solaris", "note": none, "stability": "experimental", -// "value": "solaris"}, {"brief": "IBM z/OS", "deprecated": none, "id": "z_os", "note": none, -// "stability": "experimental", "value": "z_os"}]}} +static constexpr const char *kOsVersion = "os.version"; + namespace OsTypeValues { /** - * Microsoft Windows. + * Microsoft Windows */ -// DEBUG: {"brief": "Microsoft Windows", "deprecated": none, "id": "windows", "note": none, -// "stability": "experimental", "value": "windows"} static constexpr const char *kWindows = "windows"; + /** - * Linux. + * Linux */ -// DEBUG: {"brief": "Linux", "deprecated": none, "id": "linux", "note": none, "stability": -// "experimental", "value": "linux"} static constexpr const char *kLinux = "linux"; + /** - * Apple Darwin. + * Apple Darwin */ -// DEBUG: {"brief": "Apple Darwin", "deprecated": none, "id": "darwin", "note": none, "stability": -// "experimental", "value": "darwin"} static constexpr const char *kDarwin = "darwin"; + /** - * FreeBSD. + * FreeBSD */ -// DEBUG: {"brief": "FreeBSD", "deprecated": none, "id": "freebsd", "note": none, "stability": -// "experimental", "value": "freebsd"} static constexpr const char *kFreebsd = "freebsd"; + /** - * NetBSD. + * NetBSD */ -// DEBUG: {"brief": "NetBSD", "deprecated": none, "id": "netbsd", "note": none, "stability": -// "experimental", "value": "netbsd"} static constexpr const char *kNetbsd = "netbsd"; + /** - * OpenBSD. + * OpenBSD */ -// DEBUG: {"brief": "OpenBSD", "deprecated": none, "id": "openbsd", "note": none, "stability": -// "experimental", "value": "openbsd"} static constexpr const char *kOpenbsd = "openbsd"; + /** - * DragonFly BSD. + * DragonFly BSD */ -// DEBUG: {"brief": "DragonFly BSD", "deprecated": none, "id": "dragonflybsd", "note": none, -// "stability": "experimental", "value": "dragonflybsd"} static constexpr const char *kDragonflybsd = "dragonflybsd"; + /** - * HP-UX (Hewlett Packard Unix). + * HP-UX (Hewlett Packard Unix) */ -// DEBUG: {"brief": "HP-UX (Hewlett Packard Unix)", "deprecated": none, "id": "hpux", "note": none, -// "stability": "experimental", "value": "hpux"} static constexpr const char *kHpux = "hpux"; + /** - * AIX (Advanced Interactive eXecutive). + * AIX (Advanced Interactive eXecutive) */ -// DEBUG: {"brief": "AIX (Advanced Interactive eXecutive)", "deprecated": none, "id": "aix", "note": -// none, "stability": "experimental", "value": "aix"} static constexpr const char *kAix = "aix"; + /** - * SunOS, Oracle Solaris. + * SunOS, Oracle Solaris */ -// DEBUG: {"brief": "SunOS, Oracle Solaris", "deprecated": none, "id": "solaris", "note": none, -// "stability": "experimental", "value": "solaris"} static constexpr const char *kSolaris = "solaris"; + /** - * IBM z/OS. + * IBM z/OS */ -// DEBUG: {"brief": "IBM z/OS", "deprecated": none, "id": "z_os", "note": none, "stability": -// "experimental", "value": "z_os"} static constexpr const char *kZOs = "z_os"; + } // namespace OsTypeValues } // namespace os diff --git a/api/include/opentelemetry/semconv/incubating/attributes/otel_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/otel_attributes.h index a4d4832eb0..241e07d1aa 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/otel_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/otel_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -22,65 +20,52 @@ namespace otel { /** - * @Deprecated: use the @code otel.scope.name @endcode attribute. + * @deprecated + * use the @code otel.scope.name @endcode attribute. */ -static const char *kOtelLibraryName = "otel.library.name"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kOtelLibraryName = "otel.library.name"; /** - * @Deprecated: use the @code otel.scope.version @endcode attribute. + * @deprecated + * use the @code otel.scope.version @endcode attribute. */ -static const char *kOtelLibraryVersion = "otel.library.version"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kOtelLibraryVersion = "otel.library.version"; /** - * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.otel_attributes. - * @endcode. + * The name of the instrumentation scope - (@code InstrumentationScope.Name @endcode in OTLP). */ -static const char *kOtelScopeName = "otel.scope.name"; +static constexpr const char *kOtelScopeName = "otel.scope.name"; /** - * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.otel_attributes. - * @endcode. + * The version of the instrumentation scope - (@code InstrumentationScope.Version @endcode in OTLP). */ -static const char *kOtelScopeVersion = "otel.scope.version"; +static constexpr const char *kOtelScopeVersion = "otel.scope.version"; /** - * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.otel_attributes. - * @endcode. + * Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET. */ -static const char *kOtelStatusCode = "otel.status_code"; +static constexpr const char *kOtelStatusCode = "otel.status_code"; /** - * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.otel_attributes. - * @endcode. + * Description of the Status if it has a value, otherwise not set. */ -static const char *kOtelStatusDescription = "otel.status_description"; +static constexpr const char *kOtelStatusDescription = "otel.status_description"; -// @deprecated(reason="Deprecated in favor of stable -// `opentelemetry.semconv.attributes.otel_attributes.OtelStatusCodeValues`.") # type: ignore DEBUG: -// {"brief": "Name of the code, either \"OK\" or \"ERROR\". MUST NOT be set if the status code is -// UNSET.", "name": "otel.status_code", "requirement_level": "recommended", "root_namespace": -// "otel", "stability": "stable", "type": {"allow_custom_values": true, "members": [{"brief": "The -// operation has been validated by an Application developer or Operator to have completed -// successfully.", "deprecated": none, "id": "ok", "note": none, "stability": "stable", "value": -// "OK"}, {"brief": "The operation contains an error.", "deprecated": none, "id": "error", "note": -// none, "stability": "stable", "value": "ERROR"}]}} namespace OtelStatusCodeValues { /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.otel_attributes.OtelStatusCodeValues.kOk @endcode. + * The operation has been validated by an Application developer or Operator to have completed + * successfully. */ -// DEBUG: {"brief": "The operation has been validated by an Application developer or Operator to -// have completed successfully.", "deprecated": none, "id": "ok", "note": none, "stability": -// "stable", "value": "OK"} static constexpr const char *kOk = "OK"; + /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.otel_attributes.OtelStatusCodeValues.kError @endcode. + * The operation contains an error. */ -// DEBUG: {"brief": "The operation contains an error.", "deprecated": none, "id": "error", "note": -// none, "stability": "stable", "value": "ERROR"} static constexpr const char *kError = "ERROR"; + } // namespace OtelStatusCodeValues } // namespace otel diff --git a/api/include/opentelemetry/semconv/incubating/attributes/other_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/other_attributes.h index 00cbba2786..bc6d26ef16 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/other_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/other_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -22,32 +20,26 @@ namespace other { /** - * @Deprecated: Replaced by @code db.client.connection.state @endcode. + * Deprecated, use @code db.client.connection.state @endcode instead. + *

+ * @deprecated + * Replaced by @code db.client.connection.state @endcode. */ -static const char *kState = "state"; - -// @deprecated(reason="The attribute state is deprecated - Replaced by -// `db.client.connection.state`") # type: ignore DEBUG: {"brief": "Deprecated, use -// `db.client.connection.state` instead.", "deprecated": "Replaced by -// `db.client.connection.state`.", "examples": ["idle"], "name": "state", "requirement_level": -// "recommended", "root_namespace": "other", "stability": "experimental", "type": -// {"allow_custom_values": true, "members": [{"brief": none, "deprecated": none, "id": "idle", -// "note": none, "stability": "experimental", "value": "idle"}, {"brief": none, "deprecated": none, -// "id": "used", "note": none, "stability": "experimental", "value": "used"}]}} +OPENTELEMETRY_DEPRECATED +static constexpr const char *kState = "state"; + namespace StateValues { /** - * idle. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "idle", "note": none, "stability": -// "experimental", "value": "idle"} static constexpr const char *kIdle = "idle"; + /** - * used. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "used", "note": none, "stability": -// "experimental", "value": "used"} static constexpr const char *kUsed = "used"; + } // namespace StateValues } // namespace other diff --git a/api/include/opentelemetry/semconv/incubating/attributes/peer_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/peer_attributes.h index c6a07788a6..6215d913f5 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/peer_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/peer_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -26,7 +24,7 @@ namespace peer * service. SHOULD be equal to the actual @code service.name @endcode resource attribute of the * remote service if any. */ -static const char *kPeerService = "peer.service"; +static constexpr const char *kPeerService = "peer.service"; } // namespace peer } // namespace semconv diff --git a/api/include/opentelemetry/semconv/incubating/attributes/pool_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/pool_attributes.h index d034fb0e27..6c26b22c23 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/pool_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/pool_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -22,9 +20,13 @@ namespace pool { /** - * @Deprecated: Replaced by @code db.client.connection.pool.name @endcode. + * Deprecated, use @code db.client.connection.pool.name @endcode instead. + *

+ * @deprecated + * Replaced by @code db.client.connection.pool.name @endcode. */ -static const char *kPoolName = "pool.name"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kPoolName = "pool.name"; } // namespace pool } // namespace semconv diff --git a/api/include/opentelemetry/semconv/incubating/attributes/process_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/process_attributes.h index a9a5f727de..392ef869d1 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/process_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/process_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -26,7 +24,7 @@ namespace process * set to the zeroth string in @code proc/[pid]/cmdline @endcode. On Windows, can be set to the * first parameter extracted from @code GetCommandLineW @endcode. */ -static const char *kProcessCommand = "process.command"; +static constexpr const char *kProcessCommand = "process.command"; /** * All the command arguments (including the command/executable itself) as received by the process. @@ -34,216 +32,193 @@ static const char *kProcessCommand = "process.command"; * to the list of null-delimited strings extracted from @code proc/[pid]/cmdline @endcode. For * libc-based executables, this would be the full argv vector passed to @code main @endcode. */ -static const char *kProcessCommandArgs = "process.command_args"; +static constexpr const char *kProcessCommandArgs = "process.command_args"; /** * The full command used to launch the process as a single string representing the full command. On * Windows, can be set to the result of @code GetCommandLineW @endcode. Do not set this if you have * to assemble it just for monitoring; use @code process.command_args @endcode instead. */ -static const char *kProcessCommandLine = "process.command_line"; +static constexpr const char *kProcessCommandLine = "process.command_line"; /** * Specifies whether the context switches for this data point were voluntary or involuntary. */ -static const char *kProcessContextSwitchType = "process.context_switch_type"; +static constexpr const char *kProcessContextSwitchType = "process.context_switch_type"; /** - * @Deprecated: Replaced by @code cpu.mode @endcode. + * Deprecated, use @code cpu.mode @endcode instead. + *

+ * @deprecated + * Replaced by @code cpu.mode @endcode */ -static const char *kProcessCpuState = "process.cpu.state"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kProcessCpuState = "process.cpu.state"; /** * The date and time the process was created, in ISO 8601 format. */ -static const char *kProcessCreationTime = "process.creation.time"; +static constexpr const char *kProcessCreationTime = "process.creation.time"; /** * The name of the process executable. On Linux based systems, can be set to the @code Name @endcode * in @code proc/[pid]/status @endcode. On Windows, can be set to the base name of @code * GetProcessImageFileNameW @endcode. */ -static const char *kProcessExecutableName = "process.executable.name"; +static constexpr const char *kProcessExecutableName = "process.executable.name"; /** * The full path to the process executable. On Linux based systems, can be set to the target of * @code proc/[pid]/exe @endcode. On Windows, can be set to the result of @code * GetProcessImageFileNameW @endcode. */ -static const char *kProcessExecutablePath = "process.executable.path"; +static constexpr const char *kProcessExecutablePath = "process.executable.path"; /** * The exit code of the process. */ -static const char *kProcessExitCode = "process.exit.code"; +static constexpr const char *kProcessExitCode = "process.exit.code"; /** * The date and time the process exited, in ISO 8601 format. */ -static const char *kProcessExitTime = "process.exit.time"; +static constexpr const char *kProcessExitTime = "process.exit.time"; /** * The PID of the process's group leader. This is also the process group ID (PGID) of the process. */ -static const char *kProcessGroupLeaderPid = "process.group_leader.pid"; +static constexpr const char *kProcessGroupLeaderPid = "process.group_leader.pid"; /** * Whether the process is connected to an interactive shell. */ -static const char *kProcessInteractive = "process.interactive"; +static constexpr const char *kProcessInteractive = "process.interactive"; /** * The username of the user that owns the process. */ -static const char *kProcessOwner = "process.owner"; +static constexpr const char *kProcessOwner = "process.owner"; /** * The type of page fault for this data point. Type @code major @endcode is for major/hard page * faults, and @code minor @endcode is for minor/soft page faults. */ -static const char *kProcessPagingFaultType = "process.paging.fault_type"; +static constexpr const char *kProcessPagingFaultType = "process.paging.fault_type"; /** * Parent Process identifier (PPID). */ -static const char *kProcessParentPid = "process.parent_pid"; +static constexpr const char *kProcessParentPid = "process.parent_pid"; /** * Process identifier (PID). */ -static const char *kProcessPid = "process.pid"; +static constexpr const char *kProcessPid = "process.pid"; /** * The real user ID (RUID) of the process. */ -static const char *kProcessRealUserId = "process.real_user.id"; +static constexpr const char *kProcessRealUserId = "process.real_user.id"; /** * The username of the real user of the process. */ -static const char *kProcessRealUserName = "process.real_user.name"; +static constexpr const char *kProcessRealUserName = "process.real_user.name"; /** * An additional description about the runtime of the process, for example a specific vendor * customization of the runtime environment. */ -static const char *kProcessRuntimeDescription = "process.runtime.description"; +static constexpr const char *kProcessRuntimeDescription = "process.runtime.description"; /** * The name of the runtime of this process. */ -static const char *kProcessRuntimeName = "process.runtime.name"; +static constexpr const char *kProcessRuntimeName = "process.runtime.name"; /** * The version of the runtime of this process, as returned by the runtime without modification. */ -static const char *kProcessRuntimeVersion = "process.runtime.version"; +static constexpr const char *kProcessRuntimeVersion = "process.runtime.version"; /** * The saved user ID (SUID) of the process. */ -static const char *kProcessSavedUserId = "process.saved_user.id"; +static constexpr const char *kProcessSavedUserId = "process.saved_user.id"; /** * The username of the saved user. */ -static const char *kProcessSavedUserName = "process.saved_user.name"; +static constexpr const char *kProcessSavedUserName = "process.saved_user.name"; /** * The PID of the process's session leader. This is also the session ID (SID) of the process. */ -static const char *kProcessSessionLeaderPid = "process.session_leader.pid"; +static constexpr const char *kProcessSessionLeaderPid = "process.session_leader.pid"; /** * The effective user ID (EUID) of the process. */ -static const char *kProcessUserId = "process.user.id"; +static constexpr const char *kProcessUserId = "process.user.id"; /** * The username of the effective user of the process. */ -static const char *kProcessUserName = "process.user.name"; +static constexpr const char *kProcessUserName = "process.user.name"; /** * Virtual process identifier. - * Note: The process ID within a PID namespace. This is not necessarily unique across all processes - * on the host but it is unique within the process namespace that the process exists within. + *

+ * The process ID within a PID namespace. This is not necessarily unique across all processes on the + * host but it is unique within the process namespace that the process exists within. */ -static const char *kProcessVpid = "process.vpid"; +static constexpr const char *kProcessVpid = "process.vpid"; -// DEBUG: {"brief": "Specifies whether the context switches for this data point were voluntary or -// involuntary.", "name": "process.context_switch_type", "requirement_level": "recommended", -// "root_namespace": "process", "stability": "experimental", "type": {"allow_custom_values": true, -// "members": [{"brief": none, "deprecated": none, "id": "voluntary", "note": none, "stability": -// "experimental", "value": "voluntary"}, {"brief": none, "deprecated": none, "id": "involuntary", -// "note": none, "stability": "experimental", "value": "involuntary"}]}} namespace ProcessContextSwitchTypeValues { /** - * voluntary. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "voluntary", "note": none, "stability": -// "experimental", "value": "voluntary"} static constexpr const char *kVoluntary = "voluntary"; + /** - * involuntary. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "involuntary", "note": none, "stability": -// "experimental", "value": "involuntary"} static constexpr const char *kInvoluntary = "involuntary"; + } // namespace ProcessContextSwitchTypeValues -// @deprecated(reason="The attribute process.cpu.state is deprecated - Replaced by `cpu.mode`") # -// type: ignore DEBUG: {"brief": "Deprecated, use `cpu.mode` instead.", "deprecated": "Replaced by -// `cpu.mode`", "name": "process.cpu.state", "requirement_level": "recommended", "root_namespace": -// "process", "stability": "experimental", "type": {"allow_custom_values": true, "members": -// [{"brief": none, "deprecated": none, "id": "system", "note": none, "stability": "experimental", -// "value": "system"}, {"brief": none, "deprecated": none, "id": "user", "note": none, "stability": -// "experimental", "value": "user"}, {"brief": none, "deprecated": none, "id": "wait", "note": none, -// "stability": "experimental", "value": "wait"}]}} namespace ProcessCpuStateValues { /** - * system. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "system", "note": none, "stability": -// "experimental", "value": "system"} static constexpr const char *kSystem = "system"; + /** - * user. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "user", "note": none, "stability": -// "experimental", "value": "user"} static constexpr const char *kUser = "user"; + /** - * wait. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "wait", "note": none, "stability": -// "experimental", "value": "wait"} static constexpr const char *kWait = "wait"; + } // namespace ProcessCpuStateValues -// DEBUG: {"brief": "The type of page fault for this data point. Type `major` is for major/hard page -// faults, and `minor` is for minor/soft page faults.\n", "name": "process.paging.fault_type", -// "requirement_level": "recommended", "root_namespace": "process", "stability": "experimental", -// "type": {"allow_custom_values": true, "members": [{"brief": none, "deprecated": none, "id": -// "major", "note": none, "stability": "experimental", "value": "major"}, {"brief": none, -// "deprecated": none, "id": "minor", "note": none, "stability": "experimental", "value": -// "minor"}]}} namespace ProcessPagingFaultTypeValues { /** - * major. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "major", "note": none, "stability": -// "experimental", "value": "major"} static constexpr const char *kMajor = "major"; + /** - * minor. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "minor", "note": none, "stability": -// "experimental", "value": "minor"} static constexpr const char *kMinor = "minor"; + } // namespace ProcessPagingFaultTypeValues } // namespace process diff --git a/api/include/opentelemetry/semconv/incubating/attributes/rpc_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/rpc_attributes.h index 6fd706f126..49ba418512 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/rpc_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/rpc_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -25,57 +23,55 @@ namespace rpc * The error codes of the Connect * request. Error codes are always string values. */ -static const char *kRpcConnectRpcErrorCode = "rpc.connect_rpc.error_code"; +static constexpr const char *kRpcConnectRpcErrorCode = "rpc.connect_rpc.error_code"; /** * Connect request metadata, @code @endcode being the normalized Connect Metadata key - * (lowercase), the value being the metadata values. Note: Instrumentations SHOULD require an - * explicit configuration of which metadata values are to be captured. Including all request - * metadata values can be a security risk - explicit configuration helps avoid leaking sensitive - * information. + * (lowercase), the value being the metadata values.

Instrumentations SHOULD require an explicit + * configuration of which metadata values are to be captured. Including all request metadata values + * can be a security risk - explicit configuration helps avoid leaking sensitive information. */ -static const char *kRpcConnectRpcRequestMetadata = "rpc.connect_rpc.request.metadata"; +static constexpr const char *kRpcConnectRpcRequestMetadata = "rpc.connect_rpc.request.metadata"; /** * Connect response metadata, @code @endcode being the normalized Connect Metadata key - * (lowercase), the value being the metadata values. Note: Instrumentations SHOULD require an - * explicit configuration of which metadata values are to be captured. Including all response - * metadata values can be a security risk - explicit configuration helps avoid leaking sensitive - * information. + * (lowercase), the value being the metadata values.

Instrumentations SHOULD require an explicit + * configuration of which metadata values are to be captured. Including all response metadata values + * can be a security risk - explicit configuration helps avoid leaking sensitive information. */ -static const char *kRpcConnectRpcResponseMetadata = "rpc.connect_rpc.response.metadata"; +static constexpr const char *kRpcConnectRpcResponseMetadata = "rpc.connect_rpc.response.metadata"; /** * gRPC request metadata, @code @endcode being the normalized gRPC Metadata key (lowercase), - * the value being the metadata values. Note: Instrumentations SHOULD require an explicit + * the value being the metadata values.

Instrumentations SHOULD require an explicit * configuration of which metadata values are to be captured. Including all request metadata values * can be a security risk - explicit configuration helps avoid leaking sensitive information. */ -static const char *kRpcGrpcRequestMetadata = "rpc.grpc.request.metadata"; +static constexpr const char *kRpcGrpcRequestMetadata = "rpc.grpc.request.metadata"; /** * gRPC response metadata, @code @endcode being the normalized gRPC Metadata key (lowercase), - * the value being the metadata values. Note: Instrumentations SHOULD require an explicit + * the value being the metadata values.

Instrumentations SHOULD require an explicit * configuration of which metadata values are to be captured. Including all response metadata values * can be a security risk - explicit configuration helps avoid leaking sensitive information. */ -static const char *kRpcGrpcResponseMetadata = "rpc.grpc.response.metadata"; +static constexpr const char *kRpcGrpcResponseMetadata = "rpc.grpc.response.metadata"; /** * The numeric status * code of the gRPC request. */ -static const char *kRpcGrpcStatusCode = "rpc.grpc.status_code"; +static constexpr const char *kRpcGrpcStatusCode = "rpc.grpc.status_code"; /** * @code error.code @endcode property of response if it is an error response. */ -static const char *kRpcJsonrpcErrorCode = "rpc.jsonrpc.error_code"; +static constexpr const char *kRpcJsonrpcErrorCode = "rpc.jsonrpc.error_code"; /** * @code error.message @endcode property of response if it is an error response. */ -static const char *kRpcJsonrpcErrorMessage = "rpc.jsonrpc.error_message"; +static constexpr const char *kRpcJsonrpcErrorMessage = "rpc.jsonrpc.error_message"; /** * @code id @endcode property of request or response. Since protocol allows id to be int, string, @@ -83,382 +79,275 @@ static const char *kRpcJsonrpcErrorMessage = "rpc.jsonrpc.error_message"; * simplicity. Use empty string in case of @code null @endcode value. Omit entirely if this is a * notification. */ -static const char *kRpcJsonrpcRequestId = "rpc.jsonrpc.request_id"; +static constexpr const char *kRpcJsonrpcRequestId = "rpc.jsonrpc.request_id"; /** * Protocol version as in @code jsonrpc @endcode property of request/response. Since JSON-RPC 1.0 * doesn't specify this, the value can be omitted. */ -static const char *kRpcJsonrpcVersion = "rpc.jsonrpc.version"; +static constexpr const char *kRpcJsonrpcVersion = "rpc.jsonrpc.version"; /** * Compressed size of the message in bytes. */ -static const char *kRpcMessageCompressedSize = "rpc.message.compressed_size"; +static constexpr const char *kRpcMessageCompressedSize = "rpc.message.compressed_size"; /** * MUST be calculated as two different counters starting from @code 1 @endcode one for sent messages - * and one for received message. Note: This way we guarantee that the values will be consistent + * and one for received message.

This way we guarantee that the values will be consistent * between different implementations. */ -static const char *kRpcMessageId = "rpc.message.id"; +static constexpr const char *kRpcMessageId = "rpc.message.id"; /** * Whether this is a received or sent message. */ -static const char *kRpcMessageType = "rpc.message.type"; +static constexpr const char *kRpcMessageType = "rpc.message.type"; /** * Uncompressed size of the message in bytes. */ -static const char *kRpcMessageUncompressedSize = "rpc.message.uncompressed_size"; +static constexpr const char *kRpcMessageUncompressedSize = "rpc.message.uncompressed_size"; /** * The name of the (logical) method being called, must be equal to the $method part in the span - * name. Note: This is the logical name of the method from the RPC interface perspective, which can - * be different from the name of any implementing method/function. The @code code.function @endcode + * name.

This is the logical name of the method from the RPC interface perspective, which can be + * different from the name of any implementing method/function. The @code code.function @endcode * attribute may be used to store the latter (e.g., method actually executing the call on the server * side, RPC client stub method on the client side). */ -static const char *kRpcMethod = "rpc.method"; +static constexpr const char *kRpcMethod = "rpc.method"; /** * The full (logical) name of the service being called, including its package name, if applicable. - * Note: This is the logical name of the service from the RPC interface perspective, which can be + *

+ * This is the logical name of the service from the RPC interface perspective, which can be * different from the name of any implementing class. The @code code.namespace @endcode attribute * may be used to store the latter (despite the attribute name, it may include a class name; e.g., * class with method actually executing the call on the server side, RPC client stub class on the * client side). */ -static const char *kRpcService = "rpc.service"; +static constexpr const char *kRpcService = "rpc.service"; /** * A string identifying the remoting system. See below for a list of well-known identifiers. */ -static const char *kRpcSystem = "rpc.system"; - -// DEBUG: {"brief": "The [error codes](https://connect.build/docs/protocol/#error-codes) of the -// Connect request. Error codes are always string values.", "name": "rpc.connect_rpc.error_code", -// "requirement_level": "recommended", "root_namespace": "rpc", "stability": "experimental", "type": -// {"allow_custom_values": true, "members": [{"brief": none, "deprecated": none, "id": "cancelled", -// "note": none, "stability": "experimental", "value": "cancelled"}, {"brief": none, "deprecated": -// none, "id": "unknown", "note": none, "stability": "experimental", "value": "unknown"}, {"brief": -// none, "deprecated": none, "id": "invalid_argument", "note": none, "stability": "experimental", -// "value": "invalid_argument"}, {"brief": none, "deprecated": none, "id": "deadline_exceeded", -// "note": none, "stability": "experimental", "value": "deadline_exceeded"}, {"brief": none, -// "deprecated": none, "id": "not_found", "note": none, "stability": "experimental", "value": -// "not_found"}, {"brief": none, "deprecated": none, "id": "already_exists", "note": none, -// "stability": "experimental", "value": "already_exists"}, {"brief": none, "deprecated": none, -// "id": "permission_denied", "note": none, "stability": "experimental", "value": -// "permission_denied"}, {"brief": none, "deprecated": none, "id": "resource_exhausted", "note": -// none, "stability": "experimental", "value": "resource_exhausted"}, {"brief": none, "deprecated": -// none, "id": "failed_precondition", "note": none, "stability": "experimental", "value": -// "failed_precondition"}, {"brief": none, "deprecated": none, "id": "aborted", "note": none, -// "stability": "experimental", "value": "aborted"}, {"brief": none, "deprecated": none, "id": -// "out_of_range", "note": none, "stability": "experimental", "value": "out_of_range"}, {"brief": -// none, "deprecated": none, "id": "unimplemented", "note": none, "stability": "experimental", -// "value": "unimplemented"}, {"brief": none, "deprecated": none, "id": "internal", "note": none, -// "stability": "experimental", "value": "internal"}, {"brief": none, "deprecated": none, "id": -// "unavailable", "note": none, "stability": "experimental", "value": "unavailable"}, {"brief": -// none, "deprecated": none, "id": "data_loss", "note": none, "stability": "experimental", "value": -// "data_loss"}, {"brief": none, "deprecated": none, "id": "unauthenticated", "note": none, -// "stability": "experimental", "value": "unauthenticated"}]}} +static constexpr const char *kRpcSystem = "rpc.system"; + namespace RpcConnectRpcErrorCodeValues { /** - * cancelled. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "cancelled", "note": none, "stability": -// "experimental", "value": "cancelled"} static constexpr const char *kCancelled = "cancelled"; + /** - * unknown. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "unknown", "note": none, "stability": -// "experimental", "value": "unknown"} static constexpr const char *kUnknown = "unknown"; + /** - * invalid_argument. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "invalid_argument", "note": none, "stability": -// "experimental", "value": "invalid_argument"} static constexpr const char *kInvalidArgument = "invalid_argument"; + /** - * deadline_exceeded. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "deadline_exceeded", "note": none, "stability": -// "experimental", "value": "deadline_exceeded"} static constexpr const char *kDeadlineExceeded = "deadline_exceeded"; + /** - * not_found. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "not_found", "note": none, "stability": -// "experimental", "value": "not_found"} static constexpr const char *kNotFound = "not_found"; + /** - * already_exists. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "already_exists", "note": none, "stability": -// "experimental", "value": "already_exists"} static constexpr const char *kAlreadyExists = "already_exists"; + /** - * permission_denied. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "permission_denied", "note": none, "stability": -// "experimental", "value": "permission_denied"} static constexpr const char *kPermissionDenied = "permission_denied"; + /** - * resource_exhausted. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "resource_exhausted", "note": none, "stability": -// "experimental", "value": "resource_exhausted"} static constexpr const char *kResourceExhausted = "resource_exhausted"; + /** - * failed_precondition. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "failed_precondition", "note": none, -// "stability": "experimental", "value": "failed_precondition"} static constexpr const char *kFailedPrecondition = "failed_precondition"; + /** - * aborted. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "aborted", "note": none, "stability": -// "experimental", "value": "aborted"} static constexpr const char *kAborted = "aborted"; + /** - * out_of_range. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "out_of_range", "note": none, "stability": -// "experimental", "value": "out_of_range"} static constexpr const char *kOutOfRange = "out_of_range"; + /** - * unimplemented. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "unimplemented", "note": none, "stability": -// "experimental", "value": "unimplemented"} static constexpr const char *kUnimplemented = "unimplemented"; + /** - * internal. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "internal", "note": none, "stability": -// "experimental", "value": "internal"} static constexpr const char *kInternal = "internal"; + /** - * unavailable. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "unavailable", "note": none, "stability": -// "experimental", "value": "unavailable"} static constexpr const char *kUnavailable = "unavailable"; + /** - * data_loss. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "data_loss", "note": none, "stability": -// "experimental", "value": "data_loss"} static constexpr const char *kDataLoss = "data_loss"; + /** - * unauthenticated. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "unauthenticated", "note": none, "stability": -// "experimental", "value": "unauthenticated"} static constexpr const char *kUnauthenticated = "unauthenticated"; + } // namespace RpcConnectRpcErrorCodeValues -// DEBUG: {"brief": "The [numeric status -// code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request.", -// "name": "rpc.grpc.status_code", "requirement_level": "recommended", "root_namespace": "rpc", -// "stability": "experimental", "type": {"allow_custom_values": true, "members": [{"brief": "OK", -// "deprecated": none, "id": "ok", "note": none, "stability": "experimental", "value": 0}, {"brief": -// "CANCELLED", "deprecated": none, "id": "cancelled", "note": none, "stability": "experimental", -// "value": 1}, {"brief": "UNKNOWN", "deprecated": none, "id": "unknown", "note": none, "stability": -// "experimental", "value": 2}, {"brief": "INVALID_ARGUMENT", "deprecated": none, "id": -// "invalid_argument", "note": none, "stability": "experimental", "value": 3}, {"brief": -// "DEADLINE_EXCEEDED", "deprecated": none, "id": "deadline_exceeded", "note": none, "stability": -// "experimental", "value": 4}, {"brief": "NOT_FOUND", "deprecated": none, "id": "not_found", -// "note": none, "stability": "experimental", "value": 5}, {"brief": "ALREADY_EXISTS", "deprecated": -// none, "id": "already_exists", "note": none, "stability": "experimental", "value": 6}, {"brief": -// "PERMISSION_DENIED", "deprecated": none, "id": "permission_denied", "note": none, "stability": -// "experimental", "value": 7}, {"brief": "RESOURCE_EXHAUSTED", "deprecated": none, "id": -// "resource_exhausted", "note": none, "stability": "experimental", "value": 8}, {"brief": -// "FAILED_PRECONDITION", "deprecated": none, "id": "failed_precondition", "note": none, -// "stability": "experimental", "value": 9}, {"brief": "ABORTED", "deprecated": none, "id": -// "aborted", "note": none, "stability": "experimental", "value": 10}, {"brief": "OUT_OF_RANGE", -// "deprecated": none, "id": "out_of_range", "note": none, "stability": "experimental", "value": -// 11}, {"brief": "UNIMPLEMENTED", "deprecated": none, "id": "unimplemented", "note": none, -// "stability": "experimental", "value": 12}, {"brief": "INTERNAL", "deprecated": none, "id": -// "internal", "note": none, "stability": "experimental", "value": 13}, {"brief": "UNAVAILABLE", -// "deprecated": none, "id": "unavailable", "note": none, "stability": "experimental", "value": 14}, -// {"brief": "DATA_LOSS", "deprecated": none, "id": "data_loss", "note": none, "stability": -// "experimental", "value": 15}, {"brief": "UNAUTHENTICATED", "deprecated": none, "id": -// "unauthenticated", "note": none, "stability": "experimental", "value": 16}]}} namespace RpcGrpcStatusCodeValues { /** - * OK. + * OK */ -// DEBUG: {"brief": "OK", "deprecated": none, "id": "ok", "note": none, "stability": "experimental", -// "value": 0} static constexpr int kOk = 0; + /** - * CANCELLED. + * CANCELLED */ -// DEBUG: {"brief": "CANCELLED", "deprecated": none, "id": "cancelled", "note": none, "stability": -// "experimental", "value": 1} static constexpr int kCancelled = 1; + /** - * UNKNOWN. + * UNKNOWN */ -// DEBUG: {"brief": "UNKNOWN", "deprecated": none, "id": "unknown", "note": none, "stability": -// "experimental", "value": 2} static constexpr int kUnknown = 2; + /** - * INVALID_ARGUMENT. + * INVALID_ARGUMENT */ -// DEBUG: {"brief": "INVALID_ARGUMENT", "deprecated": none, "id": "invalid_argument", "note": none, -// "stability": "experimental", "value": 3} static constexpr int kInvalidArgument = 3; + /** - * DEADLINE_EXCEEDED. + * DEADLINE_EXCEEDED */ -// DEBUG: {"brief": "DEADLINE_EXCEEDED", "deprecated": none, "id": "deadline_exceeded", "note": -// none, "stability": "experimental", "value": 4} static constexpr int kDeadlineExceeded = 4; + /** - * NOT_FOUND. + * NOT_FOUND */ -// DEBUG: {"brief": "NOT_FOUND", "deprecated": none, "id": "not_found", "note": none, "stability": -// "experimental", "value": 5} static constexpr int kNotFound = 5; + /** - * ALREADY_EXISTS. + * ALREADY_EXISTS */ -// DEBUG: {"brief": "ALREADY_EXISTS", "deprecated": none, "id": "already_exists", "note": none, -// "stability": "experimental", "value": 6} static constexpr int kAlreadyExists = 6; + /** - * PERMISSION_DENIED. + * PERMISSION_DENIED */ -// DEBUG: {"brief": "PERMISSION_DENIED", "deprecated": none, "id": "permission_denied", "note": -// none, "stability": "experimental", "value": 7} static constexpr int kPermissionDenied = 7; + /** - * RESOURCE_EXHAUSTED. + * RESOURCE_EXHAUSTED */ -// DEBUG: {"brief": "RESOURCE_EXHAUSTED", "deprecated": none, "id": "resource_exhausted", "note": -// none, "stability": "experimental", "value": 8} static constexpr int kResourceExhausted = 8; + /** - * FAILED_PRECONDITION. + * FAILED_PRECONDITION */ -// DEBUG: {"brief": "FAILED_PRECONDITION", "deprecated": none, "id": "failed_precondition", "note": -// none, "stability": "experimental", "value": 9} static constexpr int kFailedPrecondition = 9; + /** - * ABORTED. + * ABORTED */ -// DEBUG: {"brief": "ABORTED", "deprecated": none, "id": "aborted", "note": none, "stability": -// "experimental", "value": 10} static constexpr int kAborted = 10; + /** - * OUT_OF_RANGE. + * OUT_OF_RANGE */ -// DEBUG: {"brief": "OUT_OF_RANGE", "deprecated": none, "id": "out_of_range", "note": none, -// "stability": "experimental", "value": 11} static constexpr int kOutOfRange = 11; + /** - * UNIMPLEMENTED. + * UNIMPLEMENTED */ -// DEBUG: {"brief": "UNIMPLEMENTED", "deprecated": none, "id": "unimplemented", "note": none, -// "stability": "experimental", "value": 12} static constexpr int kUnimplemented = 12; + /** - * INTERNAL. + * INTERNAL */ -// DEBUG: {"brief": "INTERNAL", "deprecated": none, "id": "internal", "note": none, "stability": -// "experimental", "value": 13} static constexpr int kInternal = 13; + /** - * UNAVAILABLE. + * UNAVAILABLE */ -// DEBUG: {"brief": "UNAVAILABLE", "deprecated": none, "id": "unavailable", "note": none, -// "stability": "experimental", "value": 14} static constexpr int kUnavailable = 14; + /** - * DATA_LOSS. + * DATA_LOSS */ -// DEBUG: {"brief": "DATA_LOSS", "deprecated": none, "id": "data_loss", "note": none, "stability": -// "experimental", "value": 15} static constexpr int kDataLoss = 15; + /** - * UNAUTHENTICATED. + * UNAUTHENTICATED */ -// DEBUG: {"brief": "UNAUTHENTICATED", "deprecated": none, "id": "unauthenticated", "note": none, -// "stability": "experimental", "value": 16} static constexpr int kUnauthenticated = 16; + } // namespace RpcGrpcStatusCodeValues -// DEBUG: {"brief": "Whether this is a received or sent message.", "name": "rpc.message.type", -// "requirement_level": "recommended", "root_namespace": "rpc", "stability": "experimental", "type": -// {"allow_custom_values": true, "members": [{"brief": none, "deprecated": none, "id": "sent", -// "note": none, "stability": "experimental", "value": "SENT"}, {"brief": none, "deprecated": none, -// "id": "received", "note": none, "stability": "experimental", "value": "RECEIVED"}]}} namespace RpcMessageTypeValues { /** - * sent. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "sent", "note": none, "stability": -// "experimental", "value": "SENT"} static constexpr const char *kSent = "SENT"; + /** - * received. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "received", "note": none, "stability": -// "experimental", "value": "RECEIVED"} static constexpr const char *kReceived = "RECEIVED"; + } // namespace RpcMessageTypeValues -// DEBUG: {"brief": "A string identifying the remoting system. See below for a list of well-known -// identifiers.", "name": "rpc.system", "requirement_level": "recommended", "root_namespace": "rpc", -// "stability": "experimental", "type": {"allow_custom_values": true, "members": [{"brief": "gRPC", -// "deprecated": none, "id": "grpc", "note": none, "stability": "experimental", "value": "grpc"}, -// {"brief": "Java RMI", "deprecated": none, "id": "java_rmi", "note": none, "stability": -// "experimental", "value": "java_rmi"}, {"brief": ".NET WCF", "deprecated": none, "id": -// "dotnet_wcf", "note": none, "stability": "experimental", "value": "dotnet_wcf"}, {"brief": -// "Apache Dubbo", "deprecated": none, "id": "apache_dubbo", "note": none, "stability": -// "experimental", "value": "apache_dubbo"}, {"brief": "Connect RPC", "deprecated": none, "id": -// "connect_rpc", "note": none, "stability": "experimental", "value": "connect_rpc"}]}} namespace RpcSystemValues { /** - * gRPC. + * gRPC */ -// DEBUG: {"brief": "gRPC", "deprecated": none, "id": "grpc", "note": none, "stability": -// "experimental", "value": "grpc"} static constexpr const char *kGrpc = "grpc"; + /** - * Java RMI. + * Java RMI */ -// DEBUG: {"brief": "Java RMI", "deprecated": none, "id": "java_rmi", "note": none, "stability": -// "experimental", "value": "java_rmi"} static constexpr const char *kJavaRmi = "java_rmi"; + /** - * .NET WCF. + * .NET WCF */ -// DEBUG: {"brief": ".NET WCF", "deprecated": none, "id": "dotnet_wcf", "note": none, "stability": -// "experimental", "value": "dotnet_wcf"} static constexpr const char *kDotnetWcf = "dotnet_wcf"; + /** - * Apache Dubbo. + * Apache Dubbo */ -// DEBUG: {"brief": "Apache Dubbo", "deprecated": none, "id": "apache_dubbo", "note": none, -// "stability": "experimental", "value": "apache_dubbo"} static constexpr const char *kApacheDubbo = "apache_dubbo"; + /** - * Connect RPC. + * Connect RPC */ -// DEBUG: {"brief": "Connect RPC", "deprecated": none, "id": "connect_rpc", "note": none, -// "stability": "experimental", "value": "connect_rpc"} static constexpr const char *kConnectRpc = "connect_rpc"; + } // namespace RpcSystemValues } // namespace rpc diff --git a/api/include/opentelemetry/semconv/incubating/attributes/server_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/server_attributes.h index ce9a19dd10..21cb75d729 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/server_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/server_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -22,16 +20,21 @@ namespace server { /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.server_attributes. @endcode. + * Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain + * socket name.

When observed from the client side, and when communicating through an + * intermediary, @code server.address @endcode SHOULD represent the server address behind any + * intermediaries, for example proxies, if it's available. */ -static const char *kServerAddress = "server.address"; +static constexpr const char *kServerAddress = "server.address"; /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.server_attributes. @endcode. + * Server port number. + *

+ * When observed from the client side, and when communicating through an intermediary, @code + * server.port @endcode SHOULD represent the server port behind any intermediaries, for example + * proxies, if it's available. */ -static const char *kServerPort = "server.port"; +static constexpr const char *kServerPort = "server.port"; } // namespace server } // namespace semconv diff --git a/api/include/opentelemetry/semconv/incubating/attributes/service_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/service_attributes.h index 12d2a3028c..7582c19868 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/service_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/service_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -23,8 +21,9 @@ namespace service /** * The string ID of the service instance. - * Note: MUST be unique for each instance of the same @code service.namespace,service.name @endcode - * pair (in other words + *

+ * MUST be unique for each instance of the same @code service.namespace,service.name @endcode pair + * (in other words * @code service.namespace,service.name,service.instance.id @endcode triplet MUST be globally * unique). The ID helps to distinguish instances of the same service that exist at the same time * (e.g. instances of a horizontally scaled service).

Implementations, such as SDKs, are @@ -49,30 +48,36 @@ namespace service * telemetry. This is typically the case for scraping receivers, as they know the target address and * port. */ -static const char *kServiceInstanceId = "service.instance.id"; +static constexpr const char *kServiceInstanceId = "service.instance.id"; /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.service_attributes. @endcode. + * Logical name of the service. + *

+ * MUST be the same for all instances of horizontally scaled services. If the value was not + * specified, SDKs MUST fallback to @code unknown_service: @endcode concatenated with @code process.executable.name @endcode, e.g. @code unknown_service:bash + * @endcode. If @code process.executable.name @endcode is not available, the value MUST be set to + * @code unknown_service @endcode. */ -static const char *kServiceName = "service.name"; +static constexpr const char *kServiceName = "service.name"; /** * A namespace for @code service.name @endcode. - * Note: A string value having a meaning that helps to distinguish a group of services, for example - * the team name that owns a group of services. @code service.name @endcode is expected to be unique + *

+ * A string value having a meaning that helps to distinguish a group of services, for example the + * team name that owns a group of services. @code service.name @endcode is expected to be unique * within the same namespace. If @code service.namespace @endcode is not specified in the Resource * then @code service.name @endcode is expected to be unique for all services that have no explicit * namespace defined (so the empty/unspecified namespace is simply one more valid namespace). * Zero-length namespace string is assumed equal to unspecified namespace. */ -static const char *kServiceNamespace = "service.namespace"; +static constexpr const char *kServiceNamespace = "service.namespace"; /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.service_attributes. @endcode. + * The version string of the service API or implementation. The format is not defined by these + * conventions. */ -static const char *kServiceVersion = "service.version"; +static constexpr const char *kServiceVersion = "service.version"; } // namespace service } // namespace semconv diff --git a/api/include/opentelemetry/semconv/incubating/attributes/session_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/session_attributes.h index 570469b5e1..abbe9446d6 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/session_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/session_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -24,12 +22,12 @@ namespace session /** * A unique id to identify a session. */ -static const char *kSessionId = "session.id"; +static constexpr const char *kSessionId = "session.id"; /** * The previous @code session.id @endcode for this user, when known. */ -static const char *kSessionPreviousId = "session.previous_id"; +static constexpr const char *kSessionPreviousId = "session.previous_id"; } // namespace session } // namespace semconv diff --git a/api/include/opentelemetry/semconv/incubating/attributes/source_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/source_attributes.h index d29f25ecf8..06a6ddc2f6 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/source_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/source_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -23,16 +21,16 @@ namespace source /** * Source address - domain name if available without reverse DNS lookup; otherwise, IP address or - * Unix domain socket name. Note: When observed from the destination side, and when communicating + * Unix domain socket name.

When observed from the destination side, and when communicating * through an intermediary, @code source.address @endcode SHOULD represent the source address behind * any intermediaries, for example proxies, if it's available. */ -static const char *kSourceAddress = "source.address"; +static constexpr const char *kSourceAddress = "source.address"; /** - * Source port number. + * Source port number */ -static const char *kSourcePort = "source.port"; +static constexpr const char *kSourcePort = "source.port"; } // namespace source } // namespace semconv diff --git a/api/include/opentelemetry/semconv/incubating/attributes/system_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/system_attributes.h index 6a62674cb4..be7ec80186 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/system_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/system_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -22,496 +20,362 @@ namespace system { /** - * The logical CPU number [0..n-1]. + * The logical CPU number [0..n-1] */ -static const char *kSystemCpuLogicalNumber = "system.cpu.logical_number"; +static constexpr const char *kSystemCpuLogicalNumber = "system.cpu.logical_number"; /** - * @Deprecated: Replaced by @code cpu.mode @endcode. + * Deprecated, use @code cpu.mode @endcode instead. + *

+ * @deprecated + * Replaced by @code cpu.mode @endcode */ -static const char *kSystemCpuState = "system.cpu.state"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kSystemCpuState = "system.cpu.state"; /** - * The device identifier. + * The device identifier */ -static const char *kSystemDevice = "system.device"; +static constexpr const char *kSystemDevice = "system.device"; /** - * The filesystem mode. + * The filesystem mode */ -static const char *kSystemFilesystemMode = "system.filesystem.mode"; +static constexpr const char *kSystemFilesystemMode = "system.filesystem.mode"; /** - * The filesystem mount path. + * The filesystem mount path */ -static const char *kSystemFilesystemMountpoint = "system.filesystem.mountpoint"; +static constexpr const char *kSystemFilesystemMountpoint = "system.filesystem.mountpoint"; /** - * The filesystem state. + * The filesystem state */ -static const char *kSystemFilesystemState = "system.filesystem.state"; +static constexpr const char *kSystemFilesystemState = "system.filesystem.state"; /** - * The filesystem type. + * The filesystem type */ -static const char *kSystemFilesystemType = "system.filesystem.type"; +static constexpr const char *kSystemFilesystemType = "system.filesystem.type"; /** - * The memory state. + * The memory state */ -static const char *kSystemMemoryState = "system.memory.state"; +static constexpr const char *kSystemMemoryState = "system.memory.state"; /** - * A stateless protocol MUST NOT set this attribute. + * A stateless protocol MUST NOT set this attribute */ -static const char *kSystemNetworkState = "system.network.state"; +static constexpr const char *kSystemNetworkState = "system.network.state"; /** - * The paging access direction. + * The paging access direction */ -static const char *kSystemPagingDirection = "system.paging.direction"; +static constexpr const char *kSystemPagingDirection = "system.paging.direction"; /** - * The memory paging state. + * The memory paging state */ -static const char *kSystemPagingState = "system.paging.state"; +static constexpr const char *kSystemPagingState = "system.paging.state"; /** - * The memory paging type. + * The memory paging type */ -static const char *kSystemPagingType = "system.paging.type"; +static constexpr const char *kSystemPagingType = "system.paging.type"; /** * The process state, e.g., Linux Process State - * Codes. + * Codes */ -static const char *kSystemProcessStatus = "system.process.status"; +static constexpr const char *kSystemProcessStatus = "system.process.status"; /** - * @Deprecated: Replaced by @code system.process.status @endcode. + * Deprecated, use @code system.process.status @endcode instead. + *

+ * @deprecated + * Replaced by @code system.process.status @endcode. */ -static const char *kSystemProcessesStatus = "system.processes.status"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kSystemProcessesStatus = "system.processes.status"; -// @deprecated(reason="The attribute system.cpu.state is deprecated - Replaced by `cpu.mode`") # -// type: ignore DEBUG: {"brief": "Deprecated, use `cpu.mode` instead.", "deprecated": "Replaced by -// `cpu.mode`", "examples": ["idle", "interrupt"], "name": "system.cpu.state", "requirement_level": -// "recommended", "root_namespace": "system", "stability": "experimental", "type": -// {"allow_custom_values": true, "members": [{"brief": none, "deprecated": none, "id": "user", -// "note": none, "stability": "experimental", "value": "user"}, {"brief": none, "deprecated": none, -// "id": "system", "note": none, "stability": "experimental", "value": "system"}, {"brief": none, -// "deprecated": none, "id": "nice", "note": none, "stability": "experimental", "value": "nice"}, -// {"brief": none, "deprecated": none, "id": "idle", "note": none, "stability": "experimental", -// "value": "idle"}, {"brief": none, "deprecated": none, "id": "iowait", "note": none, "stability": -// "experimental", "value": "iowait"}, {"brief": none, "deprecated": none, "id": "interrupt", -// "note": none, "stability": "experimental", "value": "interrupt"}, {"brief": none, "deprecated": -// none, "id": "steal", "note": none, "stability": "experimental", "value": "steal"}]}} namespace SystemCpuStateValues { /** - * user. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "user", "note": none, "stability": -// "experimental", "value": "user"} static constexpr const char *kUser = "user"; + /** - * system. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "system", "note": none, "stability": -// "experimental", "value": "system"} static constexpr const char *kSystem = "system"; + /** - * nice. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "nice", "note": none, "stability": -// "experimental", "value": "nice"} static constexpr const char *kNice = "nice"; + /** - * idle. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "idle", "note": none, "stability": -// "experimental", "value": "idle"} static constexpr const char *kIdle = "idle"; + /** - * iowait. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "iowait", "note": none, "stability": -// "experimental", "value": "iowait"} static constexpr const char *kIowait = "iowait"; + /** - * interrupt. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "interrupt", "note": none, "stability": -// "experimental", "value": "interrupt"} static constexpr const char *kInterrupt = "interrupt"; + /** - * steal. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "steal", "note": none, "stability": -// "experimental", "value": "steal"} static constexpr const char *kSteal = "steal"; + } // namespace SystemCpuStateValues -// DEBUG: {"brief": "The filesystem state", "examples": ["used"], "name": "system.filesystem.state", -// "requirement_level": "recommended", "root_namespace": "system", "stability": "experimental", -// "type": {"allow_custom_values": true, "members": [{"brief": none, "deprecated": none, "id": -// "used", "note": none, "stability": "experimental", "value": "used"}, {"brief": none, -// "deprecated": none, "id": "free", "note": none, "stability": "experimental", "value": "free"}, -// {"brief": none, "deprecated": none, "id": "reserved", "note": none, "stability": "experimental", -// "value": "reserved"}]}} namespace SystemFilesystemStateValues { /** - * used. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "used", "note": none, "stability": -// "experimental", "value": "used"} static constexpr const char *kUsed = "used"; + /** - * free. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "free", "note": none, "stability": -// "experimental", "value": "free"} static constexpr const char *kFree = "free"; + /** - * reserved. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "reserved", "note": none, "stability": -// "experimental", "value": "reserved"} static constexpr const char *kReserved = "reserved"; + } // namespace SystemFilesystemStateValues -// DEBUG: {"brief": "The filesystem type", "examples": ["ext4"], "name": "system.filesystem.type", -// "requirement_level": "recommended", "root_namespace": "system", "stability": "experimental", -// "type": {"allow_custom_values": true, "members": [{"brief": none, "deprecated": none, "id": -// "fat32", "note": none, "stability": "experimental", "value": "fat32"}, {"brief": none, -// "deprecated": none, "id": "exfat", "note": none, "stability": "experimental", "value": "exfat"}, -// {"brief": none, "deprecated": none, "id": "ntfs", "note": none, "stability": "experimental", -// "value": "ntfs"}, {"brief": none, "deprecated": none, "id": "refs", "note": none, "stability": -// "experimental", "value": "refs"}, {"brief": none, "deprecated": none, "id": "hfsplus", "note": -// none, "stability": "experimental", "value": "hfsplus"}, {"brief": none, "deprecated": none, "id": -// "ext4", "note": none, "stability": "experimental", "value": "ext4"}]}} namespace SystemFilesystemTypeValues { /** - * fat32. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "fat32", "note": none, "stability": -// "experimental", "value": "fat32"} static constexpr const char *kFat32 = "fat32"; + /** - * exfat. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "exfat", "note": none, "stability": -// "experimental", "value": "exfat"} static constexpr const char *kExfat = "exfat"; + /** - * ntfs. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "ntfs", "note": none, "stability": -// "experimental", "value": "ntfs"} static constexpr const char *kNtfs = "ntfs"; + /** - * refs. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "refs", "note": none, "stability": -// "experimental", "value": "refs"} static constexpr const char *kRefs = "refs"; + /** - * hfsplus. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "hfsplus", "note": none, "stability": -// "experimental", "value": "hfsplus"} static constexpr const char *kHfsplus = "hfsplus"; + /** - * ext4. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "ext4", "note": none, "stability": -// "experimental", "value": "ext4"} static constexpr const char *kExt4 = "ext4"; + } // namespace SystemFilesystemTypeValues -// DEBUG: {"brief": "The memory state", "examples": ["free", "cached"], "name": -// "system.memory.state", "requirement_level": "recommended", "root_namespace": "system", -// "stability": "experimental", "type": {"allow_custom_values": true, "members": [{"brief": none, -// "deprecated": none, "id": "used", "note": none, "stability": "experimental", "value": "used"}, -// {"brief": none, "deprecated": none, "id": "free", "note": none, "stability": "experimental", -// "value": "free"}, {"brief": none, "deprecated": "Removed, report shared memory usage with -// `metric.system.memory.shared` metric", "id": "shared", "note": none, "stability": "experimental", -// "value": "shared"}, {"brief": none, "deprecated": none, "id": "buffers", "note": none, -// "stability": "experimental", "value": "buffers"}, {"brief": none, "deprecated": none, "id": -// "cached", "note": none, "stability": "experimental", "value": "cached"}]}} namespace SystemMemoryStateValues { /** - * used. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "used", "note": none, "stability": -// "experimental", "value": "used"} static constexpr const char *kUsed = "used"; + /** - * free. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "free", "note": none, "stability": -// "experimental", "value": "free"} static constexpr const char *kFree = "free"; + /** - * @Deprecated: Removed, report shared memory usage with @code metric.system.memory.shared @endcode - * metric. + * none + *

+ * @deprecated + * Removed, report shared memory usage with @code metric.system.memory.shared @endcode metric */ -// DEBUG: {"brief": none, "deprecated": "Removed, report shared memory usage with -// `metric.system.memory.shared` metric", "id": "shared", "note": none, "stability": "experimental", -// "value": "shared"} +OPENTELEMETRY_DEPRECATED static constexpr const char *kShared = "shared"; + /** - * buffers. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "buffers", "note": none, "stability": -// "experimental", "value": "buffers"} static constexpr const char *kBuffers = "buffers"; + /** - * cached. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "cached", "note": none, "stability": -// "experimental", "value": "cached"} static constexpr const char *kCached = "cached"; + } // namespace SystemMemoryStateValues -// DEBUG: {"brief": "A stateless protocol MUST NOT set this attribute", "examples": ["close_wait"], -// "name": "system.network.state", "requirement_level": "recommended", "root_namespace": "system", -// "stability": "experimental", "type": {"allow_custom_values": true, "members": [{"brief": none, -// "deprecated": none, "id": "close", "note": none, "stability": "experimental", "value": "close"}, -// {"brief": none, "deprecated": none, "id": "close_wait", "note": none, "stability": -// "experimental", "value": "close_wait"}, {"brief": none, "deprecated": none, "id": "closing", -// "note": none, "stability": "experimental", "value": "closing"}, {"brief": none, "deprecated": -// none, "id": "delete", "note": none, "stability": "experimental", "value": "delete"}, {"brief": -// none, "deprecated": none, "id": "established", "note": none, "stability": "experimental", -// "value": "established"}, {"brief": none, "deprecated": none, "id": "fin_wait_1", "note": none, -// "stability": "experimental", "value": "fin_wait_1"}, {"brief": none, "deprecated": none, "id": -// "fin_wait_2", "note": none, "stability": "experimental", "value": "fin_wait_2"}, {"brief": none, -// "deprecated": none, "id": "last_ack", "note": none, "stability": "experimental", "value": -// "last_ack"}, {"brief": none, "deprecated": none, "id": "listen", "note": none, "stability": -// "experimental", "value": "listen"}, {"brief": none, "deprecated": none, "id": "syn_recv", "note": -// none, "stability": "experimental", "value": "syn_recv"}, {"brief": none, "deprecated": none, -// "id": "syn_sent", "note": none, "stability": "experimental", "value": "syn_sent"}, {"brief": -// none, "deprecated": none, "id": "time_wait", "note": none, "stability": "experimental", "value": -// "time_wait"}]}} namespace SystemNetworkStateValues { /** - * close. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "close", "note": none, "stability": -// "experimental", "value": "close"} static constexpr const char *kClose = "close"; + /** - * close_wait. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "close_wait", "note": none, "stability": -// "experimental", "value": "close_wait"} static constexpr const char *kCloseWait = "close_wait"; + /** - * closing. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "closing", "note": none, "stability": -// "experimental", "value": "closing"} static constexpr const char *kClosing = "closing"; + /** - * delete. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "delete", "note": none, "stability": -// "experimental", "value": "delete"} static constexpr const char *kDelete = "delete"; + /** - * established. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "established", "note": none, "stability": -// "experimental", "value": "established"} static constexpr const char *kEstablished = "established"; + /** - * fin_wait_1. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "fin_wait_1", "note": none, "stability": -// "experimental", "value": "fin_wait_1"} static constexpr const char *kFinWait1 = "fin_wait_1"; + /** - * fin_wait_2. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "fin_wait_2", "note": none, "stability": -// "experimental", "value": "fin_wait_2"} static constexpr const char *kFinWait2 = "fin_wait_2"; + /** - * last_ack. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "last_ack", "note": none, "stability": -// "experimental", "value": "last_ack"} static constexpr const char *kLastAck = "last_ack"; + /** - * listen. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "listen", "note": none, "stability": -// "experimental", "value": "listen"} static constexpr const char *kListen = "listen"; + /** - * syn_recv. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "syn_recv", "note": none, "stability": -// "experimental", "value": "syn_recv"} static constexpr const char *kSynRecv = "syn_recv"; + /** - * syn_sent. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "syn_sent", "note": none, "stability": -// "experimental", "value": "syn_sent"} static constexpr const char *kSynSent = "syn_sent"; + /** - * time_wait. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "time_wait", "note": none, "stability": -// "experimental", "value": "time_wait"} static constexpr const char *kTimeWait = "time_wait"; + } // namespace SystemNetworkStateValues -// DEBUG: {"brief": "The paging access direction", "examples": ["in"], "name": -// "system.paging.direction", "requirement_level": "recommended", "root_namespace": "system", -// "stability": "experimental", "type": {"allow_custom_values": true, "members": [{"brief": none, -// "deprecated": none, "id": "in", "note": none, "stability": "experimental", "value": "in"}, -// {"brief": none, "deprecated": none, "id": "out", "note": none, "stability": "experimental", -// "value": "out"}]}} namespace SystemPagingDirectionValues { /** - * in. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "in", "note": none, "stability": "experimental", -// "value": "in"} static constexpr const char *kIn = "in"; + /** - * out. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "out", "note": none, "stability": -// "experimental", "value": "out"} static constexpr const char *kOut = "out"; + } // namespace SystemPagingDirectionValues -// DEBUG: {"brief": "The memory paging state", "examples": ["free"], "name": "system.paging.state", -// "requirement_level": "recommended", "root_namespace": "system", "stability": "experimental", -// "type": {"allow_custom_values": true, "members": [{"brief": none, "deprecated": none, "id": -// "used", "note": none, "stability": "experimental", "value": "used"}, {"brief": none, -// "deprecated": none, "id": "free", "note": none, "stability": "experimental", "value": "free"}]}} namespace SystemPagingStateValues { /** - * used. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "used", "note": none, "stability": -// "experimental", "value": "used"} static constexpr const char *kUsed = "used"; + /** - * free. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "free", "note": none, "stability": -// "experimental", "value": "free"} static constexpr const char *kFree = "free"; + } // namespace SystemPagingStateValues -// DEBUG: {"brief": "The memory paging type", "examples": ["minor"], "name": "system.paging.type", -// "requirement_level": "recommended", "root_namespace": "system", "stability": "experimental", -// "type": {"allow_custom_values": true, "members": [{"brief": none, "deprecated": none, "id": -// "major", "note": none, "stability": "experimental", "value": "major"}, {"brief": none, -// "deprecated": none, "id": "minor", "note": none, "stability": "experimental", "value": -// "minor"}]}} namespace SystemPagingTypeValues { /** - * major. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "major", "note": none, "stability": -// "experimental", "value": "major"} static constexpr const char *kMajor = "major"; + /** - * minor. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "minor", "note": none, "stability": -// "experimental", "value": "minor"} static constexpr const char *kMinor = "minor"; + } // namespace SystemPagingTypeValues -// DEBUG: {"brief": "The process state, e.g., [Linux Process State -// Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES)\n", "examples": -// ["running"], "name": "system.process.status", "requirement_level": "recommended", -// "root_namespace": "system", "stability": "experimental", "type": {"allow_custom_values": true, -// "members": [{"brief": none, "deprecated": none, "id": "running", "note": none, "stability": -// "experimental", "value": "running"}, {"brief": none, "deprecated": none, "id": "sleeping", -// "note": none, "stability": "experimental", "value": "sleeping"}, {"brief": none, "deprecated": -// none, "id": "stopped", "note": none, "stability": "experimental", "value": "stopped"}, {"brief": -// none, "deprecated": none, "id": "defunct", "note": none, "stability": "experimental", "value": -// "defunct"}]}} namespace SystemProcessStatusValues { /** - * running. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "running", "note": none, "stability": -// "experimental", "value": "running"} static constexpr const char *kRunning = "running"; + /** - * sleeping. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "sleeping", "note": none, "stability": -// "experimental", "value": "sleeping"} static constexpr const char *kSleeping = "sleeping"; + /** - * stopped. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "stopped", "note": none, "stability": -// "experimental", "value": "stopped"} static constexpr const char *kStopped = "stopped"; + /** - * defunct. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "defunct", "note": none, "stability": -// "experimental", "value": "defunct"} static constexpr const char *kDefunct = "defunct"; + } // namespace SystemProcessStatusValues -// @deprecated(reason="The attribute system.processes.status is deprecated - Replaced by -// `system.process.status`") # type: ignore DEBUG: {"brief": "Deprecated, use -// `system.process.status` instead.", "deprecated": "Replaced by `system.process.status`.", -// "examples": ["running"], "name": "system.processes.status", "requirement_level": "recommended", -// "root_namespace": "system", "stability": "experimental", "type": {"allow_custom_values": true, -// "members": [{"brief": none, "deprecated": none, "id": "running", "note": none, "stability": -// "experimental", "value": "running"}, {"brief": none, "deprecated": none, "id": "sleeping", -// "note": none, "stability": "experimental", "value": "sleeping"}, {"brief": none, "deprecated": -// none, "id": "stopped", "note": none, "stability": "experimental", "value": "stopped"}, {"brief": -// none, "deprecated": none, "id": "defunct", "note": none, "stability": "experimental", "value": -// "defunct"}]}} namespace SystemProcessesStatusValues { /** - * running. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "running", "note": none, "stability": -// "experimental", "value": "running"} static constexpr const char *kRunning = "running"; + /** - * sleeping. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "sleeping", "note": none, "stability": -// "experimental", "value": "sleeping"} static constexpr const char *kSleeping = "sleeping"; + /** - * stopped. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "stopped", "note": none, "stability": -// "experimental", "value": "stopped"} static constexpr const char *kStopped = "stopped"; + /** - * defunct. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "defunct", "note": none, "stability": -// "experimental", "value": "defunct"} static constexpr const char *kDefunct = "defunct"; + } // namespace SystemProcessesStatusValues } // namespace system diff --git a/api/include/opentelemetry/semconv/incubating/attributes/telemetry_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/telemetry_attributes.h index 4f671a976f..5504febaba 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/telemetry_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/telemetry_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -23,143 +21,103 @@ namespace telemetry /** * The name of the auto instrumentation agent or distribution, if used. - * Note: Official auto instrumentation agents and distributions SHOULD set the @code - * telemetry.distro.name @endcode attribute to a string starting with @code opentelemetry- @endcode, - * e.g. @code opentelemetry-java-instrumentation @endcode. + *

+ * Official auto instrumentation agents and distributions SHOULD set the @code telemetry.distro.name + * @endcode attribute to a string starting with @code opentelemetry- @endcode, e.g. @code + * opentelemetry-java-instrumentation @endcode. */ -static const char *kTelemetryDistroName = "telemetry.distro.name"; +static constexpr const char *kTelemetryDistroName = "telemetry.distro.name"; /** * The version string of the auto instrumentation agent or distribution, if used. */ -static const char *kTelemetryDistroVersion = "telemetry.distro.version"; +static constexpr const char *kTelemetryDistroVersion = "telemetry.distro.version"; /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.telemetry_attributes. @endcode. + * The language of the telemetry SDK. */ -static const char *kTelemetrySdkLanguage = "telemetry.sdk.language"; +static constexpr const char *kTelemetrySdkLanguage = "telemetry.sdk.language"; /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.telemetry_attributes. @endcode. - */ -static const char *kTelemetrySdkName = "telemetry.sdk.name"; + * The name of the telemetry SDK as defined above. + *

+ * The OpenTelemetry SDK MUST set the @code telemetry.sdk.name @endcode attribute to @code + * opentelemetry @endcode. If another SDK, like a fork or a vendor-provided implementation, is used, + * this SDK MUST set the + * @code telemetry.sdk.name @endcode attribute to the fully-qualified class or module name of this + * SDK's main entry point or another suitable identifier depending on the language. The identifier + * @code opentelemetry @endcode is reserved and MUST NOT be used in this case. All custom + * identifiers SHOULD be stable across different versions of an implementation. + */ +static constexpr const char *kTelemetrySdkName = "telemetry.sdk.name"; /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.telemetry_attributes. @endcode. + * The version string of the telemetry SDK. */ -static const char *kTelemetrySdkVersion = "telemetry.sdk.version"; +static constexpr const char *kTelemetrySdkVersion = "telemetry.sdk.version"; -// @deprecated(reason="Deprecated in favor of stable -// `opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues`.") # type: -// ignore DEBUG: {"brief": "The language of the telemetry SDK.\n", "name": "telemetry.sdk.language", -// "requirement_level": "required", "root_namespace": "telemetry", "stability": "stable", "type": -// {"allow_custom_values": true, "members": [{"brief": none, "deprecated": none, "id": "cpp", -// "note": none, "stability": "stable", "value": "cpp"}, {"brief": none, "deprecated": none, "id": -// "dotnet", "note": none, "stability": "stable", "value": "dotnet"}, {"brief": none, "deprecated": -// none, "id": "erlang", "note": none, "stability": "stable", "value": "erlang"}, {"brief": none, -// "deprecated": none, "id": "go", "note": none, "stability": "stable", "value": "go"}, {"brief": -// none, "deprecated": none, "id": "java", "note": none, "stability": "stable", "value": "java"}, -// {"brief": none, "deprecated": none, "id": "nodejs", "note": none, "stability": "stable", "value": -// "nodejs"}, {"brief": none, "deprecated": none, "id": "php", "note": none, "stability": "stable", -// "value": "php"}, {"brief": none, "deprecated": none, "id": "python", "note": none, "stability": -// "stable", "value": "python"}, {"brief": none, "deprecated": none, "id": "ruby", "note": none, -// "stability": "stable", "value": "ruby"}, {"brief": none, "deprecated": none, "id": "rust", -// "note": none, "stability": "stable", "value": "rust"}, {"brief": none, "deprecated": none, "id": -// "swift", "note": none, "stability": "stable", "value": "swift"}, {"brief": none, "deprecated": -// none, "id": "webjs", "note": none, "stability": "stable", "value": "webjs"}]}} namespace TelemetrySdkLanguageValues { /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues.kCpp @endcode. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "cpp", "note": none, "stability": "stable", -// "value": "cpp"} static constexpr const char *kCpp = "cpp"; + /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues.kDotnet - * @endcode. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "dotnet", "note": none, "stability": "stable", -// "value": "dotnet"} static constexpr const char *kDotnet = "dotnet"; + /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues.kErlang - * @endcode. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "erlang", "note": none, "stability": "stable", -// "value": "erlang"} static constexpr const char *kErlang = "erlang"; + /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues.kGo @endcode. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "go", "note": none, "stability": "stable", -// "value": "go"} static constexpr const char *kGo = "go"; + /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues.kJava @endcode. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "java", "note": none, "stability": "stable", -// "value": "java"} static constexpr const char *kJava = "java"; + /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues.kNodejs - * @endcode. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "nodejs", "note": none, "stability": "stable", -// "value": "nodejs"} static constexpr const char *kNodejs = "nodejs"; + /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues.kPhp @endcode. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "php", "note": none, "stability": "stable", -// "value": "php"} static constexpr const char *kPhp = "php"; + /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues.kPython - * @endcode. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "python", "note": none, "stability": "stable", -// "value": "python"} static constexpr const char *kPython = "python"; + /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues.kRuby @endcode. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "ruby", "note": none, "stability": "stable", -// "value": "ruby"} static constexpr const char *kRuby = "ruby"; + /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues.kRust @endcode. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "rust", "note": none, "stability": "stable", -// "value": "rust"} static constexpr const char *kRust = "rust"; + /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues.kSwift @endcode. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "swift", "note": none, "stability": "stable", -// "value": "swift"} static constexpr const char *kSwift = "swift"; + /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues.kWebjs @endcode. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "webjs", "note": none, "stability": "stable", -// "value": "webjs"} static constexpr const char *kWebjs = "webjs"; + } // namespace TelemetrySdkLanguageValues } // namespace telemetry diff --git a/api/include/opentelemetry/semconv/incubating/attributes/test_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/test_attributes.h index d67701b411..dce482055c 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/test_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/test_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -25,95 +23,69 @@ namespace test * The fully qualified human readable name of the test case. */ -static const char *kTestCaseName = "test.case.name"; +static constexpr const char *kTestCaseName = "test.case.name"; /** * The status of the actual test case result from test execution. */ -static const char *kTestCaseResultStatus = "test.case.result.status"; +static constexpr const char *kTestCaseResultStatus = "test.case.result.status"; /** * The human readable name of a test suite. */ -static const char *kTestSuiteName = "test.suite.name"; +static constexpr const char *kTestSuiteName = "test.suite.name"; /** * The status of the test suite run. */ -static const char *kTestSuiteRunStatus = "test.suite.run.status"; - -// DEBUG: {"brief": "The status of the actual test case result from test execution.\n", "examples": -// ["pass", "fail"], "name": "test.case.result.status", "requirement_level": "recommended", -// "root_namespace": "test", "stability": "experimental", "type": {"allow_custom_values": true, -// "members": [{"brief": "pass", "deprecated": none, "id": "pass", "note": none, "stability": -// "experimental", "value": "pass"}, {"brief": "fail", "deprecated": none, "id": "fail", "note": -// none, "stability": "experimental", "value": "fail"}]}} +static constexpr const char *kTestSuiteRunStatus = "test.suite.run.status"; + namespace TestCaseResultStatusValues { /** - * pass. + * pass */ -// DEBUG: {"brief": "pass", "deprecated": none, "id": "pass", "note": none, "stability": -// "experimental", "value": "pass"} static constexpr const char *kPass = "pass"; + /** - * fail. + * fail */ -// DEBUG: {"brief": "fail", "deprecated": none, "id": "fail", "note": none, "stability": -// "experimental", "value": "fail"} static constexpr const char *kFail = "fail"; + } // namespace TestCaseResultStatusValues -// DEBUG: {"brief": "The status of the test suite run.\n", "examples": ["success", "failure", -// "skipped", "aborted", "timed_out", "in_progress"], "name": "test.suite.run.status", -// "requirement_level": "recommended", "root_namespace": "test", "stability": "experimental", -// "type": {"allow_custom_values": true, "members": [{"brief": "success", "deprecated": none, "id": -// "success", "note": none, "stability": "experimental", "value": "success"}, {"brief": "failure", -// "deprecated": none, "id": "failure", "note": none, "stability": "experimental", "value": -// "failure"}, {"brief": "skipped", "deprecated": none, "id": "skipped", "note": none, "stability": -// "experimental", "value": "skipped"}, {"brief": "aborted", "deprecated": none, "id": "aborted", -// "note": none, "stability": "experimental", "value": "aborted"}, {"brief": "timed_out", -// "deprecated": none, "id": "timed_out", "note": none, "stability": "experimental", "value": -// "timed_out"}, {"brief": "in_progress", "deprecated": none, "id": "in_progress", "note": none, -// "stability": "experimental", "value": "in_progress"}]}} namespace TestSuiteRunStatusValues { /** - * success. + * success */ -// DEBUG: {"brief": "success", "deprecated": none, "id": "success", "note": none, "stability": -// "experimental", "value": "success"} static constexpr const char *kSuccess = "success"; + /** - * failure. + * failure */ -// DEBUG: {"brief": "failure", "deprecated": none, "id": "failure", "note": none, "stability": -// "experimental", "value": "failure"} static constexpr const char *kFailure = "failure"; + /** - * skipped. + * skipped */ -// DEBUG: {"brief": "skipped", "deprecated": none, "id": "skipped", "note": none, "stability": -// "experimental", "value": "skipped"} static constexpr const char *kSkipped = "skipped"; + /** - * aborted. + * aborted */ -// DEBUG: {"brief": "aborted", "deprecated": none, "id": "aborted", "note": none, "stability": -// "experimental", "value": "aborted"} static constexpr const char *kAborted = "aborted"; + /** - * timed_out. + * timed_out */ -// DEBUG: {"brief": "timed_out", "deprecated": none, "id": "timed_out", "note": none, "stability": -// "experimental", "value": "timed_out"} static constexpr const char *kTimedOut = "timed_out"; + /** - * in_progress. + * in_progress */ -// DEBUG: {"brief": "in_progress", "deprecated": none, "id": "in_progress", "note": none, -// "stability": "experimental", "value": "in_progress"} static constexpr const char *kInProgress = "in_progress"; + } // namespace TestSuiteRunStatusValues } // namespace test diff --git a/api/include/opentelemetry/semconv/incubating/attributes/thread_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/thread_attributes.h index f81619f02d..8c053f8408 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/thread_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/thread_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -24,12 +22,12 @@ namespace thread /** * Current "managed" thread ID (as opposed to OS thread ID). */ -static const char *kThreadId = "thread.id"; +static constexpr const char *kThreadId = "thread.id"; /** * Current thread name. */ -static const char *kThreadName = "thread.name"; +static constexpr const char *kThreadName = "thread.name"; } // namespace thread } // namespace semconv diff --git a/api/include/opentelemetry/semconv/incubating/attributes/tls_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/tls_attributes.h index 5fcf65f2e5..5e14b6d3f0 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/tls_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/tls_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -24,204 +22,198 @@ namespace tls /** * String indicating the cipher used during the - * current connection. Note: The values allowed for @code tls.cipher @endcode MUST be one of the - * @code Descriptions @endcode of the The values allowed for @code tls.cipher @endcode MUST be one of the @code + * Descriptions @endcode of the registered * TLS Cipher Suits. */ -static const char *kTlsCipher = "tls.cipher"; +static constexpr const char *kTlsCipher = "tls.cipher"; /** * PEM-encoded stand-alone certificate offered by the client. This is usually mutually-exclusive of * @code client.certificate_chain @endcode since this value also exists in that list. */ -static const char *kTlsClientCertificate = "tls.client.certificate"; +static constexpr const char *kTlsClientCertificate = "tls.client.certificate"; /** * Array of PEM-encoded certificates that make up the certificate chain offered by the client. This * is usually mutually-exclusive of @code client.certificate @endcode since that value should be the * first certificate in the chain. */ -static const char *kTlsClientCertificateChain = "tls.client.certificate_chain"; +static constexpr const char *kTlsClientCertificateChain = "tls.client.certificate_chain"; /** * Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the * client. For consistency with other hash values, this value should be formatted as an uppercase * hash. */ -static const char *kTlsClientHashMd5 = "tls.client.hash.md5"; +static constexpr const char *kTlsClientHashMd5 = "tls.client.hash.md5"; /** * Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by * the client. For consistency with other hash values, this value should be formatted as an * uppercase hash. */ -static const char *kTlsClientHashSha1 = "tls.client.hash.sha1"; +static constexpr const char *kTlsClientHashSha1 = "tls.client.hash.sha1"; /** * Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by * the client. For consistency with other hash values, this value should be formatted as an * uppercase hash. */ -static const char *kTlsClientHashSha256 = "tls.client.hash.sha256"; +static constexpr const char *kTlsClientHashSha256 = "tls.client.hash.sha256"; /** * Distinguished name of subject of the issuer of * the x.509 certificate presented by the client. */ -static const char *kTlsClientIssuer = "tls.client.issuer"; +static constexpr const char *kTlsClientIssuer = "tls.client.issuer"; /** * A hash that identifies clients based on how they perform an SSL/TLS handshake. */ -static const char *kTlsClientJa3 = "tls.client.ja3"; +static constexpr const char *kTlsClientJa3 = "tls.client.ja3"; /** * Date/Time indicating when client certificate is no longer considered valid. */ -static const char *kTlsClientNotAfter = "tls.client.not_after"; +static constexpr const char *kTlsClientNotAfter = "tls.client.not_after"; /** * Date/Time indicating when client certificate is first considered valid. */ -static const char *kTlsClientNotBefore = "tls.client.not_before"; +static constexpr const char *kTlsClientNotBefore = "tls.client.not_before"; /** - * @Deprecated: Replaced by `server.address. + * Deprecated, use @code server.address @endcode instead. + *

+ * @deprecated + * Replaced by `server.address. */ -static const char *kTlsClientServerName = "tls.client.server_name"; +OPENTELEMETRY_DEPRECATED +static constexpr const char *kTlsClientServerName = "tls.client.server_name"; /** * Distinguished name of subject of the x.509 certificate presented by the client. */ -static const char *kTlsClientSubject = "tls.client.subject"; +static constexpr const char *kTlsClientSubject = "tls.client.subject"; /** * Array of ciphers offered by the client during the client hello. */ -static const char *kTlsClientSupportedCiphers = "tls.client.supported_ciphers"; +static constexpr const char *kTlsClientSupportedCiphers = "tls.client.supported_ciphers"; /** - * String indicating the curve used for the given cipher, when applicable. + * String indicating the curve used for the given cipher, when applicable */ -static const char *kTlsCurve = "tls.curve"; +static constexpr const char *kTlsCurve = "tls.curve"; /** * Boolean flag indicating if the TLS negotiation was successful and transitioned to an encrypted * tunnel. */ -static const char *kTlsEstablished = "tls.established"; +static constexpr const char *kTlsEstablished = "tls.established"; /** * String indicating the protocol being tunneled. Per the values in the IANA * registry, this string should be lower case. */ -static const char *kTlsNextProtocol = "tls.next_protocol"; +static constexpr const char *kTlsNextProtocol = "tls.next_protocol"; /** * Normalized lowercase protocol name parsed from original string of the negotiated SSL/TLS - * protocol version. + * protocol version */ -static const char *kTlsProtocolName = "tls.protocol.name"; +static constexpr const char *kTlsProtocolName = "tls.protocol.name"; /** * Numeric part of the version parsed from the original string of the negotiated SSL/TLS - * protocol version. + * protocol version */ -static const char *kTlsProtocolVersion = "tls.protocol.version"; +static constexpr const char *kTlsProtocolVersion = "tls.protocol.version"; /** * Boolean flag indicating if this TLS connection was resumed from an existing TLS negotiation. */ -static const char *kTlsResumed = "tls.resumed"; +static constexpr const char *kTlsResumed = "tls.resumed"; /** * PEM-encoded stand-alone certificate offered by the server. This is usually mutually-exclusive of * @code server.certificate_chain @endcode since this value also exists in that list. */ -static const char *kTlsServerCertificate = "tls.server.certificate"; +static constexpr const char *kTlsServerCertificate = "tls.server.certificate"; /** * Array of PEM-encoded certificates that make up the certificate chain offered by the server. This * is usually mutually-exclusive of @code server.certificate @endcode since that value should be the * first certificate in the chain. */ -static const char *kTlsServerCertificateChain = "tls.server.certificate_chain"; +static constexpr const char *kTlsServerCertificateChain = "tls.server.certificate_chain"; /** * Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the * server. For consistency with other hash values, this value should be formatted as an uppercase * hash. */ -static const char *kTlsServerHashMd5 = "tls.server.hash.md5"; +static constexpr const char *kTlsServerHashMd5 = "tls.server.hash.md5"; /** * Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by * the server. For consistency with other hash values, this value should be formatted as an * uppercase hash. */ -static const char *kTlsServerHashSha1 = "tls.server.hash.sha1"; +static constexpr const char *kTlsServerHashSha1 = "tls.server.hash.sha1"; /** * Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by * the server. For consistency with other hash values, this value should be formatted as an * uppercase hash. */ -static const char *kTlsServerHashSha256 = "tls.server.hash.sha256"; +static constexpr const char *kTlsServerHashSha256 = "tls.server.hash.sha256"; /** * Distinguished name of subject of the issuer of * the x.509 certificate presented by the client. */ -static const char *kTlsServerIssuer = "tls.server.issuer"; +static constexpr const char *kTlsServerIssuer = "tls.server.issuer"; /** * A hash that identifies servers based on how they perform an SSL/TLS handshake. */ -static const char *kTlsServerJa3s = "tls.server.ja3s"; +static constexpr const char *kTlsServerJa3s = "tls.server.ja3s"; /** * Date/Time indicating when server certificate is no longer considered valid. */ -static const char *kTlsServerNotAfter = "tls.server.not_after"; +static constexpr const char *kTlsServerNotAfter = "tls.server.not_after"; /** * Date/Time indicating when server certificate is first considered valid. */ -static const char *kTlsServerNotBefore = "tls.server.not_before"; +static constexpr const char *kTlsServerNotBefore = "tls.server.not_before"; /** * Distinguished name of subject of the x.509 certificate presented by the server. */ -static const char *kTlsServerSubject = "tls.server.subject"; +static constexpr const char *kTlsServerSubject = "tls.server.subject"; -// DEBUG: {"brief": "Normalized lowercase protocol name parsed from original string of the -// negotiated [SSL/TLS protocol -// version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES)\n", -// "name": "tls.protocol.name", "requirement_level": "recommended", "root_namespace": "tls", -// "stability": "experimental", "type": {"allow_custom_values": true, "members": [{"brief": none, -// "deprecated": none, "id": "ssl", "note": none, "stability": "experimental", "value": "ssl"}, -// {"brief": none, "deprecated": none, "id": "tls", "note": none, "stability": "experimental", -// "value": "tls"}]}} namespace TlsProtocolNameValues { /** - * ssl. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "ssl", "note": none, "stability": -// "experimental", "value": "ssl"} static constexpr const char *kSsl = "ssl"; + /** - * tls. + * none */ -// DEBUG: {"brief": none, "deprecated": none, "id": "tls", "note": none, "stability": -// "experimental", "value": "tls"} static constexpr const char *kTls = "tls"; + } // namespace TlsProtocolNameValues } // namespace tls diff --git a/api/include/opentelemetry/semconv/incubating/attributes/url_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/url_attributes.h index ebfea2a01b..fb3418e26a 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/url_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/url_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -23,100 +21,116 @@ namespace url /** * Domain extracted from the @code url.full @endcode, such as "opentelemetry.io". - * Note: In some cases a URL may refer to an IP and/or port directly, without a domain name. In this - * case, the IP address would go to the domain field. If the URL contains a + * In some cases a URL may refer to an IP and/or port directly, without a domain name. In this case, + * the IP address would go to the domain field. If the URL contains a literal IPv6 address enclosed by * @code [ @endcode and @code ] @endcode, the @code [ @endcode and @code ] @endcode characters * should also be captured in the domain field. */ -static const char *kUrlDomain = "url.domain"; +static constexpr const char *kUrlDomain = "url.domain"; /** * The file extension extracted from the @code url.full @endcode, excluding the leading dot. - * Note: The file extension is only set if it exists, as not every url has a file extension. When - * the file name has multiple extensions @code example.tar.gz @endcode, only the last one should be - * captured @code gz @endcode, not @code tar.gz @endcode. + *

+ * The file extension is only set if it exists, as not every url has a file extension. When the file + * name has multiple extensions @code example.tar.gz @endcode, only the last one should be captured + * @code gz @endcode, not @code tar.gz @endcode. */ -static const char *kUrlExtension = "url.extension"; +static constexpr const char *kUrlExtension = "url.extension"; /** - * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.url_attributes. - * @endcode. + * The URI fragment component */ -static const char *kUrlFragment = "url.fragment"; +static constexpr const char *kUrlFragment = "url.fragment"; /** - * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.url_attributes. + * Absolute URL describing a network resource according to RFC3986

For network calls, URL usually has + * @code scheme://host[:port][path][?query][#fragment] @endcode format, where the fragment is not + * transmitted over HTTP, but if it is known, it SHOULD be included nevertheless. + * @code url.full @endcode MUST NOT contain credentials passed via URL in form of @code + * https://username:password@www.example.com/ @endcode. In such case username and password SHOULD be + * redacted and attribute's value SHOULD be @code https://REDACTED:REDACTED@www.example.com/ * @endcode. + * @code url.full @endcode SHOULD capture the absolute URL when it is available (or can be + * reconstructed). Sensitive content provided in @code url.full @endcode SHOULD be scrubbed when + * instrumentations can identify it. */ -static const char *kUrlFull = "url.full"; +static constexpr const char *kUrlFull = "url.full"; /** * Unmodified original URL as seen in the event source. - * Note: In network monitoring, the observed URL may be a full URL, whereas in access logs, the URL - * is often just represented as a path. This field is meant to represent the URL as it was observed, + *

+ * In network monitoring, the observed URL may be a full URL, whereas in access logs, the URL is + * often just represented as a path. This field is meant to represent the URL as it was observed, * complete or not. * @code url.original @endcode might contain credentials passed via URL in form of @code * https://username:password@www.example.com/ @endcode. In such case password and username SHOULD * NOT be redacted and attribute's value SHOULD remain the same. */ -static const char *kUrlOriginal = "url.original"; +static constexpr const char *kUrlOriginal = "url.original"; /** - * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.url_attributes. - * @endcode. + * The URI path component + *

+ * Sensitive content provided in @code url.path @endcode SHOULD be scrubbed when instrumentations + * can identify it. */ -static const char *kUrlPath = "url.path"; +static constexpr const char *kUrlPath = "url.path"; /** - * Port extracted from the @code url.full @endcode. + * Port extracted from the @code url.full @endcode */ -static const char *kUrlPort = "url.port"; +static constexpr const char *kUrlPort = "url.port"; /** - * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.url_attributes. - * @endcode. + * The URI query component + *

+ * Sensitive content provided in @code url.query @endcode SHOULD be scrubbed when instrumentations + * can identify it. */ -static const char *kUrlQuery = "url.query"; +static constexpr const char *kUrlQuery = "url.query"; /** * The highest registered url domain, stripped of the subdomain. - * Note: This value can be determined precisely with the public - * suffix list. For example, the registered domain for @code foo.example.com @endcode is @code + *

+ * This value can be determined precisely with the public suffix + * list. For example, the registered domain for @code foo.example.com @endcode is @code * example.com @endcode. Trying to approximate this by simply taking the last two labels will not * work well for TLDs such as @code co.uk @endcode. */ -static const char *kUrlRegisteredDomain = "url.registered_domain"; +static constexpr const char *kUrlRegisteredDomain = "url.registered_domain"; /** - * @Deprecated in favor of stable :py:const:@code opentelemetry.semconv.attributes.url_attributes. - * @endcode. + * The URI scheme component + * identifying the used protocol. */ -static const char *kUrlScheme = "url.scheme"; +static constexpr const char *kUrlScheme = "url.scheme"; /** * The subdomain portion of a fully qualified domain name includes all of the names except the host * name under the registered_domain. In a partially qualified domain, or if the qualification level * of the full name cannot be determined, subdomain contains all of the names below the registered - * domain. Note: The subdomain portion of @code www.east.mydomain.co.uk @endcode is @code east + * domain.

The subdomain portion of @code www.east.mydomain.co.uk @endcode is @code east * @endcode. If the domain has multiple levels of subdomain, such as @code sub2.sub1.example.com * @endcode, the subdomain field should contain @code sub2.sub1 @endcode, with no trailing period. */ -static const char *kUrlSubdomain = "url.subdomain"; +static constexpr const char *kUrlSubdomain = "url.subdomain"; /** * The low-cardinality template of an absolute path reference. */ -static const char *kUrlTemplate = "url.template"; +static constexpr const char *kUrlTemplate = "url.template"; /** * The effective top level domain (eTLD), also known as the domain suffix, is the last part of the - * domain name. For example, the top level domain for example.com is @code com @endcode. Note: This + * domain name. For example, the top level domain for example.com is @code com @endcode.

This * value can be determined precisely with the public suffix * list. */ -static const char *kUrlTopLevelDomain = "url.top_level_domain"; +static constexpr const char *kUrlTopLevelDomain = "url.top_level_domain"; } // namespace url } // namespace semconv diff --git a/api/include/opentelemetry/semconv/incubating/attributes/user_agent_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/user_agent_attributes.h index 7daffb44d8..738bb6de15 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/user_agent_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/user_agent_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -23,28 +21,30 @@ namespace user_agent /** * Name of the user-agent extracted from original. Usually refers to the browser's name. - * Note: Example of extracting browser's name from original + *

+ * Example of extracting browser's name from original * string. In the case of using a user-agent for non-browser products, such as microservices with * multiple names/versions inside the @code user_agent.original @endcode, the most significant name - * SHOULD be selected. In such a scenario it should align with @code user_agent.version @endcode. + * SHOULD be selected. In such a scenario it should align with @code user_agent.version @endcode */ -static const char *kUserAgentName = "user_agent.name"; +static constexpr const char *kUserAgentName = "user_agent.name"; /** - * @Deprecated in favor of stable :py:const:@code - * opentelemetry.semconv.attributes.user_agent_attributes. @endcode. + * Value of the HTTP + * User-Agent header sent by the client. */ -static const char *kUserAgentOriginal = "user_agent.original"; +static constexpr const char *kUserAgentOriginal = "user_agent.original"; /** - * Version of the user-agent extracted from original. Usually refers to the browser's version. - * Note: Example of extracting browser's version from - * original string. In the case of using a user-agent for non-browser products, such as - * microservices with multiple names/versions inside the @code user_agent.original @endcode, the - * most significant version SHOULD be selected. In such a scenario it should align with @code - * user_agent.name @endcode. + * Version of the user-agent extracted from original. Usually refers to the browser's version + *

+ * Example of extracting browser's version from original + * string. In the case of using a user-agent for non-browser products, such as microservices with + * multiple names/versions inside the @code user_agent.original @endcode, the most significant + * version SHOULD be selected. In such a scenario it should align with @code user_agent.name + * @endcode */ -static const char *kUserAgentVersion = "user_agent.version"; +static constexpr const char *kUserAgentVersion = "user_agent.version"; } // namespace user_agent } // namespace semconv diff --git a/api/include/opentelemetry/semconv/incubating/attributes/user_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/user_attributes.h index 4c0e36c5c3..cc5a80d069 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/user_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/user_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -24,34 +22,35 @@ namespace user /** * User email address. */ -static const char *kUserEmail = "user.email"; +static constexpr const char *kUserEmail = "user.email"; /** - * User's full name. + * User's full name */ -static const char *kUserFullName = "user.full_name"; +static constexpr const char *kUserFullName = "user.full_name"; /** * Unique user hash to correlate information for a user in anonymized form. - * Note: Useful if @code user.id @endcode or @code user.name @endcode contain confidential - * information and cannot be used. + *

+ * Useful if @code user.id @endcode or @code user.name @endcode contain confidential information and + * cannot be used. */ -static const char *kUserHash = "user.hash"; +static constexpr const char *kUserHash = "user.hash"; /** * Unique identifier of the user. */ -static const char *kUserId = "user.id"; +static constexpr const char *kUserId = "user.id"; /** * Short name or login/username of the user. */ -static const char *kUserName = "user.name"; +static constexpr const char *kUserName = "user.name"; /** * Array of user roles at the time of the event. */ -static const char *kUserRoles = "user.roles"; +static constexpr const char *kUserRoles = "user.roles"; } // namespace user } // namespace semconv diff --git a/api/include/opentelemetry/semconv/incubating/attributes/vcs_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/vcs_attributes.h index 9f5221d5e3..cc38902e88 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/vcs_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/vcs_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -25,24 +23,24 @@ namespace vcs * The ID of the change (pull request/merge request) if applicable. This is usually a unique (within * repository) identifier generated by the VCS system. */ -static const char *kVcsRepositoryChangeId = "vcs.repository.change.id"; +static constexpr const char *kVcsRepositoryChangeId = "vcs.repository.change.id"; /** * The human readable title of the change (pull request/merge request). This title is often a brief * summary of the change and may get merged in to a ref as the commit summary. */ -static const char *kVcsRepositoryChangeTitle = "vcs.repository.change.title"; +static constexpr const char *kVcsRepositoryChangeTitle = "vcs.repository.change.title"; /** * The name of the reference such as * branch or tag in the repository. */ -static const char *kVcsRepositoryRefName = "vcs.repository.ref.name"; +static constexpr const char *kVcsRepositoryRefName = "vcs.repository.ref.name"; /** * The revision, literally revised * version, The revision most often refers to a commit object in Git, or a revision number in - * SVN. Note: The revision can be a full The revision can be a full hash value (see glossary), * of the recorded change to a ref within a repository pointing to a * commit commit object. It does @@ -53,47 +51,34 @@ static const char *kVcsRepositoryRefName = "vcs.repository.ref.name"; * up to the implementer to decide which value to set as the revision * based on the VCS system and situational context. */ -static const char *kVcsRepositoryRefRevision = "vcs.repository.ref.revision"; +static constexpr const char *kVcsRepositoryRefRevision = "vcs.repository.ref.revision"; /** * The type of the reference in the * repository. */ -static const char *kVcsRepositoryRefType = "vcs.repository.ref.type"; +static constexpr const char *kVcsRepositoryRefType = "vcs.repository.ref.type"; /** * The URL of the repository providing the complete * address in order to locate and identify the repository. */ -static const char *kVcsRepositoryUrlFull = "vcs.repository.url.full"; +static constexpr const char *kVcsRepositoryUrlFull = "vcs.repository.url.full"; -// DEBUG: {"brief": "The type of the [reference](https://git-scm.com/docs/gitglossary#def_ref) in -// the repository.\n", "examples": ["branch", "tag"], "name": "vcs.repository.ref.type", -// "requirement_level": "recommended", "root_namespace": "vcs", "stability": "experimental", "type": -// {"allow_custom_values": true, "members": [{"brief": -// "[branch](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefbranchabranch)", -// "deprecated": none, "id": "branch", "note": none, "stability": "experimental", "value": -// "branch"}, {"brief": -// "[tag](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddeftagatag)", -// "deprecated": none, "id": "tag", "note": none, "stability": "experimental", "value": "tag"}]}} namespace VcsRepositoryRefTypeValues { /** * branch. + * href="https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefbranchabranch">branch */ -// DEBUG: {"brief": -// "[branch](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefbranchabranch)", -// "deprecated": none, "id": "branch", "note": none, "stability": "experimental", "value": "branch"} static constexpr const char *kBranch = "branch"; + /** * tag. + * href="https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddeftagatag">tag */ -// DEBUG: {"brief": -// "[tag](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddeftagatag)", -// "deprecated": none, "id": "tag", "note": none, "stability": "experimental", "value": "tag"} static constexpr const char *kTag = "tag"; + } // namespace VcsRepositoryRefTypeValues } // namespace vcs diff --git a/api/include/opentelemetry/semconv/incubating/attributes/webengine_attributes.h b/api/include/opentelemetry/semconv/incubating/attributes/webengine_attributes.h index 27d68ad766..16283b43cb 100644 --- a/api/include/opentelemetry/semconv/incubating/attributes/webengine_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/attributes/webengine_attributes.h @@ -1,5 +1,3 @@ - - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -24,17 +22,17 @@ namespace webengine /** * Additional description of the web engine (e.g. detailed version and edition information). */ -static const char *kWebengineDescription = "webengine.description"; +static constexpr const char *kWebengineDescription = "webengine.description"; /** * The name of the web engine. */ -static const char *kWebengineName = "webengine.name"; +static constexpr const char *kWebengineName = "webengine.name"; /** * The version of the web engine. */ -static const char *kWebengineVersion = "webengine.version"; +static constexpr const char *kWebengineVersion = "webengine.version"; } // namespace webengine } // namespace semconv diff --git a/api/include/opentelemetry/semconv/schema_url.h b/api/include/opentelemetry/semconv/schema_url.h new file mode 100644 index 0000000000..62d040e40b --- /dev/null +++ b/api/include/opentelemetry/semconv/schema_url.h @@ -0,0 +1,24 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/schema_url-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +/** + * The URL of the OpenTelemetry schema for these keys and values. + */ +static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.27.0"; +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/buildscripts/semantic-convention/generate.sh b/buildscripts/semantic-convention/generate.sh index 2f291f06ed..785efc2905 100755 --- a/buildscripts/semantic-convention/generate.sh +++ b/buildscripts/semantic-convention/generate.sh @@ -23,7 +23,7 @@ WEAVER_VERSION=0.10.0 SEMCONV_VERSION_TAG=v$SEMCONV_VERSION WEAVER_VERSION_TAG=v$WEAVER_VERSION -SCHEMA_URL=https://opentelemetry.io/schemas/$SEMCONV_VERSION +SCHEMA_URL="https://opentelemetry.io/schemas/${SEMCONV_VERSION}" INCUBATING_DIR=incubating cd ${SCRIPT_DIR} @@ -79,7 +79,8 @@ generate() { ${TARGET} \ /output/${TARGET} \ --param output=${OUTPUT} \ - --param filter=${FILTER} + --param filter=${FILTER} \ + --param schema_url=${SCHEMA_URL} } # stable attributes and metrics @@ -91,6 +92,9 @@ mkdir -p ${ROOT_DIR}/wip/${INCUBATING_DIR}/attributes mkdir -p ${ROOT_DIR}/wip/${INCUBATING_DIR}/metrics generate "./" "./${INCUBATING_DIR}/" "any" +cp -r ${ROOT_DIR}/wip/*.h \ + ${ROOT_DIR}/api/include/opentelemetry/semconv/ + cp -r ${ROOT_DIR}/wip/attributes/*.h \ ${ROOT_DIR}/api/include/opentelemetry/semconv/attributes # cp -r ${ROOT_DIR}/wip/metrics/*.h \ diff --git a/buildscripts/semantic-convention/templates/registry/schema_url-h.j2 b/buildscripts/semantic-convention/templates/registry/schema_url-h.j2 new file mode 100644 index 0000000000..b53f0f02be --- /dev/null +++ b/buildscripts/semantic-convention/templates/registry/schema_url-h.j2 @@ -0,0 +1,49 @@ +{# + Copyright The OpenTelemetry Authors + SPDX-License-Identifier: Apache-2.0 + + This file is: + - a Jinja template, + - used to generate semantic conventions, + - using weaver. + + For doc on the template syntax: + https://jinja.palletsprojects.com/en/3.0.x/ + + For doc on the semantic conventions: + https://github.com/open-telemetry/semantic-conventions + + For doc on weaver: + https://github.com/open-telemetry/weaver +#} +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/schema_url-h.j2 + */ +{# ========================================================================== #} + +{{ template.set_file_name("schema_url.h") }} +{% import 'common.j2' as c %} + +{# ========================================================================== #} + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +/** + * The URL of the OpenTelemetry schema for these keys and values. + */ +static constexpr const char *kSchemaUrl = {{ params.schema_url | print_member_value }}; +} +OPENTELEMETRY_END_NAMESPACE + diff --git a/buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 b/buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 index 00472d906b..206623d87f 100644 --- a/buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 +++ b/buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 @@ -16,7 +16,6 @@ For doc on weaver: https://github.com/open-telemetry/weaver #} - /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 @@ -26,50 +25,44 @@ * DO NOT EDIT, this is an Auto-generated file from: * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 */ +{# ========================================================================== #} + +{% set debug = false %} -{% set file_name = ctx.output + (ctx.root_namespace | snake_case) ~ "_attributes.h" -%} -{{- template.set_file_name(file_name) -}} -{%- import 'common.j2' as c %} +{% set file_name = ctx.output + (ctx.root_namespace | snake_case) ~ "_attributes.h" %} +{{ template.set_file_name(file_name) }} +{% import 'common.j2' as c %} {% set attributes = ctx.attributes | list %} {% set enum_attributes = attributes | select("enum") | rejectattr("name", "in", ctx.excluded_attributes) | list %} -{%- macro attribute_namespace(ctx) -%} +{% macro attribute_namespace(ctx) %} {{ ctx.root_namespace | snake_case }} -{%- endmacro -%} +{% endmacro %} -{%- macro attribute_name(attribute) -%} +{% macro attribute_name(attribute) %} k{{ attribute.name | pascal_case }} -{%- endmacro -%} +{% endmacro %} -{%- macro attribute_type(attribute) -%} +{% macro attribute_type(attribute) %} {{ attribute.type | enum_type | map_text("cpp_types", "FIXME") }} -{%- endmacro -%} +{% endmacro %} -{%- macro enum_namespace_name(attribute) -%} +{% macro enum_namespace_name(attribute) %} {{ attribute.name | pascal_case ~ "Values"}} -{%- endmacro -%} +{% endmacro %} -{%- macro enum_name(member) -%} +{% macro enum_name(member) %} k{{ member.id | pascal_case }} -{%- endmacro -%} +{% endmacro %} -{%- macro stable_class_ref(const_name, separator) -%} +{% macro stable_class_ref(const_name, separator) %} {{ctx.stable_package_name}}.{{ctx.root_namespace}}_attributes{{separator}}{{const_name}} -{%- endmacro %} - -{%- macro write_docstring(name, brief, note, deprecated, stability, multiline) -%} - {%- if c.str_or_empty(deprecated)|length -%} -{{prefix}}@Deprecated: {{c.comment_with_prefix(deprecated, "")}}. - {%- elif ctx.filter == "any" and stability == "stable" -%} -{{prefix}}@Deprecated in favor of stable :py:const:`{{stable_class_ref(name, '.')}}`. - {%- elif c.str_or_empty(brief)|length -%} -{{prefix}}{{c.comment_with_prefix(brief, "")}}. - {%- if c.str_or_empty(note)|length %} -{{prefix}}Note: {{c.comment_with_prefix(note, "")}}. - {%- endif -%} - {%- endif -%} -{%- endmacro -%} +{% endmacro %} + +{% set cpp_attribute_namespace = attribute_namespace(ctx) %} + +{# ========================================================================== #} #pragma once @@ -79,37 +72,57 @@ k{{ member.id | pascal_case }} OPENTELEMETRY_BEGIN_NAMESPACE namespace semconv { -namespace {{ attribute_namespace(ctx) }} +namespace {{ cpp_attribute_namespace -}} { {% for attribute in attributes %} -{% set cpp_attr_name = attribute_name(attribute) %} -{%- set multiline = attribute.name not in ctx.excluded_attributes -%} -{%- set doc_string = write_docstring(attr_name, attribute.brief, attribute.note, attribute.deprecated, attribute.stability, multiline)-%} -{%- set prefix = "" if multiline else "// " -%} -{{prefix}}{{doc_string | comment(ident=2) }} -{{prefix}}static const char *{{cpp_attr_name}} = "{{attribute.name}}"; + {% if debug %} +// DEBUG: {{ attribute }} + {% endif %} + {% set cpp_attr_name = attribute_name(attribute) %} + {% set excluded = attribute.name in ctx.excluded_attributes %} + {% if excluded %} +#if 0 +// Excluded attribute: + {% endif %} + {% if attribute is deprecated %} +{{ [attribute.brief, "\n", "@deprecated", attribute.deprecated, "\n", attribute.note] | comment(ident=2) }} +OPENTELEMETRY_DEPRECATED + {% else %} +{{ [attribute.brief, "\n", attribute.note] | comment(ident=2) }} + {% endif %} +static constexpr const char *{{cpp_attr_name}} = "{{attribute.name}}"; + {% if excluded %} +#endif + {% endif %} + {% endfor %} -{% for attribute in enum_attributes %}{%- set class_name = attribute.name | pascal_case ~ "Values" -%} -{% set cpp_enum_name = enum_namespace_name(attribute) %} -{% set cpp_enum_type = attribute_type(attribute) -%} -{%- if attribute is deprecated %} -// @deprecated(reason="The attribute {{attribute.name}} is deprecated - {{ c.comment_with_prefix(attribute.deprecated, "") }}") # type: ignore - {%- elif attribute.stability == "stable" and ctx.filter == "any" %} -// @deprecated(reason="Deprecated in favor of stable `{{stable_class_ref(class_name, '.')}}`.") # type: ignore - {%- endif %} +{% for attribute in enum_attributes %} + {% set class_name = attribute.name | pascal_case ~ "Values" %} + {% set cpp_enum_name = enum_namespace_name(attribute) %} + {% set cpp_enum_type = attribute_type(attribute) %} + {% if debug %} // DEBUG: {{ attribute }} -namespace {{cpp_enum_name}} + {% endif %} +namespace {{cpp_enum_name -}} { -{%- for member in attribute.type.members %} -{% set member_name = enum_name(member) -%} -{%- set doc_string=write_docstring(class_name + '.' + member_name, member.brief or member.id, "", member.deprecated, member.stability, false)-%} - {% if doc_string %}{{doc_string | comment(ident=2) }}{% endif %} - // DEBUG: {{ member }} - static constexpr {{cpp_enum_type}} {{member_name}} = {{ member.value | print_member_value }}; -{%- endfor %} + {% for member in attribute.type.members %} + {% set member_name = enum_name(member) %} + {% if debug %} +// DEBUG: {{ member }} + {% endif %} + {% if member is deprecated %} +{{ [member.brief, "\n", "@deprecated", member.deprecated] | comment(ident=2) }} +OPENTELEMETRY_DEPRECATED + {% else %} +{{ member.brief | comment(ident=2) }} + {% endif %} +static constexpr {{ cpp_enum_type }} {{ member_name }} = {{ member.value | print_member_value }}; + + {% endfor %} } + {% endfor %} } diff --git a/buildscripts/semantic-convention/templates/registry/weaver.yaml b/buildscripts/semantic-convention/templates/registry/weaver.yaml index 29033fdc1e..08c02d3ecd 100644 --- a/buildscripts/semantic-convention/templates/registry/weaver.yaml +++ b/buildscripts/semantic-convention/templates/registry/weaver.yaml @@ -1,3 +1,6 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + params: # excluded namespaces will not be generated excluded_namespaces: [ios, aspnetcore, signalr, android, dotnet, jvm, kestrel, v8js, veightjs, go, nodejs] @@ -8,7 +11,14 @@ params: stable_package_name: opentelemetry.semconv + # "https://opentelemetry.io/schemas/" + # this is provided from the command line + schema_url: "" + templates: + - pattern: schema_url-h.j2 + filter: . + application_mode: single - pattern: semantic_attributes-h.j2 filter: > semconv_grouped_attributes({ @@ -76,3 +86,8 @@ comment_formats: block_code_snippet: "@verbatim {{code}} @endverbatim" default_comment_format: cpp +whitespace_control: + trim_blocks: true + lstrip_blocks: true + keep_trailing_newline: true + From d880a1af6335e0c55745e8095c25a100c794ccee Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Fri, 18 Oct 2024 01:02:26 +0200 Subject: [PATCH 03/16] CI cleanup --- .../templates/registry/common.j2 | 20 +++++++++++++ .../templates/registry/semantic_metrics-h.j2 | 29 +++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/buildscripts/semantic-convention/templates/registry/common.j2 b/buildscripts/semantic-convention/templates/registry/common.j2 index 99dcf1495d..1b7eb47e08 100644 --- a/buildscripts/semantic-convention/templates/registry/common.j2 +++ b/buildscripts/semantic-convention/templates/registry/common.j2 @@ -1,3 +1,23 @@ +{# + Copyright The OpenTelemetry Authors + SPDX-License-Identifier: Apache-2.0 + + This file is: + - a Jinja template, + - used to generate semantic conventions, + - using weaver. + + For doc on the template syntax: + https://jinja.palletsprojects.com/en/3.0.x/ + + For doc on the semantic conventions: + https://github.com/open-telemetry/semantic-conventions + + For doc on weaver: + https://github.com/open-telemetry/weaver +#} + + {%- macro file_header() -%} # Copyright The OpenTelemetry Authors # diff --git a/buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 b/buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 index 49550cf538..f12a057dc0 100644 --- a/buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 +++ b/buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 @@ -1,3 +1,32 @@ +{# + Copyright The OpenTelemetry Authors + SPDX-License-Identifier: Apache-2.0 + + This file is: + - a Jinja template, + - used to generate semantic conventions, + - using weaver. + + For doc on the template syntax: + https://jinja.palletsprojects.com/en/3.0.x/ + + For doc on the semantic conventions: + https://github.com/open-telemetry/semantic-conventions + + For doc on weaver: + https://github.com/open-telemetry/weaver +#} +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 + */ +{# ========================================================================== #} + # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); From 5308cc2ec0246064b4ef37d81f3e65d001e71e12 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Fri, 18 Oct 2024 01:48:03 +0200 Subject: [PATCH 04/16] Removed attributes directory --- .../{attributes => }/client_attributes.h | 0 .../{attributes => }/error_attributes.h | 0 .../{attributes => }/exception_attributes.h | 0 .../{attributes => }/http_attributes.h | 0 .../{attributes => }/artifact_attributes.h | 0 .../{attributes => }/aws_attributes.h | 0 .../{attributes => }/az_attributes.h | 0 .../{attributes => }/browser_attributes.h | 0 .../{attributes => }/cicd_attributes.h | 0 .../{attributes => }/client_attributes.h | 0 .../{attributes => }/cloud_attributes.h | 0 .../{attributes => }/cloudevents_attributes.h | 0 .../{attributes => }/code_attributes.h | 0 .../{attributes => }/container_attributes.h | 0 .../{attributes => }/cpu_attributes.h | 0 .../{attributes => }/db_attributes.h | 0 .../{attributes => }/deployment_attributes.h | 0 .../{attributes => }/destination_attributes.h | 0 .../{attributes => }/device_attributes.h | 0 .../{attributes => }/disk_attributes.h | 0 .../{attributes => }/dns_attributes.h | 0 .../{attributes => }/enduser_attributes.h | 0 .../{attributes => }/error_attributes.h | 0 .../{attributes => }/event_attributes.h | 0 .../{attributes => }/exception_attributes.h | 0 .../{attributes => }/faas_attributes.h | 0 .../feature_flag_attributes.h | 0 .../{attributes => }/file_attributes.h | 0 .../{attributes => }/gcp_attributes.h | 0 .../{attributes => }/gen_ai_attributes.h | 0 .../{attributes => }/graphql_attributes.h | 0 .../{attributes => }/heroku_attributes.h | 0 .../{attributes => }/host_attributes.h | 0 .../{attributes => }/http_attributes.h | 0 .../{attributes => }/k8s_attributes.h | 0 .../{attributes => }/linux_attributes.h | 0 .../{attributes => }/log_attributes.h | 0 .../{attributes => }/message_attributes.h | 0 .../{attributes => }/messaging_attributes.h | 0 .../{attributes => }/net_attributes.h | 0 .../{attributes => }/network_attributes.h | 0 .../{attributes => }/oci_attributes.h | 0 .../{attributes => }/opentracing_attributes.h | 0 .../{attributes => }/os_attributes.h | 0 .../{attributes => }/otel_attributes.h | 0 .../{attributes => }/other_attributes.h | 0 .../{attributes => }/peer_attributes.h | 0 .../{attributes => }/pool_attributes.h | 0 .../{attributes => }/process_attributes.h | 0 .../{attributes => }/rpc_attributes.h | 0 .../server_attributes.h | 0 .../{attributes => }/service_attributes.h | 0 .../{attributes => }/session_attributes.h | 0 .../{attributes => }/source_attributes.h | 0 .../{attributes => }/system_attributes.h | 0 .../{attributes => }/telemetry_attributes.h | 0 .../{attributes => }/test_attributes.h | 0 .../{attributes => }/thread_attributes.h | 0 .../{attributes => }/tls_attributes.h | 0 .../{attributes => }/url_attributes.h | 0 .../{attributes => }/user_agent_attributes.h | 0 .../{attributes => }/user_attributes.h | 0 .../{attributes => }/vcs_attributes.h | 0 .../{attributes => }/webengine_attributes.h | 0 .../{attributes => }/network_attributes.h | 0 .../{attributes => }/otel_attributes.h | 0 .../attributes => }/server_attributes.h | 0 .../{attributes => }/service_attributes.h | 0 .../{attributes => }/telemetry_attributes.h | 0 .../semconv/{attributes => }/url_attributes.h | 0 .../{attributes => }/user_agent_attributes.h | 0 buildscripts/semantic-convention/generate.sh | 31 ++++++++++--------- .../templates/registry/weaver.yaml | 2 +- examples/grpc/client.cc | 4 +-- examples/grpc/server.cc | 2 +- examples/http/client.cc | 4 +-- examples/http/server.cc | 8 ++--- exporters/zipkin/src/recordable.cc | 2 +- .../opentracingshim/shim_utils.h | 2 +- opentracing-shim/src/span_shim.cc | 2 +- sdk/src/resource/resource.cc | 6 ++-- sdk/src/resource/resource_detector.cc | 2 +- sdk/test/resource/resource_test.cc | 4 +-- 83 files changed, 36 insertions(+), 33 deletions(-) rename api/include/opentelemetry/semconv/{attributes => }/client_attributes.h (100%) rename api/include/opentelemetry/semconv/{attributes => }/error_attributes.h (100%) rename api/include/opentelemetry/semconv/{attributes => }/exception_attributes.h (100%) rename api/include/opentelemetry/semconv/{attributes => }/http_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/artifact_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/aws_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/az_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/browser_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/cicd_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/client_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/cloud_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/cloudevents_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/code_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/container_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/cpu_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/db_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/deployment_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/destination_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/device_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/disk_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/dns_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/enduser_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/error_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/event_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/exception_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/faas_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/feature_flag_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/file_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/gcp_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/gen_ai_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/graphql_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/heroku_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/host_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/http_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/k8s_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/linux_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/log_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/message_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/messaging_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/net_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/network_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/oci_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/opentracing_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/os_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/otel_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/other_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/peer_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/pool_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/process_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/rpc_attributes.h (100%) rename api/include/opentelemetry/semconv/{attributes => incubating}/server_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/service_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/session_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/source_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/system_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/telemetry_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/test_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/thread_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/tls_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/url_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/user_agent_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/user_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/vcs_attributes.h (100%) rename api/include/opentelemetry/semconv/incubating/{attributes => }/webengine_attributes.h (100%) rename api/include/opentelemetry/semconv/{attributes => }/network_attributes.h (100%) rename api/include/opentelemetry/semconv/{attributes => }/otel_attributes.h (100%) rename api/include/opentelemetry/semconv/{incubating/attributes => }/server_attributes.h (100%) rename api/include/opentelemetry/semconv/{attributes => }/service_attributes.h (100%) rename api/include/opentelemetry/semconv/{attributes => }/telemetry_attributes.h (100%) rename api/include/opentelemetry/semconv/{attributes => }/url_attributes.h (100%) rename api/include/opentelemetry/semconv/{attributes => }/user_agent_attributes.h (100%) diff --git a/api/include/opentelemetry/semconv/attributes/client_attributes.h b/api/include/opentelemetry/semconv/client_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/attributes/client_attributes.h rename to api/include/opentelemetry/semconv/client_attributes.h diff --git a/api/include/opentelemetry/semconv/attributes/error_attributes.h b/api/include/opentelemetry/semconv/error_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/attributes/error_attributes.h rename to api/include/opentelemetry/semconv/error_attributes.h diff --git a/api/include/opentelemetry/semconv/attributes/exception_attributes.h b/api/include/opentelemetry/semconv/exception_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/attributes/exception_attributes.h rename to api/include/opentelemetry/semconv/exception_attributes.h diff --git a/api/include/opentelemetry/semconv/attributes/http_attributes.h b/api/include/opentelemetry/semconv/http_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/attributes/http_attributes.h rename to api/include/opentelemetry/semconv/http_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/artifact_attributes.h b/api/include/opentelemetry/semconv/incubating/artifact_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/artifact_attributes.h rename to api/include/opentelemetry/semconv/incubating/artifact_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/aws_attributes.h b/api/include/opentelemetry/semconv/incubating/aws_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/aws_attributes.h rename to api/include/opentelemetry/semconv/incubating/aws_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/az_attributes.h b/api/include/opentelemetry/semconv/incubating/az_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/az_attributes.h rename to api/include/opentelemetry/semconv/incubating/az_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/browser_attributes.h b/api/include/opentelemetry/semconv/incubating/browser_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/browser_attributes.h rename to api/include/opentelemetry/semconv/incubating/browser_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/cicd_attributes.h b/api/include/opentelemetry/semconv/incubating/cicd_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/cicd_attributes.h rename to api/include/opentelemetry/semconv/incubating/cicd_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/client_attributes.h b/api/include/opentelemetry/semconv/incubating/client_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/client_attributes.h rename to api/include/opentelemetry/semconv/incubating/client_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/cloud_attributes.h b/api/include/opentelemetry/semconv/incubating/cloud_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/cloud_attributes.h rename to api/include/opentelemetry/semconv/incubating/cloud_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/cloudevents_attributes.h b/api/include/opentelemetry/semconv/incubating/cloudevents_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/cloudevents_attributes.h rename to api/include/opentelemetry/semconv/incubating/cloudevents_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/code_attributes.h b/api/include/opentelemetry/semconv/incubating/code_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/code_attributes.h rename to api/include/opentelemetry/semconv/incubating/code_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/container_attributes.h b/api/include/opentelemetry/semconv/incubating/container_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/container_attributes.h rename to api/include/opentelemetry/semconv/incubating/container_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/cpu_attributes.h b/api/include/opentelemetry/semconv/incubating/cpu_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/cpu_attributes.h rename to api/include/opentelemetry/semconv/incubating/cpu_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/db_attributes.h b/api/include/opentelemetry/semconv/incubating/db_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/db_attributes.h rename to api/include/opentelemetry/semconv/incubating/db_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/deployment_attributes.h b/api/include/opentelemetry/semconv/incubating/deployment_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/deployment_attributes.h rename to api/include/opentelemetry/semconv/incubating/deployment_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/destination_attributes.h b/api/include/opentelemetry/semconv/incubating/destination_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/destination_attributes.h rename to api/include/opentelemetry/semconv/incubating/destination_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/device_attributes.h b/api/include/opentelemetry/semconv/incubating/device_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/device_attributes.h rename to api/include/opentelemetry/semconv/incubating/device_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/disk_attributes.h b/api/include/opentelemetry/semconv/incubating/disk_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/disk_attributes.h rename to api/include/opentelemetry/semconv/incubating/disk_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/dns_attributes.h b/api/include/opentelemetry/semconv/incubating/dns_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/dns_attributes.h rename to api/include/opentelemetry/semconv/incubating/dns_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/enduser_attributes.h b/api/include/opentelemetry/semconv/incubating/enduser_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/enduser_attributes.h rename to api/include/opentelemetry/semconv/incubating/enduser_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/error_attributes.h b/api/include/opentelemetry/semconv/incubating/error_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/error_attributes.h rename to api/include/opentelemetry/semconv/incubating/error_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/event_attributes.h b/api/include/opentelemetry/semconv/incubating/event_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/event_attributes.h rename to api/include/opentelemetry/semconv/incubating/event_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/exception_attributes.h b/api/include/opentelemetry/semconv/incubating/exception_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/exception_attributes.h rename to api/include/opentelemetry/semconv/incubating/exception_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/faas_attributes.h b/api/include/opentelemetry/semconv/incubating/faas_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/faas_attributes.h rename to api/include/opentelemetry/semconv/incubating/faas_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/feature_flag_attributes.h b/api/include/opentelemetry/semconv/incubating/feature_flag_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/feature_flag_attributes.h rename to api/include/opentelemetry/semconv/incubating/feature_flag_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/file_attributes.h b/api/include/opentelemetry/semconv/incubating/file_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/file_attributes.h rename to api/include/opentelemetry/semconv/incubating/file_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/gcp_attributes.h b/api/include/opentelemetry/semconv/incubating/gcp_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/gcp_attributes.h rename to api/include/opentelemetry/semconv/incubating/gcp_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/gen_ai_attributes.h b/api/include/opentelemetry/semconv/incubating/gen_ai_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/gen_ai_attributes.h rename to api/include/opentelemetry/semconv/incubating/gen_ai_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/graphql_attributes.h b/api/include/opentelemetry/semconv/incubating/graphql_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/graphql_attributes.h rename to api/include/opentelemetry/semconv/incubating/graphql_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/heroku_attributes.h b/api/include/opentelemetry/semconv/incubating/heroku_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/heroku_attributes.h rename to api/include/opentelemetry/semconv/incubating/heroku_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/host_attributes.h b/api/include/opentelemetry/semconv/incubating/host_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/host_attributes.h rename to api/include/opentelemetry/semconv/incubating/host_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/http_attributes.h b/api/include/opentelemetry/semconv/incubating/http_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/http_attributes.h rename to api/include/opentelemetry/semconv/incubating/http_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/k8s_attributes.h b/api/include/opentelemetry/semconv/incubating/k8s_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/k8s_attributes.h rename to api/include/opentelemetry/semconv/incubating/k8s_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/linux_attributes.h b/api/include/opentelemetry/semconv/incubating/linux_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/linux_attributes.h rename to api/include/opentelemetry/semconv/incubating/linux_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/log_attributes.h b/api/include/opentelemetry/semconv/incubating/log_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/log_attributes.h rename to api/include/opentelemetry/semconv/incubating/log_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/message_attributes.h b/api/include/opentelemetry/semconv/incubating/message_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/message_attributes.h rename to api/include/opentelemetry/semconv/incubating/message_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/messaging_attributes.h b/api/include/opentelemetry/semconv/incubating/messaging_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/messaging_attributes.h rename to api/include/opentelemetry/semconv/incubating/messaging_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/net_attributes.h b/api/include/opentelemetry/semconv/incubating/net_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/net_attributes.h rename to api/include/opentelemetry/semconv/incubating/net_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/network_attributes.h b/api/include/opentelemetry/semconv/incubating/network_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/network_attributes.h rename to api/include/opentelemetry/semconv/incubating/network_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/oci_attributes.h b/api/include/opentelemetry/semconv/incubating/oci_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/oci_attributes.h rename to api/include/opentelemetry/semconv/incubating/oci_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/opentracing_attributes.h b/api/include/opentelemetry/semconv/incubating/opentracing_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/opentracing_attributes.h rename to api/include/opentelemetry/semconv/incubating/opentracing_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/os_attributes.h b/api/include/opentelemetry/semconv/incubating/os_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/os_attributes.h rename to api/include/opentelemetry/semconv/incubating/os_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/otel_attributes.h b/api/include/opentelemetry/semconv/incubating/otel_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/otel_attributes.h rename to api/include/opentelemetry/semconv/incubating/otel_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/other_attributes.h b/api/include/opentelemetry/semconv/incubating/other_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/other_attributes.h rename to api/include/opentelemetry/semconv/incubating/other_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/peer_attributes.h b/api/include/opentelemetry/semconv/incubating/peer_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/peer_attributes.h rename to api/include/opentelemetry/semconv/incubating/peer_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/pool_attributes.h b/api/include/opentelemetry/semconv/incubating/pool_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/pool_attributes.h rename to api/include/opentelemetry/semconv/incubating/pool_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/process_attributes.h b/api/include/opentelemetry/semconv/incubating/process_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/process_attributes.h rename to api/include/opentelemetry/semconv/incubating/process_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/rpc_attributes.h b/api/include/opentelemetry/semconv/incubating/rpc_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/rpc_attributes.h rename to api/include/opentelemetry/semconv/incubating/rpc_attributes.h diff --git a/api/include/opentelemetry/semconv/attributes/server_attributes.h b/api/include/opentelemetry/semconv/incubating/server_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/attributes/server_attributes.h rename to api/include/opentelemetry/semconv/incubating/server_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/service_attributes.h b/api/include/opentelemetry/semconv/incubating/service_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/service_attributes.h rename to api/include/opentelemetry/semconv/incubating/service_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/session_attributes.h b/api/include/opentelemetry/semconv/incubating/session_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/session_attributes.h rename to api/include/opentelemetry/semconv/incubating/session_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/source_attributes.h b/api/include/opentelemetry/semconv/incubating/source_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/source_attributes.h rename to api/include/opentelemetry/semconv/incubating/source_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/system_attributes.h b/api/include/opentelemetry/semconv/incubating/system_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/system_attributes.h rename to api/include/opentelemetry/semconv/incubating/system_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/telemetry_attributes.h b/api/include/opentelemetry/semconv/incubating/telemetry_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/telemetry_attributes.h rename to api/include/opentelemetry/semconv/incubating/telemetry_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/test_attributes.h b/api/include/opentelemetry/semconv/incubating/test_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/test_attributes.h rename to api/include/opentelemetry/semconv/incubating/test_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/thread_attributes.h b/api/include/opentelemetry/semconv/incubating/thread_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/thread_attributes.h rename to api/include/opentelemetry/semconv/incubating/thread_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/tls_attributes.h b/api/include/opentelemetry/semconv/incubating/tls_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/tls_attributes.h rename to api/include/opentelemetry/semconv/incubating/tls_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/url_attributes.h b/api/include/opentelemetry/semconv/incubating/url_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/url_attributes.h rename to api/include/opentelemetry/semconv/incubating/url_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/user_agent_attributes.h b/api/include/opentelemetry/semconv/incubating/user_agent_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/user_agent_attributes.h rename to api/include/opentelemetry/semconv/incubating/user_agent_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/user_attributes.h b/api/include/opentelemetry/semconv/incubating/user_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/user_attributes.h rename to api/include/opentelemetry/semconv/incubating/user_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/vcs_attributes.h b/api/include/opentelemetry/semconv/incubating/vcs_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/vcs_attributes.h rename to api/include/opentelemetry/semconv/incubating/vcs_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/webengine_attributes.h b/api/include/opentelemetry/semconv/incubating/webengine_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/webengine_attributes.h rename to api/include/opentelemetry/semconv/incubating/webengine_attributes.h diff --git a/api/include/opentelemetry/semconv/attributes/network_attributes.h b/api/include/opentelemetry/semconv/network_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/attributes/network_attributes.h rename to api/include/opentelemetry/semconv/network_attributes.h diff --git a/api/include/opentelemetry/semconv/attributes/otel_attributes.h b/api/include/opentelemetry/semconv/otel_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/attributes/otel_attributes.h rename to api/include/opentelemetry/semconv/otel_attributes.h diff --git a/api/include/opentelemetry/semconv/incubating/attributes/server_attributes.h b/api/include/opentelemetry/semconv/server_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/incubating/attributes/server_attributes.h rename to api/include/opentelemetry/semconv/server_attributes.h diff --git a/api/include/opentelemetry/semconv/attributes/service_attributes.h b/api/include/opentelemetry/semconv/service_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/attributes/service_attributes.h rename to api/include/opentelemetry/semconv/service_attributes.h diff --git a/api/include/opentelemetry/semconv/attributes/telemetry_attributes.h b/api/include/opentelemetry/semconv/telemetry_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/attributes/telemetry_attributes.h rename to api/include/opentelemetry/semconv/telemetry_attributes.h diff --git a/api/include/opentelemetry/semconv/attributes/url_attributes.h b/api/include/opentelemetry/semconv/url_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/attributes/url_attributes.h rename to api/include/opentelemetry/semconv/url_attributes.h diff --git a/api/include/opentelemetry/semconv/attributes/user_agent_attributes.h b/api/include/opentelemetry/semconv/user_agent_attributes.h similarity index 100% rename from api/include/opentelemetry/semconv/attributes/user_agent_attributes.h rename to api/include/opentelemetry/semconv/user_agent_attributes.h diff --git a/buildscripts/semantic-convention/generate.sh b/buildscripts/semantic-convention/generate.sh index 785efc2905..550689be73 100755 --- a/buildscripts/semantic-convention/generate.sh +++ b/buildscripts/semantic-convention/generate.sh @@ -63,11 +63,23 @@ fi # # docker --user 0:0 +MY_UID=$(id -u) +MY_GID=$(id -g) + +if [ -x "$(command -v docker)" ]; then + PODMANSTATUS=$(docker -v | grep -c podman); + if [ "${PODMANSTATUS}" -ge "1" ]; then + echo "Detected PODMAN" + MY_UID="0" + MY_GID="0" + fi; +fi + generate() { TARGET=$1 OUTPUT=$2 FILTER=$3 - docker run --rm --user 0:0 \ + docker run --rm --user ${MY_UID}:${MY_GID} \ -v ${SCRIPT_DIR}/semantic-conventions/model:/source${USE_MOUNT_OPTION} \ -v ${SCRIPT_DIR}/templates:/templates${USE_MOUNT_OPTION} \ -v ${ROOT_DIR}/wip/:/output${USE_MOUNT_OPTION} \ @@ -84,24 +96,15 @@ generate() { } # stable attributes and metrics -mkdir -p ${ROOT_DIR}/wip/attributes -mkdir -p ${ROOT_DIR}/wip/metrics +mkdir -p ${ROOT_DIR}/wip generate "./" "./" "stable" -mkdir -p ${ROOT_DIR}/wip/${INCUBATING_DIR}/attributes -mkdir -p ${ROOT_DIR}/wip/${INCUBATING_DIR}/metrics +mkdir -p ${ROOT_DIR}/wip/${INCUBATING_DIR} generate "./" "./${INCUBATING_DIR}/" "any" cp -r ${ROOT_DIR}/wip/*.h \ ${ROOT_DIR}/api/include/opentelemetry/semconv/ -cp -r ${ROOT_DIR}/wip/attributes/*.h \ - ${ROOT_DIR}/api/include/opentelemetry/semconv/attributes -# cp -r ${ROOT_DIR}/wip/metrics/*.h \ -# ${ROOT_DIR}/api/include/opentelemetry/semconv/metrics - -cp -r ${ROOT_DIR}/wip/${INCUBATING_DIR}/attributes/*.h \ - ${ROOT_DIR}/api/include/opentelemetry/semconv/incubating/attributes -# cp -r ${ROOT_DIR}/wip/${INCUBATING_DIR}/metrics/*.h \ -# ${ROOT_DIR}/api/include/opentelemetry/semconv/incubating/metrics +cp -r ${ROOT_DIR}/wip/${INCUBATING_DIR}/*.h \ + ${ROOT_DIR}/api/include/opentelemetry/semconv/incubating diff --git a/buildscripts/semantic-convention/templates/registry/weaver.yaml b/buildscripts/semantic-convention/templates/registry/weaver.yaml index 08c02d3ecd..8d249a9b4b 100644 --- a/buildscripts/semantic-convention/templates/registry/weaver.yaml +++ b/buildscripts/semantic-convention/templates/registry/weaver.yaml @@ -28,7 +28,7 @@ templates: | map({ root_namespace: .root_namespace, attributes: .attributes, - output: $output + "attributes/", + output: $output, stable_package_name: $stable_package_name + ".attributes", filter: $filter, excluded_attributes: $excluded_attributes[] diff --git a/examples/grpc/client.cc b/examples/grpc/client.cc index b8be0fec92..bad276839a 100644 --- a/examples/grpc/client.cc +++ b/examples/grpc/client.cc @@ -15,8 +15,8 @@ #include #include -#include "opentelemetry/semconv/attributes/network_attributes.h" -#include "opentelemetry/semconv/incubating/attributes/rpc_attributes.h" +#include "opentelemetry/semconv/network_attributes.h" +#include "opentelemetry/semconv/incubating/rpc_attributes.h" #include "tracer_common.h" using grpc::Channel; diff --git a/examples/grpc/server.cc b/examples/grpc/server.cc index 1927257c71..6aa543a8a1 100644 --- a/examples/grpc/server.cc +++ b/examples/grpc/server.cc @@ -7,7 +7,7 @@ # include "messages.grpc.pb.h" #endif -#include "opentelemetry/semconv/incubating/attributes/rpc_attributes.h" +#include "opentelemetry/semconv/incubating/rpc_attributes.h" #include "opentelemetry/trace/context.h" #include "opentelemetry/trace/span_context_kv_iterable_view.h" #include "tracer_common.h" diff --git a/examples/http/client.cc b/examples/http/client.cc index 5230e0c425..54f10b2f95 100644 --- a/examples/http/client.cc +++ b/examples/http/client.cc @@ -3,8 +3,8 @@ #include "opentelemetry/ext/http/client/http_client_factory.h" #include "opentelemetry/ext/http/common/url_parser.h" -#include "opentelemetry/semconv/attributes/http_attributes.h" -#include "opentelemetry/semconv/attributes/url_attributes.h" +#include "opentelemetry/semconv/http_attributes.h" +#include "opentelemetry/semconv/url_attributes.h" #include "tracer_common.h" namespace diff --git a/examples/http/server.cc b/examples/http/server.cc index 415809e4a5..5daa7b2110 100644 --- a/examples/http/server.cc +++ b/examples/http/server.cc @@ -2,10 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 #include "server.h" -#include "opentelemetry/semconv/attributes/client_attributes.h" -#include "opentelemetry/semconv/attributes/server_attributes.h" -#include "opentelemetry/semconv/attributes/url_attributes.h" -#include "opentelemetry/semconv/incubating/attributes/http_attributes.h" +#include "opentelemetry/semconv/client_attributes.h" +#include "opentelemetry/semconv/server_attributes.h" +#include "opentelemetry/semconv/url_attributes.h" +#include "opentelemetry/semconv/incubating/http_attributes.h" #include "opentelemetry/trace/context.h" #include "tracer_common.h" diff --git a/exporters/zipkin/src/recordable.cc b/exporters/zipkin/src/recordable.cc index ac5c3f4fe3..8b60faef71 100644 --- a/exporters/zipkin/src/recordable.cc +++ b/exporters/zipkin/src/recordable.cc @@ -21,7 +21,7 @@ #include "opentelemetry/sdk/common/attribute_utils.h" #include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h" #include "opentelemetry/sdk/resource/resource.h" -#include "opentelemetry/semconv/attributes/service_attributes.h" +#include "opentelemetry/semconv/service_attributes.h" #include "opentelemetry/trace/span_context.h" #include "opentelemetry/trace/span_id.h" #include "opentelemetry/trace/span_metadata.h" diff --git a/opentracing-shim/include/opentelemetry/opentracingshim/shim_utils.h b/opentracing-shim/include/opentelemetry/opentracingshim/shim_utils.h index d771e164e8..a7feb5efc4 100644 --- a/opentracing-shim/include/opentelemetry/opentracingshim/shim_utils.h +++ b/opentracing-shim/include/opentelemetry/opentracingshim/shim_utils.h @@ -7,7 +7,7 @@ #include "opentelemetry/opentracingshim/span_context_shim.h" -#include "opentelemetry/semconv/incubating/attributes/opentracing_attributes.h" +#include "opentelemetry/semconv/incubating/opentracing_attributes.h" #include "opentelemetry/trace/tracer.h" #include "opentracing/tracer.h" diff --git a/opentracing-shim/src/span_shim.cc b/opentracing-shim/src/span_shim.cc index 28b16104a6..1be909f1bd 100644 --- a/opentracing-shim/src/span_shim.cc +++ b/opentracing-shim/src/span_shim.cc @@ -8,7 +8,7 @@ #include "opentelemetry/opentracingshim/span_context_shim.h" #include "opentelemetry/opentracingshim/tracer_shim.h" -#include "opentelemetry/semconv/attributes/exception_attributes.h" +#include "opentelemetry/semconv/exception_attributes.h" #include "opentelemetry/trace/span_metadata.h" #include "opentracing/ext/tags.h" diff --git a/sdk/src/resource/resource.cc b/sdk/src/resource/resource.cc index 84a9602264..70b57ba20a 100644 --- a/sdk/src/resource/resource.cc +++ b/sdk/src/resource/resource.cc @@ -9,9 +9,9 @@ #include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/sdk/resource/resource_detector.h" #include "opentelemetry/sdk/version/version.h" -#include "opentelemetry/semconv/attributes/service_attributes.h" -#include "opentelemetry/semconv/attributes/telemetry_attributes.h" -#include "opentelemetry/semconv/incubating/attributes/process_attributes.h" +#include "opentelemetry/semconv/service_attributes.h" +#include "opentelemetry/semconv/telemetry_attributes.h" +#include "opentelemetry/semconv/incubating/process_attributes.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE diff --git a/sdk/src/resource/resource_detector.cc b/sdk/src/resource/resource_detector.cc index 789dbb8017..cab8ce748a 100644 --- a/sdk/src/resource/resource_detector.cc +++ b/sdk/src/resource/resource_detector.cc @@ -4,7 +4,7 @@ #include "opentelemetry/sdk/resource/resource_detector.h" #include "opentelemetry/sdk/common/env_variables.h" #include "opentelemetry/sdk/resource/resource.h" -#include "opentelemetry/semconv/attributes/service_attributes.h" +#include "opentelemetry/semconv/service_attributes.h" #include "opentelemetry/version.h" #include diff --git a/sdk/test/resource/resource_test.cc b/sdk/test/resource/resource_test.cc index e627cc58a0..a359cb33d4 100644 --- a/sdk/test/resource/resource_test.cc +++ b/sdk/test/resource/resource_test.cc @@ -15,8 +15,8 @@ #include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/sdk/resource/resource_detector.h" #include "opentelemetry/sdk/version/version.h" -#include "opentelemetry/semconv/attributes/service_attributes.h" -#include "opentelemetry/semconv/attributes/telemetry_attributes.h" +#include "opentelemetry/semconv/service_attributes.h" +#include "opentelemetry/semconv/telemetry_attributes.h" #if defined(_MSC_VER) # include "opentelemetry/sdk/common/env_variables.h" From 5fb6486cd223e5f1fa5d9c6bf54879ff41fe753d Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Fri, 18 Oct 2024 02:05:47 +0200 Subject: [PATCH 05/16] Format --- examples/grpc/client.cc | 2 +- examples/http/server.cc | 2 +- sdk/src/resource/resource.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/grpc/client.cc b/examples/grpc/client.cc index bad276839a..49be22c155 100644 --- a/examples/grpc/client.cc +++ b/examples/grpc/client.cc @@ -15,8 +15,8 @@ #include #include -#include "opentelemetry/semconv/network_attributes.h" #include "opentelemetry/semconv/incubating/rpc_attributes.h" +#include "opentelemetry/semconv/network_attributes.h" #include "tracer_common.h" using grpc::Channel; diff --git a/examples/http/server.cc b/examples/http/server.cc index 5daa7b2110..23b37d3ab9 100644 --- a/examples/http/server.cc +++ b/examples/http/server.cc @@ -3,9 +3,9 @@ #include "server.h" #include "opentelemetry/semconv/client_attributes.h" +#include "opentelemetry/semconv/incubating/http_attributes.h" #include "opentelemetry/semconv/server_attributes.h" #include "opentelemetry/semconv/url_attributes.h" -#include "opentelemetry/semconv/incubating/http_attributes.h" #include "opentelemetry/trace/context.h" #include "tracer_common.h" diff --git a/sdk/src/resource/resource.cc b/sdk/src/resource/resource.cc index 70b57ba20a..5ae5446e80 100644 --- a/sdk/src/resource/resource.cc +++ b/sdk/src/resource/resource.cc @@ -9,9 +9,9 @@ #include "opentelemetry/sdk/resource/resource.h" #include "opentelemetry/sdk/resource/resource_detector.h" #include "opentelemetry/sdk/version/version.h" +#include "opentelemetry/semconv/incubating/process_attributes.h" #include "opentelemetry/semconv/service_attributes.h" #include "opentelemetry/semconv/telemetry_attributes.h" -#include "opentelemetry/semconv/incubating/process_attributes.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE From c427131165d4d92c6b9aeab2f263a1df9ab13263 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Sat, 19 Oct 2024 22:03:04 +0200 Subject: [PATCH 06/16] added metrics (draft) --- .../opentelemetry/semconv/http_metrics.h | 78 ++ .../semconv/incubating/container_metrics.h | 124 +++ .../semconv/incubating/db_metrics.h | 574 +++++++++++++ .../semconv/incubating/dns_metrics.h | 48 ++ .../semconv/incubating/faas_metrics.h | 232 ++++++ .../semconv/incubating/gen_ai_metrics.h | 157 ++++ .../semconv/incubating/http_metrics.h | 304 +++++++ .../semconv/incubating/messaging_metrics.h | 289 +++++++ .../semconv/incubating/process_metrics.h | 267 ++++++ .../semconv/incubating/rpc_metrics.h | 311 +++++++ .../semconv/incubating/system_metrics.h | 758 ++++++++++++++++++ .../templates/registry/semantic_metrics-h.j2 | 230 +++--- .../templates/registry/weaver.yaml | 51 +- 13 files changed, 3318 insertions(+), 105 deletions(-) create mode 100644 api/include/opentelemetry/semconv/http_metrics.h create mode 100644 api/include/opentelemetry/semconv/incubating/container_metrics.h create mode 100644 api/include/opentelemetry/semconv/incubating/db_metrics.h create mode 100644 api/include/opentelemetry/semconv/incubating/dns_metrics.h create mode 100644 api/include/opentelemetry/semconv/incubating/faas_metrics.h create mode 100644 api/include/opentelemetry/semconv/incubating/gen_ai_metrics.h create mode 100644 api/include/opentelemetry/semconv/incubating/http_metrics.h create mode 100644 api/include/opentelemetry/semconv/incubating/messaging_metrics.h create mode 100644 api/include/opentelemetry/semconv/incubating/process_metrics.h create mode 100644 api/include/opentelemetry/semconv/incubating/rpc_metrics.h create mode 100644 api/include/opentelemetry/semconv/incubating/system_metrics.h diff --git a/api/include/opentelemetry/semconv/http_metrics.h b/api/include/opentelemetry/semconv/http_metrics.h new file mode 100644 index 0000000000..ab698d3984 --- /dev/null +++ b/api/include/opentelemetry/semconv/http_metrics.h @@ -0,0 +1,78 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace http +{ + +/** + * Duration of HTTP client requests. + *

+ * histogram + */ +static constexpr const char *kMetricHttpClientRequestDuration = + "metric.http.client.request.duration"; +static constexpr const char *descrMetricHttpClientRequestDuration = + "Duration of HTTP client requests."; +static constexpr const char *unitMetricHttpClientRequestDuration = "s"; + +static nostd::unique_ptr> CreateSyncMetricHttpClientRequestDuration( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricHttpClientRequestDuration, + descrMetricHttpClientRequestDuration, + unitMetricHttpClientRequestDuration); +} + +static nostd::shared_ptr CreateAsyncMetricHttpClientRequestDuration( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricHttpClientRequestDuration, + descrMetricHttpClientRequestDuration, + unitMetricHttpClientRequestDuration); +} + +/** + * Duration of HTTP server requests. + *

+ * histogram + */ +static constexpr const char *kMetricHttpServerRequestDuration = + "metric.http.server.request.duration"; +static constexpr const char *descrMetricHttpServerRequestDuration = + "Duration of HTTP server requests."; +static constexpr const char *unitMetricHttpServerRequestDuration = "s"; + +static nostd::unique_ptr> CreateSyncMetricHttpServerRequestDuration( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricHttpServerRequestDuration, + descrMetricHttpServerRequestDuration, + unitMetricHttpServerRequestDuration); +} + +static nostd::shared_ptr CreateAsyncMetricHttpServerRequestDuration( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricHttpServerRequestDuration, + descrMetricHttpServerRequestDuration, + unitMetricHttpServerRequestDuration); +} + +} // namespace http +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/container_metrics.h b/api/include/opentelemetry/semconv/incubating/container_metrics.h new file mode 100644 index 0000000000..450d334926 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/container_metrics.h @@ -0,0 +1,124 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace container +{ + +/** + * Total CPU time consumed + *

+ * Total CPU time consumed by the specific container on all available CPU cores + *

+ * counter + */ +static constexpr const char *kMetricContainerCpuTime = "metric.container.cpu.time"; +static constexpr const char *descrMetricContainerCpuTime = "Total CPU time consumed"; +static constexpr const char *unitMetricContainerCpuTime = "s"; + +static nostd::unique_ptr> CreateSyncMetricContainerCpuTime( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricContainerCpuTime, descrMetricContainerCpuTime, + unitMetricContainerCpuTime); +} + +static nostd::shared_ptr CreateAsyncMetricContainerCpuTime( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricContainerCpuTime, descrMetricContainerCpuTime, + unitMetricContainerCpuTime); +} + +/** + * Disk bytes for the container. + *

+ * The total number of bytes read/written successfully (aggregated from all disks). + *

+ * counter + */ +static constexpr const char *kMetricContainerDiskIo = "metric.container.disk.io"; +static constexpr const char *descrMetricContainerDiskIo = "Disk bytes for the container."; +static constexpr const char *unitMetricContainerDiskIo = "By"; + +static nostd::unique_ptr> CreateSyncMetricContainerDiskIo( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricContainerDiskIo, descrMetricContainerDiskIo, + unitMetricContainerDiskIo); +} + +static nostd::shared_ptr CreateAsyncMetricContainerDiskIo( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricContainerDiskIo, descrMetricContainerDiskIo, + unitMetricContainerDiskIo); +} + +/** + * Memory usage of the container. + *

+ * Memory usage of the container. + *

+ * counter + */ +static constexpr const char *kMetricContainerMemoryUsage = "metric.container.memory.usage"; +static constexpr const char *descrMetricContainerMemoryUsage = "Memory usage of the container."; +static constexpr const char *unitMetricContainerMemoryUsage = "By"; + +static nostd::unique_ptr> CreateSyncMetricContainerMemoryUsage( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricContainerMemoryUsage, descrMetricContainerMemoryUsage, + unitMetricContainerMemoryUsage); +} + +static nostd::shared_ptr CreateAsyncMetricContainerMemoryUsage( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter( + kMetricContainerMemoryUsage, descrMetricContainerMemoryUsage, unitMetricContainerMemoryUsage); +} + +/** + * Network bytes for the container. + *

+ * The number of bytes sent/received on all network interfaces by the container. + *

+ * counter + */ +static constexpr const char *kMetricContainerNetworkIo = "metric.container.network.io"; +static constexpr const char *descrMetricContainerNetworkIo = "Network bytes for the container."; +static constexpr const char *unitMetricContainerNetworkIo = "By"; + +static nostd::unique_ptr> CreateSyncMetricContainerNetworkIo( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricContainerNetworkIo, descrMetricContainerNetworkIo, + unitMetricContainerNetworkIo); +} + +static nostd::shared_ptr CreateAsyncMetricContainerNetworkIo( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter( + kMetricContainerNetworkIo, descrMetricContainerNetworkIo, unitMetricContainerNetworkIo); +} + +} // namespace container +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/db_metrics.h b/api/include/opentelemetry/semconv/incubating/db_metrics.h new file mode 100644 index 0000000000..a2bda6b9c3 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/db_metrics.h @@ -0,0 +1,574 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace db +{ + +/** + * The number of connections that are currently in state described by the @code state @endcode + * attribute

updowncounter + */ +static constexpr const char *kMetricDbClientConnectionCount = "metric.db.client.connection.count"; +static constexpr const char *descrMetricDbClientConnectionCount = + "The number of connections that are currently in state described by the `state` attribute"; +static constexpr const char *unitMetricDbClientConnectionCount = "{connection}"; + +static nostd::unique_ptr> CreateSyncMetricDbClientConnectionCount( + metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricDbClientConnectionCount, + descrMetricDbClientConnectionCount, + unitMetricDbClientConnectionCount); +} + +static nostd::shared_ptr CreateAsyncMetricDbClientConnectionCount( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricDbClientConnectionCount, + descrMetricDbClientConnectionCount, + unitMetricDbClientConnectionCount); +} + +/** + * The time it took to create a new connection + *

+ * histogram + */ +static constexpr const char *kMetricDbClientConnectionCreateTime = + "metric.db.client.connection.create_time"; +static constexpr const char *descrMetricDbClientConnectionCreateTime = + "The time it took to create a new connection"; +static constexpr const char *unitMetricDbClientConnectionCreateTime = "s"; + +static nostd::unique_ptr> CreateSyncMetricDbClientConnectionCreateTime( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricDbClientConnectionCreateTime, + descrMetricDbClientConnectionCreateTime, + unitMetricDbClientConnectionCreateTime); +} + +static nostd::shared_ptr +CreateAsyncMetricDbClientConnectionCreateTime(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricDbClientConnectionCreateTime, + descrMetricDbClientConnectionCreateTime, + unitMetricDbClientConnectionCreateTime); +} + +/** + * The maximum number of idle open connections allowed + *

+ * updowncounter + */ +static constexpr const char *kMetricDbClientConnectionIdleMax = + "metric.db.client.connection.idle.max"; +static constexpr const char *descrMetricDbClientConnectionIdleMax = + "The maximum number of idle open connections allowed"; +static constexpr const char *unitMetricDbClientConnectionIdleMax = "{connection}"; + +static nostd::unique_ptr> +CreateSyncMetricDbClientConnectionIdleMax(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricDbClientConnectionIdleMax, + descrMetricDbClientConnectionIdleMax, + unitMetricDbClientConnectionIdleMax); +} + +static nostd::shared_ptr CreateAsyncMetricDbClientConnectionIdleMax( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricDbClientConnectionIdleMax, + descrMetricDbClientConnectionIdleMax, + unitMetricDbClientConnectionIdleMax); +} + +/** + * The minimum number of idle open connections allowed + *

+ * updowncounter + */ +static constexpr const char *kMetricDbClientConnectionIdleMin = + "metric.db.client.connection.idle.min"; +static constexpr const char *descrMetricDbClientConnectionIdleMin = + "The minimum number of idle open connections allowed"; +static constexpr const char *unitMetricDbClientConnectionIdleMin = "{connection}"; + +static nostd::unique_ptr> +CreateSyncMetricDbClientConnectionIdleMin(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricDbClientConnectionIdleMin, + descrMetricDbClientConnectionIdleMin, + unitMetricDbClientConnectionIdleMin); +} + +static nostd::shared_ptr CreateAsyncMetricDbClientConnectionIdleMin( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricDbClientConnectionIdleMin, + descrMetricDbClientConnectionIdleMin, + unitMetricDbClientConnectionIdleMin); +} + +/** + * The maximum number of open connections allowed + *

+ * updowncounter + */ +static constexpr const char *kMetricDbClientConnectionMax = "metric.db.client.connection.max"; +static constexpr const char *descrMetricDbClientConnectionMax = + "The maximum number of open connections allowed"; +static constexpr const char *unitMetricDbClientConnectionMax = "{connection}"; + +static nostd::unique_ptr> CreateSyncMetricDbClientConnectionMax( + metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricDbClientConnectionMax, + descrMetricDbClientConnectionMax, + unitMetricDbClientConnectionMax); +} + +static nostd::shared_ptr CreateAsyncMetricDbClientConnectionMax( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricDbClientConnectionMax, + descrMetricDbClientConnectionMax, + unitMetricDbClientConnectionMax); +} + +/** + * The number of pending requests for an open connection, cumulative for the entire pool + *

+ * updowncounter + */ +static constexpr const char *kMetricDbClientConnectionPendingRequests = + "metric.db.client.connection.pending_requests"; +static constexpr const char *descrMetricDbClientConnectionPendingRequests = + "The number of pending requests for an open connection, cumulative for the entire pool"; +static constexpr const char *unitMetricDbClientConnectionPendingRequests = "{request}"; + +static nostd::unique_ptr> +CreateSyncMetricDbClientConnectionPendingRequests(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricDbClientConnectionPendingRequests, + descrMetricDbClientConnectionPendingRequests, + unitMetricDbClientConnectionPendingRequests); +} + +static nostd::shared_ptr +CreateAsyncMetricDbClientConnectionPendingRequests(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricDbClientConnectionPendingRequests, + descrMetricDbClientConnectionPendingRequests, + unitMetricDbClientConnectionPendingRequests); +} + +/** + * The number of connection timeouts that have occurred trying to obtain a connection from the pool + *

+ * counter + */ +static constexpr const char *kMetricDbClientConnectionTimeouts = + "metric.db.client.connection.timeouts"; +static constexpr const char *descrMetricDbClientConnectionTimeouts = + "The number of connection timeouts that have occurred trying to obtain a connection from the " + "pool"; +static constexpr const char *unitMetricDbClientConnectionTimeouts = "{timeout}"; + +static nostd::unique_ptr> CreateSyncMetricDbClientConnectionTimeouts( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricDbClientConnectionTimeouts, + descrMetricDbClientConnectionTimeouts, + unitMetricDbClientConnectionTimeouts); +} + +static nostd::shared_ptr CreateAsyncMetricDbClientConnectionTimeouts( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricDbClientConnectionTimeouts, + descrMetricDbClientConnectionTimeouts, + unitMetricDbClientConnectionTimeouts); +} + +/** + * The time between borrowing a connection and returning it to the pool + *

+ * histogram + */ +static constexpr const char *kMetricDbClientConnectionUseTime = + "metric.db.client.connection.use_time"; +static constexpr const char *descrMetricDbClientConnectionUseTime = + "The time between borrowing a connection and returning it to the pool"; +static constexpr const char *unitMetricDbClientConnectionUseTime = "s"; + +static nostd::unique_ptr> CreateSyncMetricDbClientConnectionUseTime( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricDbClientConnectionUseTime, + descrMetricDbClientConnectionUseTime, + unitMetricDbClientConnectionUseTime); +} + +static nostd::shared_ptr CreateAsyncMetricDbClientConnectionUseTime( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricDbClientConnectionUseTime, + descrMetricDbClientConnectionUseTime, + unitMetricDbClientConnectionUseTime); +} + +/** + * The time it took to obtain an open connection from the pool + *

+ * histogram + */ +static constexpr const char *kMetricDbClientConnectionWaitTime = + "metric.db.client.connection.wait_time"; +static constexpr const char *descrMetricDbClientConnectionWaitTime = + "The time it took to obtain an open connection from the pool"; +static constexpr const char *unitMetricDbClientConnectionWaitTime = "s"; + +static nostd::unique_ptr> CreateSyncMetricDbClientConnectionWaitTime( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricDbClientConnectionWaitTime, + descrMetricDbClientConnectionWaitTime, + unitMetricDbClientConnectionWaitTime); +} + +static nostd::shared_ptr CreateAsyncMetricDbClientConnectionWaitTime( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricDbClientConnectionWaitTime, + descrMetricDbClientConnectionWaitTime, + unitMetricDbClientConnectionWaitTime); +} + +/** + * Deprecated, use @code db.client.connection.create_time @endcode instead. Note: the unit also + * changed from @code ms @endcode to @code s @endcode.

+ * @deprecated + * Replaced by @code db.client.connection.create_time @endcode. Note: the unit also changed from + * @code ms @endcode to @code s @endcode.

histogram + */ +OPENTELEMETRY_DEPRECATED +static constexpr const char *kMetricDbClientConnectionsCreateTimeDeprecated = + "metric.db.client.connections.create_time.deprecated"; +static constexpr const char *descrMetricDbClientConnectionsCreateTimeDeprecated = + "Deprecated, use `db.client.connection.create_time` instead. Note: the unit also changed from " + "`ms` to `s`."; +static constexpr const char *unitMetricDbClientConnectionsCreateTimeDeprecated = "ms"; + +static nostd::unique_ptr> +CreateSyncMetricDbClientConnectionsCreateTimeDeprecated(metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricDbClientConnectionsCreateTimeDeprecated, + descrMetricDbClientConnectionsCreateTimeDeprecated, + unitMetricDbClientConnectionsCreateTimeDeprecated); +} + +static nostd::shared_ptr +CreateAsyncMetricDbClientConnectionsCreateTimeDeprecated(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricDbClientConnectionsCreateTimeDeprecated, + descrMetricDbClientConnectionsCreateTimeDeprecated, + unitMetricDbClientConnectionsCreateTimeDeprecated); +} + +/** + * Deprecated, use @code db.client.connection.idle.max @endcode instead. + *

+ * @deprecated + * Replaced by @code db.client.connection.idle.max @endcode. + *

+ * updowncounter + */ +OPENTELEMETRY_DEPRECATED +static constexpr const char *kMetricDbClientConnectionsIdleMaxDeprecated = + "metric.db.client.connections.idle.max.deprecated"; +static constexpr const char *descrMetricDbClientConnectionsIdleMaxDeprecated = + "Deprecated, use `db.client.connection.idle.max` instead."; +static constexpr const char *unitMetricDbClientConnectionsIdleMaxDeprecated = "{connection}"; + +static nostd::unique_ptr> +CreateSyncMetricDbClientConnectionsIdleMaxDeprecated(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricDbClientConnectionsIdleMaxDeprecated, + descrMetricDbClientConnectionsIdleMaxDeprecated, + unitMetricDbClientConnectionsIdleMaxDeprecated); +} + +static nostd::shared_ptr +CreateAsyncMetricDbClientConnectionsIdleMaxDeprecated(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricDbClientConnectionsIdleMaxDeprecated, + descrMetricDbClientConnectionsIdleMaxDeprecated, + unitMetricDbClientConnectionsIdleMaxDeprecated); +} + +/** + * Deprecated, use @code db.client.connection.idle.min @endcode instead. + *

+ * @deprecated + * Replaced by @code db.client.connection.idle.min @endcode. + *

+ * updowncounter + */ +OPENTELEMETRY_DEPRECATED +static constexpr const char *kMetricDbClientConnectionsIdleMinDeprecated = + "metric.db.client.connections.idle.min.deprecated"; +static constexpr const char *descrMetricDbClientConnectionsIdleMinDeprecated = + "Deprecated, use `db.client.connection.idle.min` instead."; +static constexpr const char *unitMetricDbClientConnectionsIdleMinDeprecated = "{connection}"; + +static nostd::unique_ptr> +CreateSyncMetricDbClientConnectionsIdleMinDeprecated(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricDbClientConnectionsIdleMinDeprecated, + descrMetricDbClientConnectionsIdleMinDeprecated, + unitMetricDbClientConnectionsIdleMinDeprecated); +} + +static nostd::shared_ptr +CreateAsyncMetricDbClientConnectionsIdleMinDeprecated(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricDbClientConnectionsIdleMinDeprecated, + descrMetricDbClientConnectionsIdleMinDeprecated, + unitMetricDbClientConnectionsIdleMinDeprecated); +} + +/** + * Deprecated, use @code db.client.connection.max @endcode instead. + *

+ * @deprecated + * Replaced by @code db.client.connection.max @endcode. + *

+ * updowncounter + */ +OPENTELEMETRY_DEPRECATED +static constexpr const char *kMetricDbClientConnectionsMaxDeprecated = + "metric.db.client.connections.max.deprecated"; +static constexpr const char *descrMetricDbClientConnectionsMaxDeprecated = + "Deprecated, use `db.client.connection.max` instead."; +static constexpr const char *unitMetricDbClientConnectionsMaxDeprecated = "{connection}"; + +static nostd::unique_ptr> +CreateSyncMetricDbClientConnectionsMaxDeprecated(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricDbClientConnectionsMaxDeprecated, + descrMetricDbClientConnectionsMaxDeprecated, + unitMetricDbClientConnectionsMaxDeprecated); +} + +static nostd::shared_ptr +CreateAsyncMetricDbClientConnectionsMaxDeprecated(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricDbClientConnectionsMaxDeprecated, + descrMetricDbClientConnectionsMaxDeprecated, + unitMetricDbClientConnectionsMaxDeprecated); +} + +/** + * Deprecated, use @code db.client.connection.pending_requests @endcode instead. + *

+ * @deprecated + * Replaced by @code db.client.connection.pending_requests @endcode. + *

+ * updowncounter + */ +OPENTELEMETRY_DEPRECATED +static constexpr const char *kMetricDbClientConnectionsPendingRequestsDeprecated = + "metric.db.client.connections.pending_requests.deprecated"; +static constexpr const char *descrMetricDbClientConnectionsPendingRequestsDeprecated = + "Deprecated, use `db.client.connection.pending_requests` instead."; +static constexpr const char *unitMetricDbClientConnectionsPendingRequestsDeprecated = "{request}"; + +static nostd::unique_ptr> +CreateSyncMetricDbClientConnectionsPendingRequestsDeprecated(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricDbClientConnectionsPendingRequestsDeprecated, + descrMetricDbClientConnectionsPendingRequestsDeprecated, + unitMetricDbClientConnectionsPendingRequestsDeprecated); +} + +static nostd::shared_ptr +CreateAsyncMetricDbClientConnectionsPendingRequestsDeprecated(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter( + kMetricDbClientConnectionsPendingRequestsDeprecated, + descrMetricDbClientConnectionsPendingRequestsDeprecated, + unitMetricDbClientConnectionsPendingRequestsDeprecated); +} + +/** + * Deprecated, use @code db.client.connection.timeouts @endcode instead. + *

+ * @deprecated + * Replaced by @code db.client.connection.timeouts @endcode. + *

+ * counter + */ +OPENTELEMETRY_DEPRECATED +static constexpr const char *kMetricDbClientConnectionsTimeoutsDeprecated = + "metric.db.client.connections.timeouts.deprecated"; +static constexpr const char *descrMetricDbClientConnectionsTimeoutsDeprecated = + "Deprecated, use `db.client.connection.timeouts` instead."; +static constexpr const char *unitMetricDbClientConnectionsTimeoutsDeprecated = "{timeout}"; + +static nostd::unique_ptr> +CreateSyncMetricDbClientConnectionsTimeoutsDeprecated(metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricDbClientConnectionsTimeoutsDeprecated, + descrMetricDbClientConnectionsTimeoutsDeprecated, + unitMetricDbClientConnectionsTimeoutsDeprecated); +} + +static nostd::shared_ptr +CreateAsyncMetricDbClientConnectionsTimeoutsDeprecated(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricDbClientConnectionsTimeoutsDeprecated, + descrMetricDbClientConnectionsTimeoutsDeprecated, + unitMetricDbClientConnectionsTimeoutsDeprecated); +} + +/** + * Deprecated, use @code db.client.connection.count @endcode instead. + *

+ * @deprecated + * Replaced by @code db.client.connection.count @endcode. + *

+ * updowncounter + */ +OPENTELEMETRY_DEPRECATED +static constexpr const char *kMetricDbClientConnectionsCountDeprecated = + "metric.db.client.connections.count.deprecated"; +static constexpr const char *descrMetricDbClientConnectionsCountDeprecated = + "Deprecated, use `db.client.connection.count` instead."; +static constexpr const char *unitMetricDbClientConnectionsCountDeprecated = "{connection}"; + +static nostd::unique_ptr> +CreateSyncMetricDbClientConnectionsCountDeprecated(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricDbClientConnectionsCountDeprecated, + descrMetricDbClientConnectionsCountDeprecated, + unitMetricDbClientConnectionsCountDeprecated); +} + +static nostd::shared_ptr +CreateAsyncMetricDbClientConnectionsCountDeprecated(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricDbClientConnectionsCountDeprecated, + descrMetricDbClientConnectionsCountDeprecated, + unitMetricDbClientConnectionsCountDeprecated); +} + +/** + * Deprecated, use @code db.client.connection.use_time @endcode instead. Note: the unit also changed + * from @code ms @endcode to @code s @endcode.

+ * @deprecated + * Replaced by @code db.client.connection.use_time @endcode. Note: the unit also changed from @code + * ms @endcode to @code s @endcode.

histogram + */ +OPENTELEMETRY_DEPRECATED +static constexpr const char *kMetricDbClientConnectionsUseTimeDeprecated = + "metric.db.client.connections.use_time.deprecated"; +static constexpr const char *descrMetricDbClientConnectionsUseTimeDeprecated = + "Deprecated, use `db.client.connection.use_time` instead. Note: the unit also changed from " + "`ms` to `s`."; +static constexpr const char *unitMetricDbClientConnectionsUseTimeDeprecated = "ms"; + +static nostd::unique_ptr> +CreateSyncMetricDbClientConnectionsUseTimeDeprecated(metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricDbClientConnectionsUseTimeDeprecated, + descrMetricDbClientConnectionsUseTimeDeprecated, + unitMetricDbClientConnectionsUseTimeDeprecated); +} + +static nostd::shared_ptr +CreateAsyncMetricDbClientConnectionsUseTimeDeprecated(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricDbClientConnectionsUseTimeDeprecated, + descrMetricDbClientConnectionsUseTimeDeprecated, + unitMetricDbClientConnectionsUseTimeDeprecated); +} + +/** + * Deprecated, use @code db.client.connection.wait_time @endcode instead. Note: the unit also + * changed from @code ms @endcode to @code s @endcode.

+ * @deprecated + * Replaced by @code db.client.connection.wait_time @endcode. Note: the unit also changed from @code + * ms @endcode to @code s @endcode.

histogram + */ +OPENTELEMETRY_DEPRECATED +static constexpr const char *kMetricDbClientConnectionsWaitTimeDeprecated = + "metric.db.client.connections.wait_time.deprecated"; +static constexpr const char *descrMetricDbClientConnectionsWaitTimeDeprecated = + "Deprecated, use `db.client.connection.wait_time` instead. Note: the unit also changed from " + "`ms` to `s`."; +static constexpr const char *unitMetricDbClientConnectionsWaitTimeDeprecated = "ms"; + +static nostd::unique_ptr> +CreateSyncMetricDbClientConnectionsWaitTimeDeprecated(metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricDbClientConnectionsWaitTimeDeprecated, + descrMetricDbClientConnectionsWaitTimeDeprecated, + unitMetricDbClientConnectionsWaitTimeDeprecated); +} + +static nostd::shared_ptr +CreateAsyncMetricDbClientConnectionsWaitTimeDeprecated(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricDbClientConnectionsWaitTimeDeprecated, + descrMetricDbClientConnectionsWaitTimeDeprecated, + unitMetricDbClientConnectionsWaitTimeDeprecated); +} + +/** + * Duration of database client operations. + *

+ * Batch operations SHOULD be recorded as a single operation. + *

+ * histogram + */ +static constexpr const char *kMetricDbClientOperationDuration = + "metric.db.client.operation.duration"; +static constexpr const char *descrMetricDbClientOperationDuration = + "Duration of database client operations."; +static constexpr const char *unitMetricDbClientOperationDuration = "s"; + +static nostd::unique_ptr> CreateSyncMetricDbClientOperationDuration( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricDbClientOperationDuration, + descrMetricDbClientOperationDuration, + unitMetricDbClientOperationDuration); +} + +static nostd::shared_ptr CreateAsyncMetricDbClientOperationDuration( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricDbClientOperationDuration, + descrMetricDbClientOperationDuration, + unitMetricDbClientOperationDuration); +} + +} // namespace db +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/dns_metrics.h b/api/include/opentelemetry/semconv/incubating/dns_metrics.h new file mode 100644 index 0000000000..abd9513a0c --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/dns_metrics.h @@ -0,0 +1,48 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace dns +{ + +/** + * Measures the time taken to perform a DNS lookup. + *

+ * histogram + */ +static constexpr const char *kMetricDnsLookupDuration = "metric.dns.lookup.duration"; +static constexpr const char *descrMetricDnsLookupDuration = + "Measures the time taken to perform a DNS lookup."; +static constexpr const char *unitMetricDnsLookupDuration = "s"; + +static nostd::unique_ptr> CreateSyncMetricDnsLookupDuration( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricDnsLookupDuration, descrMetricDnsLookupDuration, + unitMetricDnsLookupDuration); +} + +static nostd::shared_ptr CreateAsyncMetricDnsLookupDuration( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram( + kMetricDnsLookupDuration, descrMetricDnsLookupDuration, unitMetricDnsLookupDuration); +} + +} // namespace dns +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/faas_metrics.h b/api/include/opentelemetry/semconv/incubating/faas_metrics.h new file mode 100644 index 0000000000..fcfdfad251 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/faas_metrics.h @@ -0,0 +1,232 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace faas +{ + +/** + * Number of invocation cold starts + *

+ * counter + */ +static constexpr const char *kMetricFaasColdstarts = "metric.faas.coldstarts"; +static constexpr const char *descrMetricFaasColdstarts = "Number of invocation cold starts"; +static constexpr const char *unitMetricFaasColdstarts = "{coldstart}"; + +static nostd::unique_ptr> CreateSyncMetricFaasColdstarts( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricFaasColdstarts, descrMetricFaasColdstarts, + unitMetricFaasColdstarts); +} + +static nostd::shared_ptr CreateAsyncMetricFaasColdstarts( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricFaasColdstarts, descrMetricFaasColdstarts, + unitMetricFaasColdstarts); +} + +/** + * Distribution of CPU usage per invocation + *

+ * histogram + */ +static constexpr const char *kMetricFaasCpuUsage = "metric.faas.cpu_usage"; +static constexpr const char *descrMetricFaasCpuUsage = "Distribution of CPU usage per invocation"; +static constexpr const char *unitMetricFaasCpuUsage = "s"; + +static nostd::unique_ptr> CreateSyncMetricFaasCpuUsage( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricFaasCpuUsage, descrMetricFaasCpuUsage, + unitMetricFaasCpuUsage); +} + +static nostd::shared_ptr CreateAsyncMetricFaasCpuUsage( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricFaasCpuUsage, descrMetricFaasCpuUsage, + unitMetricFaasCpuUsage); +} + +/** + * Number of invocation errors + *

+ * counter + */ +static constexpr const char *kMetricFaasErrors = "metric.faas.errors"; +static constexpr const char *descrMetricFaasErrors = "Number of invocation errors"; +static constexpr const char *unitMetricFaasErrors = "{error}"; + +static nostd::unique_ptr> CreateSyncMetricFaasErrors( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricFaasErrors, descrMetricFaasErrors, unitMetricFaasErrors); +} + +static nostd::shared_ptr CreateAsyncMetricFaasErrors( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricFaasErrors, descrMetricFaasErrors, + unitMetricFaasErrors); +} + +/** + * Measures the duration of the function's initialization, such as a cold start + *

+ * histogram + */ +static constexpr const char *kMetricFaasInitDuration = "metric.faas.init_duration"; +static constexpr const char *descrMetricFaasInitDuration = + "Measures the duration of the function's initialization, such as a cold start"; +static constexpr const char *unitMetricFaasInitDuration = "s"; + +static nostd::unique_ptr> CreateSyncMetricFaasInitDuration( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricFaasInitDuration, descrMetricFaasInitDuration, + unitMetricFaasInitDuration); +} + +static nostd::shared_ptr CreateAsyncMetricFaasInitDuration( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricFaasInitDuration, descrMetricFaasInitDuration, + unitMetricFaasInitDuration); +} + +/** + * Number of successful invocations + *

+ * counter + */ +static constexpr const char *kMetricFaasInvocations = "metric.faas.invocations"; +static constexpr const char *descrMetricFaasInvocations = "Number of successful invocations"; +static constexpr const char *unitMetricFaasInvocations = "{invocation}"; + +static nostd::unique_ptr> CreateSyncMetricFaasInvocations( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricFaasInvocations, descrMetricFaasInvocations, + unitMetricFaasInvocations); +} + +static nostd::shared_ptr CreateAsyncMetricFaasInvocations( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricFaasInvocations, descrMetricFaasInvocations, + unitMetricFaasInvocations); +} + +/** + * Measures the duration of the function's logic execution + *

+ * histogram + */ +static constexpr const char *kMetricFaasInvokeDuration = "metric.faas.invoke_duration"; +static constexpr const char *descrMetricFaasInvokeDuration = + "Measures the duration of the function's logic execution"; +static constexpr const char *unitMetricFaasInvokeDuration = "s"; + +static nostd::unique_ptr> CreateSyncMetricFaasInvokeDuration( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricFaasInvokeDuration, descrMetricFaasInvokeDuration, + unitMetricFaasInvokeDuration); +} + +static nostd::shared_ptr CreateAsyncMetricFaasInvokeDuration( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram( + kMetricFaasInvokeDuration, descrMetricFaasInvokeDuration, unitMetricFaasInvokeDuration); +} + +/** + * Distribution of max memory usage per invocation + *

+ * histogram + */ +static constexpr const char *kMetricFaasMemUsage = "metric.faas.mem_usage"; +static constexpr const char *descrMetricFaasMemUsage = + "Distribution of max memory usage per invocation"; +static constexpr const char *unitMetricFaasMemUsage = "By"; + +static nostd::unique_ptr> CreateSyncMetricFaasMemUsage( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricFaasMemUsage, descrMetricFaasMemUsage, + unitMetricFaasMemUsage); +} + +static nostd::shared_ptr CreateAsyncMetricFaasMemUsage( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricFaasMemUsage, descrMetricFaasMemUsage, + unitMetricFaasMemUsage); +} + +/** + * Distribution of net I/O usage per invocation + *

+ * histogram + */ +static constexpr const char *kMetricFaasNetIo = "metric.faas.net_io"; +static constexpr const char *descrMetricFaasNetIo = "Distribution of net I/O usage per invocation"; +static constexpr const char *unitMetricFaasNetIo = "By"; + +static nostd::unique_ptr> CreateSyncMetricFaasNetIo( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricFaasNetIo, descrMetricFaasNetIo, unitMetricFaasNetIo); +} + +static nostd::shared_ptr CreateAsyncMetricFaasNetIo( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricFaasNetIo, descrMetricFaasNetIo, + unitMetricFaasNetIo); +} + +/** + * Number of invocation timeouts + *

+ * counter + */ +static constexpr const char *kMetricFaasTimeouts = "metric.faas.timeouts"; +static constexpr const char *descrMetricFaasTimeouts = "Number of invocation timeouts"; +static constexpr const char *unitMetricFaasTimeouts = "{timeout}"; + +static nostd::unique_ptr> CreateSyncMetricFaasTimeouts( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricFaasTimeouts, descrMetricFaasTimeouts, + unitMetricFaasTimeouts); +} + +static nostd::shared_ptr CreateAsyncMetricFaasTimeouts( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricFaasTimeouts, descrMetricFaasTimeouts, + unitMetricFaasTimeouts); +} + +} // namespace faas +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/gen_ai_metrics.h b/api/include/opentelemetry/semconv/incubating/gen_ai_metrics.h new file mode 100644 index 0000000000..48db5b7351 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/gen_ai_metrics.h @@ -0,0 +1,157 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace gen_ai +{ + +/** + * GenAI operation duration + *

+ * histogram + */ +static constexpr const char *kMetricGenAiClientOperationDuration = + "metric.gen_ai.client.operation.duration"; +static constexpr const char *descrMetricGenAiClientOperationDuration = "GenAI operation duration"; +static constexpr const char *unitMetricGenAiClientOperationDuration = "s"; + +static nostd::unique_ptr> CreateSyncMetricGenAiClientOperationDuration( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricGenAiClientOperationDuration, + descrMetricGenAiClientOperationDuration, + unitMetricGenAiClientOperationDuration); +} + +static nostd::shared_ptr +CreateAsyncMetricGenAiClientOperationDuration(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricGenAiClientOperationDuration, + descrMetricGenAiClientOperationDuration, + unitMetricGenAiClientOperationDuration); +} + +/** + * Measures number of input and output tokens used + *

+ * histogram + */ +static constexpr const char *kMetricGenAiClientTokenUsage = "metric.gen_ai.client.token.usage"; +static constexpr const char *descrMetricGenAiClientTokenUsage = + "Measures number of input and output tokens used"; +static constexpr const char *unitMetricGenAiClientTokenUsage = "{token}"; + +static nostd::unique_ptr> CreateSyncMetricGenAiClientTokenUsage( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricGenAiClientTokenUsage, + descrMetricGenAiClientTokenUsage, + unitMetricGenAiClientTokenUsage); +} + +static nostd::shared_ptr CreateAsyncMetricGenAiClientTokenUsage( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricGenAiClientTokenUsage, + descrMetricGenAiClientTokenUsage, + unitMetricGenAiClientTokenUsage); +} + +/** + * Generative AI server request duration such as time-to-last byte or last output token + *

+ * histogram + */ +static constexpr const char *kMetricGenAiServerRequestDuration = + "metric.gen_ai.server.request.duration"; +static constexpr const char *descrMetricGenAiServerRequestDuration = + "Generative AI server request duration such as time-to-last byte or last output token"; +static constexpr const char *unitMetricGenAiServerRequestDuration = "s"; + +static nostd::unique_ptr> CreateSyncMetricGenAiServerRequestDuration( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricGenAiServerRequestDuration, + descrMetricGenAiServerRequestDuration, + unitMetricGenAiServerRequestDuration); +} + +static nostd::shared_ptr CreateAsyncMetricGenAiServerRequestDuration( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricGenAiServerRequestDuration, + descrMetricGenAiServerRequestDuration, + unitMetricGenAiServerRequestDuration); +} + +/** + * Time per output token generated after the first token for successful responses + *

+ * histogram + */ +static constexpr const char *kMetricGenAiServerTimePerOutputToken = + "metric.gen_ai.server.time_per_output_token"; +static constexpr const char *descrMetricGenAiServerTimePerOutputToken = + "Time per output token generated after the first token for successful responses"; +static constexpr const char *unitMetricGenAiServerTimePerOutputToken = "s"; + +static nostd::unique_ptr> +CreateSyncMetricGenAiServerTimePerOutputToken(metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricGenAiServerTimePerOutputToken, + descrMetricGenAiServerTimePerOutputToken, + unitMetricGenAiServerTimePerOutputToken); +} + +static nostd::shared_ptr +CreateAsyncMetricGenAiServerTimePerOutputToken(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricGenAiServerTimePerOutputToken, + descrMetricGenAiServerTimePerOutputToken, + unitMetricGenAiServerTimePerOutputToken); +} + +/** + * Time to generate first token for successful responses + *

+ * histogram + */ +static constexpr const char *kMetricGenAiServerTimeToFirstToken = + "metric.gen_ai.server.time_to_first_token"; +static constexpr const char *descrMetricGenAiServerTimeToFirstToken = + "Time to generate first token for successful responses"; +static constexpr const char *unitMetricGenAiServerTimeToFirstToken = "s"; + +static nostd::unique_ptr> CreateSyncMetricGenAiServerTimeToFirstToken( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricGenAiServerTimeToFirstToken, + descrMetricGenAiServerTimeToFirstToken, + unitMetricGenAiServerTimeToFirstToken); +} + +static nostd::shared_ptr +CreateAsyncMetricGenAiServerTimeToFirstToken(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricGenAiServerTimeToFirstToken, + descrMetricGenAiServerTimeToFirstToken, + unitMetricGenAiServerTimeToFirstToken); +} + +} // namespace gen_ai +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/http_metrics.h b/api/include/opentelemetry/semconv/incubating/http_metrics.h new file mode 100644 index 0000000000..a2820feced --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/http_metrics.h @@ -0,0 +1,304 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace http +{ + +/** + * Number of active HTTP requests. + *

+ * updowncounter + */ +static constexpr const char *kMetricHttpClientActiveRequests = "metric.http.client.active_requests"; +static constexpr const char *descrMetricHttpClientActiveRequests = + "Number of active HTTP requests."; +static constexpr const char *unitMetricHttpClientActiveRequests = "{request}"; + +static nostd::unique_ptr> CreateSyncMetricHttpClientActiveRequests( + metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricHttpClientActiveRequests, + descrMetricHttpClientActiveRequests, + unitMetricHttpClientActiveRequests); +} + +static nostd::shared_ptr CreateAsyncMetricHttpClientActiveRequests( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricHttpClientActiveRequests, + descrMetricHttpClientActiveRequests, + unitMetricHttpClientActiveRequests); +} + +/** + * The duration of the successfully established outbound HTTP connections. + *

+ * histogram + */ +static constexpr const char *kMetricHttpClientConnectionDuration = + "metric.http.client.connection.duration"; +static constexpr const char *descrMetricHttpClientConnectionDuration = + "The duration of the successfully established outbound HTTP connections."; +static constexpr const char *unitMetricHttpClientConnectionDuration = "s"; + +static nostd::unique_ptr> CreateSyncMetricHttpClientConnectionDuration( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricHttpClientConnectionDuration, + descrMetricHttpClientConnectionDuration, + unitMetricHttpClientConnectionDuration); +} + +static nostd::shared_ptr +CreateAsyncMetricHttpClientConnectionDuration(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricHttpClientConnectionDuration, + descrMetricHttpClientConnectionDuration, + unitMetricHttpClientConnectionDuration); +} + +/** + * Number of outbound HTTP connections that are currently active or idle on the client. + *

+ * updowncounter + */ +static constexpr const char *kMetricHttpClientOpenConnections = + "metric.http.client.open_connections"; +static constexpr const char *descrMetricHttpClientOpenConnections = + "Number of outbound HTTP connections that are currently active or idle on the client."; +static constexpr const char *unitMetricHttpClientOpenConnections = "{connection}"; + +static nostd::unique_ptr> +CreateSyncMetricHttpClientOpenConnections(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricHttpClientOpenConnections, + descrMetricHttpClientOpenConnections, + unitMetricHttpClientOpenConnections); +} + +static nostd::shared_ptr CreateAsyncMetricHttpClientOpenConnections( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricHttpClientOpenConnections, + descrMetricHttpClientOpenConnections, + unitMetricHttpClientOpenConnections); +} + +/** + * Size of HTTP client request bodies. + *

+ * 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 + * header. For requests using transport encoding, this should be the compressed size.

histogram + */ +static constexpr const char *kMetricHttpClientRequestBodySize = + "metric.http.client.request.body.size"; +static constexpr const char *descrMetricHttpClientRequestBodySize = + "Size of HTTP client request bodies."; +static constexpr const char *unitMetricHttpClientRequestBodySize = "By"; + +static nostd::unique_ptr> CreateSyncMetricHttpClientRequestBodySize( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricHttpClientRequestBodySize, + descrMetricHttpClientRequestBodySize, + unitMetricHttpClientRequestBodySize); +} + +static nostd::shared_ptr CreateAsyncMetricHttpClientRequestBodySize( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricHttpClientRequestBodySize, + descrMetricHttpClientRequestBodySize, + unitMetricHttpClientRequestBodySize); +} + +/** + * Duration of HTTP client requests. + *

+ * histogram + */ +static constexpr const char *kMetricHttpClientRequestDuration = + "metric.http.client.request.duration"; +static constexpr const char *descrMetricHttpClientRequestDuration = + "Duration of HTTP client requests."; +static constexpr const char *unitMetricHttpClientRequestDuration = "s"; + +static nostd::unique_ptr> CreateSyncMetricHttpClientRequestDuration( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricHttpClientRequestDuration, + descrMetricHttpClientRequestDuration, + unitMetricHttpClientRequestDuration); +} + +static nostd::shared_ptr CreateAsyncMetricHttpClientRequestDuration( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricHttpClientRequestDuration, + descrMetricHttpClientRequestDuration, + unitMetricHttpClientRequestDuration); +} + +/** + * Size of HTTP client response bodies. + *

+ * 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 + * header. For requests using transport encoding, this should be the compressed size.

histogram + */ +static constexpr const char *kMetricHttpClientResponseBodySize = + "metric.http.client.response.body.size"; +static constexpr const char *descrMetricHttpClientResponseBodySize = + "Size of HTTP client response bodies."; +static constexpr const char *unitMetricHttpClientResponseBodySize = "By"; + +static nostd::unique_ptr> CreateSyncMetricHttpClientResponseBodySize( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricHttpClientResponseBodySize, + descrMetricHttpClientResponseBodySize, + unitMetricHttpClientResponseBodySize); +} + +static nostd::shared_ptr CreateAsyncMetricHttpClientResponseBodySize( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricHttpClientResponseBodySize, + descrMetricHttpClientResponseBodySize, + unitMetricHttpClientResponseBodySize); +} + +/** + * Number of active HTTP server requests. + *

+ * updowncounter + */ +static constexpr const char *kMetricHttpServerActiveRequests = "metric.http.server.active_requests"; +static constexpr const char *descrMetricHttpServerActiveRequests = + "Number of active HTTP server requests."; +static constexpr const char *unitMetricHttpServerActiveRequests = "{request}"; + +static nostd::unique_ptr> CreateSyncMetricHttpServerActiveRequests( + metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricHttpServerActiveRequests, + descrMetricHttpServerActiveRequests, + unitMetricHttpServerActiveRequests); +} + +static nostd::shared_ptr CreateAsyncMetricHttpServerActiveRequests( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricHttpServerActiveRequests, + descrMetricHttpServerActiveRequests, + unitMetricHttpServerActiveRequests); +} + +/** + * Size of HTTP server request bodies. + *

+ * 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 + * header. For requests using transport encoding, this should be the compressed size.

histogram + */ +static constexpr const char *kMetricHttpServerRequestBodySize = + "metric.http.server.request.body.size"; +static constexpr const char *descrMetricHttpServerRequestBodySize = + "Size of HTTP server request bodies."; +static constexpr const char *unitMetricHttpServerRequestBodySize = "By"; + +static nostd::unique_ptr> CreateSyncMetricHttpServerRequestBodySize( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricHttpServerRequestBodySize, + descrMetricHttpServerRequestBodySize, + unitMetricHttpServerRequestBodySize); +} + +static nostd::shared_ptr CreateAsyncMetricHttpServerRequestBodySize( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricHttpServerRequestBodySize, + descrMetricHttpServerRequestBodySize, + unitMetricHttpServerRequestBodySize); +} + +/** + * Duration of HTTP server requests. + *

+ * histogram + */ +static constexpr const char *kMetricHttpServerRequestDuration = + "metric.http.server.request.duration"; +static constexpr const char *descrMetricHttpServerRequestDuration = + "Duration of HTTP server requests."; +static constexpr const char *unitMetricHttpServerRequestDuration = "s"; + +static nostd::unique_ptr> CreateSyncMetricHttpServerRequestDuration( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricHttpServerRequestDuration, + descrMetricHttpServerRequestDuration, + unitMetricHttpServerRequestDuration); +} + +static nostd::shared_ptr CreateAsyncMetricHttpServerRequestDuration( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricHttpServerRequestDuration, + descrMetricHttpServerRequestDuration, + unitMetricHttpServerRequestDuration); +} + +/** + * Size of HTTP server response bodies. + *

+ * 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 + * header. For requests using transport encoding, this should be the compressed size.

histogram + */ +static constexpr const char *kMetricHttpServerResponseBodySize = + "metric.http.server.response.body.size"; +static constexpr const char *descrMetricHttpServerResponseBodySize = + "Size of HTTP server response bodies."; +static constexpr const char *unitMetricHttpServerResponseBodySize = "By"; + +static nostd::unique_ptr> CreateSyncMetricHttpServerResponseBodySize( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricHttpServerResponseBodySize, + descrMetricHttpServerResponseBodySize, + unitMetricHttpServerResponseBodySize); +} + +static nostd::shared_ptr CreateAsyncMetricHttpServerResponseBodySize( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricHttpServerResponseBodySize, + descrMetricHttpServerResponseBodySize, + unitMetricHttpServerResponseBodySize); +} + +} // namespace http +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/messaging_metrics.h b/api/include/opentelemetry/semconv/incubating/messaging_metrics.h new file mode 100644 index 0000000000..3e1b1fe5eb --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/messaging_metrics.h @@ -0,0 +1,289 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace messaging +{ + +/** + * Number of messages that were delivered to the application. + *

+ * Records the number of messages pulled from the broker or number of messages dispatched to the + * application in push-based scenarios. The metric SHOULD be reported once per message delivery. For + * example, if receiving and processing operations are both instrumented for a single message + * delivery, this counter is incremented when the message is received and not reported when it is + * processed.

counter + */ +static constexpr const char *kMetricMessagingClientConsumedMessages = + "metric.messaging.client.consumed.messages"; +static constexpr const char *descrMetricMessagingClientConsumedMessages = + "Number of messages that were delivered to the application."; +static constexpr const char *unitMetricMessagingClientConsumedMessages = "{message}"; + +static nostd::unique_ptr> +CreateSyncMetricMessagingClientConsumedMessages(metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricMessagingClientConsumedMessages, + descrMetricMessagingClientConsumedMessages, + unitMetricMessagingClientConsumedMessages); +} + +static nostd::shared_ptr +CreateAsyncMetricMessagingClientConsumedMessages(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricMessagingClientConsumedMessages, + descrMetricMessagingClientConsumedMessages, + unitMetricMessagingClientConsumedMessages); +} + +/** + * Duration of messaging operation initiated by a producer or consumer client. + *

+ * This metric SHOULD NOT be used to report processing duration - processing duration is reported in + * @code messaging.process.duration @endcode metric.

histogram + */ +static constexpr const char *kMetricMessagingClientOperationDuration = + "metric.messaging.client.operation.duration"; +static constexpr const char *descrMetricMessagingClientOperationDuration = + "Duration of messaging operation initiated by a producer or consumer client."; +static constexpr const char *unitMetricMessagingClientOperationDuration = "s"; + +static nostd::unique_ptr> +CreateSyncMetricMessagingClientOperationDuration(metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricMessagingClientOperationDuration, + descrMetricMessagingClientOperationDuration, + unitMetricMessagingClientOperationDuration); +} + +static nostd::shared_ptr +CreateAsyncMetricMessagingClientOperationDuration(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricMessagingClientOperationDuration, + descrMetricMessagingClientOperationDuration, + unitMetricMessagingClientOperationDuration); +} + +/** + * Number of messages producer attempted to publish to the broker. + *

+ * This metric MUST NOT count messages that were created haven't yet been attempted to be published. + *

+ * counter + */ +static constexpr const char *kMetricMessagingClientPublishedMessages = + "metric.messaging.client.published.messages"; +static constexpr const char *descrMetricMessagingClientPublishedMessages = + "Number of messages producer attempted to publish to the broker."; +static constexpr const char *unitMetricMessagingClientPublishedMessages = "{message}"; + +static nostd::unique_ptr> +CreateSyncMetricMessagingClientPublishedMessages(metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricMessagingClientPublishedMessages, + descrMetricMessagingClientPublishedMessages, + unitMetricMessagingClientPublishedMessages); +} + +static nostd::shared_ptr +CreateAsyncMetricMessagingClientPublishedMessages(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricMessagingClientPublishedMessages, + descrMetricMessagingClientPublishedMessages, + unitMetricMessagingClientPublishedMessages); +} + +/** + * Duration of processing operation. + *

+ * This metric MUST be reported for operations with @code messaging.operation.type @endcode that + * matches @code process @endcode.

histogram + */ +static constexpr const char *kMetricMessagingProcessDuration = "metric.messaging.process.duration"; +static constexpr const char *descrMetricMessagingProcessDuration = + "Duration of processing operation."; +static constexpr const char *unitMetricMessagingProcessDuration = "s"; + +static nostd::unique_ptr> CreateSyncMetricMessagingProcessDuration( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricMessagingProcessDuration, + descrMetricMessagingProcessDuration, + unitMetricMessagingProcessDuration); +} + +static nostd::shared_ptr CreateAsyncMetricMessagingProcessDuration( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricMessagingProcessDuration, + descrMetricMessagingProcessDuration, + unitMetricMessagingProcessDuration); +} + +/** + * Deprecated. Use @code messaging.client.consumed.messages @endcode instead. + *

+ * @deprecated + * Replaced by @code messaging.client.consumed.messages @endcode. + *

+ * counter + */ +OPENTELEMETRY_DEPRECATED +static constexpr const char *kMetricMessagingProcessMessages = "metric.messaging.process.messages"; +static constexpr const char *descrMetricMessagingProcessMessages = + "Deprecated. Use `messaging.client.consumed.messages` instead."; +static constexpr const char *unitMetricMessagingProcessMessages = "{message}"; + +static nostd::unique_ptr> CreateSyncMetricMessagingProcessMessages( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricMessagingProcessMessages, + descrMetricMessagingProcessMessages, + unitMetricMessagingProcessMessages); +} + +static nostd::shared_ptr CreateAsyncMetricMessagingProcessMessages( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricMessagingProcessMessages, + descrMetricMessagingProcessMessages, + unitMetricMessagingProcessMessages); +} + +/** + * Deprecated. Use @code messaging.client.operation.duration @endcode instead. + *

+ * @deprecated + * Replaced by @code messaging.client.operation.duration @endcode. + *

+ * histogram + */ +OPENTELEMETRY_DEPRECATED +static constexpr const char *kMetricMessagingPublishDuration = "metric.messaging.publish.duration"; +static constexpr const char *descrMetricMessagingPublishDuration = + "Deprecated. Use `messaging.client.operation.duration` instead."; +static constexpr const char *unitMetricMessagingPublishDuration = "s"; + +static nostd::unique_ptr> CreateSyncMetricMessagingPublishDuration( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricMessagingPublishDuration, + descrMetricMessagingPublishDuration, + unitMetricMessagingPublishDuration); +} + +static nostd::shared_ptr CreateAsyncMetricMessagingPublishDuration( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricMessagingPublishDuration, + descrMetricMessagingPublishDuration, + unitMetricMessagingPublishDuration); +} + +/** + * Deprecated. Use @code messaging.client.produced.messages @endcode instead. + *

+ * @deprecated + * Replaced by @code messaging.client.produced.messages @endcode. + *

+ * counter + */ +OPENTELEMETRY_DEPRECATED +static constexpr const char *kMetricMessagingPublishMessages = "metric.messaging.publish.messages"; +static constexpr const char *descrMetricMessagingPublishMessages = + "Deprecated. Use `messaging.client.produced.messages` instead."; +static constexpr const char *unitMetricMessagingPublishMessages = "{message}"; + +static nostd::unique_ptr> CreateSyncMetricMessagingPublishMessages( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricMessagingPublishMessages, + descrMetricMessagingPublishMessages, + unitMetricMessagingPublishMessages); +} + +static nostd::shared_ptr CreateAsyncMetricMessagingPublishMessages( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricMessagingPublishMessages, + descrMetricMessagingPublishMessages, + unitMetricMessagingPublishMessages); +} + +/** + * Deprecated. Use @code messaging.client.operation.duration @endcode instead. + *

+ * @deprecated + * Replaced by @code messaging.client.operation.duration @endcode. + *

+ * histogram + */ +OPENTELEMETRY_DEPRECATED +static constexpr const char *kMetricMessagingReceiveDuration = "metric.messaging.receive.duration"; +static constexpr const char *descrMetricMessagingReceiveDuration = + "Deprecated. Use `messaging.client.operation.duration` instead."; +static constexpr const char *unitMetricMessagingReceiveDuration = "s"; + +static nostd::unique_ptr> CreateSyncMetricMessagingReceiveDuration( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricMessagingReceiveDuration, + descrMetricMessagingReceiveDuration, + unitMetricMessagingReceiveDuration); +} + +static nostd::shared_ptr CreateAsyncMetricMessagingReceiveDuration( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricMessagingReceiveDuration, + descrMetricMessagingReceiveDuration, + unitMetricMessagingReceiveDuration); +} + +/** + * Deprecated. Use @code messaging.client.consumed.messages @endcode instead. + *

+ * @deprecated + * Replaced by @code messaging.client.consumed.messages @endcode. + *

+ * counter + */ +OPENTELEMETRY_DEPRECATED +static constexpr const char *kMetricMessagingReceiveMessages = "metric.messaging.receive.messages"; +static constexpr const char *descrMetricMessagingReceiveMessages = + "Deprecated. Use `messaging.client.consumed.messages` instead."; +static constexpr const char *unitMetricMessagingReceiveMessages = "{message}"; + +static nostd::unique_ptr> CreateSyncMetricMessagingReceiveMessages( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricMessagingReceiveMessages, + descrMetricMessagingReceiveMessages, + unitMetricMessagingReceiveMessages); +} + +static nostd::shared_ptr CreateAsyncMetricMessagingReceiveMessages( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricMessagingReceiveMessages, + descrMetricMessagingReceiveMessages, + unitMetricMessagingReceiveMessages); +} + +} // namespace messaging +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/process_metrics.h b/api/include/opentelemetry/semconv/incubating/process_metrics.h new file mode 100644 index 0000000000..2ee736ed27 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/process_metrics.h @@ -0,0 +1,267 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace process +{ + +/** + * Number of times the process has been context switched. + *

+ * counter + */ +static constexpr const char *kMetricProcessContextSwitches = "metric.process.context_switches"; +static constexpr const char *descrMetricProcessContextSwitches = + "Number of times the process has been context switched."; +static constexpr const char *unitMetricProcessContextSwitches = "{count}"; + +static nostd::unique_ptr> CreateSyncMetricProcessContextSwitches( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricProcessContextSwitches, + descrMetricProcessContextSwitches, + unitMetricProcessContextSwitches); +} + +static nostd::shared_ptr CreateAsyncMetricProcessContextSwitches( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricProcessContextSwitches, + descrMetricProcessContextSwitches, + unitMetricProcessContextSwitches); +} + +/** + * Total CPU seconds broken down by different states. + *

+ * counter + */ +static constexpr const char *kMetricProcessCpuTime = "metric.process.cpu.time"; +static constexpr const char *descrMetricProcessCpuTime = + "Total CPU seconds broken down by different states."; +static constexpr const char *unitMetricProcessCpuTime = "s"; + +static nostd::unique_ptr> CreateSyncMetricProcessCpuTime( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricProcessCpuTime, descrMetricProcessCpuTime, + unitMetricProcessCpuTime); +} + +static nostd::shared_ptr CreateAsyncMetricProcessCpuTime( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricProcessCpuTime, descrMetricProcessCpuTime, + unitMetricProcessCpuTime); +} + +/** + * Difference in process.cpu.time since the last measurement, divided by the elapsed time and number + * of CPUs available to the process.

gauge + */ +static constexpr const char *kMetricProcessCpuUtilization = "metric.process.cpu.utilization"; +static constexpr const char *descrMetricProcessCpuUtilization = + "Difference in process.cpu.time since the last measurement, divided by the elapsed time and " + "number of CPUs available to the process."; +static constexpr const char *unitMetricProcessCpuUtilization = "1"; + +static nostd::unique_ptr> CreateSyncMetricProcessCpuUtilization( + metrics::Meter *meter) +{ + return meter->CreateUInt64Gauge(kMetricProcessCpuUtilization, descrMetricProcessCpuUtilization, + unitMetricProcessCpuUtilization); +} + +static nostd::shared_ptr CreateAsyncMetricProcessCpuUtilization( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableGauge(kMetricProcessCpuUtilization, + descrMetricProcessCpuUtilization, + unitMetricProcessCpuUtilization); +} + +/** + * Disk bytes transferred. + *

+ * counter + */ +static constexpr const char *kMetricProcessDiskIo = "metric.process.disk.io"; +static constexpr const char *descrMetricProcessDiskIo = "Disk bytes transferred."; +static constexpr const char *unitMetricProcessDiskIo = "By"; + +static nostd::unique_ptr> CreateSyncMetricProcessDiskIo( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricProcessDiskIo, descrMetricProcessDiskIo, + unitMetricProcessDiskIo); +} + +static nostd::shared_ptr CreateAsyncMetricProcessDiskIo( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricProcessDiskIo, descrMetricProcessDiskIo, + unitMetricProcessDiskIo); +} + +/** + * The amount of physical memory in use. + *

+ * updowncounter + */ +static constexpr const char *kMetricProcessMemoryUsage = "metric.process.memory.usage"; +static constexpr const char *descrMetricProcessMemoryUsage = + "The amount of physical memory in use."; +static constexpr const char *unitMetricProcessMemoryUsage = "By"; + +static nostd::unique_ptr> CreateSyncMetricProcessMemoryUsage( + metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricProcessMemoryUsage, descrMetricProcessMemoryUsage, + unitMetricProcessMemoryUsage); +} + +static nostd::shared_ptr CreateAsyncMetricProcessMemoryUsage( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter( + kMetricProcessMemoryUsage, descrMetricProcessMemoryUsage, unitMetricProcessMemoryUsage); +} + +/** + * The amount of committed virtual memory. + *

+ * updowncounter + */ +static constexpr const char *kMetricProcessMemoryVirtual = "metric.process.memory.virtual"; +static constexpr const char *descrMetricProcessMemoryVirtual = + "The amount of committed virtual memory."; +static constexpr const char *unitMetricProcessMemoryVirtual = "By"; + +static nostd::unique_ptr> CreateSyncMetricProcessMemoryVirtual( + metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter( + kMetricProcessMemoryVirtual, descrMetricProcessMemoryVirtual, unitMetricProcessMemoryVirtual); +} + +static nostd::shared_ptr CreateAsyncMetricProcessMemoryVirtual( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter( + kMetricProcessMemoryVirtual, descrMetricProcessMemoryVirtual, unitMetricProcessMemoryVirtual); +} + +/** + * Network bytes transferred. + *

+ * counter + */ +static constexpr const char *kMetricProcessNetworkIo = "metric.process.network.io"; +static constexpr const char *descrMetricProcessNetworkIo = "Network bytes transferred."; +static constexpr const char *unitMetricProcessNetworkIo = "By"; + +static nostd::unique_ptr> CreateSyncMetricProcessNetworkIo( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricProcessNetworkIo, descrMetricProcessNetworkIo, + unitMetricProcessNetworkIo); +} + +static nostd::shared_ptr CreateAsyncMetricProcessNetworkIo( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricProcessNetworkIo, descrMetricProcessNetworkIo, + unitMetricProcessNetworkIo); +} + +/** + * Number of file descriptors in use by the process. + *

+ * updowncounter + */ +static constexpr const char *kMetricProcessOpenFileDescriptorCount = + "metric.process.open_file_descriptor.count"; +static constexpr const char *descrMetricProcessOpenFileDescriptorCount = + "Number of file descriptors in use by the process."; +static constexpr const char *unitMetricProcessOpenFileDescriptorCount = "{count}"; + +static nostd::unique_ptr> +CreateSyncMetricProcessOpenFileDescriptorCount(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricProcessOpenFileDescriptorCount, + descrMetricProcessOpenFileDescriptorCount, + unitMetricProcessOpenFileDescriptorCount); +} + +static nostd::shared_ptr +CreateAsyncMetricProcessOpenFileDescriptorCount(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricProcessOpenFileDescriptorCount, + descrMetricProcessOpenFileDescriptorCount, + unitMetricProcessOpenFileDescriptorCount); +} + +/** + * Number of page faults the process has made. + *

+ * counter + */ +static constexpr const char *kMetricProcessPagingFaults = "metric.process.paging.faults"; +static constexpr const char *descrMetricProcessPagingFaults = + "Number of page faults the process has made."; +static constexpr const char *unitMetricProcessPagingFaults = "{fault}"; + +static nostd::unique_ptr> CreateSyncMetricProcessPagingFaults( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricProcessPagingFaults, descrMetricProcessPagingFaults, + unitMetricProcessPagingFaults); +} + +static nostd::shared_ptr CreateAsyncMetricProcessPagingFaults( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter( + kMetricProcessPagingFaults, descrMetricProcessPagingFaults, unitMetricProcessPagingFaults); +} + +/** + * Process threads count. + *

+ * updowncounter + */ +static constexpr const char *kMetricProcessThreadCount = "metric.process.thread.count"; +static constexpr const char *descrMetricProcessThreadCount = "Process threads count."; +static constexpr const char *unitMetricProcessThreadCount = "{thread}"; + +static nostd::unique_ptr> CreateSyncMetricProcessThreadCount( + metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricProcessThreadCount, descrMetricProcessThreadCount, + unitMetricProcessThreadCount); +} + +static nostd::shared_ptr CreateAsyncMetricProcessThreadCount( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter( + kMetricProcessThreadCount, descrMetricProcessThreadCount, unitMetricProcessThreadCount); +} + +} // namespace process +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/rpc_metrics.h b/api/include/opentelemetry/semconv/incubating/rpc_metrics.h new file mode 100644 index 0000000000..0fb503694e --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/rpc_metrics.h @@ -0,0 +1,311 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace rpc +{ + +/** + * Measures the duration of outbound RPC. + *

+ * While streaming RPCs may record this metric as start-of-batch + * to end-of-batch, it's hard to interpret in practice. + *

+ * Streaming: N/A. + *

+ * histogram + */ +static constexpr const char *kMetricRpcClientDuration = "metric.rpc.client.duration"; +static constexpr const char *descrMetricRpcClientDuration = + "Measures the duration of outbound RPC."; +static constexpr const char *unitMetricRpcClientDuration = "ms"; + +static nostd::unique_ptr> CreateSyncMetricRpcClientDuration( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricRpcClientDuration, descrMetricRpcClientDuration, + unitMetricRpcClientDuration); +} + +static nostd::shared_ptr CreateAsyncMetricRpcClientDuration( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram( + kMetricRpcClientDuration, descrMetricRpcClientDuration, unitMetricRpcClientDuration); +} + +/** + * Measures the size of RPC request messages (uncompressed). + *

+ * Streaming: Recorded per message in a streaming batch + *

+ * histogram + */ +static constexpr const char *kMetricRpcClientRequestSize = "metric.rpc.client.request.size"; +static constexpr const char *descrMetricRpcClientRequestSize = + "Measures the size of RPC request messages (uncompressed)."; +static constexpr const char *unitMetricRpcClientRequestSize = "By"; + +static nostd::unique_ptr> CreateSyncMetricRpcClientRequestSize( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricRpcClientRequestSize, descrMetricRpcClientRequestSize, + unitMetricRpcClientRequestSize); +} + +static nostd::shared_ptr CreateAsyncMetricRpcClientRequestSize( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram( + kMetricRpcClientRequestSize, descrMetricRpcClientRequestSize, unitMetricRpcClientRequestSize); +} + +/** + * Measures the number of messages received per RPC. + *

+ * Should be 1 for all non-streaming RPCs. + *

+ * Streaming: This metric is required for server and client streaming RPCs + *

+ * histogram + */ +static constexpr const char *kMetricRpcClientRequestsPerRpc = "metric.rpc.client.requests_per_rpc"; +static constexpr const char *descrMetricRpcClientRequestsPerRpc = + "Measures the number of messages received per RPC."; +static constexpr const char *unitMetricRpcClientRequestsPerRpc = "{count}"; + +static nostd::unique_ptr> CreateSyncMetricRpcClientRequestsPerRpc( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricRpcClientRequestsPerRpc, + descrMetricRpcClientRequestsPerRpc, + unitMetricRpcClientRequestsPerRpc); +} + +static nostd::shared_ptr CreateAsyncMetricRpcClientRequestsPerRpc( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricRpcClientRequestsPerRpc, + descrMetricRpcClientRequestsPerRpc, + unitMetricRpcClientRequestsPerRpc); +} + +/** + * Measures the size of RPC response messages (uncompressed). + *

+ * Streaming: Recorded per response in a streaming batch + *

+ * histogram + */ +static constexpr const char *kMetricRpcClientResponseSize = "metric.rpc.client.response.size"; +static constexpr const char *descrMetricRpcClientResponseSize = + "Measures the size of RPC response messages (uncompressed)."; +static constexpr const char *unitMetricRpcClientResponseSize = "By"; + +static nostd::unique_ptr> CreateSyncMetricRpcClientResponseSize( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricRpcClientResponseSize, + descrMetricRpcClientResponseSize, + unitMetricRpcClientResponseSize); +} + +static nostd::shared_ptr CreateAsyncMetricRpcClientResponseSize( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricRpcClientResponseSize, + descrMetricRpcClientResponseSize, + unitMetricRpcClientResponseSize); +} + +/** + * Measures the number of messages sent per RPC. + *

+ * Should be 1 for all non-streaming RPCs. + *

+ * Streaming: This metric is required for server and client streaming RPCs + *

+ * histogram + */ +static constexpr const char *kMetricRpcClientResponsesPerRpc = + "metric.rpc.client.responses_per_rpc"; +static constexpr const char *descrMetricRpcClientResponsesPerRpc = + "Measures the number of messages sent per RPC."; +static constexpr const char *unitMetricRpcClientResponsesPerRpc = "{count}"; + +static nostd::unique_ptr> CreateSyncMetricRpcClientResponsesPerRpc( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricRpcClientResponsesPerRpc, + descrMetricRpcClientResponsesPerRpc, + unitMetricRpcClientResponsesPerRpc); +} + +static nostd::shared_ptr CreateAsyncMetricRpcClientResponsesPerRpc( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricRpcClientResponsesPerRpc, + descrMetricRpcClientResponsesPerRpc, + unitMetricRpcClientResponsesPerRpc); +} + +/** + * Measures the duration of inbound RPC. + *

+ * While streaming RPCs may record this metric as start-of-batch + * to end-of-batch, it's hard to interpret in practice. + *

+ * Streaming: N/A. + *

+ * histogram + */ +static constexpr const char *kMetricRpcServerDuration = "metric.rpc.server.duration"; +static constexpr const char *descrMetricRpcServerDuration = "Measures the duration of inbound RPC."; +static constexpr const char *unitMetricRpcServerDuration = "ms"; + +static nostd::unique_ptr> CreateSyncMetricRpcServerDuration( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricRpcServerDuration, descrMetricRpcServerDuration, + unitMetricRpcServerDuration); +} + +static nostd::shared_ptr CreateAsyncMetricRpcServerDuration( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram( + kMetricRpcServerDuration, descrMetricRpcServerDuration, unitMetricRpcServerDuration); +} + +/** + * Measures the size of RPC request messages (uncompressed). + *

+ * Streaming: Recorded per message in a streaming batch + *

+ * histogram + */ +static constexpr const char *kMetricRpcServerRequestSize = "metric.rpc.server.request.size"; +static constexpr const char *descrMetricRpcServerRequestSize = + "Measures the size of RPC request messages (uncompressed)."; +static constexpr const char *unitMetricRpcServerRequestSize = "By"; + +static nostd::unique_ptr> CreateSyncMetricRpcServerRequestSize( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricRpcServerRequestSize, descrMetricRpcServerRequestSize, + unitMetricRpcServerRequestSize); +} + +static nostd::shared_ptr CreateAsyncMetricRpcServerRequestSize( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram( + kMetricRpcServerRequestSize, descrMetricRpcServerRequestSize, unitMetricRpcServerRequestSize); +} + +/** + * Measures the number of messages received per RPC. + *

+ * Should be 1 for all non-streaming RPCs. + *

+ * Streaming : This metric is required for server and client streaming RPCs + *

+ * histogram + */ +static constexpr const char *kMetricRpcServerRequestsPerRpc = "metric.rpc.server.requests_per_rpc"; +static constexpr const char *descrMetricRpcServerRequestsPerRpc = + "Measures the number of messages received per RPC."; +static constexpr const char *unitMetricRpcServerRequestsPerRpc = "{count}"; + +static nostd::unique_ptr> CreateSyncMetricRpcServerRequestsPerRpc( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricRpcServerRequestsPerRpc, + descrMetricRpcServerRequestsPerRpc, + unitMetricRpcServerRequestsPerRpc); +} + +static nostd::shared_ptr CreateAsyncMetricRpcServerRequestsPerRpc( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricRpcServerRequestsPerRpc, + descrMetricRpcServerRequestsPerRpc, + unitMetricRpcServerRequestsPerRpc); +} + +/** + * Measures the size of RPC response messages (uncompressed). + *

+ * Streaming: Recorded per response in a streaming batch + *

+ * histogram + */ +static constexpr const char *kMetricRpcServerResponseSize = "metric.rpc.server.response.size"; +static constexpr const char *descrMetricRpcServerResponseSize = + "Measures the size of RPC response messages (uncompressed)."; +static constexpr const char *unitMetricRpcServerResponseSize = "By"; + +static nostd::unique_ptr> CreateSyncMetricRpcServerResponseSize( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricRpcServerResponseSize, + descrMetricRpcServerResponseSize, + unitMetricRpcServerResponseSize); +} + +static nostd::shared_ptr CreateAsyncMetricRpcServerResponseSize( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricRpcServerResponseSize, + descrMetricRpcServerResponseSize, + unitMetricRpcServerResponseSize); +} + +/** + * Measures the number of messages sent per RPC. + *

+ * Should be 1 for all non-streaming RPCs. + *

+ * Streaming: This metric is required for server and client streaming RPCs + *

+ * histogram + */ +static constexpr const char *kMetricRpcServerResponsesPerRpc = + "metric.rpc.server.responses_per_rpc"; +static constexpr const char *descrMetricRpcServerResponsesPerRpc = + "Measures the number of messages sent per RPC."; +static constexpr const char *unitMetricRpcServerResponsesPerRpc = "{count}"; + +static nostd::unique_ptr> CreateSyncMetricRpcServerResponsesPerRpc( + metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricRpcServerResponsesPerRpc, + descrMetricRpcServerResponsesPerRpc, + unitMetricRpcServerResponsesPerRpc); +} + +static nostd::shared_ptr CreateAsyncMetricRpcServerResponsesPerRpc( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableHistogram(kMetricRpcServerResponsesPerRpc, + descrMetricRpcServerResponsesPerRpc, + unitMetricRpcServerResponsesPerRpc); +} + +} // namespace rpc +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/system_metrics.h b/api/include/opentelemetry/semconv/incubating/system_metrics.h new file mode 100644 index 0000000000..c6f82d35dd --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/system_metrics.h @@ -0,0 +1,758 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace system +{ + +/** + * Reports the current frequency of the CPU in Hz + *

+ * gauge + */ +static constexpr const char *kMetricSystemCpuFrequency = "metric.system.cpu.frequency"; +static constexpr const char *descrMetricSystemCpuFrequency = + "Reports the current frequency of the CPU in Hz"; +static constexpr const char *unitMetricSystemCpuFrequency = "{Hz}"; + +static nostd::unique_ptr> CreateSyncMetricSystemCpuFrequency( + metrics::Meter *meter) +{ + return meter->CreateUInt64Gauge(kMetricSystemCpuFrequency, descrMetricSystemCpuFrequency, + unitMetricSystemCpuFrequency); +} + +static nostd::shared_ptr CreateAsyncMetricSystemCpuFrequency( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableGauge(kMetricSystemCpuFrequency, descrMetricSystemCpuFrequency, + unitMetricSystemCpuFrequency); +} + +/** + * Reports the number of logical (virtual) processor cores created by the operating system to manage + * multitasking

updowncounter + */ +static constexpr const char *kMetricSystemCpuLogicalCount = "metric.system.cpu.logical.count"; +static constexpr const char *descrMetricSystemCpuLogicalCount = + "Reports the number of logical (virtual) processor cores created by the operating system to " + "manage multitasking"; +static constexpr const char *unitMetricSystemCpuLogicalCount = "{cpu}"; + +static nostd::unique_ptr> CreateSyncMetricSystemCpuLogicalCount( + metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricSystemCpuLogicalCount, + descrMetricSystemCpuLogicalCount, + unitMetricSystemCpuLogicalCount); +} + +static nostd::shared_ptr CreateAsyncMetricSystemCpuLogicalCount( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricSystemCpuLogicalCount, + descrMetricSystemCpuLogicalCount, + unitMetricSystemCpuLogicalCount); +} + +/** + * Reports the number of actual physical processor cores on the hardware + *

+ * updowncounter + */ +static constexpr const char *kMetricSystemCpuPhysicalCount = "metric.system.cpu.physical.count"; +static constexpr const char *descrMetricSystemCpuPhysicalCount = + "Reports the number of actual physical processor cores on the hardware"; +static constexpr const char *unitMetricSystemCpuPhysicalCount = "{cpu}"; + +static nostd::unique_ptr> CreateSyncMetricSystemCpuPhysicalCount( + metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricSystemCpuPhysicalCount, + descrMetricSystemCpuPhysicalCount, + unitMetricSystemCpuPhysicalCount); +} + +static nostd::shared_ptr CreateAsyncMetricSystemCpuPhysicalCount( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricSystemCpuPhysicalCount, + descrMetricSystemCpuPhysicalCount, + unitMetricSystemCpuPhysicalCount); +} + +/** + * Seconds each logical CPU spent on each mode + *

+ * counter + */ +static constexpr const char *kMetricSystemCpuTime = "metric.system.cpu.time"; +static constexpr const char *descrMetricSystemCpuTime = + "Seconds each logical CPU spent on each mode"; +static constexpr const char *unitMetricSystemCpuTime = "s"; + +static nostd::unique_ptr> CreateSyncMetricSystemCpuTime( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricSystemCpuTime, descrMetricSystemCpuTime, + unitMetricSystemCpuTime); +} + +static nostd::shared_ptr CreateAsyncMetricSystemCpuTime( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricSystemCpuTime, descrMetricSystemCpuTime, + unitMetricSystemCpuTime); +} + +/** + * Difference in system.cpu.time since the last measurement, divided by the elapsed time and number + * of logical CPUs

gauge + */ +static constexpr const char *kMetricSystemCpuUtilization = "metric.system.cpu.utilization"; +static constexpr const char *descrMetricSystemCpuUtilization = + "Difference in system.cpu.time since the last measurement, divided by the elapsed time and " + "number of logical CPUs"; +static constexpr const char *unitMetricSystemCpuUtilization = "1"; + +static nostd::unique_ptr> CreateSyncMetricSystemCpuUtilization( + metrics::Meter *meter) +{ + return meter->CreateUInt64Gauge(kMetricSystemCpuUtilization, descrMetricSystemCpuUtilization, + unitMetricSystemCpuUtilization); +} + +static nostd::shared_ptr CreateAsyncMetricSystemCpuUtilization( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableGauge( + kMetricSystemCpuUtilization, descrMetricSystemCpuUtilization, unitMetricSystemCpuUtilization); +} + +/** + * counter + */ +static constexpr const char *kMetricSystemDiskIo = "metric.system.disk.io"; +static constexpr const char *descrMetricSystemDiskIo = ""; +static constexpr const char *unitMetricSystemDiskIo = "By"; + +static nostd::unique_ptr> CreateSyncMetricSystemDiskIo( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricSystemDiskIo, descrMetricSystemDiskIo, + unitMetricSystemDiskIo); +} + +static nostd::shared_ptr CreateAsyncMetricSystemDiskIo( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricSystemDiskIo, descrMetricSystemDiskIo, + unitMetricSystemDiskIo); +} + +/** + * Time disk spent activated + *

+ * The real elapsed time ("wall clock") used in the I/O path (time from operations running in + * parallel are not counted). Measured as:

+ * counter + */ +static constexpr const char *kMetricSystemDiskIoTime = "metric.system.disk.io_time"; +static constexpr const char *descrMetricSystemDiskIoTime = "Time disk spent activated"; +static constexpr const char *unitMetricSystemDiskIoTime = "s"; + +static nostd::unique_ptr> CreateSyncMetricSystemDiskIoTime( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricSystemDiskIoTime, descrMetricSystemDiskIoTime, + unitMetricSystemDiskIoTime); +} + +static nostd::shared_ptr CreateAsyncMetricSystemDiskIoTime( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricSystemDiskIoTime, descrMetricSystemDiskIoTime, + unitMetricSystemDiskIoTime); +} + +/** + * counter + */ +static constexpr const char *kMetricSystemDiskMerged = "metric.system.disk.merged"; +static constexpr const char *descrMetricSystemDiskMerged = ""; +static constexpr const char *unitMetricSystemDiskMerged = "{operation}"; + +static nostd::unique_ptr> CreateSyncMetricSystemDiskMerged( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricSystemDiskMerged, descrMetricSystemDiskMerged, + unitMetricSystemDiskMerged); +} + +static nostd::shared_ptr CreateAsyncMetricSystemDiskMerged( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricSystemDiskMerged, descrMetricSystemDiskMerged, + unitMetricSystemDiskMerged); +} + +/** + * Sum of the time each operation took to complete + *

+ * Because it is the sum of time each request took, parallel-issued requests each contribute to make + * the count grow. Measured as:

  • Linux: Fields 7 & 11 from procfs-diskstats
  • + *
  • Windows: "Avg. Disk sec/Read" perf counter multiplied by "Disk Reads/sec" perf counter + * (similar for Writes)
  • + *
+ * counter + */ +static constexpr const char *kMetricSystemDiskOperationTime = "metric.system.disk.operation_time"; +static constexpr const char *descrMetricSystemDiskOperationTime = + "Sum of the time each operation took to complete"; +static constexpr const char *unitMetricSystemDiskOperationTime = "s"; + +static nostd::unique_ptr> CreateSyncMetricSystemDiskOperationTime( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricSystemDiskOperationTime, + descrMetricSystemDiskOperationTime, + unitMetricSystemDiskOperationTime); +} + +static nostd::shared_ptr CreateAsyncMetricSystemDiskOperationTime( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricSystemDiskOperationTime, + descrMetricSystemDiskOperationTime, + unitMetricSystemDiskOperationTime); +} + +/** + * counter + */ +static constexpr const char *kMetricSystemDiskOperations = "metric.system.disk.operations"; +static constexpr const char *descrMetricSystemDiskOperations = ""; +static constexpr const char *unitMetricSystemDiskOperations = "{operation}"; + +static nostd::unique_ptr> CreateSyncMetricSystemDiskOperations( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricSystemDiskOperations, descrMetricSystemDiskOperations, + unitMetricSystemDiskOperations); +} + +static nostd::shared_ptr CreateAsyncMetricSystemDiskOperations( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter( + kMetricSystemDiskOperations, descrMetricSystemDiskOperations, unitMetricSystemDiskOperations); +} + +/** + * updowncounter + */ +static constexpr const char *kMetricSystemFilesystemUsage = "metric.system.filesystem.usage"; +static constexpr const char *descrMetricSystemFilesystemUsage = ""; +static constexpr const char *unitMetricSystemFilesystemUsage = "By"; + +static nostd::unique_ptr> CreateSyncMetricSystemFilesystemUsage( + metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricSystemFilesystemUsage, + descrMetricSystemFilesystemUsage, + unitMetricSystemFilesystemUsage); +} + +static nostd::shared_ptr CreateAsyncMetricSystemFilesystemUsage( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricSystemFilesystemUsage, + descrMetricSystemFilesystemUsage, + unitMetricSystemFilesystemUsage); +} + +/** + * gauge + */ +static constexpr const char *kMetricSystemFilesystemUtilization = + "metric.system.filesystem.utilization"; +static constexpr const char *descrMetricSystemFilesystemUtilization = ""; +static constexpr const char *unitMetricSystemFilesystemUtilization = "1"; + +static nostd::unique_ptr> CreateSyncMetricSystemFilesystemUtilization( + metrics::Meter *meter) +{ + return meter->CreateUInt64Gauge(kMetricSystemFilesystemUtilization, + descrMetricSystemFilesystemUtilization, + unitMetricSystemFilesystemUtilization); +} + +static nostd::shared_ptr +CreateAsyncMetricSystemFilesystemUtilization(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableGauge(kMetricSystemFilesystemUtilization, + descrMetricSystemFilesystemUtilization, + unitMetricSystemFilesystemUtilization); +} + +/** + * An estimate of how much memory is available for starting new applications, without causing + * swapping

This is an alternative to @code system.memory.usage @endcode metric with @code + * state=free @endcode. Linux starting from 3.14 exports "available" memory. It takes "free" memory + * as a baseline, and then factors in kernel-specific values. This is supposed to be more accurate + * than just "free" memory. For reference, see the calculations here. See also @code MemAvailable @endcode in /proc/meminfo.

updowncounter + */ +static constexpr const char *kMetricSystemLinuxMemoryAvailable = + "metric.system.linux.memory.available"; +static constexpr const char *descrMetricSystemLinuxMemoryAvailable = + "An estimate of how much memory is available for starting new applications, without causing " + "swapping"; +static constexpr const char *unitMetricSystemLinuxMemoryAvailable = "By"; + +static nostd::unique_ptr> +CreateSyncMetricSystemLinuxMemoryAvailable(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricSystemLinuxMemoryAvailable, + descrMetricSystemLinuxMemoryAvailable, + unitMetricSystemLinuxMemoryAvailable); +} + +static nostd::shared_ptr CreateAsyncMetricSystemLinuxMemoryAvailable( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricSystemLinuxMemoryAvailable, + descrMetricSystemLinuxMemoryAvailable, + unitMetricSystemLinuxMemoryAvailable); +} + +/** + * Reports the memory used by the Linux kernel for managing caches of frequently used objects. + *

+ * The sum over the @code reclaimable @endcode and @code unreclaimable @endcode state values in + * @code linux.memory.slab.usage @endcode SHOULD be equal to the total slab memory available on the + * system. Note that the total slab memory is not constant and may vary over time. See also the Slab + * allocator and @code Slab @endcode in /proc/meminfo.

updowncounter + */ +static constexpr const char *kMetricSystemLinuxMemorySlabUsage = + "metric.system.linux.memory.slab.usage"; +static constexpr const char *descrMetricSystemLinuxMemorySlabUsage = + "Reports the memory used by the Linux kernel for managing caches of frequently used objects."; +static constexpr const char *unitMetricSystemLinuxMemorySlabUsage = "By"; + +static nostd::unique_ptr> +CreateSyncMetricSystemLinuxMemorySlabUsage(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricSystemLinuxMemorySlabUsage, + descrMetricSystemLinuxMemorySlabUsage, + unitMetricSystemLinuxMemorySlabUsage); +} + +static nostd::shared_ptr CreateAsyncMetricSystemLinuxMemorySlabUsage( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricSystemLinuxMemorySlabUsage, + descrMetricSystemLinuxMemorySlabUsage, + unitMetricSystemLinuxMemorySlabUsage); +} + +/** + * Total memory available in the system. + *

+ * Its value SHOULD equal the sum of @code system.memory.state @endcode over all states. + *

+ * updowncounter + */ +static constexpr const char *kMetricSystemMemoryLimit = "metric.system.memory.limit"; +static constexpr const char *descrMetricSystemMemoryLimit = "Total memory available in the system."; +static constexpr const char *unitMetricSystemMemoryLimit = "By"; + +static nostd::unique_ptr> CreateSyncMetricSystemMemoryLimit( + metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricSystemMemoryLimit, descrMetricSystemMemoryLimit, + unitMetricSystemMemoryLimit); +} + +static nostd::shared_ptr CreateAsyncMetricSystemMemoryLimit( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter( + kMetricSystemMemoryLimit, descrMetricSystemMemoryLimit, unitMetricSystemMemoryLimit); +} + +/** + * Shared memory used (mostly by tmpfs). + *

+ * Equivalent of @code shared @endcode from @code free @endcode command or + * @code Shmem @endcode from @code + * /proc/meminfo @endcode"

updowncounter + */ +static constexpr const char *kMetricSystemMemoryShared = "metric.system.memory.shared"; +static constexpr const char *descrMetricSystemMemoryShared = + "Shared memory used (mostly by tmpfs)."; +static constexpr const char *unitMetricSystemMemoryShared = "By"; + +static nostd::unique_ptr> CreateSyncMetricSystemMemoryShared( + metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricSystemMemoryShared, descrMetricSystemMemoryShared, + unitMetricSystemMemoryShared); +} + +static nostd::shared_ptr CreateAsyncMetricSystemMemoryShared( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter( + kMetricSystemMemoryShared, descrMetricSystemMemoryShared, unitMetricSystemMemoryShared); +} + +/** + * Reports memory in use by state. + *

+ * The sum over all @code system.memory.state @endcode values SHOULD equal the total memory + * available on the system, that is @code system.memory.limit @endcode. + *

+ * updowncounter + */ +static constexpr const char *kMetricSystemMemoryUsage = "metric.system.memory.usage"; +static constexpr const char *descrMetricSystemMemoryUsage = "Reports memory in use by state."; +static constexpr const char *unitMetricSystemMemoryUsage = "By"; + +static nostd::unique_ptr> CreateSyncMetricSystemMemoryUsage( + metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricSystemMemoryUsage, descrMetricSystemMemoryUsage, + unitMetricSystemMemoryUsage); +} + +static nostd::shared_ptr CreateAsyncMetricSystemMemoryUsage( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter( + kMetricSystemMemoryUsage, descrMetricSystemMemoryUsage, unitMetricSystemMemoryUsage); +} + +/** + * gauge + */ +static constexpr const char *kMetricSystemMemoryUtilization = "metric.system.memory.utilization"; +static constexpr const char *descrMetricSystemMemoryUtilization = ""; +static constexpr const char *unitMetricSystemMemoryUtilization = "1"; + +static nostd::unique_ptr> CreateSyncMetricSystemMemoryUtilization( + metrics::Meter *meter) +{ + return meter->CreateUInt64Gauge(kMetricSystemMemoryUtilization, + descrMetricSystemMemoryUtilization, + unitMetricSystemMemoryUtilization); +} + +static nostd::shared_ptr CreateAsyncMetricSystemMemoryUtilization( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableGauge(kMetricSystemMemoryUtilization, + descrMetricSystemMemoryUtilization, + unitMetricSystemMemoryUtilization); +} + +/** + * updowncounter + */ +static constexpr const char *kMetricSystemNetworkConnections = "metric.system.network.connections"; +static constexpr const char *descrMetricSystemNetworkConnections = ""; +static constexpr const char *unitMetricSystemNetworkConnections = "{connection}"; + +static nostd::unique_ptr> CreateSyncMetricSystemNetworkConnections( + metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricSystemNetworkConnections, + descrMetricSystemNetworkConnections, + unitMetricSystemNetworkConnections); +} + +static nostd::shared_ptr CreateAsyncMetricSystemNetworkConnections( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricSystemNetworkConnections, + descrMetricSystemNetworkConnections, + unitMetricSystemNetworkConnections); +} + +/** + * Count of packets that are dropped or discarded even though there was no error + *

+ * Measured as: + *

+ *

+ * counter + */ +static constexpr const char *kMetricSystemNetworkDropped = "metric.system.network.dropped"; +static constexpr const char *descrMetricSystemNetworkDropped = + "Count of packets that are dropped or discarded even though there was no error"; +static constexpr const char *unitMetricSystemNetworkDropped = "{packet}"; + +static nostd::unique_ptr> CreateSyncMetricSystemNetworkDropped( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricSystemNetworkDropped, descrMetricSystemNetworkDropped, + unitMetricSystemNetworkDropped); +} + +static nostd::shared_ptr CreateAsyncMetricSystemNetworkDropped( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter( + kMetricSystemNetworkDropped, descrMetricSystemNetworkDropped, unitMetricSystemNetworkDropped); +} + +/** + * Count of network errors detected + *

+ * Measured as: + *

+ *

+ * counter + */ +static constexpr const char *kMetricSystemNetworkErrors = "metric.system.network.errors"; +static constexpr const char *descrMetricSystemNetworkErrors = "Count of network errors detected"; +static constexpr const char *unitMetricSystemNetworkErrors = "{error}"; + +static nostd::unique_ptr> CreateSyncMetricSystemNetworkErrors( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricSystemNetworkErrors, descrMetricSystemNetworkErrors, + unitMetricSystemNetworkErrors); +} + +static nostd::shared_ptr CreateAsyncMetricSystemNetworkErrors( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter( + kMetricSystemNetworkErrors, descrMetricSystemNetworkErrors, unitMetricSystemNetworkErrors); +} + +/** + * counter + */ +static constexpr const char *kMetricSystemNetworkIo = "metric.system.network.io"; +static constexpr const char *descrMetricSystemNetworkIo = ""; +static constexpr const char *unitMetricSystemNetworkIo = "By"; + +static nostd::unique_ptr> CreateSyncMetricSystemNetworkIo( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricSystemNetworkIo, descrMetricSystemNetworkIo, + unitMetricSystemNetworkIo); +} + +static nostd::shared_ptr CreateAsyncMetricSystemNetworkIo( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricSystemNetworkIo, descrMetricSystemNetworkIo, + unitMetricSystemNetworkIo); +} + +/** + * counter + */ +static constexpr const char *kMetricSystemNetworkPackets = "metric.system.network.packets"; +static constexpr const char *descrMetricSystemNetworkPackets = ""; +static constexpr const char *unitMetricSystemNetworkPackets = "{packet}"; + +static nostd::unique_ptr> CreateSyncMetricSystemNetworkPackets( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricSystemNetworkPackets, descrMetricSystemNetworkPackets, + unitMetricSystemNetworkPackets); +} + +static nostd::shared_ptr CreateAsyncMetricSystemNetworkPackets( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter( + kMetricSystemNetworkPackets, descrMetricSystemNetworkPackets, unitMetricSystemNetworkPackets); +} + +/** + * counter + */ +static constexpr const char *kMetricSystemPagingFaults = "metric.system.paging.faults"; +static constexpr const char *descrMetricSystemPagingFaults = ""; +static constexpr const char *unitMetricSystemPagingFaults = "{fault}"; + +static nostd::unique_ptr> CreateSyncMetricSystemPagingFaults( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricSystemPagingFaults, descrMetricSystemPagingFaults, + unitMetricSystemPagingFaults); +} + +static nostd::shared_ptr CreateAsyncMetricSystemPagingFaults( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter( + kMetricSystemPagingFaults, descrMetricSystemPagingFaults, unitMetricSystemPagingFaults); +} + +/** + * counter + */ +static constexpr const char *kMetricSystemPagingOperations = "metric.system.paging.operations"; +static constexpr const char *descrMetricSystemPagingOperations = ""; +static constexpr const char *unitMetricSystemPagingOperations = "{operation}"; + +static nostd::unique_ptr> CreateSyncMetricSystemPagingOperations( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricSystemPagingOperations, + descrMetricSystemPagingOperations, + unitMetricSystemPagingOperations); +} + +static nostd::shared_ptr CreateAsyncMetricSystemPagingOperations( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricSystemPagingOperations, + descrMetricSystemPagingOperations, + unitMetricSystemPagingOperations); +} + +/** + * Unix swap or windows pagefile usage + *

+ * updowncounter + */ +static constexpr const char *kMetricSystemPagingUsage = "metric.system.paging.usage"; +static constexpr const char *descrMetricSystemPagingUsage = "Unix swap or windows pagefile usage"; +static constexpr const char *unitMetricSystemPagingUsage = "By"; + +static nostd::unique_ptr> CreateSyncMetricSystemPagingUsage( + metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricSystemPagingUsage, descrMetricSystemPagingUsage, + unitMetricSystemPagingUsage); +} + +static nostd::shared_ptr CreateAsyncMetricSystemPagingUsage( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter( + kMetricSystemPagingUsage, descrMetricSystemPagingUsage, unitMetricSystemPagingUsage); +} + +/** + * gauge + */ +static constexpr const char *kMetricSystemPagingUtilization = "metric.system.paging.utilization"; +static constexpr const char *descrMetricSystemPagingUtilization = ""; +static constexpr const char *unitMetricSystemPagingUtilization = "1"; + +static nostd::unique_ptr> CreateSyncMetricSystemPagingUtilization( + metrics::Meter *meter) +{ + return meter->CreateUInt64Gauge(kMetricSystemPagingUtilization, + descrMetricSystemPagingUtilization, + unitMetricSystemPagingUtilization); +} + +static nostd::shared_ptr CreateAsyncMetricSystemPagingUtilization( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableGauge(kMetricSystemPagingUtilization, + descrMetricSystemPagingUtilization, + unitMetricSystemPagingUtilization); +} + +/** + * Total number of processes in each state + *

+ * updowncounter + */ +static constexpr const char *kMetricSystemProcessCount = "metric.system.process.count"; +static constexpr const char *descrMetricSystemProcessCount = + "Total number of processes in each state"; +static constexpr const char *unitMetricSystemProcessCount = "{process}"; + +static nostd::unique_ptr> CreateSyncMetricSystemProcessCount( + metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricSystemProcessCount, descrMetricSystemProcessCount, + unitMetricSystemProcessCount); +} + +static nostd::shared_ptr CreateAsyncMetricSystemProcessCount( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter( + kMetricSystemProcessCount, descrMetricSystemProcessCount, unitMetricSystemProcessCount); +} + +/** + * Total number of processes created over uptime of the host + *

+ * counter + */ +static constexpr const char *kMetricSystemProcessCreated = "metric.system.process.created"; +static constexpr const char *descrMetricSystemProcessCreated = + "Total number of processes created over uptime of the host"; +static constexpr const char *unitMetricSystemProcessCreated = "{process}"; + +static nostd::unique_ptr> CreateSyncMetricSystemProcessCreated( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricSystemProcessCreated, descrMetricSystemProcessCreated, + unitMetricSystemProcessCreated); +} + +static nostd::shared_ptr CreateAsyncMetricSystemProcessCreated( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter( + kMetricSystemProcessCreated, descrMetricSystemProcessCreated, unitMetricSystemProcessCreated); +} + +} // namespace system +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 b/buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 index f12a057dc0..ea87c18547 100644 --- a/buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 +++ b/buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 @@ -27,99 +27,141 @@ */ {# ========================================================================== #} -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{% set file_name = ctx.output + ctx.root_namespace | snake_case ~ "_metrics.py" -%} -{{- template.set_file_name(file_name) -}} - -{% import 'common.j2' as c -%} - -{%- macro stable_class_ref(const_name, separator) -%} -{{ctx.stable_package_name}}.{{ctx.root_namespace}}_metrics{{separator}}{{const_name}} -{%- endmacro %} - -{%- macro write_docstring(metric, const_name, prefix) -%} - {%- if metric is deprecated %} -{{prefix}}Deprecated: {{c.comment_with_prefix(metric.deprecated, prefix)}}. - {%- elif ctx.filter == "any" and metric.stability == "stable" %} -{{prefix}}Deprecated in favor of stable :py:const:`{{stable_class_ref(const_name, '.')}}`. - {%- else -%} - {%- if c.str_or_empty(metric.brief)|length %} -{{prefix}}{{c.comment_with_prefix(metric.brief, prefix)}} - {%- endif %} -{{prefix}}Instrument: {{ metric.instrument }} -{{prefix}}Unit: {{ metric.unit }} - {%- if c.str_or_empty(metric.note)|length %} -{{prefix}}Note: {{c.comment_with_prefix(metric.note, prefix)}}. - {%- endif -%} - {%- endif -%} -{%- endmacro -%} - -{%- macro import_instrument_classes(metrics) -%} - {% if ctx.filter == "any" %} -from opentelemetry.metrics import Meter - - {%- set instruments = ["counter", "histogram", "updowncounter"]-%} - {%- for i in instruments -%} - {%- if ctx.metrics | selectattr("instrument", "equalto", i) | list | count > 0 %} -from opentelemetry.metrics import {{i | map_text("py_instrument_to_type")}} - {%- endif -%} - {%- endfor-%} - - {%- if ctx.metrics | selectattr("instrument", "equalto", "gauge") | list | count > 0 %} -from typing import Callable, Generator, Iterable, Optional, Sequence, Union -from opentelemetry.metrics import CallbackOptions, ObservableGauge, Observation - -# pylint: disable=invalid-name -CallbackT = Union[ - Callable[[CallbackOptions], Iterable[Observation]], - Generator[Iterable[Observation], CallbackOptions, None], -] - {%- endif %} - - {%- endif -%} -{%- endmacro %} - -from typing import Final -{{ import_instrument_classes(filtered_metrics) }} - -{%- for metric in ctx.metrics %} -{% set const_name = metric.metric_name | screaming_snake_case %} -{{const_name}}: Final = "{{metric.metric_name}}" -{%- set doc_string=write_docstring(metric, const_name, "")-%}{%- if doc_string %} -"""{{doc_string}} -"""{% endif %} - -{% if ctx.filter == "any" %} -{% set metric_name = metric.metric_name | replace(".", "_") %} -{%- if metric.instrument == "gauge" %} -def create_{{ metric_name }}(meter: Meter, callbacks: Optional[Sequence[CallbackT]]) -> {{metric.instrument | map_text("py_instrument_to_type")}}: -{%- else %} -def create_{{ metric_name }}(meter: Meter) -> {{metric.instrument | map_text("py_instrument_to_type")}}: -{%- endif %} - {%- if c.str_or_empty(metric.brief) |length %} - """{{ c.comment_with_prefix(metric.brief, "") }}""" - {% endif -%} - return meter.create_{{ metric.instrument | map_text("py_instrument_to_factory")}}( - name={{ const_name }}, - {%- if metric.instrument == "gauge" %} - callbacks=callbacks, - {%- endif %} - description="{{ c.str_or_empty(metric.brief) }}", - unit="{{ metric.unit }}", - ) - {%- endif -%} +{% set debug = false %} + +{% set file_name = ctx.output + (ctx.root_namespace | snake_case) ~ "_metrics.h" %} +{{ template.set_file_name(file_name) }} +{% import 'common.j2' as c %} + +{% set metrics = ctx.metrics | list %} + +{% macro metric_namespace(ctx) %} +{{ ctx.root_namespace | snake_case }} +{% endmacro %} + +{% macro func_metric_name(metric) %} +{{ metric.id | pascal_case }} +{% endmacro %} + +{% macro var_metric_name(metric) %} +k{{ metric.id | pascal_case }} +{% endmacro %} + +{% macro descr_metric_name(metric) %} +descr{{ metric.id | pascal_case }} +{% endmacro %} + +{% macro unit_metric_name(metric) %} +unit{{ metric.id | pascal_case }} +{% endmacro %} + +{% macro sync_instrument_support(metric) %} +{{ metric.instrument | map_text("cpp_sync_support", "FIXME") }} +{% endmacro %} + +{% macro sync_instrument_type(metric) %} +{{ metric.instrument | map_text("cpp_sync_instrument_to_type", "FIXME") }} +{% endmacro %} + +{% macro sync_instrument_factory(metric) %} +{{ metric.instrument | map_text("cpp_sync_instrument_to_factory", "FIXME") }} +{% endmacro %} + +{% macro async_instrument_support(metric) %} +{{ metric.instrument | map_text("cpp_async_support", "FIXME") }} +{% endmacro %} + +{% macro async_instrument_type(metric) %} +{{ metric.instrument | map_text("cpp_async_instrument_to_type", "FIXME") }} +{% endmacro %} + +{% macro async_instrument_factory(metric) %} +{{ metric.instrument | map_text("cpp_async_instrument_to_factory", "FIXME") }} +{% endmacro %} + +{% set cpp_metric_namespace = metric_namespace(ctx) %} + +{# ========================================================================== #} + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace {{ cpp_metric_namespace -}} +{ + +{% for metric in ctx.metrics %} + {% if debug %} +// DEBUG: {{ metric }} + {% endif %} + {% set f_metric_name = func_metric_name(metric) %} + {% set v_metric_name = var_metric_name(metric) %} + {% set descr = descr_metric_name(metric) %} + {% set unit = unit_metric_name(metric) %} + {% set sync_support = sync_instrument_support(metric) %} + {% set async_support = async_instrument_support(metric) %} + {% set sync_type = sync_instrument_type(metric) %} + {% set async_type = async_instrument_type(metric) %} + {% set sync_factory = sync_instrument_factory(metric) %} + {% set async_factory = async_instrument_factory(metric) %} + {% set excluded = metric.id in ctx.excluded_attributes %} + {% if excluded %} +#if 0 +// Excluded metric: + {% endif %} + {% if metric is deprecated %} +{{ [metric.brief, "\n", "@deprecated", metric.deprecated, "\n", metric.note, "\n", metric.instrument] | comment(ident=2) }} +OPENTELEMETRY_DEPRECATED + {% else %} +{{ [metric.brief, "\n", metric.note, "\n", metric.instrument] | comment(ident=2) }} + {% endif %} +static constexpr const char *{{v_metric_name}} = "{{metric.id}}"; +static constexpr const char *{{descr}} = "{{metric.brief}}"; +static constexpr const char *{{unit}} = "{{metric.unit}}"; + + {% if not sync_support %} +#if LATER +// Unsupported: + {% endif %} +static nostd::unique_ptr<{{sync_type-}}> +CreateSync{{f_metric_name-}}(metrics::Meter *meter) +{ + return meter->{{sync_factory}}( + {{v_metric_name}}, + {{descr}}, + {{unit}}); +} + {% if not sync_support %} +#endif + {% endif %} + + {% if not async_support %} +#if LATER +// Unsupported: + {% endif %} +static nostd::shared_ptr<{{async_type-}}> +CreateAsync{{f_metric_name-}}(metrics::Meter *meter) +{ + return meter->{{async_factory}}( + {{v_metric_name}}, + {{descr}}, + {{unit}}); +} + {% if not async_support %} +#endif + {% endif %} + + {% if excluded %} +#endif + {% endif %} {% endfor %} + +} +} +OPENTELEMETRY_END_NAMESPACE + diff --git a/buildscripts/semantic-convention/templates/registry/weaver.yaml b/buildscripts/semantic-convention/templates/registry/weaver.yaml index 8d249a9b4b..59236bbeff 100644 --- a/buildscripts/semantic-convention/templates/registry/weaver.yaml +++ b/buildscripts/semantic-convention/templates/registry/weaver.yaml @@ -43,7 +43,7 @@ templates: | map({ root_namespace: .root_namespace, metrics: .metrics, - output: $output + "metrics/", + output: $output, stable_package_name: $stable_package_name + ".metrics", filter: $filter }) @@ -59,16 +59,45 @@ text_maps: template[string]: const char * template[string[]]: const char *[] - py_instrument_to_factory: - counter: counter - histogram: histogram - updowncounter: up_down_counter - gauge: observable_gauge - py_instrument_to_type: - counter: Counter - histogram: Histogram - updowncounter: UpDownCounter - gauge: ObservableGauge + cpp_sync_support: + counter: true + histogram: true + updowncounter: true + gauge: false + + cpp_sync_instrument_to_type: + counter: metrics::Counter + histogram: metrics::Histogram + updowncounter: metrics::UpDownCounter + # Not supported yet + gauge: metrics::Gauge + + cpp_sync_instrument_to_factory: + counter: CreateUInt64Counter + histogram: CreateUInt64Histogram + updowncounter: CreateInt64UpDownCounter + # Not supported yet + gauge: CreateUInt64Gauge + + cpp_async_support: + counter: true + histogram: false + updowncounter: true + gauge: true + + cpp_async_instrument_to_type: + counter: metrics::ObservableInstrument + # Not supported yet + histogram: metrics::ObservableInstrument + updowncounter: metrics::ObservableInstrument + gauge: metrics::ObservableInstrument + + cpp_async_instrument_to_factory: + counter: CreateInt64ObservableCounter + # Not supported yet + histogram: CreateInt64ObservableHistogram + updowncounter: CreateInt64ObservableUpDownCounter + gauge: CreateInt64ObservableGauge comment_formats: cpp: From 0642e24d50070504ed453e82736314b00092f4a5 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Wed, 23 Oct 2024 02:11:16 +0200 Subject: [PATCH 07/16] Metrics, continued. --- .../opentelemetry/semconv/http_metrics.h | 55 +- .../semconv/incubating/container_metrics.h | 77 ++- .../semconv/incubating/db_metrics.h | 479 ++++++++++--- .../semconv/incubating/dns_metrics.h | 24 +- .../semconv/incubating/faas_metrics.h | 180 ++++- .../semconv/incubating/gen_ai_metrics.h | 136 +++- .../semconv/incubating/http_metrics.h | 262 +++++-- .../semconv/incubating/messaging_metrics.h | 229 ++++++- .../semconv/incubating/process_metrics.h | 213 +++++- .../semconv/incubating/rpc_metrics.h | 259 +++++-- .../semconv/incubating/system_metrics.h | 642 +++++++++++++++--- buildscripts/semantic-convention/generate.sh | 12 +- .../templates/registry/semantic_metrics-h.j2 | 107 ++- .../templates/registry/weaver.yaml | 54 +- .../common/metrics_foo_library/foo_library.cc | 49 ++ .../common/metrics_foo_library/foo_library.h | 3 + examples/metrics_simple/metrics_ostream.cc | 19 + 17 files changed, 2370 insertions(+), 430 deletions(-) diff --git a/api/include/opentelemetry/semconv/http_metrics.h b/api/include/opentelemetry/semconv/http_metrics.h index ab698d3984..d41594ed15 100644 --- a/api/include/opentelemetry/semconv/http_metrics.h +++ b/api/include/opentelemetry/semconv/http_metrics.h @@ -11,6 +11,7 @@ #pragma once #include "opentelemetry/common/macros.h" +#include "opentelemetry/metrics/meter.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -30,22 +31,41 @@ static constexpr const char *descrMetricHttpClientRequestDuration = "Duration of HTTP client requests."; static constexpr const char *unitMetricHttpClientRequestDuration = "s"; -static nostd::unique_ptr> CreateSyncMetricHttpClientRequestDuration( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricHttpClientRequestDuration(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricHttpClientRequestDuration, descrMetricHttpClientRequestDuration, unitMetricHttpClientRequestDuration); } -static nostd::shared_ptr CreateAsyncMetricHttpClientRequestDuration( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricHttpClientRequestDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricHttpClientRequestDuration, + descrMetricHttpClientRequestDuration, + unitMetricHttpClientRequestDuration); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricHttpClientRequestDuration(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricHttpClientRequestDuration, descrMetricHttpClientRequestDuration, unitMetricHttpClientRequestDuration); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricHttpClientRequestDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricHttpClientRequestDuration, + descrMetricHttpClientRequestDuration, + unitMetricHttpClientRequestDuration); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Duration of HTTP server requests. *

@@ -57,22 +77,41 @@ static constexpr const char *descrMetricHttpServerRequestDuration = "Duration of HTTP server requests."; static constexpr const char *unitMetricHttpServerRequestDuration = "s"; -static nostd::unique_ptr> CreateSyncMetricHttpServerRequestDuration( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricHttpServerRequestDuration(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricHttpServerRequestDuration, descrMetricHttpServerRequestDuration, unitMetricHttpServerRequestDuration); } -static nostd::shared_ptr CreateAsyncMetricHttpServerRequestDuration( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricHttpServerRequestDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricHttpServerRequestDuration, + descrMetricHttpServerRequestDuration, + unitMetricHttpServerRequestDuration); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricHttpServerRequestDuration(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricHttpServerRequestDuration, descrMetricHttpServerRequestDuration, unitMetricHttpServerRequestDuration); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricHttpServerRequestDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricHttpServerRequestDuration, + descrMetricHttpServerRequestDuration, + unitMetricHttpServerRequestDuration); +} +#endif /* OPENTELEMETRY_LATER */ + } // namespace http } // namespace semconv OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/container_metrics.h b/api/include/opentelemetry/semconv/incubating/container_metrics.h index 450d334926..e670fb3788 100644 --- a/api/include/opentelemetry/semconv/incubating/container_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/container_metrics.h @@ -11,6 +11,7 @@ #pragma once #include "opentelemetry/common/macros.h" +#include "opentelemetry/metrics/meter.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -30,20 +31,34 @@ static constexpr const char *kMetricContainerCpuTime = "metric.container.cpu static constexpr const char *descrMetricContainerCpuTime = "Total CPU time consumed"; static constexpr const char *unitMetricContainerCpuTime = "s"; -static nostd::unique_ptr> CreateSyncMetricContainerCpuTime( +static inline nostd::unique_ptr> CreateSyncInt64MetricContainerCpuTime( metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricContainerCpuTime, descrMetricContainerCpuTime, unitMetricContainerCpuTime); } -static nostd::shared_ptr CreateAsyncMetricContainerCpuTime( +static inline nostd::unique_ptr> CreateSyncDoubleMetricContainerCpuTime( metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricContainerCpuTime, descrMetricContainerCpuTime, + unitMetricContainerCpuTime); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricContainerCpuTime(metrics::Meter *meter) { return meter->CreateInt64ObservableCounter(kMetricContainerCpuTime, descrMetricContainerCpuTime, unitMetricContainerCpuTime); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricContainerCpuTime(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricContainerCpuTime, descrMetricContainerCpuTime, + unitMetricContainerCpuTime); +} + /** * Disk bytes for the container. *

@@ -55,20 +70,34 @@ static constexpr const char *kMetricContainerDiskIo = "metric.container.disk static constexpr const char *descrMetricContainerDiskIo = "Disk bytes for the container."; static constexpr const char *unitMetricContainerDiskIo = "By"; -static nostd::unique_ptr> CreateSyncMetricContainerDiskIo( +static inline nostd::unique_ptr> CreateSyncInt64MetricContainerDiskIo( metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricContainerDiskIo, descrMetricContainerDiskIo, unitMetricContainerDiskIo); } -static nostd::shared_ptr CreateAsyncMetricContainerDiskIo( +static inline nostd::unique_ptr> CreateSyncDoubleMetricContainerDiskIo( metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricContainerDiskIo, descrMetricContainerDiskIo, + unitMetricContainerDiskIo); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricContainerDiskIo(metrics::Meter *meter) { return meter->CreateInt64ObservableCounter(kMetricContainerDiskIo, descrMetricContainerDiskIo, unitMetricContainerDiskIo); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricContainerDiskIo(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricContainerDiskIo, descrMetricContainerDiskIo, + unitMetricContainerDiskIo); +} + /** * Memory usage of the container. *

@@ -80,20 +109,34 @@ static constexpr const char *kMetricContainerMemoryUsage = "metric.container static constexpr const char *descrMetricContainerMemoryUsage = "Memory usage of the container."; static constexpr const char *unitMetricContainerMemoryUsage = "By"; -static nostd::unique_ptr> CreateSyncMetricContainerMemoryUsage( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricContainerMemoryUsage(metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricContainerMemoryUsage, descrMetricContainerMemoryUsage, unitMetricContainerMemoryUsage); } -static nostd::shared_ptr CreateAsyncMetricContainerMemoryUsage( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricContainerMemoryUsage(metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricContainerMemoryUsage, descrMetricContainerMemoryUsage, + unitMetricContainerMemoryUsage); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricContainerMemoryUsage(metrics::Meter *meter) { return meter->CreateInt64ObservableCounter( kMetricContainerMemoryUsage, descrMetricContainerMemoryUsage, unitMetricContainerMemoryUsage); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricContainerMemoryUsage(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter( + kMetricContainerMemoryUsage, descrMetricContainerMemoryUsage, unitMetricContainerMemoryUsage); +} + /** * Network bytes for the container. *

@@ -105,20 +148,34 @@ static constexpr const char *kMetricContainerNetworkIo = "metric.container.n static constexpr const char *descrMetricContainerNetworkIo = "Network bytes for the container."; static constexpr const char *unitMetricContainerNetworkIo = "By"; -static nostd::unique_ptr> CreateSyncMetricContainerNetworkIo( +static inline nostd::unique_ptr> CreateSyncInt64MetricContainerNetworkIo( metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricContainerNetworkIo, descrMetricContainerNetworkIo, unitMetricContainerNetworkIo); } -static nostd::shared_ptr CreateAsyncMetricContainerNetworkIo( +static inline nostd::unique_ptr> CreateSyncDoubleMetricContainerNetworkIo( metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricContainerNetworkIo, descrMetricContainerNetworkIo, + unitMetricContainerNetworkIo); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricContainerNetworkIo(metrics::Meter *meter) { return meter->CreateInt64ObservableCounter( kMetricContainerNetworkIo, descrMetricContainerNetworkIo, unitMetricContainerNetworkIo); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricContainerNetworkIo(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter( + kMetricContainerNetworkIo, descrMetricContainerNetworkIo, unitMetricContainerNetworkIo); +} + } // namespace container } // namespace semconv OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/db_metrics.h b/api/include/opentelemetry/semconv/incubating/db_metrics.h index a2bda6b9c3..58a5466af9 100644 --- a/api/include/opentelemetry/semconv/incubating/db_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/db_metrics.h @@ -11,6 +11,7 @@ #pragma once #include "opentelemetry/common/macros.h" +#include "opentelemetry/metrics/meter.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -28,22 +29,38 @@ static constexpr const char *descrMetricDbClientConnectionCount = "The number of connections that are currently in state described by the `state` attribute"; static constexpr const char *unitMetricDbClientConnectionCount = "{connection}"; -static nostd::unique_ptr> CreateSyncMetricDbClientConnectionCount( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricDbClientConnectionCount(metrics::Meter *meter) { return meter->CreateInt64UpDownCounter(kMetricDbClientConnectionCount, descrMetricDbClientConnectionCount, unitMetricDbClientConnectionCount); } -static nostd::shared_ptr CreateAsyncMetricDbClientConnectionCount( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricDbClientConnectionCount(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricDbClientConnectionCount, + descrMetricDbClientConnectionCount, + unitMetricDbClientConnectionCount); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricDbClientConnectionCount(metrics::Meter *meter) { return meter->CreateInt64ObservableUpDownCounter(kMetricDbClientConnectionCount, descrMetricDbClientConnectionCount, unitMetricDbClientConnectionCount); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricDbClientConnectionCount(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricDbClientConnectionCount, + descrMetricDbClientConnectionCount, + unitMetricDbClientConnectionCount); +} + /** * The time it took to create a new connection *

@@ -55,22 +72,41 @@ static constexpr const char *descrMetricDbClientConnectionCreateTime = "The time it took to create a new connection"; static constexpr const char *unitMetricDbClientConnectionCreateTime = "s"; -static nostd::unique_ptr> CreateSyncMetricDbClientConnectionCreateTime( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricDbClientConnectionCreateTime(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricDbClientConnectionCreateTime, descrMetricDbClientConnectionCreateTime, unitMetricDbClientConnectionCreateTime); } -static nostd::shared_ptr -CreateAsyncMetricDbClientConnectionCreateTime(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricDbClientConnectionCreateTime(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricDbClientConnectionCreateTime, + descrMetricDbClientConnectionCreateTime, + unitMetricDbClientConnectionCreateTime); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricDbClientConnectionCreateTime(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricDbClientConnectionCreateTime, descrMetricDbClientConnectionCreateTime, unitMetricDbClientConnectionCreateTime); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricDbClientConnectionCreateTime(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricDbClientConnectionCreateTime, + descrMetricDbClientConnectionCreateTime, + unitMetricDbClientConnectionCreateTime); +} +#endif /* OPENTELEMETRY_LATER */ + /** * The maximum number of idle open connections allowed *

@@ -82,22 +118,38 @@ static constexpr const char *descrMetricDbClientConnectionIdleMax = "The maximum number of idle open connections allowed"; static constexpr const char *unitMetricDbClientConnectionIdleMax = "{connection}"; -static nostd::unique_ptr> -CreateSyncMetricDbClientConnectionIdleMax(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricDbClientConnectionIdleMax(metrics::Meter *meter) { return meter->CreateInt64UpDownCounter(kMetricDbClientConnectionIdleMax, descrMetricDbClientConnectionIdleMax, unitMetricDbClientConnectionIdleMax); } -static nostd::shared_ptr CreateAsyncMetricDbClientConnectionIdleMax( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricDbClientConnectionIdleMax(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricDbClientConnectionIdleMax, + descrMetricDbClientConnectionIdleMax, + unitMetricDbClientConnectionIdleMax); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricDbClientConnectionIdleMax(metrics::Meter *meter) { return meter->CreateInt64ObservableUpDownCounter(kMetricDbClientConnectionIdleMax, descrMetricDbClientConnectionIdleMax, unitMetricDbClientConnectionIdleMax); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricDbClientConnectionIdleMax(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricDbClientConnectionIdleMax, + descrMetricDbClientConnectionIdleMax, + unitMetricDbClientConnectionIdleMax); +} + /** * The minimum number of idle open connections allowed *

@@ -109,22 +161,38 @@ static constexpr const char *descrMetricDbClientConnectionIdleMin = "The minimum number of idle open connections allowed"; static constexpr const char *unitMetricDbClientConnectionIdleMin = "{connection}"; -static nostd::unique_ptr> -CreateSyncMetricDbClientConnectionIdleMin(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricDbClientConnectionIdleMin(metrics::Meter *meter) { return meter->CreateInt64UpDownCounter(kMetricDbClientConnectionIdleMin, descrMetricDbClientConnectionIdleMin, unitMetricDbClientConnectionIdleMin); } -static nostd::shared_ptr CreateAsyncMetricDbClientConnectionIdleMin( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricDbClientConnectionIdleMin(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricDbClientConnectionIdleMin, + descrMetricDbClientConnectionIdleMin, + unitMetricDbClientConnectionIdleMin); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricDbClientConnectionIdleMin(metrics::Meter *meter) { return meter->CreateInt64ObservableUpDownCounter(kMetricDbClientConnectionIdleMin, descrMetricDbClientConnectionIdleMin, unitMetricDbClientConnectionIdleMin); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricDbClientConnectionIdleMin(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricDbClientConnectionIdleMin, + descrMetricDbClientConnectionIdleMin, + unitMetricDbClientConnectionIdleMin); +} + /** * The maximum number of open connections allowed *

@@ -135,22 +203,38 @@ static constexpr const char *descrMetricDbClientConnectionMax = "The maximum number of open connections allowed"; static constexpr const char *unitMetricDbClientConnectionMax = "{connection}"; -static nostd::unique_ptr> CreateSyncMetricDbClientConnectionMax( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricDbClientConnectionMax(metrics::Meter *meter) { return meter->CreateInt64UpDownCounter(kMetricDbClientConnectionMax, descrMetricDbClientConnectionMax, unitMetricDbClientConnectionMax); } -static nostd::shared_ptr CreateAsyncMetricDbClientConnectionMax( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricDbClientConnectionMax(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricDbClientConnectionMax, + descrMetricDbClientConnectionMax, + unitMetricDbClientConnectionMax); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricDbClientConnectionMax(metrics::Meter *meter) { return meter->CreateInt64ObservableUpDownCounter(kMetricDbClientConnectionMax, descrMetricDbClientConnectionMax, unitMetricDbClientConnectionMax); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricDbClientConnectionMax(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricDbClientConnectionMax, + descrMetricDbClientConnectionMax, + unitMetricDbClientConnectionMax); +} + /** * The number of pending requests for an open connection, cumulative for the entire pool *

@@ -162,22 +246,38 @@ static constexpr const char *descrMetricDbClientConnectionPendingRequests = "The number of pending requests for an open connection, cumulative for the entire pool"; static constexpr const char *unitMetricDbClientConnectionPendingRequests = "{request}"; -static nostd::unique_ptr> -CreateSyncMetricDbClientConnectionPendingRequests(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricDbClientConnectionPendingRequests(metrics::Meter *meter) { return meter->CreateInt64UpDownCounter(kMetricDbClientConnectionPendingRequests, descrMetricDbClientConnectionPendingRequests, unitMetricDbClientConnectionPendingRequests); } -static nostd::shared_ptr -CreateAsyncMetricDbClientConnectionPendingRequests(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricDbClientConnectionPendingRequests(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricDbClientConnectionPendingRequests, + descrMetricDbClientConnectionPendingRequests, + unitMetricDbClientConnectionPendingRequests); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricDbClientConnectionPendingRequests(metrics::Meter *meter) { return meter->CreateInt64ObservableUpDownCounter(kMetricDbClientConnectionPendingRequests, descrMetricDbClientConnectionPendingRequests, unitMetricDbClientConnectionPendingRequests); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricDbClientConnectionPendingRequests(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricDbClientConnectionPendingRequests, + descrMetricDbClientConnectionPendingRequests, + unitMetricDbClientConnectionPendingRequests); +} + /** * The number of connection timeouts that have occurred trying to obtain a connection from the pool *

@@ -190,22 +290,38 @@ static constexpr const char *descrMetricDbClientConnectionTimeouts = "pool"; static constexpr const char *unitMetricDbClientConnectionTimeouts = "{timeout}"; -static nostd::unique_ptr> CreateSyncMetricDbClientConnectionTimeouts( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricDbClientConnectionTimeouts(metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricDbClientConnectionTimeouts, descrMetricDbClientConnectionTimeouts, unitMetricDbClientConnectionTimeouts); } -static nostd::shared_ptr CreateAsyncMetricDbClientConnectionTimeouts( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricDbClientConnectionTimeouts(metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricDbClientConnectionTimeouts, + descrMetricDbClientConnectionTimeouts, + unitMetricDbClientConnectionTimeouts); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricDbClientConnectionTimeouts(metrics::Meter *meter) { return meter->CreateInt64ObservableCounter(kMetricDbClientConnectionTimeouts, descrMetricDbClientConnectionTimeouts, unitMetricDbClientConnectionTimeouts); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricDbClientConnectionTimeouts(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricDbClientConnectionTimeouts, + descrMetricDbClientConnectionTimeouts, + unitMetricDbClientConnectionTimeouts); +} + /** * The time between borrowing a connection and returning it to the pool *

@@ -217,22 +333,41 @@ static constexpr const char *descrMetricDbClientConnectionUseTime = "The time between borrowing a connection and returning it to the pool"; static constexpr const char *unitMetricDbClientConnectionUseTime = "s"; -static nostd::unique_ptr> CreateSyncMetricDbClientConnectionUseTime( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricDbClientConnectionUseTime(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricDbClientConnectionUseTime, descrMetricDbClientConnectionUseTime, unitMetricDbClientConnectionUseTime); } -static nostd::shared_ptr CreateAsyncMetricDbClientConnectionUseTime( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricDbClientConnectionUseTime(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricDbClientConnectionUseTime, + descrMetricDbClientConnectionUseTime, + unitMetricDbClientConnectionUseTime); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricDbClientConnectionUseTime(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricDbClientConnectionUseTime, descrMetricDbClientConnectionUseTime, unitMetricDbClientConnectionUseTime); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricDbClientConnectionUseTime(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricDbClientConnectionUseTime, + descrMetricDbClientConnectionUseTime, + unitMetricDbClientConnectionUseTime); +} +#endif /* OPENTELEMETRY_LATER */ + /** * The time it took to obtain an open connection from the pool *

@@ -244,22 +379,41 @@ static constexpr const char *descrMetricDbClientConnectionWaitTime = "The time it took to obtain an open connection from the pool"; static constexpr const char *unitMetricDbClientConnectionWaitTime = "s"; -static nostd::unique_ptr> CreateSyncMetricDbClientConnectionWaitTime( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricDbClientConnectionWaitTime(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricDbClientConnectionWaitTime, descrMetricDbClientConnectionWaitTime, unitMetricDbClientConnectionWaitTime); } -static nostd::shared_ptr CreateAsyncMetricDbClientConnectionWaitTime( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricDbClientConnectionWaitTime(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricDbClientConnectionWaitTime, + descrMetricDbClientConnectionWaitTime, + unitMetricDbClientConnectionWaitTime); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricDbClientConnectionWaitTime(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricDbClientConnectionWaitTime, descrMetricDbClientConnectionWaitTime, unitMetricDbClientConnectionWaitTime); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricDbClientConnectionWaitTime(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricDbClientConnectionWaitTime, + descrMetricDbClientConnectionWaitTime, + unitMetricDbClientConnectionWaitTime); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Deprecated, use @code db.client.connection.create_time @endcode instead. Note: the unit also * changed from @code ms @endcode to @code s @endcode.

@@ -275,22 +429,41 @@ static constexpr const char *descrMetricDbClientConnectionsCreateTimeDeprecated "`ms` to `s`."; static constexpr const char *unitMetricDbClientConnectionsCreateTimeDeprecated = "ms"; -static nostd::unique_ptr> -CreateSyncMetricDbClientConnectionsCreateTimeDeprecated(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricDbClientConnectionsCreateTimeDeprecated(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricDbClientConnectionsCreateTimeDeprecated, descrMetricDbClientConnectionsCreateTimeDeprecated, unitMetricDbClientConnectionsCreateTimeDeprecated); } -static nostd::shared_ptr -CreateAsyncMetricDbClientConnectionsCreateTimeDeprecated(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricDbClientConnectionsCreateTimeDeprecated(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricDbClientConnectionsCreateTimeDeprecated, + descrMetricDbClientConnectionsCreateTimeDeprecated, + unitMetricDbClientConnectionsCreateTimeDeprecated); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricDbClientConnectionsCreateTimeDeprecated(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricDbClientConnectionsCreateTimeDeprecated, descrMetricDbClientConnectionsCreateTimeDeprecated, unitMetricDbClientConnectionsCreateTimeDeprecated); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricDbClientConnectionsCreateTimeDeprecated(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricDbClientConnectionsCreateTimeDeprecated, + descrMetricDbClientConnectionsCreateTimeDeprecated, + unitMetricDbClientConnectionsCreateTimeDeprecated); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Deprecated, use @code db.client.connection.idle.max @endcode instead. *

@@ -306,22 +479,38 @@ static constexpr const char *descrMetricDbClientConnectionsIdleMaxDeprecated = "Deprecated, use `db.client.connection.idle.max` instead."; static constexpr const char *unitMetricDbClientConnectionsIdleMaxDeprecated = "{connection}"; -static nostd::unique_ptr> -CreateSyncMetricDbClientConnectionsIdleMaxDeprecated(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricDbClientConnectionsIdleMaxDeprecated(metrics::Meter *meter) { return meter->CreateInt64UpDownCounter(kMetricDbClientConnectionsIdleMaxDeprecated, descrMetricDbClientConnectionsIdleMaxDeprecated, unitMetricDbClientConnectionsIdleMaxDeprecated); } -static nostd::shared_ptr -CreateAsyncMetricDbClientConnectionsIdleMaxDeprecated(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricDbClientConnectionsIdleMaxDeprecated(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricDbClientConnectionsIdleMaxDeprecated, + descrMetricDbClientConnectionsIdleMaxDeprecated, + unitMetricDbClientConnectionsIdleMaxDeprecated); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricDbClientConnectionsIdleMaxDeprecated(metrics::Meter *meter) { return meter->CreateInt64ObservableUpDownCounter(kMetricDbClientConnectionsIdleMaxDeprecated, descrMetricDbClientConnectionsIdleMaxDeprecated, unitMetricDbClientConnectionsIdleMaxDeprecated); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricDbClientConnectionsIdleMaxDeprecated(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricDbClientConnectionsIdleMaxDeprecated, + descrMetricDbClientConnectionsIdleMaxDeprecated, + unitMetricDbClientConnectionsIdleMaxDeprecated); +} + /** * Deprecated, use @code db.client.connection.idle.min @endcode instead. *

@@ -337,22 +526,38 @@ static constexpr const char *descrMetricDbClientConnectionsIdleMinDeprecated = "Deprecated, use `db.client.connection.idle.min` instead."; static constexpr const char *unitMetricDbClientConnectionsIdleMinDeprecated = "{connection}"; -static nostd::unique_ptr> -CreateSyncMetricDbClientConnectionsIdleMinDeprecated(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricDbClientConnectionsIdleMinDeprecated(metrics::Meter *meter) { return meter->CreateInt64UpDownCounter(kMetricDbClientConnectionsIdleMinDeprecated, descrMetricDbClientConnectionsIdleMinDeprecated, unitMetricDbClientConnectionsIdleMinDeprecated); } -static nostd::shared_ptr -CreateAsyncMetricDbClientConnectionsIdleMinDeprecated(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricDbClientConnectionsIdleMinDeprecated(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricDbClientConnectionsIdleMinDeprecated, + descrMetricDbClientConnectionsIdleMinDeprecated, + unitMetricDbClientConnectionsIdleMinDeprecated); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricDbClientConnectionsIdleMinDeprecated(metrics::Meter *meter) { return meter->CreateInt64ObservableUpDownCounter(kMetricDbClientConnectionsIdleMinDeprecated, descrMetricDbClientConnectionsIdleMinDeprecated, unitMetricDbClientConnectionsIdleMinDeprecated); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricDbClientConnectionsIdleMinDeprecated(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricDbClientConnectionsIdleMinDeprecated, + descrMetricDbClientConnectionsIdleMinDeprecated, + unitMetricDbClientConnectionsIdleMinDeprecated); +} + /** * Deprecated, use @code db.client.connection.max @endcode instead. *

@@ -368,22 +573,38 @@ static constexpr const char *descrMetricDbClientConnectionsMaxDeprecated = "Deprecated, use `db.client.connection.max` instead."; static constexpr const char *unitMetricDbClientConnectionsMaxDeprecated = "{connection}"; -static nostd::unique_ptr> -CreateSyncMetricDbClientConnectionsMaxDeprecated(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricDbClientConnectionsMaxDeprecated(metrics::Meter *meter) { return meter->CreateInt64UpDownCounter(kMetricDbClientConnectionsMaxDeprecated, descrMetricDbClientConnectionsMaxDeprecated, unitMetricDbClientConnectionsMaxDeprecated); } -static nostd::shared_ptr -CreateAsyncMetricDbClientConnectionsMaxDeprecated(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricDbClientConnectionsMaxDeprecated(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricDbClientConnectionsMaxDeprecated, + descrMetricDbClientConnectionsMaxDeprecated, + unitMetricDbClientConnectionsMaxDeprecated); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricDbClientConnectionsMaxDeprecated(metrics::Meter *meter) { return meter->CreateInt64ObservableUpDownCounter(kMetricDbClientConnectionsMaxDeprecated, descrMetricDbClientConnectionsMaxDeprecated, unitMetricDbClientConnectionsMaxDeprecated); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricDbClientConnectionsMaxDeprecated(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricDbClientConnectionsMaxDeprecated, + descrMetricDbClientConnectionsMaxDeprecated, + unitMetricDbClientConnectionsMaxDeprecated); +} + /** * Deprecated, use @code db.client.connection.pending_requests @endcode instead. *

@@ -399,16 +620,24 @@ static constexpr const char *descrMetricDbClientConnectionsPendingRequestsDeprec "Deprecated, use `db.client.connection.pending_requests` instead."; static constexpr const char *unitMetricDbClientConnectionsPendingRequestsDeprecated = "{request}"; -static nostd::unique_ptr> -CreateSyncMetricDbClientConnectionsPendingRequestsDeprecated(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricDbClientConnectionsPendingRequestsDeprecated(metrics::Meter *meter) { return meter->CreateInt64UpDownCounter(kMetricDbClientConnectionsPendingRequestsDeprecated, descrMetricDbClientConnectionsPendingRequestsDeprecated, unitMetricDbClientConnectionsPendingRequestsDeprecated); } -static nostd::shared_ptr -CreateAsyncMetricDbClientConnectionsPendingRequestsDeprecated(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricDbClientConnectionsPendingRequestsDeprecated(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricDbClientConnectionsPendingRequestsDeprecated, + descrMetricDbClientConnectionsPendingRequestsDeprecated, + unitMetricDbClientConnectionsPendingRequestsDeprecated); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricDbClientConnectionsPendingRequestsDeprecated(metrics::Meter *meter) { return meter->CreateInt64ObservableUpDownCounter( kMetricDbClientConnectionsPendingRequestsDeprecated, @@ -416,6 +645,15 @@ CreateAsyncMetricDbClientConnectionsPendingRequestsDeprecated(metrics::Meter *me unitMetricDbClientConnectionsPendingRequestsDeprecated); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricDbClientConnectionsPendingRequestsDeprecated(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter( + kMetricDbClientConnectionsPendingRequestsDeprecated, + descrMetricDbClientConnectionsPendingRequestsDeprecated, + unitMetricDbClientConnectionsPendingRequestsDeprecated); +} + /** * Deprecated, use @code db.client.connection.timeouts @endcode instead. *

@@ -431,22 +669,38 @@ static constexpr const char *descrMetricDbClientConnectionsTimeoutsDeprecated = "Deprecated, use `db.client.connection.timeouts` instead."; static constexpr const char *unitMetricDbClientConnectionsTimeoutsDeprecated = "{timeout}"; -static nostd::unique_ptr> -CreateSyncMetricDbClientConnectionsTimeoutsDeprecated(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricDbClientConnectionsTimeoutsDeprecated(metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricDbClientConnectionsTimeoutsDeprecated, descrMetricDbClientConnectionsTimeoutsDeprecated, unitMetricDbClientConnectionsTimeoutsDeprecated); } -static nostd::shared_ptr -CreateAsyncMetricDbClientConnectionsTimeoutsDeprecated(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricDbClientConnectionsTimeoutsDeprecated(metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricDbClientConnectionsTimeoutsDeprecated, + descrMetricDbClientConnectionsTimeoutsDeprecated, + unitMetricDbClientConnectionsTimeoutsDeprecated); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricDbClientConnectionsTimeoutsDeprecated(metrics::Meter *meter) { return meter->CreateInt64ObservableCounter(kMetricDbClientConnectionsTimeoutsDeprecated, descrMetricDbClientConnectionsTimeoutsDeprecated, unitMetricDbClientConnectionsTimeoutsDeprecated); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricDbClientConnectionsTimeoutsDeprecated(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricDbClientConnectionsTimeoutsDeprecated, + descrMetricDbClientConnectionsTimeoutsDeprecated, + unitMetricDbClientConnectionsTimeoutsDeprecated); +} + /** * Deprecated, use @code db.client.connection.count @endcode instead. *

@@ -462,22 +716,38 @@ static constexpr const char *descrMetricDbClientConnectionsCountDeprecated = "Deprecated, use `db.client.connection.count` instead."; static constexpr const char *unitMetricDbClientConnectionsCountDeprecated = "{connection}"; -static nostd::unique_ptr> -CreateSyncMetricDbClientConnectionsCountDeprecated(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricDbClientConnectionsCountDeprecated(metrics::Meter *meter) { return meter->CreateInt64UpDownCounter(kMetricDbClientConnectionsCountDeprecated, descrMetricDbClientConnectionsCountDeprecated, unitMetricDbClientConnectionsCountDeprecated); } -static nostd::shared_ptr -CreateAsyncMetricDbClientConnectionsCountDeprecated(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricDbClientConnectionsCountDeprecated(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricDbClientConnectionsCountDeprecated, + descrMetricDbClientConnectionsCountDeprecated, + unitMetricDbClientConnectionsCountDeprecated); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricDbClientConnectionsCountDeprecated(metrics::Meter *meter) { return meter->CreateInt64ObservableUpDownCounter(kMetricDbClientConnectionsCountDeprecated, descrMetricDbClientConnectionsCountDeprecated, unitMetricDbClientConnectionsCountDeprecated); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricDbClientConnectionsCountDeprecated(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricDbClientConnectionsCountDeprecated, + descrMetricDbClientConnectionsCountDeprecated, + unitMetricDbClientConnectionsCountDeprecated); +} + /** * Deprecated, use @code db.client.connection.use_time @endcode instead. Note: the unit also changed * from @code ms @endcode to @code s @endcode.

@@ -493,22 +763,41 @@ static constexpr const char *descrMetricDbClientConnectionsUseTimeDeprecated = "`ms` to `s`."; static constexpr const char *unitMetricDbClientConnectionsUseTimeDeprecated = "ms"; -static nostd::unique_ptr> -CreateSyncMetricDbClientConnectionsUseTimeDeprecated(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricDbClientConnectionsUseTimeDeprecated(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricDbClientConnectionsUseTimeDeprecated, descrMetricDbClientConnectionsUseTimeDeprecated, unitMetricDbClientConnectionsUseTimeDeprecated); } -static nostd::shared_ptr -CreateAsyncMetricDbClientConnectionsUseTimeDeprecated(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricDbClientConnectionsUseTimeDeprecated(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricDbClientConnectionsUseTimeDeprecated, + descrMetricDbClientConnectionsUseTimeDeprecated, + unitMetricDbClientConnectionsUseTimeDeprecated); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricDbClientConnectionsUseTimeDeprecated(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricDbClientConnectionsUseTimeDeprecated, descrMetricDbClientConnectionsUseTimeDeprecated, unitMetricDbClientConnectionsUseTimeDeprecated); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricDbClientConnectionsUseTimeDeprecated(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricDbClientConnectionsUseTimeDeprecated, + descrMetricDbClientConnectionsUseTimeDeprecated, + unitMetricDbClientConnectionsUseTimeDeprecated); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Deprecated, use @code db.client.connection.wait_time @endcode instead. Note: the unit also * changed from @code ms @endcode to @code s @endcode.

@@ -524,22 +813,41 @@ static constexpr const char *descrMetricDbClientConnectionsWaitTimeDeprecated = "`ms` to `s`."; static constexpr const char *unitMetricDbClientConnectionsWaitTimeDeprecated = "ms"; -static nostd::unique_ptr> -CreateSyncMetricDbClientConnectionsWaitTimeDeprecated(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricDbClientConnectionsWaitTimeDeprecated(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricDbClientConnectionsWaitTimeDeprecated, descrMetricDbClientConnectionsWaitTimeDeprecated, unitMetricDbClientConnectionsWaitTimeDeprecated); } -static nostd::shared_ptr -CreateAsyncMetricDbClientConnectionsWaitTimeDeprecated(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricDbClientConnectionsWaitTimeDeprecated(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricDbClientConnectionsWaitTimeDeprecated, + descrMetricDbClientConnectionsWaitTimeDeprecated, + unitMetricDbClientConnectionsWaitTimeDeprecated); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricDbClientConnectionsWaitTimeDeprecated(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricDbClientConnectionsWaitTimeDeprecated, descrMetricDbClientConnectionsWaitTimeDeprecated, unitMetricDbClientConnectionsWaitTimeDeprecated); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricDbClientConnectionsWaitTimeDeprecated(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricDbClientConnectionsWaitTimeDeprecated, + descrMetricDbClientConnectionsWaitTimeDeprecated, + unitMetricDbClientConnectionsWaitTimeDeprecated); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Duration of database client operations. *

@@ -553,22 +861,41 @@ static constexpr const char *descrMetricDbClientOperationDuration = "Duration of database client operations."; static constexpr const char *unitMetricDbClientOperationDuration = "s"; -static nostd::unique_ptr> CreateSyncMetricDbClientOperationDuration( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricDbClientOperationDuration(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricDbClientOperationDuration, descrMetricDbClientOperationDuration, unitMetricDbClientOperationDuration); } -static nostd::shared_ptr CreateAsyncMetricDbClientOperationDuration( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricDbClientOperationDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricDbClientOperationDuration, + descrMetricDbClientOperationDuration, + unitMetricDbClientOperationDuration); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricDbClientOperationDuration(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricDbClientOperationDuration, descrMetricDbClientOperationDuration, unitMetricDbClientOperationDuration); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricDbClientOperationDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricDbClientOperationDuration, + descrMetricDbClientOperationDuration, + unitMetricDbClientOperationDuration); +} +#endif /* OPENTELEMETRY_LATER */ + } // namespace db } // namespace semconv OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/dns_metrics.h b/api/include/opentelemetry/semconv/incubating/dns_metrics.h index abd9513a0c..ccdb91de84 100644 --- a/api/include/opentelemetry/semconv/incubating/dns_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/dns_metrics.h @@ -11,6 +11,7 @@ #pragma once #include "opentelemetry/common/macros.h" +#include "opentelemetry/metrics/meter.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -29,20 +30,37 @@ static constexpr const char *descrMetricDnsLookupDuration = "Measures the time taken to perform a DNS lookup."; static constexpr const char *unitMetricDnsLookupDuration = "s"; -static nostd::unique_ptr> CreateSyncMetricDnsLookupDuration( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricDnsLookupDuration(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricDnsLookupDuration, descrMetricDnsLookupDuration, unitMetricDnsLookupDuration); } -static nostd::shared_ptr CreateAsyncMetricDnsLookupDuration( +static inline nostd::unique_ptr> CreateSyncDoubleMetricDnsLookupDuration( metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricDnsLookupDuration, descrMetricDnsLookupDuration, + unitMetricDnsLookupDuration); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricDnsLookupDuration(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram( kMetricDnsLookupDuration, descrMetricDnsLookupDuration, unitMetricDnsLookupDuration); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricDnsLookupDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram( + kMetricDnsLookupDuration, descrMetricDnsLookupDuration, unitMetricDnsLookupDuration); +} +#endif /* OPENTELEMETRY_LATER */ + } // namespace dns } // namespace semconv OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/faas_metrics.h b/api/include/opentelemetry/semconv/incubating/faas_metrics.h index fcfdfad251..10d2196d93 100644 --- a/api/include/opentelemetry/semconv/incubating/faas_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/faas_metrics.h @@ -11,6 +11,7 @@ #pragma once #include "opentelemetry/common/macros.h" +#include "opentelemetry/metrics/meter.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -28,20 +29,34 @@ static constexpr const char *kMetricFaasColdstarts = "metric.faas.coldstarts static constexpr const char *descrMetricFaasColdstarts = "Number of invocation cold starts"; static constexpr const char *unitMetricFaasColdstarts = "{coldstart}"; -static nostd::unique_ptr> CreateSyncMetricFaasColdstarts( +static inline nostd::unique_ptr> CreateSyncInt64MetricFaasColdstarts( metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricFaasColdstarts, descrMetricFaasColdstarts, unitMetricFaasColdstarts); } -static nostd::shared_ptr CreateAsyncMetricFaasColdstarts( +static inline nostd::unique_ptr> CreateSyncDoubleMetricFaasColdstarts( + metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricFaasColdstarts, descrMetricFaasColdstarts, + unitMetricFaasColdstarts); +} + +static inline nostd::shared_ptr CreateAsyncInt64MetricFaasColdstarts( metrics::Meter *meter) { return meter->CreateInt64ObservableCounter(kMetricFaasColdstarts, descrMetricFaasColdstarts, unitMetricFaasColdstarts); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricFaasColdstarts(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricFaasColdstarts, descrMetricFaasColdstarts, + unitMetricFaasColdstarts); +} + /** * Distribution of CPU usage per invocation *

@@ -51,20 +66,37 @@ static constexpr const char *kMetricFaasCpuUsage = "metric.faas.cpu_usage"; static constexpr const char *descrMetricFaasCpuUsage = "Distribution of CPU usage per invocation"; static constexpr const char *unitMetricFaasCpuUsage = "s"; -static nostd::unique_ptr> CreateSyncMetricFaasCpuUsage( +static inline nostd::unique_ptr> CreateSyncInt64MetricFaasCpuUsage( metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricFaasCpuUsage, descrMetricFaasCpuUsage, unitMetricFaasCpuUsage); } -static nostd::shared_ptr CreateAsyncMetricFaasCpuUsage( +static inline nostd::unique_ptr> CreateSyncDoubleMetricFaasCpuUsage( + metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricFaasCpuUsage, descrMetricFaasCpuUsage, + unitMetricFaasCpuUsage); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr CreateAsyncInt64MetricFaasCpuUsage( metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricFaasCpuUsage, descrMetricFaasCpuUsage, unitMetricFaasCpuUsage); } +static inline nostd::shared_ptr CreateAsyncDoubleMetricFaasCpuUsage( + metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricFaasCpuUsage, descrMetricFaasCpuUsage, + unitMetricFaasCpuUsage); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Number of invocation errors *

@@ -74,19 +106,32 @@ static constexpr const char *kMetricFaasErrors = "metric.faas.errors"; static constexpr const char *descrMetricFaasErrors = "Number of invocation errors"; static constexpr const char *unitMetricFaasErrors = "{error}"; -static nostd::unique_ptr> CreateSyncMetricFaasErrors( +static inline nostd::unique_ptr> CreateSyncInt64MetricFaasErrors( metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricFaasErrors, descrMetricFaasErrors, unitMetricFaasErrors); } -static nostd::shared_ptr CreateAsyncMetricFaasErrors( +static inline nostd::unique_ptr> CreateSyncDoubleMetricFaasErrors( + metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricFaasErrors, descrMetricFaasErrors, unitMetricFaasErrors); +} + +static inline nostd::shared_ptr CreateAsyncInt64MetricFaasErrors( metrics::Meter *meter) { return meter->CreateInt64ObservableCounter(kMetricFaasErrors, descrMetricFaasErrors, unitMetricFaasErrors); } +static inline nostd::shared_ptr CreateAsyncDoubleMetricFaasErrors( + metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricFaasErrors, descrMetricFaasErrors, + unitMetricFaasErrors); +} + /** * Measures the duration of the function's initialization, such as a cold start *

@@ -97,20 +142,37 @@ static constexpr const char *descrMetricFaasInitDuration = "Measures the duration of the function's initialization, such as a cold start"; static constexpr const char *unitMetricFaasInitDuration = "s"; -static nostd::unique_ptr> CreateSyncMetricFaasInitDuration( +static inline nostd::unique_ptr> CreateSyncInt64MetricFaasInitDuration( metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricFaasInitDuration, descrMetricFaasInitDuration, unitMetricFaasInitDuration); } -static nostd::shared_ptr CreateAsyncMetricFaasInitDuration( +static inline nostd::unique_ptr> CreateSyncDoubleMetricFaasInitDuration( metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricFaasInitDuration, descrMetricFaasInitDuration, + unitMetricFaasInitDuration); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricFaasInitDuration(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricFaasInitDuration, descrMetricFaasInitDuration, unitMetricFaasInitDuration); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricFaasInitDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram( + kMetricFaasInitDuration, descrMetricFaasInitDuration, unitMetricFaasInitDuration); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Number of successful invocations *

@@ -120,20 +182,34 @@ static constexpr const char *kMetricFaasInvocations = "metric.faas.invocatio static constexpr const char *descrMetricFaasInvocations = "Number of successful invocations"; static constexpr const char *unitMetricFaasInvocations = "{invocation}"; -static nostd::unique_ptr> CreateSyncMetricFaasInvocations( +static inline nostd::unique_ptr> CreateSyncInt64MetricFaasInvocations( metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricFaasInvocations, descrMetricFaasInvocations, unitMetricFaasInvocations); } -static nostd::shared_ptr CreateAsyncMetricFaasInvocations( +static inline nostd::unique_ptr> CreateSyncDoubleMetricFaasInvocations( metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricFaasInvocations, descrMetricFaasInvocations, + unitMetricFaasInvocations); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricFaasInvocations(metrics::Meter *meter) { return meter->CreateInt64ObservableCounter(kMetricFaasInvocations, descrMetricFaasInvocations, unitMetricFaasInvocations); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricFaasInvocations(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricFaasInvocations, descrMetricFaasInvocations, + unitMetricFaasInvocations); +} + /** * Measures the duration of the function's logic execution *

@@ -144,20 +220,37 @@ static constexpr const char *descrMetricFaasInvokeDuration = "Measures the duration of the function's logic execution"; static constexpr const char *unitMetricFaasInvokeDuration = "s"; -static nostd::unique_ptr> CreateSyncMetricFaasInvokeDuration( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricFaasInvokeDuration(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricFaasInvokeDuration, descrMetricFaasInvokeDuration, unitMetricFaasInvokeDuration); } -static nostd::shared_ptr CreateAsyncMetricFaasInvokeDuration( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricFaasInvokeDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricFaasInvokeDuration, descrMetricFaasInvokeDuration, + unitMetricFaasInvokeDuration); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricFaasInvokeDuration(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram( kMetricFaasInvokeDuration, descrMetricFaasInvokeDuration, unitMetricFaasInvokeDuration); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricFaasInvokeDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram( + kMetricFaasInvokeDuration, descrMetricFaasInvokeDuration, unitMetricFaasInvokeDuration); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Distribution of max memory usage per invocation *

@@ -168,20 +261,37 @@ static constexpr const char *descrMetricFaasMemUsage = "Distribution of max memory usage per invocation"; static constexpr const char *unitMetricFaasMemUsage = "By"; -static nostd::unique_ptr> CreateSyncMetricFaasMemUsage( +static inline nostd::unique_ptr> CreateSyncInt64MetricFaasMemUsage( metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricFaasMemUsage, descrMetricFaasMemUsage, unitMetricFaasMemUsage); } -static nostd::shared_ptr CreateAsyncMetricFaasMemUsage( +static inline nostd::unique_ptr> CreateSyncDoubleMetricFaasMemUsage( + metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricFaasMemUsage, descrMetricFaasMemUsage, + unitMetricFaasMemUsage); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr CreateAsyncInt64MetricFaasMemUsage( metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricFaasMemUsage, descrMetricFaasMemUsage, unitMetricFaasMemUsage); } +static inline nostd::shared_ptr CreateAsyncDoubleMetricFaasMemUsage( + metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricFaasMemUsage, descrMetricFaasMemUsage, + unitMetricFaasMemUsage); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Distribution of net I/O usage per invocation *

@@ -191,19 +301,35 @@ static constexpr const char *kMetricFaasNetIo = "metric.faas.net_io"; static constexpr const char *descrMetricFaasNetIo = "Distribution of net I/O usage per invocation"; static constexpr const char *unitMetricFaasNetIo = "By"; -static nostd::unique_ptr> CreateSyncMetricFaasNetIo( +static inline nostd::unique_ptr> CreateSyncInt64MetricFaasNetIo( metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricFaasNetIo, descrMetricFaasNetIo, unitMetricFaasNetIo); } -static nostd::shared_ptr CreateAsyncMetricFaasNetIo( +static inline nostd::unique_ptr> CreateSyncDoubleMetricFaasNetIo( + metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricFaasNetIo, descrMetricFaasNetIo, unitMetricFaasNetIo); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr CreateAsyncInt64MetricFaasNetIo( metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricFaasNetIo, descrMetricFaasNetIo, unitMetricFaasNetIo); } +static inline nostd::shared_ptr CreateAsyncDoubleMetricFaasNetIo( + metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricFaasNetIo, descrMetricFaasNetIo, + unitMetricFaasNetIo); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Number of invocation timeouts *

@@ -213,20 +339,34 @@ static constexpr const char *kMetricFaasTimeouts = "metric.faas.timeouts"; static constexpr const char *descrMetricFaasTimeouts = "Number of invocation timeouts"; static constexpr const char *unitMetricFaasTimeouts = "{timeout}"; -static nostd::unique_ptr> CreateSyncMetricFaasTimeouts( +static inline nostd::unique_ptr> CreateSyncInt64MetricFaasTimeouts( metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricFaasTimeouts, descrMetricFaasTimeouts, unitMetricFaasTimeouts); } -static nostd::shared_ptr CreateAsyncMetricFaasTimeouts( +static inline nostd::unique_ptr> CreateSyncDoubleMetricFaasTimeouts( + metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricFaasTimeouts, descrMetricFaasTimeouts, + unitMetricFaasTimeouts); +} + +static inline nostd::shared_ptr CreateAsyncInt64MetricFaasTimeouts( metrics::Meter *meter) { return meter->CreateInt64ObservableCounter(kMetricFaasTimeouts, descrMetricFaasTimeouts, unitMetricFaasTimeouts); } +static inline nostd::shared_ptr CreateAsyncDoubleMetricFaasTimeouts( + metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricFaasTimeouts, descrMetricFaasTimeouts, + unitMetricFaasTimeouts); +} + } // namespace faas } // namespace semconv OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/gen_ai_metrics.h b/api/include/opentelemetry/semconv/incubating/gen_ai_metrics.h index 48db5b7351..04ba77aa18 100644 --- a/api/include/opentelemetry/semconv/incubating/gen_ai_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/gen_ai_metrics.h @@ -11,6 +11,7 @@ #pragma once #include "opentelemetry/common/macros.h" +#include "opentelemetry/metrics/meter.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -29,22 +30,41 @@ static constexpr const char *kMetricGenAiClientOperationDuration = static constexpr const char *descrMetricGenAiClientOperationDuration = "GenAI operation duration"; static constexpr const char *unitMetricGenAiClientOperationDuration = "s"; -static nostd::unique_ptr> CreateSyncMetricGenAiClientOperationDuration( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricGenAiClientOperationDuration(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricGenAiClientOperationDuration, descrMetricGenAiClientOperationDuration, unitMetricGenAiClientOperationDuration); } -static nostd::shared_ptr -CreateAsyncMetricGenAiClientOperationDuration(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricGenAiClientOperationDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricGenAiClientOperationDuration, + descrMetricGenAiClientOperationDuration, + unitMetricGenAiClientOperationDuration); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricGenAiClientOperationDuration(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricGenAiClientOperationDuration, descrMetricGenAiClientOperationDuration, unitMetricGenAiClientOperationDuration); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricGenAiClientOperationDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricGenAiClientOperationDuration, + descrMetricGenAiClientOperationDuration, + unitMetricGenAiClientOperationDuration); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Measures number of input and output tokens used *

@@ -55,22 +75,41 @@ static constexpr const char *descrMetricGenAiClientTokenUsage = "Measures number of input and output tokens used"; static constexpr const char *unitMetricGenAiClientTokenUsage = "{token}"; -static nostd::unique_ptr> CreateSyncMetricGenAiClientTokenUsage( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricGenAiClientTokenUsage(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricGenAiClientTokenUsage, descrMetricGenAiClientTokenUsage, unitMetricGenAiClientTokenUsage); } -static nostd::shared_ptr CreateAsyncMetricGenAiClientTokenUsage( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricGenAiClientTokenUsage(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricGenAiClientTokenUsage, + descrMetricGenAiClientTokenUsage, + unitMetricGenAiClientTokenUsage); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricGenAiClientTokenUsage(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricGenAiClientTokenUsage, descrMetricGenAiClientTokenUsage, unitMetricGenAiClientTokenUsage); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricGenAiClientTokenUsage(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricGenAiClientTokenUsage, + descrMetricGenAiClientTokenUsage, + unitMetricGenAiClientTokenUsage); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Generative AI server request duration such as time-to-last byte or last output token *

@@ -82,22 +121,41 @@ static constexpr const char *descrMetricGenAiServerRequestDuration = "Generative AI server request duration such as time-to-last byte or last output token"; static constexpr const char *unitMetricGenAiServerRequestDuration = "s"; -static nostd::unique_ptr> CreateSyncMetricGenAiServerRequestDuration( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricGenAiServerRequestDuration(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricGenAiServerRequestDuration, descrMetricGenAiServerRequestDuration, unitMetricGenAiServerRequestDuration); } -static nostd::shared_ptr CreateAsyncMetricGenAiServerRequestDuration( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricGenAiServerRequestDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricGenAiServerRequestDuration, + descrMetricGenAiServerRequestDuration, + unitMetricGenAiServerRequestDuration); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricGenAiServerRequestDuration(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricGenAiServerRequestDuration, descrMetricGenAiServerRequestDuration, unitMetricGenAiServerRequestDuration); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricGenAiServerRequestDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricGenAiServerRequestDuration, + descrMetricGenAiServerRequestDuration, + unitMetricGenAiServerRequestDuration); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Time per output token generated after the first token for successful responses *

@@ -109,22 +167,41 @@ static constexpr const char *descrMetricGenAiServerTimePerOutputToken = "Time per output token generated after the first token for successful responses"; static constexpr const char *unitMetricGenAiServerTimePerOutputToken = "s"; -static nostd::unique_ptr> -CreateSyncMetricGenAiServerTimePerOutputToken(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricGenAiServerTimePerOutputToken(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricGenAiServerTimePerOutputToken, descrMetricGenAiServerTimePerOutputToken, unitMetricGenAiServerTimePerOutputToken); } -static nostd::shared_ptr -CreateAsyncMetricGenAiServerTimePerOutputToken(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricGenAiServerTimePerOutputToken(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricGenAiServerTimePerOutputToken, + descrMetricGenAiServerTimePerOutputToken, + unitMetricGenAiServerTimePerOutputToken); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricGenAiServerTimePerOutputToken(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricGenAiServerTimePerOutputToken, descrMetricGenAiServerTimePerOutputToken, unitMetricGenAiServerTimePerOutputToken); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricGenAiServerTimePerOutputToken(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricGenAiServerTimePerOutputToken, + descrMetricGenAiServerTimePerOutputToken, + unitMetricGenAiServerTimePerOutputToken); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Time to generate first token for successful responses *

@@ -136,22 +213,41 @@ static constexpr const char *descrMetricGenAiServerTimeToFirstToken = "Time to generate first token for successful responses"; static constexpr const char *unitMetricGenAiServerTimeToFirstToken = "s"; -static nostd::unique_ptr> CreateSyncMetricGenAiServerTimeToFirstToken( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricGenAiServerTimeToFirstToken(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricGenAiServerTimeToFirstToken, descrMetricGenAiServerTimeToFirstToken, unitMetricGenAiServerTimeToFirstToken); } -static nostd::shared_ptr -CreateAsyncMetricGenAiServerTimeToFirstToken(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricGenAiServerTimeToFirstToken(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricGenAiServerTimeToFirstToken, + descrMetricGenAiServerTimeToFirstToken, + unitMetricGenAiServerTimeToFirstToken); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricGenAiServerTimeToFirstToken(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricGenAiServerTimeToFirstToken, descrMetricGenAiServerTimeToFirstToken, unitMetricGenAiServerTimeToFirstToken); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricGenAiServerTimeToFirstToken(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricGenAiServerTimeToFirstToken, + descrMetricGenAiServerTimeToFirstToken, + unitMetricGenAiServerTimeToFirstToken); +} +#endif /* OPENTELEMETRY_LATER */ + } // namespace gen_ai } // namespace semconv OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/http_metrics.h b/api/include/opentelemetry/semconv/incubating/http_metrics.h index a2820feced..d3a084235e 100644 --- a/api/include/opentelemetry/semconv/incubating/http_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/http_metrics.h @@ -11,6 +11,7 @@ #pragma once #include "opentelemetry/common/macros.h" +#include "opentelemetry/metrics/meter.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -29,22 +30,38 @@ static constexpr const char *descrMetricHttpClientActiveRequests = "Number of active HTTP requests."; static constexpr const char *unitMetricHttpClientActiveRequests = "{request}"; -static nostd::unique_ptr> CreateSyncMetricHttpClientActiveRequests( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricHttpClientActiveRequests(metrics::Meter *meter) { return meter->CreateInt64UpDownCounter(kMetricHttpClientActiveRequests, descrMetricHttpClientActiveRequests, unitMetricHttpClientActiveRequests); } -static nostd::shared_ptr CreateAsyncMetricHttpClientActiveRequests( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricHttpClientActiveRequests(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricHttpClientActiveRequests, + descrMetricHttpClientActiveRequests, + unitMetricHttpClientActiveRequests); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricHttpClientActiveRequests(metrics::Meter *meter) { return meter->CreateInt64ObservableUpDownCounter(kMetricHttpClientActiveRequests, descrMetricHttpClientActiveRequests, unitMetricHttpClientActiveRequests); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricHttpClientActiveRequests(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricHttpClientActiveRequests, + descrMetricHttpClientActiveRequests, + unitMetricHttpClientActiveRequests); +} + /** * The duration of the successfully established outbound HTTP connections. *

@@ -56,22 +73,41 @@ static constexpr const char *descrMetricHttpClientConnectionDuration = "The duration of the successfully established outbound HTTP connections."; static constexpr const char *unitMetricHttpClientConnectionDuration = "s"; -static nostd::unique_ptr> CreateSyncMetricHttpClientConnectionDuration( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricHttpClientConnectionDuration(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricHttpClientConnectionDuration, descrMetricHttpClientConnectionDuration, unitMetricHttpClientConnectionDuration); } -static nostd::shared_ptr -CreateAsyncMetricHttpClientConnectionDuration(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricHttpClientConnectionDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricHttpClientConnectionDuration, + descrMetricHttpClientConnectionDuration, + unitMetricHttpClientConnectionDuration); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricHttpClientConnectionDuration(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricHttpClientConnectionDuration, descrMetricHttpClientConnectionDuration, unitMetricHttpClientConnectionDuration); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricHttpClientConnectionDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricHttpClientConnectionDuration, + descrMetricHttpClientConnectionDuration, + unitMetricHttpClientConnectionDuration); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Number of outbound HTTP connections that are currently active or idle on the client. *

@@ -83,22 +119,38 @@ static constexpr const char *descrMetricHttpClientOpenConnections = "Number of outbound HTTP connections that are currently active or idle on the client."; static constexpr const char *unitMetricHttpClientOpenConnections = "{connection}"; -static nostd::unique_ptr> -CreateSyncMetricHttpClientOpenConnections(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricHttpClientOpenConnections(metrics::Meter *meter) { return meter->CreateInt64UpDownCounter(kMetricHttpClientOpenConnections, descrMetricHttpClientOpenConnections, unitMetricHttpClientOpenConnections); } -static nostd::shared_ptr CreateAsyncMetricHttpClientOpenConnections( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricHttpClientOpenConnections(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricHttpClientOpenConnections, + descrMetricHttpClientOpenConnections, + unitMetricHttpClientOpenConnections); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricHttpClientOpenConnections(metrics::Meter *meter) { return meter->CreateInt64ObservableUpDownCounter(kMetricHttpClientOpenConnections, descrMetricHttpClientOpenConnections, unitMetricHttpClientOpenConnections); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricHttpClientOpenConnections(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricHttpClientOpenConnections, + descrMetricHttpClientOpenConnections, + unitMetricHttpClientOpenConnections); +} + /** * Size of HTTP client request bodies. *

@@ -113,22 +165,41 @@ static constexpr const char *descrMetricHttpClientRequestBodySize = "Size of HTTP client request bodies."; static constexpr const char *unitMetricHttpClientRequestBodySize = "By"; -static nostd::unique_ptr> CreateSyncMetricHttpClientRequestBodySize( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricHttpClientRequestBodySize(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricHttpClientRequestBodySize, descrMetricHttpClientRequestBodySize, unitMetricHttpClientRequestBodySize); } -static nostd::shared_ptr CreateAsyncMetricHttpClientRequestBodySize( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricHttpClientRequestBodySize(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricHttpClientRequestBodySize, + descrMetricHttpClientRequestBodySize, + unitMetricHttpClientRequestBodySize); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricHttpClientRequestBodySize(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricHttpClientRequestBodySize, descrMetricHttpClientRequestBodySize, unitMetricHttpClientRequestBodySize); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricHttpClientRequestBodySize(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricHttpClientRequestBodySize, + descrMetricHttpClientRequestBodySize, + unitMetricHttpClientRequestBodySize); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Duration of HTTP client requests. *

@@ -140,22 +211,41 @@ static constexpr const char *descrMetricHttpClientRequestDuration = "Duration of HTTP client requests."; static constexpr const char *unitMetricHttpClientRequestDuration = "s"; -static nostd::unique_ptr> CreateSyncMetricHttpClientRequestDuration( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricHttpClientRequestDuration(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricHttpClientRequestDuration, descrMetricHttpClientRequestDuration, unitMetricHttpClientRequestDuration); } -static nostd::shared_ptr CreateAsyncMetricHttpClientRequestDuration( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricHttpClientRequestDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricHttpClientRequestDuration, + descrMetricHttpClientRequestDuration, + unitMetricHttpClientRequestDuration); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricHttpClientRequestDuration(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricHttpClientRequestDuration, descrMetricHttpClientRequestDuration, unitMetricHttpClientRequestDuration); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricHttpClientRequestDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricHttpClientRequestDuration, + descrMetricHttpClientRequestDuration, + unitMetricHttpClientRequestDuration); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Size of HTTP client response bodies. *

@@ -170,22 +260,41 @@ static constexpr const char *descrMetricHttpClientResponseBodySize = "Size of HTTP client response bodies."; static constexpr const char *unitMetricHttpClientResponseBodySize = "By"; -static nostd::unique_ptr> CreateSyncMetricHttpClientResponseBodySize( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricHttpClientResponseBodySize(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricHttpClientResponseBodySize, descrMetricHttpClientResponseBodySize, unitMetricHttpClientResponseBodySize); } -static nostd::shared_ptr CreateAsyncMetricHttpClientResponseBodySize( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricHttpClientResponseBodySize(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricHttpClientResponseBodySize, + descrMetricHttpClientResponseBodySize, + unitMetricHttpClientResponseBodySize); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricHttpClientResponseBodySize(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricHttpClientResponseBodySize, descrMetricHttpClientResponseBodySize, unitMetricHttpClientResponseBodySize); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricHttpClientResponseBodySize(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricHttpClientResponseBodySize, + descrMetricHttpClientResponseBodySize, + unitMetricHttpClientResponseBodySize); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Number of active HTTP server requests. *

@@ -196,22 +305,38 @@ static constexpr const char *descrMetricHttpServerActiveRequests = "Number of active HTTP server requests."; static constexpr const char *unitMetricHttpServerActiveRequests = "{request}"; -static nostd::unique_ptr> CreateSyncMetricHttpServerActiveRequests( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricHttpServerActiveRequests(metrics::Meter *meter) { return meter->CreateInt64UpDownCounter(kMetricHttpServerActiveRequests, descrMetricHttpServerActiveRequests, unitMetricHttpServerActiveRequests); } -static nostd::shared_ptr CreateAsyncMetricHttpServerActiveRequests( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricHttpServerActiveRequests(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricHttpServerActiveRequests, + descrMetricHttpServerActiveRequests, + unitMetricHttpServerActiveRequests); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricHttpServerActiveRequests(metrics::Meter *meter) { return meter->CreateInt64ObservableUpDownCounter(kMetricHttpServerActiveRequests, descrMetricHttpServerActiveRequests, unitMetricHttpServerActiveRequests); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricHttpServerActiveRequests(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricHttpServerActiveRequests, + descrMetricHttpServerActiveRequests, + unitMetricHttpServerActiveRequests); +} + /** * Size of HTTP server request bodies. *

@@ -226,22 +351,41 @@ static constexpr const char *descrMetricHttpServerRequestBodySize = "Size of HTTP server request bodies."; static constexpr const char *unitMetricHttpServerRequestBodySize = "By"; -static nostd::unique_ptr> CreateSyncMetricHttpServerRequestBodySize( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricHttpServerRequestBodySize(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricHttpServerRequestBodySize, descrMetricHttpServerRequestBodySize, unitMetricHttpServerRequestBodySize); } -static nostd::shared_ptr CreateAsyncMetricHttpServerRequestBodySize( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricHttpServerRequestBodySize(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricHttpServerRequestBodySize, + descrMetricHttpServerRequestBodySize, + unitMetricHttpServerRequestBodySize); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricHttpServerRequestBodySize(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricHttpServerRequestBodySize, descrMetricHttpServerRequestBodySize, unitMetricHttpServerRequestBodySize); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricHttpServerRequestBodySize(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricHttpServerRequestBodySize, + descrMetricHttpServerRequestBodySize, + unitMetricHttpServerRequestBodySize); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Duration of HTTP server requests. *

@@ -253,22 +397,41 @@ static constexpr const char *descrMetricHttpServerRequestDuration = "Duration of HTTP server requests."; static constexpr const char *unitMetricHttpServerRequestDuration = "s"; -static nostd::unique_ptr> CreateSyncMetricHttpServerRequestDuration( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricHttpServerRequestDuration(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricHttpServerRequestDuration, descrMetricHttpServerRequestDuration, unitMetricHttpServerRequestDuration); } -static nostd::shared_ptr CreateAsyncMetricHttpServerRequestDuration( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricHttpServerRequestDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricHttpServerRequestDuration, + descrMetricHttpServerRequestDuration, + unitMetricHttpServerRequestDuration); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricHttpServerRequestDuration(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricHttpServerRequestDuration, descrMetricHttpServerRequestDuration, unitMetricHttpServerRequestDuration); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricHttpServerRequestDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricHttpServerRequestDuration, + descrMetricHttpServerRequestDuration, + unitMetricHttpServerRequestDuration); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Size of HTTP server response bodies. *

@@ -283,22 +446,41 @@ static constexpr const char *descrMetricHttpServerResponseBodySize = "Size of HTTP server response bodies."; static constexpr const char *unitMetricHttpServerResponseBodySize = "By"; -static nostd::unique_ptr> CreateSyncMetricHttpServerResponseBodySize( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricHttpServerResponseBodySize(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricHttpServerResponseBodySize, descrMetricHttpServerResponseBodySize, unitMetricHttpServerResponseBodySize); } -static nostd::shared_ptr CreateAsyncMetricHttpServerResponseBodySize( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricHttpServerResponseBodySize(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricHttpServerResponseBodySize, + descrMetricHttpServerResponseBodySize, + unitMetricHttpServerResponseBodySize); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricHttpServerResponseBodySize(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricHttpServerResponseBodySize, descrMetricHttpServerResponseBodySize, unitMetricHttpServerResponseBodySize); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricHttpServerResponseBodySize(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricHttpServerResponseBodySize, + descrMetricHttpServerResponseBodySize, + unitMetricHttpServerResponseBodySize); +} +#endif /* OPENTELEMETRY_LATER */ + } // namespace http } // namespace semconv OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/messaging_metrics.h b/api/include/opentelemetry/semconv/incubating/messaging_metrics.h index 3e1b1fe5eb..1d2e1228a5 100644 --- a/api/include/opentelemetry/semconv/incubating/messaging_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/messaging_metrics.h @@ -11,6 +11,7 @@ #pragma once #include "opentelemetry/common/macros.h" +#include "opentelemetry/metrics/meter.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -34,22 +35,38 @@ static constexpr const char *descrMetricMessagingClientConsumedMessages = "Number of messages that were delivered to the application."; static constexpr const char *unitMetricMessagingClientConsumedMessages = "{message}"; -static nostd::unique_ptr> -CreateSyncMetricMessagingClientConsumedMessages(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricMessagingClientConsumedMessages(metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricMessagingClientConsumedMessages, descrMetricMessagingClientConsumedMessages, unitMetricMessagingClientConsumedMessages); } -static nostd::shared_ptr -CreateAsyncMetricMessagingClientConsumedMessages(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricMessagingClientConsumedMessages(metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricMessagingClientConsumedMessages, + descrMetricMessagingClientConsumedMessages, + unitMetricMessagingClientConsumedMessages); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricMessagingClientConsumedMessages(metrics::Meter *meter) { return meter->CreateInt64ObservableCounter(kMetricMessagingClientConsumedMessages, descrMetricMessagingClientConsumedMessages, unitMetricMessagingClientConsumedMessages); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricMessagingClientConsumedMessages(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricMessagingClientConsumedMessages, + descrMetricMessagingClientConsumedMessages, + unitMetricMessagingClientConsumedMessages); +} + /** * Duration of messaging operation initiated by a producer or consumer client. *

@@ -62,22 +79,41 @@ static constexpr const char *descrMetricMessagingClientOperationDuration = "Duration of messaging operation initiated by a producer or consumer client."; static constexpr const char *unitMetricMessagingClientOperationDuration = "s"; -static nostd::unique_ptr> -CreateSyncMetricMessagingClientOperationDuration(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricMessagingClientOperationDuration(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricMessagingClientOperationDuration, descrMetricMessagingClientOperationDuration, unitMetricMessagingClientOperationDuration); } -static nostd::shared_ptr -CreateAsyncMetricMessagingClientOperationDuration(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricMessagingClientOperationDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricMessagingClientOperationDuration, + descrMetricMessagingClientOperationDuration, + unitMetricMessagingClientOperationDuration); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricMessagingClientOperationDuration(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricMessagingClientOperationDuration, descrMetricMessagingClientOperationDuration, unitMetricMessagingClientOperationDuration); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricMessagingClientOperationDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricMessagingClientOperationDuration, + descrMetricMessagingClientOperationDuration, + unitMetricMessagingClientOperationDuration); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Number of messages producer attempted to publish to the broker. *

@@ -91,22 +127,38 @@ static constexpr const char *descrMetricMessagingClientPublishedMessages = "Number of messages producer attempted to publish to the broker."; static constexpr const char *unitMetricMessagingClientPublishedMessages = "{message}"; -static nostd::unique_ptr> -CreateSyncMetricMessagingClientPublishedMessages(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricMessagingClientPublishedMessages(metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricMessagingClientPublishedMessages, descrMetricMessagingClientPublishedMessages, unitMetricMessagingClientPublishedMessages); } -static nostd::shared_ptr -CreateAsyncMetricMessagingClientPublishedMessages(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricMessagingClientPublishedMessages(metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricMessagingClientPublishedMessages, + descrMetricMessagingClientPublishedMessages, + unitMetricMessagingClientPublishedMessages); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricMessagingClientPublishedMessages(metrics::Meter *meter) { return meter->CreateInt64ObservableCounter(kMetricMessagingClientPublishedMessages, descrMetricMessagingClientPublishedMessages, unitMetricMessagingClientPublishedMessages); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricMessagingClientPublishedMessages(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricMessagingClientPublishedMessages, + descrMetricMessagingClientPublishedMessages, + unitMetricMessagingClientPublishedMessages); +} + /** * Duration of processing operation. *

@@ -118,22 +170,41 @@ static constexpr const char *descrMetricMessagingProcessDuration = "Duration of processing operation."; static constexpr const char *unitMetricMessagingProcessDuration = "s"; -static nostd::unique_ptr> CreateSyncMetricMessagingProcessDuration( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricMessagingProcessDuration(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricMessagingProcessDuration, descrMetricMessagingProcessDuration, unitMetricMessagingProcessDuration); } -static nostd::shared_ptr CreateAsyncMetricMessagingProcessDuration( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricMessagingProcessDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricMessagingProcessDuration, + descrMetricMessagingProcessDuration, + unitMetricMessagingProcessDuration); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricMessagingProcessDuration(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricMessagingProcessDuration, descrMetricMessagingProcessDuration, unitMetricMessagingProcessDuration); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricMessagingProcessDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricMessagingProcessDuration, + descrMetricMessagingProcessDuration, + unitMetricMessagingProcessDuration); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Deprecated. Use @code messaging.client.consumed.messages @endcode instead. *

@@ -148,22 +219,38 @@ static constexpr const char *descrMetricMessagingProcessMessages = "Deprecated. Use `messaging.client.consumed.messages` instead."; static constexpr const char *unitMetricMessagingProcessMessages = "{message}"; -static nostd::unique_ptr> CreateSyncMetricMessagingProcessMessages( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricMessagingProcessMessages(metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricMessagingProcessMessages, descrMetricMessagingProcessMessages, unitMetricMessagingProcessMessages); } -static nostd::shared_ptr CreateAsyncMetricMessagingProcessMessages( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricMessagingProcessMessages(metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricMessagingProcessMessages, + descrMetricMessagingProcessMessages, + unitMetricMessagingProcessMessages); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricMessagingProcessMessages(metrics::Meter *meter) { return meter->CreateInt64ObservableCounter(kMetricMessagingProcessMessages, descrMetricMessagingProcessMessages, unitMetricMessagingProcessMessages); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricMessagingProcessMessages(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricMessagingProcessMessages, + descrMetricMessagingProcessMessages, + unitMetricMessagingProcessMessages); +} + /** * Deprecated. Use @code messaging.client.operation.duration @endcode instead. *

@@ -178,22 +265,41 @@ static constexpr const char *descrMetricMessagingPublishDuration = "Deprecated. Use `messaging.client.operation.duration` instead."; static constexpr const char *unitMetricMessagingPublishDuration = "s"; -static nostd::unique_ptr> CreateSyncMetricMessagingPublishDuration( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricMessagingPublishDuration(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricMessagingPublishDuration, descrMetricMessagingPublishDuration, unitMetricMessagingPublishDuration); } -static nostd::shared_ptr CreateAsyncMetricMessagingPublishDuration( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricMessagingPublishDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricMessagingPublishDuration, + descrMetricMessagingPublishDuration, + unitMetricMessagingPublishDuration); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricMessagingPublishDuration(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricMessagingPublishDuration, descrMetricMessagingPublishDuration, unitMetricMessagingPublishDuration); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricMessagingPublishDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricMessagingPublishDuration, + descrMetricMessagingPublishDuration, + unitMetricMessagingPublishDuration); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Deprecated. Use @code messaging.client.produced.messages @endcode instead. *

@@ -208,22 +314,38 @@ static constexpr const char *descrMetricMessagingPublishMessages = "Deprecated. Use `messaging.client.produced.messages` instead."; static constexpr const char *unitMetricMessagingPublishMessages = "{message}"; -static nostd::unique_ptr> CreateSyncMetricMessagingPublishMessages( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricMessagingPublishMessages(metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricMessagingPublishMessages, descrMetricMessagingPublishMessages, unitMetricMessagingPublishMessages); } -static nostd::shared_ptr CreateAsyncMetricMessagingPublishMessages( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricMessagingPublishMessages(metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricMessagingPublishMessages, + descrMetricMessagingPublishMessages, + unitMetricMessagingPublishMessages); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricMessagingPublishMessages(metrics::Meter *meter) { return meter->CreateInt64ObservableCounter(kMetricMessagingPublishMessages, descrMetricMessagingPublishMessages, unitMetricMessagingPublishMessages); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricMessagingPublishMessages(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricMessagingPublishMessages, + descrMetricMessagingPublishMessages, + unitMetricMessagingPublishMessages); +} + /** * Deprecated. Use @code messaging.client.operation.duration @endcode instead. *

@@ -238,22 +360,41 @@ static constexpr const char *descrMetricMessagingReceiveDuration = "Deprecated. Use `messaging.client.operation.duration` instead."; static constexpr const char *unitMetricMessagingReceiveDuration = "s"; -static nostd::unique_ptr> CreateSyncMetricMessagingReceiveDuration( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricMessagingReceiveDuration(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricMessagingReceiveDuration, descrMetricMessagingReceiveDuration, unitMetricMessagingReceiveDuration); } -static nostd::shared_ptr CreateAsyncMetricMessagingReceiveDuration( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricMessagingReceiveDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricMessagingReceiveDuration, + descrMetricMessagingReceiveDuration, + unitMetricMessagingReceiveDuration); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricMessagingReceiveDuration(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricMessagingReceiveDuration, descrMetricMessagingReceiveDuration, unitMetricMessagingReceiveDuration); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricMessagingReceiveDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricMessagingReceiveDuration, + descrMetricMessagingReceiveDuration, + unitMetricMessagingReceiveDuration); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Deprecated. Use @code messaging.client.consumed.messages @endcode instead. *

@@ -268,22 +409,38 @@ static constexpr const char *descrMetricMessagingReceiveMessages = "Deprecated. Use `messaging.client.consumed.messages` instead."; static constexpr const char *unitMetricMessagingReceiveMessages = "{message}"; -static nostd::unique_ptr> CreateSyncMetricMessagingReceiveMessages( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricMessagingReceiveMessages(metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricMessagingReceiveMessages, descrMetricMessagingReceiveMessages, unitMetricMessagingReceiveMessages); } -static nostd::shared_ptr CreateAsyncMetricMessagingReceiveMessages( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricMessagingReceiveMessages(metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricMessagingReceiveMessages, + descrMetricMessagingReceiveMessages, + unitMetricMessagingReceiveMessages); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricMessagingReceiveMessages(metrics::Meter *meter) { return meter->CreateInt64ObservableCounter(kMetricMessagingReceiveMessages, descrMetricMessagingReceiveMessages, unitMetricMessagingReceiveMessages); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricMessagingReceiveMessages(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricMessagingReceiveMessages, + descrMetricMessagingReceiveMessages, + unitMetricMessagingReceiveMessages); +} + } // namespace messaging } // namespace semconv OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/process_metrics.h b/api/include/opentelemetry/semconv/incubating/process_metrics.h index 2ee736ed27..a7cdddd7bc 100644 --- a/api/include/opentelemetry/semconv/incubating/process_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/process_metrics.h @@ -11,6 +11,7 @@ #pragma once #include "opentelemetry/common/macros.h" +#include "opentelemetry/metrics/meter.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -29,22 +30,38 @@ static constexpr const char *descrMetricProcessContextSwitches = "Number of times the process has been context switched."; static constexpr const char *unitMetricProcessContextSwitches = "{count}"; -static nostd::unique_ptr> CreateSyncMetricProcessContextSwitches( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricProcessContextSwitches(metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricProcessContextSwitches, descrMetricProcessContextSwitches, unitMetricProcessContextSwitches); } -static nostd::shared_ptr CreateAsyncMetricProcessContextSwitches( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricProcessContextSwitches(metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricProcessContextSwitches, + descrMetricProcessContextSwitches, + unitMetricProcessContextSwitches); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricProcessContextSwitches(metrics::Meter *meter) { return meter->CreateInt64ObservableCounter(kMetricProcessContextSwitches, descrMetricProcessContextSwitches, unitMetricProcessContextSwitches); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricProcessContextSwitches(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricProcessContextSwitches, + descrMetricProcessContextSwitches, + unitMetricProcessContextSwitches); +} + /** * Total CPU seconds broken down by different states. *

@@ -55,20 +72,34 @@ static constexpr const char *descrMetricProcessCpuTime = "Total CPU seconds broken down by different states."; static constexpr const char *unitMetricProcessCpuTime = "s"; -static nostd::unique_ptr> CreateSyncMetricProcessCpuTime( +static inline nostd::unique_ptr> CreateSyncInt64MetricProcessCpuTime( metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricProcessCpuTime, descrMetricProcessCpuTime, unitMetricProcessCpuTime); } -static nostd::shared_ptr CreateAsyncMetricProcessCpuTime( +static inline nostd::unique_ptr> CreateSyncDoubleMetricProcessCpuTime( + metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricProcessCpuTime, descrMetricProcessCpuTime, + unitMetricProcessCpuTime); +} + +static inline nostd::shared_ptr CreateAsyncInt64MetricProcessCpuTime( metrics::Meter *meter) { return meter->CreateInt64ObservableCounter(kMetricProcessCpuTime, descrMetricProcessCpuTime, unitMetricProcessCpuTime); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricProcessCpuTime(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricProcessCpuTime, descrMetricProcessCpuTime, + unitMetricProcessCpuTime); +} + /** * Difference in process.cpu.time since the last measurement, divided by the elapsed time and number * of CPUs available to the process.

gauge @@ -79,21 +110,39 @@ static constexpr const char *descrMetricProcessCpuUtilization = "number of CPUs available to the process."; static constexpr const char *unitMetricProcessCpuUtilization = "1"; -static nostd::unique_ptr> CreateSyncMetricProcessCpuUtilization( - metrics::Meter *meter) +#ifdef OPENTELEMETRY_LATER +// Unsupported: Sync gauge +static inline nostd::unique_ptr> +CreateSyncInt64MetricProcessCpuUtilization(metrics::Meter *meter) { return meter->CreateUInt64Gauge(kMetricProcessCpuUtilization, descrMetricProcessCpuUtilization, unitMetricProcessCpuUtilization); } -static nostd::shared_ptr CreateAsyncMetricProcessCpuUtilization( +static inline nostd::unique_ptr> CreateSyncDoubleMetricProcessCpuUtilization( metrics::Meter *meter) +{ + return meter->CreateDoubleGauge(kMetricProcessCpuUtilization, descrMetricProcessCpuUtilization, + unitMetricProcessCpuUtilization); +} +#endif /* OPENTELEMETRY_LATER */ + +static inline nostd::shared_ptr +CreateAsyncInt64MetricProcessCpuUtilization(metrics::Meter *meter) { return meter->CreateInt64ObservableGauge(kMetricProcessCpuUtilization, descrMetricProcessCpuUtilization, unitMetricProcessCpuUtilization); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricProcessCpuUtilization(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableGauge(kMetricProcessCpuUtilization, + descrMetricProcessCpuUtilization, + unitMetricProcessCpuUtilization); +} + /** * Disk bytes transferred. *

@@ -103,20 +152,34 @@ static constexpr const char *kMetricProcessDiskIo = "metric.process.disk.io" static constexpr const char *descrMetricProcessDiskIo = "Disk bytes transferred."; static constexpr const char *unitMetricProcessDiskIo = "By"; -static nostd::unique_ptr> CreateSyncMetricProcessDiskIo( +static inline nostd::unique_ptr> CreateSyncInt64MetricProcessDiskIo( metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricProcessDiskIo, descrMetricProcessDiskIo, unitMetricProcessDiskIo); } -static nostd::shared_ptr CreateAsyncMetricProcessDiskIo( +static inline nostd::unique_ptr> CreateSyncDoubleMetricProcessDiskIo( + metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricProcessDiskIo, descrMetricProcessDiskIo, + unitMetricProcessDiskIo); +} + +static inline nostd::shared_ptr CreateAsyncInt64MetricProcessDiskIo( metrics::Meter *meter) { return meter->CreateInt64ObservableCounter(kMetricProcessDiskIo, descrMetricProcessDiskIo, unitMetricProcessDiskIo); } +static inline nostd::shared_ptr CreateAsyncDoubleMetricProcessDiskIo( + metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricProcessDiskIo, descrMetricProcessDiskIo, + unitMetricProcessDiskIo); +} + /** * The amount of physical memory in use. *

@@ -127,20 +190,34 @@ static constexpr const char *descrMetricProcessMemoryUsage = "The amount of physical memory in use."; static constexpr const char *unitMetricProcessMemoryUsage = "By"; -static nostd::unique_ptr> CreateSyncMetricProcessMemoryUsage( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricProcessMemoryUsage(metrics::Meter *meter) { return meter->CreateInt64UpDownCounter(kMetricProcessMemoryUsage, descrMetricProcessMemoryUsage, unitMetricProcessMemoryUsage); } -static nostd::shared_ptr CreateAsyncMetricProcessMemoryUsage( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricProcessMemoryUsage(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricProcessMemoryUsage, descrMetricProcessMemoryUsage, + unitMetricProcessMemoryUsage); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricProcessMemoryUsage(metrics::Meter *meter) { return meter->CreateInt64ObservableUpDownCounter( kMetricProcessMemoryUsage, descrMetricProcessMemoryUsage, unitMetricProcessMemoryUsage); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricProcessMemoryUsage(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter( + kMetricProcessMemoryUsage, descrMetricProcessMemoryUsage, unitMetricProcessMemoryUsage); +} + /** * The amount of committed virtual memory. *

@@ -151,20 +228,34 @@ static constexpr const char *descrMetricProcessMemoryVirtual = "The amount of committed virtual memory."; static constexpr const char *unitMetricProcessMemoryVirtual = "By"; -static nostd::unique_ptr> CreateSyncMetricProcessMemoryVirtual( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricProcessMemoryVirtual(metrics::Meter *meter) { return meter->CreateInt64UpDownCounter( kMetricProcessMemoryVirtual, descrMetricProcessMemoryVirtual, unitMetricProcessMemoryVirtual); } -static nostd::shared_ptr CreateAsyncMetricProcessMemoryVirtual( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricProcessMemoryVirtual(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter( + kMetricProcessMemoryVirtual, descrMetricProcessMemoryVirtual, unitMetricProcessMemoryVirtual); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricProcessMemoryVirtual(metrics::Meter *meter) { return meter->CreateInt64ObservableUpDownCounter( kMetricProcessMemoryVirtual, descrMetricProcessMemoryVirtual, unitMetricProcessMemoryVirtual); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricProcessMemoryVirtual(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter( + kMetricProcessMemoryVirtual, descrMetricProcessMemoryVirtual, unitMetricProcessMemoryVirtual); +} + /** * Network bytes transferred. *

@@ -174,20 +265,34 @@ static constexpr const char *kMetricProcessNetworkIo = "metric.process.netwo static constexpr const char *descrMetricProcessNetworkIo = "Network bytes transferred."; static constexpr const char *unitMetricProcessNetworkIo = "By"; -static nostd::unique_ptr> CreateSyncMetricProcessNetworkIo( +static inline nostd::unique_ptr> CreateSyncInt64MetricProcessNetworkIo( metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricProcessNetworkIo, descrMetricProcessNetworkIo, unitMetricProcessNetworkIo); } -static nostd::shared_ptr CreateAsyncMetricProcessNetworkIo( +static inline nostd::unique_ptr> CreateSyncDoubleMetricProcessNetworkIo( metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricProcessNetworkIo, descrMetricProcessNetworkIo, + unitMetricProcessNetworkIo); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricProcessNetworkIo(metrics::Meter *meter) { return meter->CreateInt64ObservableCounter(kMetricProcessNetworkIo, descrMetricProcessNetworkIo, unitMetricProcessNetworkIo); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricProcessNetworkIo(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricProcessNetworkIo, descrMetricProcessNetworkIo, + unitMetricProcessNetworkIo); +} + /** * Number of file descriptors in use by the process. *

@@ -199,22 +304,38 @@ static constexpr const char *descrMetricProcessOpenFileDescriptorCount = "Number of file descriptors in use by the process."; static constexpr const char *unitMetricProcessOpenFileDescriptorCount = "{count}"; -static nostd::unique_ptr> -CreateSyncMetricProcessOpenFileDescriptorCount(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricProcessOpenFileDescriptorCount(metrics::Meter *meter) { return meter->CreateInt64UpDownCounter(kMetricProcessOpenFileDescriptorCount, descrMetricProcessOpenFileDescriptorCount, unitMetricProcessOpenFileDescriptorCount); } -static nostd::shared_ptr -CreateAsyncMetricProcessOpenFileDescriptorCount(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricProcessOpenFileDescriptorCount(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricProcessOpenFileDescriptorCount, + descrMetricProcessOpenFileDescriptorCount, + unitMetricProcessOpenFileDescriptorCount); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricProcessOpenFileDescriptorCount(metrics::Meter *meter) { return meter->CreateInt64ObservableUpDownCounter(kMetricProcessOpenFileDescriptorCount, descrMetricProcessOpenFileDescriptorCount, unitMetricProcessOpenFileDescriptorCount); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricProcessOpenFileDescriptorCount(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricProcessOpenFileDescriptorCount, + descrMetricProcessOpenFileDescriptorCount, + unitMetricProcessOpenFileDescriptorCount); +} + /** * Number of page faults the process has made. *

@@ -225,20 +346,34 @@ static constexpr const char *descrMetricProcessPagingFaults = "Number of page faults the process has made."; static constexpr const char *unitMetricProcessPagingFaults = "{fault}"; -static nostd::unique_ptr> CreateSyncMetricProcessPagingFaults( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricProcessPagingFaults(metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricProcessPagingFaults, descrMetricProcessPagingFaults, unitMetricProcessPagingFaults); } -static nostd::shared_ptr CreateAsyncMetricProcessPagingFaults( +static inline nostd::unique_ptr> CreateSyncDoubleMetricProcessPagingFaults( metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricProcessPagingFaults, descrMetricProcessPagingFaults, + unitMetricProcessPagingFaults); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricProcessPagingFaults(metrics::Meter *meter) { return meter->CreateInt64ObservableCounter( kMetricProcessPagingFaults, descrMetricProcessPagingFaults, unitMetricProcessPagingFaults); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricProcessPagingFaults(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter( + kMetricProcessPagingFaults, descrMetricProcessPagingFaults, unitMetricProcessPagingFaults); +} + /** * Process threads count. *

@@ -248,20 +383,34 @@ static constexpr const char *kMetricProcessThreadCount = "metric.process.thr static constexpr const char *descrMetricProcessThreadCount = "Process threads count."; static constexpr const char *unitMetricProcessThreadCount = "{thread}"; -static nostd::unique_ptr> CreateSyncMetricProcessThreadCount( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricProcessThreadCount(metrics::Meter *meter) { return meter->CreateInt64UpDownCounter(kMetricProcessThreadCount, descrMetricProcessThreadCount, unitMetricProcessThreadCount); } -static nostd::shared_ptr CreateAsyncMetricProcessThreadCount( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricProcessThreadCount(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricProcessThreadCount, descrMetricProcessThreadCount, + unitMetricProcessThreadCount); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricProcessThreadCount(metrics::Meter *meter) { return meter->CreateInt64ObservableUpDownCounter( kMetricProcessThreadCount, descrMetricProcessThreadCount, unitMetricProcessThreadCount); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricProcessThreadCount(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter( + kMetricProcessThreadCount, descrMetricProcessThreadCount, unitMetricProcessThreadCount); +} + } // namespace process } // namespace semconv OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/rpc_metrics.h b/api/include/opentelemetry/semconv/incubating/rpc_metrics.h index 0fb503694e..b0ffac3a8e 100644 --- a/api/include/opentelemetry/semconv/incubating/rpc_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/rpc_metrics.h @@ -11,6 +11,7 @@ #pragma once #include "opentelemetry/common/macros.h" +#include "opentelemetry/metrics/meter.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -34,20 +35,37 @@ static constexpr const char *descrMetricRpcClientDuration = "Measures the duration of outbound RPC."; static constexpr const char *unitMetricRpcClientDuration = "ms"; -static nostd::unique_ptr> CreateSyncMetricRpcClientDuration( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricRpcClientDuration(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricRpcClientDuration, descrMetricRpcClientDuration, unitMetricRpcClientDuration); } -static nostd::shared_ptr CreateAsyncMetricRpcClientDuration( +static inline nostd::unique_ptr> CreateSyncDoubleMetricRpcClientDuration( metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricRpcClientDuration, descrMetricRpcClientDuration, + unitMetricRpcClientDuration); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricRpcClientDuration(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram( kMetricRpcClientDuration, descrMetricRpcClientDuration, unitMetricRpcClientDuration); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricRpcClientDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram( + kMetricRpcClientDuration, descrMetricRpcClientDuration, unitMetricRpcClientDuration); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Measures the size of RPC request messages (uncompressed). *

@@ -60,20 +78,37 @@ static constexpr const char *descrMetricRpcClientRequestSize = "Measures the size of RPC request messages (uncompressed)."; static constexpr const char *unitMetricRpcClientRequestSize = "By"; -static nostd::unique_ptr> CreateSyncMetricRpcClientRequestSize( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricRpcClientRequestSize(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricRpcClientRequestSize, descrMetricRpcClientRequestSize, unitMetricRpcClientRequestSize); } -static nostd::shared_ptr CreateAsyncMetricRpcClientRequestSize( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricRpcClientRequestSize(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricRpcClientRequestSize, descrMetricRpcClientRequestSize, + unitMetricRpcClientRequestSize); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricRpcClientRequestSize(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram( kMetricRpcClientRequestSize, descrMetricRpcClientRequestSize, unitMetricRpcClientRequestSize); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricRpcClientRequestSize(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram( + kMetricRpcClientRequestSize, descrMetricRpcClientRequestSize, unitMetricRpcClientRequestSize); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Measures the number of messages received per RPC. *

@@ -88,22 +123,41 @@ static constexpr const char *descrMetricRpcClientRequestsPerRpc = "Measures the number of messages received per RPC."; static constexpr const char *unitMetricRpcClientRequestsPerRpc = "{count}"; -static nostd::unique_ptr> CreateSyncMetricRpcClientRequestsPerRpc( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricRpcClientRequestsPerRpc(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricRpcClientRequestsPerRpc, descrMetricRpcClientRequestsPerRpc, unitMetricRpcClientRequestsPerRpc); } -static nostd::shared_ptr CreateAsyncMetricRpcClientRequestsPerRpc( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricRpcClientRequestsPerRpc(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricRpcClientRequestsPerRpc, + descrMetricRpcClientRequestsPerRpc, + unitMetricRpcClientRequestsPerRpc); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricRpcClientRequestsPerRpc(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricRpcClientRequestsPerRpc, descrMetricRpcClientRequestsPerRpc, unitMetricRpcClientRequestsPerRpc); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricRpcClientRequestsPerRpc(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricRpcClientRequestsPerRpc, + descrMetricRpcClientRequestsPerRpc, + unitMetricRpcClientRequestsPerRpc); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Measures the size of RPC response messages (uncompressed). *

@@ -116,22 +170,41 @@ static constexpr const char *descrMetricRpcClientResponseSize = "Measures the size of RPC response messages (uncompressed)."; static constexpr const char *unitMetricRpcClientResponseSize = "By"; -static nostd::unique_ptr> CreateSyncMetricRpcClientResponseSize( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricRpcClientResponseSize(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricRpcClientResponseSize, descrMetricRpcClientResponseSize, unitMetricRpcClientResponseSize); } -static nostd::shared_ptr CreateAsyncMetricRpcClientResponseSize( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricRpcClientResponseSize(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricRpcClientResponseSize, + descrMetricRpcClientResponseSize, + unitMetricRpcClientResponseSize); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricRpcClientResponseSize(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricRpcClientResponseSize, descrMetricRpcClientResponseSize, unitMetricRpcClientResponseSize); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricRpcClientResponseSize(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricRpcClientResponseSize, + descrMetricRpcClientResponseSize, + unitMetricRpcClientResponseSize); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Measures the number of messages sent per RPC. *

@@ -147,22 +220,41 @@ static constexpr const char *descrMetricRpcClientResponsesPerRpc = "Measures the number of messages sent per RPC."; static constexpr const char *unitMetricRpcClientResponsesPerRpc = "{count}"; -static nostd::unique_ptr> CreateSyncMetricRpcClientResponsesPerRpc( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricRpcClientResponsesPerRpc(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricRpcClientResponsesPerRpc, descrMetricRpcClientResponsesPerRpc, unitMetricRpcClientResponsesPerRpc); } -static nostd::shared_ptr CreateAsyncMetricRpcClientResponsesPerRpc( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricRpcClientResponsesPerRpc(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricRpcClientResponsesPerRpc, + descrMetricRpcClientResponsesPerRpc, + unitMetricRpcClientResponsesPerRpc); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricRpcClientResponsesPerRpc(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricRpcClientResponsesPerRpc, descrMetricRpcClientResponsesPerRpc, unitMetricRpcClientResponsesPerRpc); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricRpcClientResponsesPerRpc(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricRpcClientResponsesPerRpc, + descrMetricRpcClientResponsesPerRpc, + unitMetricRpcClientResponsesPerRpc); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Measures the duration of inbound RPC. *

@@ -177,20 +269,37 @@ static constexpr const char *kMetricRpcServerDuration = "metric.rpc.server.d static constexpr const char *descrMetricRpcServerDuration = "Measures the duration of inbound RPC."; static constexpr const char *unitMetricRpcServerDuration = "ms"; -static nostd::unique_ptr> CreateSyncMetricRpcServerDuration( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricRpcServerDuration(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricRpcServerDuration, descrMetricRpcServerDuration, unitMetricRpcServerDuration); } -static nostd::shared_ptr CreateAsyncMetricRpcServerDuration( +static inline nostd::unique_ptr> CreateSyncDoubleMetricRpcServerDuration( metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricRpcServerDuration, descrMetricRpcServerDuration, + unitMetricRpcServerDuration); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricRpcServerDuration(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram( kMetricRpcServerDuration, descrMetricRpcServerDuration, unitMetricRpcServerDuration); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricRpcServerDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram( + kMetricRpcServerDuration, descrMetricRpcServerDuration, unitMetricRpcServerDuration); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Measures the size of RPC request messages (uncompressed). *

@@ -203,20 +312,37 @@ static constexpr const char *descrMetricRpcServerRequestSize = "Measures the size of RPC request messages (uncompressed)."; static constexpr const char *unitMetricRpcServerRequestSize = "By"; -static nostd::unique_ptr> CreateSyncMetricRpcServerRequestSize( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricRpcServerRequestSize(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricRpcServerRequestSize, descrMetricRpcServerRequestSize, unitMetricRpcServerRequestSize); } -static nostd::shared_ptr CreateAsyncMetricRpcServerRequestSize( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricRpcServerRequestSize(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricRpcServerRequestSize, descrMetricRpcServerRequestSize, + unitMetricRpcServerRequestSize); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricRpcServerRequestSize(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram( kMetricRpcServerRequestSize, descrMetricRpcServerRequestSize, unitMetricRpcServerRequestSize); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricRpcServerRequestSize(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram( + kMetricRpcServerRequestSize, descrMetricRpcServerRequestSize, unitMetricRpcServerRequestSize); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Measures the number of messages received per RPC. *

@@ -231,22 +357,41 @@ static constexpr const char *descrMetricRpcServerRequestsPerRpc = "Measures the number of messages received per RPC."; static constexpr const char *unitMetricRpcServerRequestsPerRpc = "{count}"; -static nostd::unique_ptr> CreateSyncMetricRpcServerRequestsPerRpc( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricRpcServerRequestsPerRpc(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricRpcServerRequestsPerRpc, descrMetricRpcServerRequestsPerRpc, unitMetricRpcServerRequestsPerRpc); } -static nostd::shared_ptr CreateAsyncMetricRpcServerRequestsPerRpc( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricRpcServerRequestsPerRpc(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricRpcServerRequestsPerRpc, + descrMetricRpcServerRequestsPerRpc, + unitMetricRpcServerRequestsPerRpc); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricRpcServerRequestsPerRpc(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricRpcServerRequestsPerRpc, descrMetricRpcServerRequestsPerRpc, unitMetricRpcServerRequestsPerRpc); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricRpcServerRequestsPerRpc(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricRpcServerRequestsPerRpc, + descrMetricRpcServerRequestsPerRpc, + unitMetricRpcServerRequestsPerRpc); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Measures the size of RPC response messages (uncompressed). *

@@ -259,22 +404,41 @@ static constexpr const char *descrMetricRpcServerResponseSize = "Measures the size of RPC response messages (uncompressed)."; static constexpr const char *unitMetricRpcServerResponseSize = "By"; -static nostd::unique_ptr> CreateSyncMetricRpcServerResponseSize( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricRpcServerResponseSize(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricRpcServerResponseSize, descrMetricRpcServerResponseSize, unitMetricRpcServerResponseSize); } -static nostd::shared_ptr CreateAsyncMetricRpcServerResponseSize( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricRpcServerResponseSize(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricRpcServerResponseSize, + descrMetricRpcServerResponseSize, + unitMetricRpcServerResponseSize); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricRpcServerResponseSize(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricRpcServerResponseSize, descrMetricRpcServerResponseSize, unitMetricRpcServerResponseSize); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricRpcServerResponseSize(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricRpcServerResponseSize, + descrMetricRpcServerResponseSize, + unitMetricRpcServerResponseSize); +} +#endif /* OPENTELEMETRY_LATER */ + /** * Measures the number of messages sent per RPC. *

@@ -290,22 +454,41 @@ static constexpr const char *descrMetricRpcServerResponsesPerRpc = "Measures the number of messages sent per RPC."; static constexpr const char *unitMetricRpcServerResponsesPerRpc = "{count}"; -static nostd::unique_ptr> CreateSyncMetricRpcServerResponsesPerRpc( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricRpcServerResponsesPerRpc(metrics::Meter *meter) { return meter->CreateUInt64Histogram(kMetricRpcServerResponsesPerRpc, descrMetricRpcServerResponsesPerRpc, unitMetricRpcServerResponsesPerRpc); } -static nostd::shared_ptr CreateAsyncMetricRpcServerResponsesPerRpc( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricRpcServerResponsesPerRpc(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricRpcServerResponsesPerRpc, + descrMetricRpcServerResponsesPerRpc, + unitMetricRpcServerResponsesPerRpc); +} + +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async histogram +static inline nostd::shared_ptr +CreateAsyncInt64MetricRpcServerResponsesPerRpc(metrics::Meter *meter) { return meter->CreateInt64ObservableHistogram(kMetricRpcServerResponsesPerRpc, descrMetricRpcServerResponsesPerRpc, unitMetricRpcServerResponsesPerRpc); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricRpcServerResponsesPerRpc(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableHistogram(kMetricRpcServerResponsesPerRpc, + descrMetricRpcServerResponsesPerRpc, + unitMetricRpcServerResponsesPerRpc); +} +#endif /* OPENTELEMETRY_LATER */ + } // namespace rpc } // namespace semconv OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/system_metrics.h b/api/include/opentelemetry/semconv/incubating/system_metrics.h index c6f82d35dd..647c26c72c 100644 --- a/api/include/opentelemetry/semconv/incubating/system_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/system_metrics.h @@ -11,6 +11,7 @@ #pragma once #include "opentelemetry/common/macros.h" +#include "opentelemetry/metrics/meter.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -29,20 +30,37 @@ static constexpr const char *descrMetricSystemCpuFrequency = "Reports the current frequency of the CPU in Hz"; static constexpr const char *unitMetricSystemCpuFrequency = "{Hz}"; -static nostd::unique_ptr> CreateSyncMetricSystemCpuFrequency( +#ifdef OPENTELEMETRY_LATER +// Unsupported: Sync gauge +static inline nostd::unique_ptr> CreateSyncInt64MetricSystemCpuFrequency( metrics::Meter *meter) { return meter->CreateUInt64Gauge(kMetricSystemCpuFrequency, descrMetricSystemCpuFrequency, unitMetricSystemCpuFrequency); } -static nostd::shared_ptr CreateAsyncMetricSystemCpuFrequency( +static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemCpuFrequency( metrics::Meter *meter) +{ + return meter->CreateDoubleGauge(kMetricSystemCpuFrequency, descrMetricSystemCpuFrequency, + unitMetricSystemCpuFrequency); +} +#endif /* OPENTELEMETRY_LATER */ + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemCpuFrequency(metrics::Meter *meter) { return meter->CreateInt64ObservableGauge(kMetricSystemCpuFrequency, descrMetricSystemCpuFrequency, unitMetricSystemCpuFrequency); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemCpuFrequency(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableGauge( + kMetricSystemCpuFrequency, descrMetricSystemCpuFrequency, unitMetricSystemCpuFrequency); +} + /** * Reports the number of logical (virtual) processor cores created by the operating system to manage * multitasking

updowncounter @@ -53,22 +71,38 @@ static constexpr const char *descrMetricSystemCpuLogicalCount = "manage multitasking"; static constexpr const char *unitMetricSystemCpuLogicalCount = "{cpu}"; -static nostd::unique_ptr> CreateSyncMetricSystemCpuLogicalCount( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemCpuLogicalCount(metrics::Meter *meter) { return meter->CreateInt64UpDownCounter(kMetricSystemCpuLogicalCount, descrMetricSystemCpuLogicalCount, unitMetricSystemCpuLogicalCount); } -static nostd::shared_ptr CreateAsyncMetricSystemCpuLogicalCount( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemCpuLogicalCount(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricSystemCpuLogicalCount, + descrMetricSystemCpuLogicalCount, + unitMetricSystemCpuLogicalCount); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemCpuLogicalCount(metrics::Meter *meter) { return meter->CreateInt64ObservableUpDownCounter(kMetricSystemCpuLogicalCount, descrMetricSystemCpuLogicalCount, unitMetricSystemCpuLogicalCount); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemCpuLogicalCount(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricSystemCpuLogicalCount, + descrMetricSystemCpuLogicalCount, + unitMetricSystemCpuLogicalCount); +} + /** * Reports the number of actual physical processor cores on the hardware *

@@ -79,22 +113,38 @@ static constexpr const char *descrMetricSystemCpuPhysicalCount = "Reports the number of actual physical processor cores on the hardware"; static constexpr const char *unitMetricSystemCpuPhysicalCount = "{cpu}"; -static nostd::unique_ptr> CreateSyncMetricSystemCpuPhysicalCount( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemCpuPhysicalCount(metrics::Meter *meter) { return meter->CreateInt64UpDownCounter(kMetricSystemCpuPhysicalCount, descrMetricSystemCpuPhysicalCount, unitMetricSystemCpuPhysicalCount); } -static nostd::shared_ptr CreateAsyncMetricSystemCpuPhysicalCount( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemCpuPhysicalCount(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricSystemCpuPhysicalCount, + descrMetricSystemCpuPhysicalCount, + unitMetricSystemCpuPhysicalCount); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemCpuPhysicalCount(metrics::Meter *meter) { return meter->CreateInt64ObservableUpDownCounter(kMetricSystemCpuPhysicalCount, descrMetricSystemCpuPhysicalCount, unitMetricSystemCpuPhysicalCount); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemCpuPhysicalCount(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricSystemCpuPhysicalCount, + descrMetricSystemCpuPhysicalCount, + unitMetricSystemCpuPhysicalCount); +} + /** * Seconds each logical CPU spent on each mode *

@@ -105,20 +155,34 @@ static constexpr const char *descrMetricSystemCpuTime = "Seconds each logical CPU spent on each mode"; static constexpr const char *unitMetricSystemCpuTime = "s"; -static nostd::unique_ptr> CreateSyncMetricSystemCpuTime( +static inline nostd::unique_ptr> CreateSyncInt64MetricSystemCpuTime( metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricSystemCpuTime, descrMetricSystemCpuTime, unitMetricSystemCpuTime); } -static nostd::shared_ptr CreateAsyncMetricSystemCpuTime( +static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemCpuTime( + metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricSystemCpuTime, descrMetricSystemCpuTime, + unitMetricSystemCpuTime); +} + +static inline nostd::shared_ptr CreateAsyncInt64MetricSystemCpuTime( metrics::Meter *meter) { return meter->CreateInt64ObservableCounter(kMetricSystemCpuTime, descrMetricSystemCpuTime, unitMetricSystemCpuTime); } +static inline nostd::shared_ptr CreateAsyncDoubleMetricSystemCpuTime( + metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricSystemCpuTime, descrMetricSystemCpuTime, + unitMetricSystemCpuTime); +} + /** * Difference in system.cpu.time since the last measurement, divided by the elapsed time and number * of logical CPUs

gauge @@ -129,20 +193,37 @@ static constexpr const char *descrMetricSystemCpuUtilization = "number of logical CPUs"; static constexpr const char *unitMetricSystemCpuUtilization = "1"; -static nostd::unique_ptr> CreateSyncMetricSystemCpuUtilization( +#ifdef OPENTELEMETRY_LATER +// Unsupported: Sync gauge +static inline nostd::unique_ptr> CreateSyncInt64MetricSystemCpuUtilization( metrics::Meter *meter) { return meter->CreateUInt64Gauge(kMetricSystemCpuUtilization, descrMetricSystemCpuUtilization, unitMetricSystemCpuUtilization); } -static nostd::shared_ptr CreateAsyncMetricSystemCpuUtilization( +static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemCpuUtilization( metrics::Meter *meter) +{ + return meter->CreateDoubleGauge(kMetricSystemCpuUtilization, descrMetricSystemCpuUtilization, + unitMetricSystemCpuUtilization); +} +#endif /* OPENTELEMETRY_LATER */ + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemCpuUtilization(metrics::Meter *meter) { return meter->CreateInt64ObservableGauge( kMetricSystemCpuUtilization, descrMetricSystemCpuUtilization, unitMetricSystemCpuUtilization); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemCpuUtilization(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableGauge( + kMetricSystemCpuUtilization, descrMetricSystemCpuUtilization, unitMetricSystemCpuUtilization); +} + /** * counter */ @@ -150,20 +231,34 @@ static constexpr const char *kMetricSystemDiskIo = "metric.system.disk.io"; static constexpr const char *descrMetricSystemDiskIo = ""; static constexpr const char *unitMetricSystemDiskIo = "By"; -static nostd::unique_ptr> CreateSyncMetricSystemDiskIo( +static inline nostd::unique_ptr> CreateSyncInt64MetricSystemDiskIo( metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricSystemDiskIo, descrMetricSystemDiskIo, unitMetricSystemDiskIo); } -static nostd::shared_ptr CreateAsyncMetricSystemDiskIo( +static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemDiskIo( + metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricSystemDiskIo, descrMetricSystemDiskIo, + unitMetricSystemDiskIo); +} + +static inline nostd::shared_ptr CreateAsyncInt64MetricSystemDiskIo( metrics::Meter *meter) { return meter->CreateInt64ObservableCounter(kMetricSystemDiskIo, descrMetricSystemDiskIo, unitMetricSystemDiskIo); } +static inline nostd::shared_ptr CreateAsyncDoubleMetricSystemDiskIo( + metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricSystemDiskIo, descrMetricSystemDiskIo, + unitMetricSystemDiskIo); +} + /** * Time disk spent activated *

@@ -181,20 +276,34 @@ static constexpr const char *kMetricSystemDiskIoTime = "metric.system.disk.i static constexpr const char *descrMetricSystemDiskIoTime = "Time disk spent activated"; static constexpr const char *unitMetricSystemDiskIoTime = "s"; -static nostd::unique_ptr> CreateSyncMetricSystemDiskIoTime( +static inline nostd::unique_ptr> CreateSyncInt64MetricSystemDiskIoTime( metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricSystemDiskIoTime, descrMetricSystemDiskIoTime, unitMetricSystemDiskIoTime); } -static nostd::shared_ptr CreateAsyncMetricSystemDiskIoTime( +static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemDiskIoTime( metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricSystemDiskIoTime, descrMetricSystemDiskIoTime, + unitMetricSystemDiskIoTime); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemDiskIoTime(metrics::Meter *meter) { return meter->CreateInt64ObservableCounter(kMetricSystemDiskIoTime, descrMetricSystemDiskIoTime, unitMetricSystemDiskIoTime); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemDiskIoTime(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricSystemDiskIoTime, descrMetricSystemDiskIoTime, + unitMetricSystemDiskIoTime); +} + /** * counter */ @@ -202,20 +311,34 @@ static constexpr const char *kMetricSystemDiskMerged = "metric.system.disk.m static constexpr const char *descrMetricSystemDiskMerged = ""; static constexpr const char *unitMetricSystemDiskMerged = "{operation}"; -static nostd::unique_ptr> CreateSyncMetricSystemDiskMerged( +static inline nostd::unique_ptr> CreateSyncInt64MetricSystemDiskMerged( metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricSystemDiskMerged, descrMetricSystemDiskMerged, unitMetricSystemDiskMerged); } -static nostd::shared_ptr CreateAsyncMetricSystemDiskMerged( +static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemDiskMerged( metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricSystemDiskMerged, descrMetricSystemDiskMerged, + unitMetricSystemDiskMerged); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemDiskMerged(metrics::Meter *meter) { return meter->CreateInt64ObservableCounter(kMetricSystemDiskMerged, descrMetricSystemDiskMerged, unitMetricSystemDiskMerged); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemDiskMerged(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricSystemDiskMerged, descrMetricSystemDiskMerged, + unitMetricSystemDiskMerged); +} + /** * Sum of the time each operation took to complete *

@@ -232,22 +355,38 @@ static constexpr const char *descrMetricSystemDiskOperationTime = "Sum of the time each operation took to complete"; static constexpr const char *unitMetricSystemDiskOperationTime = "s"; -static nostd::unique_ptr> CreateSyncMetricSystemDiskOperationTime( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemDiskOperationTime(metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricSystemDiskOperationTime, descrMetricSystemDiskOperationTime, unitMetricSystemDiskOperationTime); } -static nostd::shared_ptr CreateAsyncMetricSystemDiskOperationTime( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemDiskOperationTime(metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricSystemDiskOperationTime, + descrMetricSystemDiskOperationTime, + unitMetricSystemDiskOperationTime); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemDiskOperationTime(metrics::Meter *meter) { return meter->CreateInt64ObservableCounter(kMetricSystemDiskOperationTime, descrMetricSystemDiskOperationTime, unitMetricSystemDiskOperationTime); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemDiskOperationTime(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricSystemDiskOperationTime, + descrMetricSystemDiskOperationTime, + unitMetricSystemDiskOperationTime); +} + /** * counter */ @@ -255,20 +394,34 @@ static constexpr const char *kMetricSystemDiskOperations = "metric.system.di static constexpr const char *descrMetricSystemDiskOperations = ""; static constexpr const char *unitMetricSystemDiskOperations = "{operation}"; -static nostd::unique_ptr> CreateSyncMetricSystemDiskOperations( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemDiskOperations(metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricSystemDiskOperations, descrMetricSystemDiskOperations, unitMetricSystemDiskOperations); } -static nostd::shared_ptr CreateAsyncMetricSystemDiskOperations( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemDiskOperations(metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricSystemDiskOperations, descrMetricSystemDiskOperations, + unitMetricSystemDiskOperations); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemDiskOperations(metrics::Meter *meter) { return meter->CreateInt64ObservableCounter( kMetricSystemDiskOperations, descrMetricSystemDiskOperations, unitMetricSystemDiskOperations); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemDiskOperations(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter( + kMetricSystemDiskOperations, descrMetricSystemDiskOperations, unitMetricSystemDiskOperations); +} + /** * updowncounter */ @@ -276,22 +429,38 @@ static constexpr const char *kMetricSystemFilesystemUsage = "metric.system.f static constexpr const char *descrMetricSystemFilesystemUsage = ""; static constexpr const char *unitMetricSystemFilesystemUsage = "By"; -static nostd::unique_ptr> CreateSyncMetricSystemFilesystemUsage( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemFilesystemUsage(metrics::Meter *meter) { return meter->CreateInt64UpDownCounter(kMetricSystemFilesystemUsage, descrMetricSystemFilesystemUsage, unitMetricSystemFilesystemUsage); } -static nostd::shared_ptr CreateAsyncMetricSystemFilesystemUsage( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemFilesystemUsage(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricSystemFilesystemUsage, + descrMetricSystemFilesystemUsage, + unitMetricSystemFilesystemUsage); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemFilesystemUsage(metrics::Meter *meter) { return meter->CreateInt64ObservableUpDownCounter(kMetricSystemFilesystemUsage, descrMetricSystemFilesystemUsage, unitMetricSystemFilesystemUsage); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemFilesystemUsage(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricSystemFilesystemUsage, + descrMetricSystemFilesystemUsage, + unitMetricSystemFilesystemUsage); +} + /** * gauge */ @@ -300,22 +469,41 @@ static constexpr const char *kMetricSystemFilesystemUtilization = static constexpr const char *descrMetricSystemFilesystemUtilization = ""; static constexpr const char *unitMetricSystemFilesystemUtilization = "1"; -static nostd::unique_ptr> CreateSyncMetricSystemFilesystemUtilization( - metrics::Meter *meter) +#ifdef OPENTELEMETRY_LATER +// Unsupported: Sync gauge +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemFilesystemUtilization(metrics::Meter *meter) { return meter->CreateUInt64Gauge(kMetricSystemFilesystemUtilization, descrMetricSystemFilesystemUtilization, unitMetricSystemFilesystemUtilization); } -static nostd::shared_ptr -CreateAsyncMetricSystemFilesystemUtilization(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemFilesystemUtilization(metrics::Meter *meter) +{ + return meter->CreateDoubleGauge(kMetricSystemFilesystemUtilization, + descrMetricSystemFilesystemUtilization, + unitMetricSystemFilesystemUtilization); +} +#endif /* OPENTELEMETRY_LATER */ + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemFilesystemUtilization(metrics::Meter *meter) { return meter->CreateInt64ObservableGauge(kMetricSystemFilesystemUtilization, descrMetricSystemFilesystemUtilization, unitMetricSystemFilesystemUtilization); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemFilesystemUtilization(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableGauge(kMetricSystemFilesystemUtilization, + descrMetricSystemFilesystemUtilization, + unitMetricSystemFilesystemUtilization); +} + /** * An estimate of how much memory is available for starting new applications, without causing * swapping

This is an alternative to @code system.memory.usage @endcode metric with @code @@ -332,22 +520,38 @@ static constexpr const char *descrMetricSystemLinuxMemoryAvailable = "swapping"; static constexpr const char *unitMetricSystemLinuxMemoryAvailable = "By"; -static nostd::unique_ptr> -CreateSyncMetricSystemLinuxMemoryAvailable(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemLinuxMemoryAvailable(metrics::Meter *meter) { return meter->CreateInt64UpDownCounter(kMetricSystemLinuxMemoryAvailable, descrMetricSystemLinuxMemoryAvailable, unitMetricSystemLinuxMemoryAvailable); } -static nostd::shared_ptr CreateAsyncMetricSystemLinuxMemoryAvailable( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemLinuxMemoryAvailable(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricSystemLinuxMemoryAvailable, + descrMetricSystemLinuxMemoryAvailable, + unitMetricSystemLinuxMemoryAvailable); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemLinuxMemoryAvailable(metrics::Meter *meter) { return meter->CreateInt64ObservableUpDownCounter(kMetricSystemLinuxMemoryAvailable, descrMetricSystemLinuxMemoryAvailable, unitMetricSystemLinuxMemoryAvailable); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemLinuxMemoryAvailable(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricSystemLinuxMemoryAvailable, + descrMetricSystemLinuxMemoryAvailable, + unitMetricSystemLinuxMemoryAvailable); +} + /** * Reports the memory used by the Linux kernel for managing caches of frequently used objects. *

@@ -364,22 +568,38 @@ static constexpr const char *descrMetricSystemLinuxMemorySlabUsage = "Reports the memory used by the Linux kernel for managing caches of frequently used objects."; static constexpr const char *unitMetricSystemLinuxMemorySlabUsage = "By"; -static nostd::unique_ptr> -CreateSyncMetricSystemLinuxMemorySlabUsage(metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemLinuxMemorySlabUsage(metrics::Meter *meter) { return meter->CreateInt64UpDownCounter(kMetricSystemLinuxMemorySlabUsage, descrMetricSystemLinuxMemorySlabUsage, unitMetricSystemLinuxMemorySlabUsage); } -static nostd::shared_ptr CreateAsyncMetricSystemLinuxMemorySlabUsage( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemLinuxMemorySlabUsage(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricSystemLinuxMemorySlabUsage, + descrMetricSystemLinuxMemorySlabUsage, + unitMetricSystemLinuxMemorySlabUsage); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemLinuxMemorySlabUsage(metrics::Meter *meter) { return meter->CreateInt64ObservableUpDownCounter(kMetricSystemLinuxMemorySlabUsage, descrMetricSystemLinuxMemorySlabUsage, unitMetricSystemLinuxMemorySlabUsage); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemLinuxMemorySlabUsage(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricSystemLinuxMemorySlabUsage, + descrMetricSystemLinuxMemorySlabUsage, + unitMetricSystemLinuxMemorySlabUsage); +} + /** * Total memory available in the system. *

@@ -391,20 +611,34 @@ static constexpr const char *kMetricSystemMemoryLimit = "metric.system.memor static constexpr const char *descrMetricSystemMemoryLimit = "Total memory available in the system."; static constexpr const char *unitMetricSystemMemoryLimit = "By"; -static nostd::unique_ptr> CreateSyncMetricSystemMemoryLimit( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemMemoryLimit(metrics::Meter *meter) { return meter->CreateInt64UpDownCounter(kMetricSystemMemoryLimit, descrMetricSystemMemoryLimit, unitMetricSystemMemoryLimit); } -static nostd::shared_ptr CreateAsyncMetricSystemMemoryLimit( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemMemoryLimit(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricSystemMemoryLimit, descrMetricSystemMemoryLimit, + unitMetricSystemMemoryLimit); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemMemoryLimit(metrics::Meter *meter) { return meter->CreateInt64ObservableUpDownCounter( kMetricSystemMemoryLimit, descrMetricSystemMemoryLimit, unitMetricSystemMemoryLimit); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemMemoryLimit(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter( + kMetricSystemMemoryLimit, descrMetricSystemMemoryLimit, unitMetricSystemMemoryLimit); +} + /** * Shared memory used (mostly by tmpfs). *

@@ -418,20 +652,34 @@ static constexpr const char *descrMetricSystemMemoryShared = "Shared memory used (mostly by tmpfs)."; static constexpr const char *unitMetricSystemMemoryShared = "By"; -static nostd::unique_ptr> CreateSyncMetricSystemMemoryShared( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemMemoryShared(metrics::Meter *meter) { return meter->CreateInt64UpDownCounter(kMetricSystemMemoryShared, descrMetricSystemMemoryShared, unitMetricSystemMemoryShared); } -static nostd::shared_ptr CreateAsyncMetricSystemMemoryShared( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemMemoryShared(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricSystemMemoryShared, descrMetricSystemMemoryShared, + unitMetricSystemMemoryShared); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemMemoryShared(metrics::Meter *meter) { return meter->CreateInt64ObservableUpDownCounter( kMetricSystemMemoryShared, descrMetricSystemMemoryShared, unitMetricSystemMemoryShared); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemMemoryShared(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter( + kMetricSystemMemoryShared, descrMetricSystemMemoryShared, unitMetricSystemMemoryShared); +} + /** * Reports memory in use by state. *

@@ -444,20 +692,34 @@ static constexpr const char *kMetricSystemMemoryUsage = "metric.system.memor static constexpr const char *descrMetricSystemMemoryUsage = "Reports memory in use by state."; static constexpr const char *unitMetricSystemMemoryUsage = "By"; -static nostd::unique_ptr> CreateSyncMetricSystemMemoryUsage( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemMemoryUsage(metrics::Meter *meter) { return meter->CreateInt64UpDownCounter(kMetricSystemMemoryUsage, descrMetricSystemMemoryUsage, unitMetricSystemMemoryUsage); } -static nostd::shared_ptr CreateAsyncMetricSystemMemoryUsage( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemMemoryUsage(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricSystemMemoryUsage, descrMetricSystemMemoryUsage, + unitMetricSystemMemoryUsage); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemMemoryUsage(metrics::Meter *meter) { return meter->CreateInt64ObservableUpDownCounter( kMetricSystemMemoryUsage, descrMetricSystemMemoryUsage, unitMetricSystemMemoryUsage); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemMemoryUsage(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter( + kMetricSystemMemoryUsage, descrMetricSystemMemoryUsage, unitMetricSystemMemoryUsage); +} + /** * gauge */ @@ -465,22 +727,41 @@ static constexpr const char *kMetricSystemMemoryUtilization = "metric.system.mem static constexpr const char *descrMetricSystemMemoryUtilization = ""; static constexpr const char *unitMetricSystemMemoryUtilization = "1"; -static nostd::unique_ptr> CreateSyncMetricSystemMemoryUtilization( - metrics::Meter *meter) +#ifdef OPENTELEMETRY_LATER +// Unsupported: Sync gauge +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemMemoryUtilization(metrics::Meter *meter) { return meter->CreateUInt64Gauge(kMetricSystemMemoryUtilization, descrMetricSystemMemoryUtilization, unitMetricSystemMemoryUtilization); } -static nostd::shared_ptr CreateAsyncMetricSystemMemoryUtilization( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemMemoryUtilization(metrics::Meter *meter) +{ + return meter->CreateDoubleGauge(kMetricSystemMemoryUtilization, + descrMetricSystemMemoryUtilization, + unitMetricSystemMemoryUtilization); +} +#endif /* OPENTELEMETRY_LATER */ + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemMemoryUtilization(metrics::Meter *meter) { return meter->CreateInt64ObservableGauge(kMetricSystemMemoryUtilization, descrMetricSystemMemoryUtilization, unitMetricSystemMemoryUtilization); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemMemoryUtilization(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableGauge(kMetricSystemMemoryUtilization, + descrMetricSystemMemoryUtilization, + unitMetricSystemMemoryUtilization); +} + /** * updowncounter */ @@ -488,22 +769,38 @@ static constexpr const char *kMetricSystemNetworkConnections = "metric.system.ne static constexpr const char *descrMetricSystemNetworkConnections = ""; static constexpr const char *unitMetricSystemNetworkConnections = "{connection}"; -static nostd::unique_ptr> CreateSyncMetricSystemNetworkConnections( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemNetworkConnections(metrics::Meter *meter) { return meter->CreateInt64UpDownCounter(kMetricSystemNetworkConnections, descrMetricSystemNetworkConnections, unitMetricSystemNetworkConnections); } -static nostd::shared_ptr CreateAsyncMetricSystemNetworkConnections( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemNetworkConnections(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricSystemNetworkConnections, + descrMetricSystemNetworkConnections, + unitMetricSystemNetworkConnections); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemNetworkConnections(metrics::Meter *meter) { return meter->CreateInt64ObservableUpDownCounter(kMetricSystemNetworkConnections, descrMetricSystemNetworkConnections, unitMetricSystemNetworkConnections); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemNetworkConnections(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricSystemNetworkConnections, + descrMetricSystemNetworkConnections, + unitMetricSystemNetworkConnections); +} + /** * Count of packets that are dropped or discarded even though there was no error *

@@ -525,20 +822,34 @@ static constexpr const char *descrMetricSystemNetworkDropped = "Count of packets that are dropped or discarded even though there was no error"; static constexpr const char *unitMetricSystemNetworkDropped = "{packet}"; -static nostd::unique_ptr> CreateSyncMetricSystemNetworkDropped( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemNetworkDropped(metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricSystemNetworkDropped, descrMetricSystemNetworkDropped, unitMetricSystemNetworkDropped); } -static nostd::shared_ptr CreateAsyncMetricSystemNetworkDropped( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemNetworkDropped(metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricSystemNetworkDropped, descrMetricSystemNetworkDropped, + unitMetricSystemNetworkDropped); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemNetworkDropped(metrics::Meter *meter) { return meter->CreateInt64ObservableCounter( kMetricSystemNetworkDropped, descrMetricSystemNetworkDropped, unitMetricSystemNetworkDropped); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemNetworkDropped(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter( + kMetricSystemNetworkDropped, descrMetricSystemNetworkDropped, unitMetricSystemNetworkDropped); +} + /** * Count of network errors detected *

@@ -559,20 +870,34 @@ static constexpr const char *kMetricSystemNetworkErrors = "metric.system.net static constexpr const char *descrMetricSystemNetworkErrors = "Count of network errors detected"; static constexpr const char *unitMetricSystemNetworkErrors = "{error}"; -static nostd::unique_ptr> CreateSyncMetricSystemNetworkErrors( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemNetworkErrors(metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricSystemNetworkErrors, descrMetricSystemNetworkErrors, unitMetricSystemNetworkErrors); } -static nostd::shared_ptr CreateAsyncMetricSystemNetworkErrors( +static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemNetworkErrors( metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricSystemNetworkErrors, descrMetricSystemNetworkErrors, + unitMetricSystemNetworkErrors); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemNetworkErrors(metrics::Meter *meter) { return meter->CreateInt64ObservableCounter( kMetricSystemNetworkErrors, descrMetricSystemNetworkErrors, unitMetricSystemNetworkErrors); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemNetworkErrors(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter( + kMetricSystemNetworkErrors, descrMetricSystemNetworkErrors, unitMetricSystemNetworkErrors); +} + /** * counter */ @@ -580,20 +905,34 @@ static constexpr const char *kMetricSystemNetworkIo = "metric.system.network static constexpr const char *descrMetricSystemNetworkIo = ""; static constexpr const char *unitMetricSystemNetworkIo = "By"; -static nostd::unique_ptr> CreateSyncMetricSystemNetworkIo( +static inline nostd::unique_ptr> CreateSyncInt64MetricSystemNetworkIo( metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricSystemNetworkIo, descrMetricSystemNetworkIo, unitMetricSystemNetworkIo); } -static nostd::shared_ptr CreateAsyncMetricSystemNetworkIo( +static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemNetworkIo( metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricSystemNetworkIo, descrMetricSystemNetworkIo, + unitMetricSystemNetworkIo); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemNetworkIo(metrics::Meter *meter) { return meter->CreateInt64ObservableCounter(kMetricSystemNetworkIo, descrMetricSystemNetworkIo, unitMetricSystemNetworkIo); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemNetworkIo(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricSystemNetworkIo, descrMetricSystemNetworkIo, + unitMetricSystemNetworkIo); +} + /** * counter */ @@ -601,20 +940,34 @@ static constexpr const char *kMetricSystemNetworkPackets = "metric.system.ne static constexpr const char *descrMetricSystemNetworkPackets = ""; static constexpr const char *unitMetricSystemNetworkPackets = "{packet}"; -static nostd::unique_ptr> CreateSyncMetricSystemNetworkPackets( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemNetworkPackets(metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricSystemNetworkPackets, descrMetricSystemNetworkPackets, unitMetricSystemNetworkPackets); } -static nostd::shared_ptr CreateAsyncMetricSystemNetworkPackets( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemNetworkPackets(metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricSystemNetworkPackets, descrMetricSystemNetworkPackets, + unitMetricSystemNetworkPackets); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemNetworkPackets(metrics::Meter *meter) { return meter->CreateInt64ObservableCounter( kMetricSystemNetworkPackets, descrMetricSystemNetworkPackets, unitMetricSystemNetworkPackets); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemNetworkPackets(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter( + kMetricSystemNetworkPackets, descrMetricSystemNetworkPackets, unitMetricSystemNetworkPackets); +} + /** * counter */ @@ -622,20 +975,34 @@ static constexpr const char *kMetricSystemPagingFaults = "metric.system.pagi static constexpr const char *descrMetricSystemPagingFaults = ""; static constexpr const char *unitMetricSystemPagingFaults = "{fault}"; -static nostd::unique_ptr> CreateSyncMetricSystemPagingFaults( +static inline nostd::unique_ptr> CreateSyncInt64MetricSystemPagingFaults( metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricSystemPagingFaults, descrMetricSystemPagingFaults, unitMetricSystemPagingFaults); } -static nostd::shared_ptr CreateAsyncMetricSystemPagingFaults( +static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemPagingFaults( metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricSystemPagingFaults, descrMetricSystemPagingFaults, + unitMetricSystemPagingFaults); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemPagingFaults(metrics::Meter *meter) { return meter->CreateInt64ObservableCounter( kMetricSystemPagingFaults, descrMetricSystemPagingFaults, unitMetricSystemPagingFaults); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemPagingFaults(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter( + kMetricSystemPagingFaults, descrMetricSystemPagingFaults, unitMetricSystemPagingFaults); +} + /** * counter */ @@ -643,22 +1010,38 @@ static constexpr const char *kMetricSystemPagingOperations = "metric.system. static constexpr const char *descrMetricSystemPagingOperations = ""; static constexpr const char *unitMetricSystemPagingOperations = "{operation}"; -static nostd::unique_ptr> CreateSyncMetricSystemPagingOperations( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemPagingOperations(metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricSystemPagingOperations, descrMetricSystemPagingOperations, unitMetricSystemPagingOperations); } -static nostd::shared_ptr CreateAsyncMetricSystemPagingOperations( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemPagingOperations(metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricSystemPagingOperations, + descrMetricSystemPagingOperations, + unitMetricSystemPagingOperations); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemPagingOperations(metrics::Meter *meter) { return meter->CreateInt64ObservableCounter(kMetricSystemPagingOperations, descrMetricSystemPagingOperations, unitMetricSystemPagingOperations); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemPagingOperations(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricSystemPagingOperations, + descrMetricSystemPagingOperations, + unitMetricSystemPagingOperations); +} + /** * Unix swap or windows pagefile usage *

@@ -668,20 +1051,34 @@ static constexpr const char *kMetricSystemPagingUsage = "metric.system.pagin static constexpr const char *descrMetricSystemPagingUsage = "Unix swap or windows pagefile usage"; static constexpr const char *unitMetricSystemPagingUsage = "By"; -static nostd::unique_ptr> CreateSyncMetricSystemPagingUsage( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemPagingUsage(metrics::Meter *meter) { return meter->CreateInt64UpDownCounter(kMetricSystemPagingUsage, descrMetricSystemPagingUsage, unitMetricSystemPagingUsage); } -static nostd::shared_ptr CreateAsyncMetricSystemPagingUsage( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemPagingUsage(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricSystemPagingUsage, descrMetricSystemPagingUsage, + unitMetricSystemPagingUsage); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemPagingUsage(metrics::Meter *meter) { return meter->CreateInt64ObservableUpDownCounter( kMetricSystemPagingUsage, descrMetricSystemPagingUsage, unitMetricSystemPagingUsage); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemPagingUsage(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter( + kMetricSystemPagingUsage, descrMetricSystemPagingUsage, unitMetricSystemPagingUsage); +} + /** * gauge */ @@ -689,22 +1086,41 @@ static constexpr const char *kMetricSystemPagingUtilization = "metric.system.pag static constexpr const char *descrMetricSystemPagingUtilization = ""; static constexpr const char *unitMetricSystemPagingUtilization = "1"; -static nostd::unique_ptr> CreateSyncMetricSystemPagingUtilization( - metrics::Meter *meter) +#ifdef OPENTELEMETRY_LATER +// Unsupported: Sync gauge +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemPagingUtilization(metrics::Meter *meter) { return meter->CreateUInt64Gauge(kMetricSystemPagingUtilization, descrMetricSystemPagingUtilization, unitMetricSystemPagingUtilization); } -static nostd::shared_ptr CreateAsyncMetricSystemPagingUtilization( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemPagingUtilization(metrics::Meter *meter) +{ + return meter->CreateDoubleGauge(kMetricSystemPagingUtilization, + descrMetricSystemPagingUtilization, + unitMetricSystemPagingUtilization); +} +#endif /* OPENTELEMETRY_LATER */ + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemPagingUtilization(metrics::Meter *meter) { return meter->CreateInt64ObservableGauge(kMetricSystemPagingUtilization, descrMetricSystemPagingUtilization, unitMetricSystemPagingUtilization); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemPagingUtilization(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableGauge(kMetricSystemPagingUtilization, + descrMetricSystemPagingUtilization, + unitMetricSystemPagingUtilization); +} + /** * Total number of processes in each state *

@@ -715,20 +1131,34 @@ static constexpr const char *descrMetricSystemProcessCount = "Total number of processes in each state"; static constexpr const char *unitMetricSystemProcessCount = "{process}"; -static nostd::unique_ptr> CreateSyncMetricSystemProcessCount( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemProcessCount(metrics::Meter *meter) { return meter->CreateInt64UpDownCounter(kMetricSystemProcessCount, descrMetricSystemProcessCount, unitMetricSystemProcessCount); } -static nostd::shared_ptr CreateAsyncMetricSystemProcessCount( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemProcessCount(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricSystemProcessCount, descrMetricSystemProcessCount, + unitMetricSystemProcessCount); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemProcessCount(metrics::Meter *meter) { return meter->CreateInt64ObservableUpDownCounter( kMetricSystemProcessCount, descrMetricSystemProcessCount, unitMetricSystemProcessCount); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemProcessCount(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter( + kMetricSystemProcessCount, descrMetricSystemProcessCount, unitMetricSystemProcessCount); +} + /** * Total number of processes created over uptime of the host *

@@ -739,20 +1169,34 @@ static constexpr const char *descrMetricSystemProcessCreated = "Total number of processes created over uptime of the host"; static constexpr const char *unitMetricSystemProcessCreated = "{process}"; -static nostd::unique_ptr> CreateSyncMetricSystemProcessCreated( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemProcessCreated(metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricSystemProcessCreated, descrMetricSystemProcessCreated, unitMetricSystemProcessCreated); } -static nostd::shared_ptr CreateAsyncMetricSystemProcessCreated( - metrics::Meter *meter) +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemProcessCreated(metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricSystemProcessCreated, descrMetricSystemProcessCreated, + unitMetricSystemProcessCreated); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemProcessCreated(metrics::Meter *meter) { return meter->CreateInt64ObservableCounter( kMetricSystemProcessCreated, descrMetricSystemProcessCreated, unitMetricSystemProcessCreated); } +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemProcessCreated(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter( + kMetricSystemProcessCreated, descrMetricSystemProcessCreated, unitMetricSystemProcessCreated); +} + } // namespace system } // namespace semconv OPENTELEMETRY_END_NAMESPACE diff --git a/buildscripts/semantic-convention/generate.sh b/buildscripts/semantic-convention/generate.sh index 550689be73..65858a90a7 100755 --- a/buildscripts/semantic-convention/generate.sh +++ b/buildscripts/semantic-convention/generate.sh @@ -13,7 +13,7 @@ set -e SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" ROOT_DIR="${SCRIPT_DIR}/../../" -# freeze the spec & generator tools versions to make SemanticAttributes generation reproducible +# freeze the spec & generator tools versions to make the generation reproducible # repository: https://github.com/open-telemetry/semantic-conventions SEMCONV_VERSION=1.27.0 @@ -54,6 +54,8 @@ fi # DOCKER # ====== # +# docker is a root container +# # MY_UID=$(id -u) # MY_GID=$(id -g) # docker --user ${MY_UID}:${MY_GID} @@ -61,6 +63,9 @@ fi # PODMAN # ====== # +# podman is a rootless container +# docker is an alias to podman +# # docker --user 0:0 MY_UID=$(id -u) @@ -70,8 +75,13 @@ if [ -x "$(command -v docker)" ]; then PODMANSTATUS=$(docker -v | grep -c podman); if [ "${PODMANSTATUS}" -ge "1" ]; then echo "Detected PODMAN" + # podman is a rootless container. + # Execute the docker image as root, + # to avoid creating files as weaver:weaver in the container, + # so files end up created as the local user:group outside the container. MY_UID="0" MY_GID="0" + # Possible alternate solution: --userns=keep-id fi; fi diff --git a/buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 b/buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 index ea87c18547..79afd67191 100644 --- a/buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 +++ b/buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 @@ -26,6 +26,17 @@ * buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 */ {# ========================================================================== #} +{# + DESIGN NOTES: + - Use the debug flag to dump the semantic convention data + in the generated output, to inspect it. + - Some instruments are not supported in the SDK. + For these, we still generate the code, + protected with OPENTELEMETRY_LATER (which should be undefined). + - Using #ifdef OPENTELEMETRY_LATER is prefered to #if 0, + so that clang format generates clean code. +#} +{# ========================================================================== #} {% set debug = false %} @@ -56,27 +67,39 @@ unit{{ metric.id | pascal_case }} {% endmacro %} {% macro sync_instrument_support(metric) %} -{{ metric.instrument | map_text("cpp_sync_support", "FIXME") }} +{{ metric.instrument | map_text("cpp_sync_support") }} {% endmacro %} -{% macro sync_instrument_type(metric) %} -{{ metric.instrument | map_text("cpp_sync_instrument_to_type", "FIXME") }} +{% macro sync_instrument_int64_type(metric) %} +{{ metric.instrument | map_text("cpp_sync_instrument_to_int64_type") | trim }} {% endmacro %} -{% macro sync_instrument_factory(metric) %} -{{ metric.instrument | map_text("cpp_sync_instrument_to_factory", "FIXME") }} +{% macro sync_instrument_double_type(metric) %} +{{ metric.instrument | map_text("cpp_sync_instrument_to_double_type") | trim }} +{% endmacro %} + +{% macro sync_instrument_int64_factory(metric) %} +{{ metric.instrument | map_text("cpp_sync_instrument_to_int64_factory") }} +{% endmacro %} + +{% macro sync_instrument_double_factory(metric) %} +{{ metric.instrument | map_text("cpp_sync_instrument_to_double_factory") }} {% endmacro %} {% macro async_instrument_support(metric) %} -{{ metric.instrument | map_text("cpp_async_support", "FIXME") }} +{{ metric.instrument | map_text("cpp_async_support") | trim }} {% endmacro %} {% macro async_instrument_type(metric) %} -{{ metric.instrument | map_text("cpp_async_instrument_to_type", "FIXME") }} +{{ metric.instrument | map_text("cpp_async_instrument_to_type") }} +{% endmacro %} + +{% macro async_instrument_int64_factory(metric) %} +{{ metric.instrument | map_text("cpp_async_instrument_to_int64_factory") }} {% endmacro %} -{% macro async_instrument_factory(metric) %} -{{ metric.instrument | map_text("cpp_async_instrument_to_factory", "FIXME") }} +{% macro async_instrument_double_factory(metric) %} +{{ metric.instrument | map_text("cpp_async_instrument_to_double_factory") }} {% endmacro %} {% set cpp_metric_namespace = metric_namespace(ctx) %} @@ -86,6 +109,7 @@ unit{{ metric.id | pascal_case }} #pragma once #include "opentelemetry/common/macros.h" +#include "opentelemetry/metrics/meter.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -102,12 +126,15 @@ namespace {{ cpp_metric_namespace -}} {% set v_metric_name = var_metric_name(metric) %} {% set descr = descr_metric_name(metric) %} {% set unit = unit_metric_name(metric) %} - {% set sync_support = sync_instrument_support(metric) %} - {% set async_support = async_instrument_support(metric) %} - {% set sync_type = sync_instrument_type(metric) %} + {% set sync_support = (sync_instrument_support(metric) | trim == "true") %} + {% set async_support = (async_instrument_support(metric) | trim == "true") %} + {% set sync_int64_type = sync_instrument_int64_type(metric) %} + {% set sync_double_type = sync_instrument_double_type(metric) %} {% set async_type = async_instrument_type(metric) %} - {% set sync_factory = sync_instrument_factory(metric) %} - {% set async_factory = async_instrument_factory(metric) %} + {% set sync_int64_factory = sync_instrument_int64_factory(metric) %} + {% set sync_double_factory = sync_instrument_double_factory(metric) %} + {% set async_int64_factory = async_instrument_int64_factory(metric) %} + {% set async_double_factory = async_instrument_double_factory(metric) %} {% set excluded = metric.id in ctx.excluded_attributes %} {% if excluded %} #if 0 @@ -123,40 +150,58 @@ static constexpr const char *{{v_metric_name}} = "{{metric.id}}"; static constexpr const char *{{descr}} = "{{metric.brief}}"; static constexpr const char *{{unit}} = "{{metric.unit}}"; - {% if not sync_support %} -#if LATER -// Unsupported: + {% if sync_support is false %} +#ifdef OPENTELEMETRY_LATER +// Unsupported: Sync {{ metric.instrument }} {% endif %} -static nostd::unique_ptr<{{sync_type-}}> -CreateSync{{f_metric_name-}}(metrics::Meter *meter) +static inline nostd::unique_ptr<{{sync_int64_type-}}> +CreateSyncInt64{{f_metric_name-}}(metrics::Meter *meter) { - return meter->{{sync_factory}}( + return meter->{{sync_int64_factory}}( {{v_metric_name}}, {{descr}}, {{unit}}); } - {% if not sync_support %} -#endif + +static inline nostd::unique_ptr<{{sync_double_type-}}> +CreateSyncDouble{{f_metric_name-}}(metrics::Meter *meter) +{ + return meter->{{sync_double_factory}}( + {{v_metric_name}}, + {{descr}}, + {{unit}}); +} + {% if sync_support is false %} +#endif /* OPENTELEMETRY_LATER */ {% endif %} - {% if not async_support %} -#if LATER -// Unsupported: + {% if async_support is false %} +#ifdef OPENTELEMETRY_LATER +// Unsupported: Async {{ metric.instrument }} {% endif %} -static nostd::shared_ptr<{{async_type-}}> -CreateAsync{{f_metric_name-}}(metrics::Meter *meter) +static inline nostd::shared_ptr<{{async_type-}}> +CreateAsyncInt64{{f_metric_name-}}(metrics::Meter *meter) +{ + return meter->{{async_int64_factory}}( + {{v_metric_name}}, + {{descr}}, + {{unit}}); +} + +static inline nostd::shared_ptr<{{async_type-}}> +CreateAsyncDouble{{f_metric_name-}}(metrics::Meter *meter) { - return meter->{{async_factory}}( + return meter->{{async_double_factory}}( {{v_metric_name}}, {{descr}}, {{unit}}); } - {% if not async_support %} -#endif + {% if async_support is false %} +#endif /* OPENTELEMETRY_LATER */ {% endif %} {% if excluded %} -#endif +#endif /* 0 */ {% endif %} {% endfor %} diff --git a/buildscripts/semantic-convention/templates/registry/weaver.yaml b/buildscripts/semantic-convention/templates/registry/weaver.yaml index 59236bbeff..beb2e21abe 100644 --- a/buildscripts/semantic-convention/templates/registry/weaver.yaml +++ b/buildscripts/semantic-convention/templates/registry/weaver.yaml @@ -60,30 +60,44 @@ text_maps: template[string[]]: const char *[] cpp_sync_support: - counter: true - histogram: true - updowncounter: true - gauge: false - - cpp_sync_instrument_to_type: - counter: metrics::Counter - histogram: metrics::Histogram - updowncounter: metrics::UpDownCounter + counter: "true" + histogram: "true" + updowncounter: "true" + gauge: "false" + + cpp_sync_instrument_to_int64_type: + counter: metrics::Counter + histogram: metrics::Histogram + updowncounter: metrics::UpDownCounter + # Not supported yet + gauge: metrics::Gauge + + cpp_sync_instrument_to_double_type: + counter: metrics::Counter + histogram: metrics::Histogram + updowncounter: metrics::UpDownCounter # Not supported yet - gauge: metrics::Gauge + gauge: metrics::Gauge - cpp_sync_instrument_to_factory: + cpp_sync_instrument_to_int64_factory: counter: CreateUInt64Counter histogram: CreateUInt64Histogram updowncounter: CreateInt64UpDownCounter # Not supported yet gauge: CreateUInt64Gauge + cpp_sync_instrument_to_double_factory: + counter: CreateDoubleCounter + histogram: CreateDoubleHistogram + updowncounter: CreateDoubleUpDownCounter + # Not supported yet + gauge: CreateDoubleGauge + cpp_async_support: - counter: true - histogram: false - updowncounter: true - gauge: true + counter: "true" + histogram: "false" + updowncounter: "true" + gauge: "true" cpp_async_instrument_to_type: counter: metrics::ObservableInstrument @@ -92,13 +106,21 @@ text_maps: updowncounter: metrics::ObservableInstrument gauge: metrics::ObservableInstrument - cpp_async_instrument_to_factory: + cpp_async_instrument_to_int64_factory: counter: CreateInt64ObservableCounter # Not supported yet histogram: CreateInt64ObservableHistogram updowncounter: CreateInt64ObservableUpDownCounter gauge: CreateInt64ObservableGauge + cpp_async_instrument_to_double_factory: + counter: CreateDoubleObservableCounter + # Not supported yet + histogram: CreateDoubleObservableHistogram + updowncounter: CreateDoubleObservableUpDownCounter + gauge: CreateDoubleObservableGauge + + comment_formats: cpp: format: html diff --git a/examples/common/metrics_foo_library/foo_library.cc b/examples/common/metrics_foo_library/foo_library.cc index c4be2b530f..a1cf134a0c 100644 --- a/examples/common/metrics_foo_library/foo_library.cc +++ b/examples/common/metrics_foo_library/foo_library.cc @@ -20,6 +20,9 @@ #include "opentelemetry/metrics/sync_instruments.h" #include "opentelemetry/nostd/shared_ptr.h" #include "opentelemetry/nostd/variant.h" +#include "opentelemetry/semconv/http_metrics.h" +#include "opentelemetry/semconv/incubating/messaging_metrics.h" +#include "opentelemetry/semconv/incubating/system_metrics.h" namespace metrics_api = opentelemetry::metrics; @@ -107,3 +110,49 @@ void foo_library::histogram_example(const std::string &name) std::this_thread::sleep_for(std::chrono::milliseconds(250)); } } + +void foo_library::semconv_counter_example() +{ + auto provider = metrics_api::Provider::GetMeterProvider(); + opentelemetry::nostd::shared_ptr meter = provider->GetMeter("demo", "1.2.0"); + auto double_counter = + opentelemetry::semconv::messaging::CreateSyncDoubleMetricMessagingClientConsumedMessages( + meter.get()); + + for (uint32_t i = 0; i < 20; ++i) + { + double val = (rand() % 700) + 1.1; + double_counter->Add(val); + std::this_thread::sleep_for(std::chrono::milliseconds(500)); + } +} + +void foo_library::semconv_observable_counter_example() +{ + auto provider = metrics_api::Provider::GetMeterProvider(); + opentelemetry::nostd::shared_ptr meter = provider->GetMeter("demo", "1.2.0"); + double_observable_counter = + opentelemetry::semconv::system::CreateAsyncDoubleMetricSystemCpuTime(meter.get()); + double_observable_counter->AddCallback(MeasurementFetcher::Fetcher, nullptr); + for (uint32_t i = 0; i < 20; ++i) + { + std::this_thread::sleep_for(std::chrono::milliseconds(500)); + } +} + +void foo_library::semconv_histogram_example() +{ + auto provider = metrics_api::Provider::GetMeterProvider(); + opentelemetry::nostd::shared_ptr meter = provider->GetMeter("demo", "1.2.0"); + auto histogram_counter = + opentelemetry::semconv::http::CreateSyncInt64MetricHttpClientRequestDuration(meter.get()); + auto context = opentelemetry::context::Context{}; + for (uint32_t i = 0; i < 20; ++i) + { + double val = (rand() % 700) + 1.1; + std::map labels = get_random_attr(); + auto labelkv = opentelemetry::common::KeyValueIterableView{labels}; + histogram_counter->Record(val, labelkv, context); + std::this_thread::sleep_for(std::chrono::milliseconds(250)); + } +} diff --git a/examples/common/metrics_foo_library/foo_library.h b/examples/common/metrics_foo_library/foo_library.h index 217f91671b..896c53695b 100644 --- a/examples/common/metrics_foo_library/foo_library.h +++ b/examples/common/metrics_foo_library/foo_library.h @@ -11,4 +11,7 @@ class foo_library static void counter_example(const std::string &name); static void histogram_example(const std::string &name); static void observable_counter_example(const std::string &name); + static void semconv_counter_example(); + static void semconv_histogram_example(); + static void semconv_observable_counter_example(); }; diff --git a/examples/metrics_simple/metrics_ostream.cc b/examples/metrics_simple/metrics_ostream.cc index 5bdc7339eb..b18e196177 100644 --- a/examples/metrics_simple/metrics_ostream.cc +++ b/examples/metrics_simple/metrics_ostream.cc @@ -148,15 +148,34 @@ int main(int argc, char **argv) { foo_library::histogram_example(name); } + else if (example_type == "semconv_counter") + { + foo_library::semconv_counter_example(); + } + else if (example_type == "semconv_observable_counter") + { + foo_library::semconv_observable_counter_example(); + } + else if (example_type == "semconv_histogram") + { + foo_library::semconv_histogram_example(); + } else { std::thread counter_example{&foo_library::counter_example, name}; std::thread observable_counter_example{&foo_library::observable_counter_example, name}; std::thread histogram_example{&foo_library::histogram_example, name}; + std::thread semconv_counter_example{&foo_library::semconv_counter_example}; + std::thread semconv_observable_counter_example{ + &foo_library::semconv_observable_counter_example}; + std::thread semconv_histogram_example{&foo_library::semconv_histogram_example}; counter_example.join(); observable_counter_example.join(); histogram_example.join(); + semconv_counter_example.join(); + semconv_observable_counter_example.join(); + semconv_histogram_example.join(); } CleanupMetrics(); From bdef3df062641170b870e50c9946e7405e7a092a Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Wed, 30 Oct 2024 23:08:40 +0100 Subject: [PATCH 08/16] cleanup --- .../semconv/incubating/db_metrics.h | 54 +++++++++++++++++++ .../semconv/incubating/messaging_metrics.h | 30 +++++++++++ .../templates/registry/semantic_metrics-h.j2 | 20 ++++++- .../common/metrics_foo_library/foo_library.cc | 4 +- 4 files changed, 105 insertions(+), 3 deletions(-) diff --git a/api/include/opentelemetry/semconv/incubating/db_metrics.h b/api/include/opentelemetry/semconv/incubating/db_metrics.h index 58a5466af9..610306de72 100644 --- a/api/include/opentelemetry/semconv/incubating/db_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/db_metrics.h @@ -424,11 +424,14 @@ CreateAsyncDoubleMetricDbClientConnectionWaitTime(metrics::Meter *meter) OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricDbClientConnectionsCreateTimeDeprecated = "metric.db.client.connections.create_time.deprecated"; +OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricDbClientConnectionsCreateTimeDeprecated = "Deprecated, use `db.client.connection.create_time` instead. Note: the unit also changed from " "`ms` to `s`."; +OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricDbClientConnectionsCreateTimeDeprecated = "ms"; +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncInt64MetricDbClientConnectionsCreateTimeDeprecated(metrics::Meter *meter) { @@ -437,6 +440,7 @@ CreateSyncInt64MetricDbClientConnectionsCreateTimeDeprecated(metrics::Meter *met unitMetricDbClientConnectionsCreateTimeDeprecated); } +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncDoubleMetricDbClientConnectionsCreateTimeDeprecated(metrics::Meter *meter) { @@ -447,6 +451,7 @@ CreateSyncDoubleMetricDbClientConnectionsCreateTimeDeprecated(metrics::Meter *me #ifdef OPENTELEMETRY_LATER // Unsupported: Async histogram +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncInt64MetricDbClientConnectionsCreateTimeDeprecated(metrics::Meter *meter) { @@ -455,6 +460,7 @@ CreateAsyncInt64MetricDbClientConnectionsCreateTimeDeprecated(metrics::Meter *me unitMetricDbClientConnectionsCreateTimeDeprecated); } +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncDoubleMetricDbClientConnectionsCreateTimeDeprecated(metrics::Meter *meter) { @@ -475,10 +481,13 @@ CreateAsyncDoubleMetricDbClientConnectionsCreateTimeDeprecated(metrics::Meter *m OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricDbClientConnectionsIdleMaxDeprecated = "metric.db.client.connections.idle.max.deprecated"; +OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricDbClientConnectionsIdleMaxDeprecated = "Deprecated, use `db.client.connection.idle.max` instead."; +OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricDbClientConnectionsIdleMaxDeprecated = "{connection}"; +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncInt64MetricDbClientConnectionsIdleMaxDeprecated(metrics::Meter *meter) { @@ -487,6 +496,7 @@ CreateSyncInt64MetricDbClientConnectionsIdleMaxDeprecated(metrics::Meter *meter) unitMetricDbClientConnectionsIdleMaxDeprecated); } +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncDoubleMetricDbClientConnectionsIdleMaxDeprecated(metrics::Meter *meter) { @@ -495,6 +505,7 @@ CreateSyncDoubleMetricDbClientConnectionsIdleMaxDeprecated(metrics::Meter *meter unitMetricDbClientConnectionsIdleMaxDeprecated); } +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncInt64MetricDbClientConnectionsIdleMaxDeprecated(metrics::Meter *meter) { @@ -503,6 +514,7 @@ CreateAsyncInt64MetricDbClientConnectionsIdleMaxDeprecated(metrics::Meter *meter unitMetricDbClientConnectionsIdleMaxDeprecated); } +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncDoubleMetricDbClientConnectionsIdleMaxDeprecated(metrics::Meter *meter) { @@ -522,10 +534,13 @@ CreateAsyncDoubleMetricDbClientConnectionsIdleMaxDeprecated(metrics::Meter *mete OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricDbClientConnectionsIdleMinDeprecated = "metric.db.client.connections.idle.min.deprecated"; +OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricDbClientConnectionsIdleMinDeprecated = "Deprecated, use `db.client.connection.idle.min` instead."; +OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricDbClientConnectionsIdleMinDeprecated = "{connection}"; +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncInt64MetricDbClientConnectionsIdleMinDeprecated(metrics::Meter *meter) { @@ -534,6 +549,7 @@ CreateSyncInt64MetricDbClientConnectionsIdleMinDeprecated(metrics::Meter *meter) unitMetricDbClientConnectionsIdleMinDeprecated); } +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncDoubleMetricDbClientConnectionsIdleMinDeprecated(metrics::Meter *meter) { @@ -542,6 +558,7 @@ CreateSyncDoubleMetricDbClientConnectionsIdleMinDeprecated(metrics::Meter *meter unitMetricDbClientConnectionsIdleMinDeprecated); } +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncInt64MetricDbClientConnectionsIdleMinDeprecated(metrics::Meter *meter) { @@ -550,6 +567,7 @@ CreateAsyncInt64MetricDbClientConnectionsIdleMinDeprecated(metrics::Meter *meter unitMetricDbClientConnectionsIdleMinDeprecated); } +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncDoubleMetricDbClientConnectionsIdleMinDeprecated(metrics::Meter *meter) { @@ -569,10 +587,13 @@ CreateAsyncDoubleMetricDbClientConnectionsIdleMinDeprecated(metrics::Meter *mete OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricDbClientConnectionsMaxDeprecated = "metric.db.client.connections.max.deprecated"; +OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricDbClientConnectionsMaxDeprecated = "Deprecated, use `db.client.connection.max` instead."; +OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricDbClientConnectionsMaxDeprecated = "{connection}"; +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncInt64MetricDbClientConnectionsMaxDeprecated(metrics::Meter *meter) { @@ -581,6 +602,7 @@ CreateSyncInt64MetricDbClientConnectionsMaxDeprecated(metrics::Meter *meter) unitMetricDbClientConnectionsMaxDeprecated); } +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncDoubleMetricDbClientConnectionsMaxDeprecated(metrics::Meter *meter) { @@ -589,6 +611,7 @@ CreateSyncDoubleMetricDbClientConnectionsMaxDeprecated(metrics::Meter *meter) unitMetricDbClientConnectionsMaxDeprecated); } +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncInt64MetricDbClientConnectionsMaxDeprecated(metrics::Meter *meter) { @@ -597,6 +620,7 @@ CreateAsyncInt64MetricDbClientConnectionsMaxDeprecated(metrics::Meter *meter) unitMetricDbClientConnectionsMaxDeprecated); } +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncDoubleMetricDbClientConnectionsMaxDeprecated(metrics::Meter *meter) { @@ -616,10 +640,13 @@ CreateAsyncDoubleMetricDbClientConnectionsMaxDeprecated(metrics::Meter *meter) OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricDbClientConnectionsPendingRequestsDeprecated = "metric.db.client.connections.pending_requests.deprecated"; +OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricDbClientConnectionsPendingRequestsDeprecated = "Deprecated, use `db.client.connection.pending_requests` instead."; +OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricDbClientConnectionsPendingRequestsDeprecated = "{request}"; +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncInt64MetricDbClientConnectionsPendingRequestsDeprecated(metrics::Meter *meter) { @@ -628,6 +655,7 @@ CreateSyncInt64MetricDbClientConnectionsPendingRequestsDeprecated(metrics::Meter unitMetricDbClientConnectionsPendingRequestsDeprecated); } +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncDoubleMetricDbClientConnectionsPendingRequestsDeprecated(metrics::Meter *meter) { @@ -636,6 +664,7 @@ CreateSyncDoubleMetricDbClientConnectionsPendingRequestsDeprecated(metrics::Mete unitMetricDbClientConnectionsPendingRequestsDeprecated); } +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncInt64MetricDbClientConnectionsPendingRequestsDeprecated(metrics::Meter *meter) { @@ -645,6 +674,7 @@ CreateAsyncInt64MetricDbClientConnectionsPendingRequestsDeprecated(metrics::Mete unitMetricDbClientConnectionsPendingRequestsDeprecated); } +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncDoubleMetricDbClientConnectionsPendingRequestsDeprecated(metrics::Meter *meter) { @@ -665,10 +695,13 @@ CreateAsyncDoubleMetricDbClientConnectionsPendingRequestsDeprecated(metrics::Met OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricDbClientConnectionsTimeoutsDeprecated = "metric.db.client.connections.timeouts.deprecated"; +OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricDbClientConnectionsTimeoutsDeprecated = "Deprecated, use `db.client.connection.timeouts` instead."; +OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricDbClientConnectionsTimeoutsDeprecated = "{timeout}"; +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncInt64MetricDbClientConnectionsTimeoutsDeprecated(metrics::Meter *meter) { @@ -677,6 +710,7 @@ CreateSyncInt64MetricDbClientConnectionsTimeoutsDeprecated(metrics::Meter *meter unitMetricDbClientConnectionsTimeoutsDeprecated); } +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncDoubleMetricDbClientConnectionsTimeoutsDeprecated(metrics::Meter *meter) { @@ -685,6 +719,7 @@ CreateSyncDoubleMetricDbClientConnectionsTimeoutsDeprecated(metrics::Meter *mete unitMetricDbClientConnectionsTimeoutsDeprecated); } +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncInt64MetricDbClientConnectionsTimeoutsDeprecated(metrics::Meter *meter) { @@ -693,6 +728,7 @@ CreateAsyncInt64MetricDbClientConnectionsTimeoutsDeprecated(metrics::Meter *mete unitMetricDbClientConnectionsTimeoutsDeprecated); } +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncDoubleMetricDbClientConnectionsTimeoutsDeprecated(metrics::Meter *meter) { @@ -712,10 +748,13 @@ CreateAsyncDoubleMetricDbClientConnectionsTimeoutsDeprecated(metrics::Meter *met OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricDbClientConnectionsCountDeprecated = "metric.db.client.connections.count.deprecated"; +OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricDbClientConnectionsCountDeprecated = "Deprecated, use `db.client.connection.count` instead."; +OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricDbClientConnectionsCountDeprecated = "{connection}"; +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncInt64MetricDbClientConnectionsCountDeprecated(metrics::Meter *meter) { @@ -724,6 +763,7 @@ CreateSyncInt64MetricDbClientConnectionsCountDeprecated(metrics::Meter *meter) unitMetricDbClientConnectionsCountDeprecated); } +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncDoubleMetricDbClientConnectionsCountDeprecated(metrics::Meter *meter) { @@ -732,6 +772,7 @@ CreateSyncDoubleMetricDbClientConnectionsCountDeprecated(metrics::Meter *meter) unitMetricDbClientConnectionsCountDeprecated); } +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncInt64MetricDbClientConnectionsCountDeprecated(metrics::Meter *meter) { @@ -740,6 +781,7 @@ CreateAsyncInt64MetricDbClientConnectionsCountDeprecated(metrics::Meter *meter) unitMetricDbClientConnectionsCountDeprecated); } +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncDoubleMetricDbClientConnectionsCountDeprecated(metrics::Meter *meter) { @@ -758,11 +800,14 @@ CreateAsyncDoubleMetricDbClientConnectionsCountDeprecated(metrics::Meter *meter) OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricDbClientConnectionsUseTimeDeprecated = "metric.db.client.connections.use_time.deprecated"; +OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricDbClientConnectionsUseTimeDeprecated = "Deprecated, use `db.client.connection.use_time` instead. Note: the unit also changed from " "`ms` to `s`."; +OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricDbClientConnectionsUseTimeDeprecated = "ms"; +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncInt64MetricDbClientConnectionsUseTimeDeprecated(metrics::Meter *meter) { @@ -771,6 +816,7 @@ CreateSyncInt64MetricDbClientConnectionsUseTimeDeprecated(metrics::Meter *meter) unitMetricDbClientConnectionsUseTimeDeprecated); } +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncDoubleMetricDbClientConnectionsUseTimeDeprecated(metrics::Meter *meter) { @@ -781,6 +827,7 @@ CreateSyncDoubleMetricDbClientConnectionsUseTimeDeprecated(metrics::Meter *meter #ifdef OPENTELEMETRY_LATER // Unsupported: Async histogram +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncInt64MetricDbClientConnectionsUseTimeDeprecated(metrics::Meter *meter) { @@ -789,6 +836,7 @@ CreateAsyncInt64MetricDbClientConnectionsUseTimeDeprecated(metrics::Meter *meter unitMetricDbClientConnectionsUseTimeDeprecated); } +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncDoubleMetricDbClientConnectionsUseTimeDeprecated(metrics::Meter *meter) { @@ -808,11 +856,14 @@ CreateAsyncDoubleMetricDbClientConnectionsUseTimeDeprecated(metrics::Meter *mete OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricDbClientConnectionsWaitTimeDeprecated = "metric.db.client.connections.wait_time.deprecated"; +OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricDbClientConnectionsWaitTimeDeprecated = "Deprecated, use `db.client.connection.wait_time` instead. Note: the unit also changed from " "`ms` to `s`."; +OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricDbClientConnectionsWaitTimeDeprecated = "ms"; +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncInt64MetricDbClientConnectionsWaitTimeDeprecated(metrics::Meter *meter) { @@ -821,6 +872,7 @@ CreateSyncInt64MetricDbClientConnectionsWaitTimeDeprecated(metrics::Meter *meter unitMetricDbClientConnectionsWaitTimeDeprecated); } +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncDoubleMetricDbClientConnectionsWaitTimeDeprecated(metrics::Meter *meter) { @@ -831,6 +883,7 @@ CreateSyncDoubleMetricDbClientConnectionsWaitTimeDeprecated(metrics::Meter *mete #ifdef OPENTELEMETRY_LATER // Unsupported: Async histogram +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncInt64MetricDbClientConnectionsWaitTimeDeprecated(metrics::Meter *meter) { @@ -839,6 +892,7 @@ CreateAsyncInt64MetricDbClientConnectionsWaitTimeDeprecated(metrics::Meter *mete unitMetricDbClientConnectionsWaitTimeDeprecated); } +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncDoubleMetricDbClientConnectionsWaitTimeDeprecated(metrics::Meter *meter) { diff --git a/api/include/opentelemetry/semconv/incubating/messaging_metrics.h b/api/include/opentelemetry/semconv/incubating/messaging_metrics.h index 1d2e1228a5..ae80e2c88a 100644 --- a/api/include/opentelemetry/semconv/incubating/messaging_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/messaging_metrics.h @@ -215,10 +215,13 @@ CreateAsyncDoubleMetricMessagingProcessDuration(metrics::Meter *meter) */ OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricMessagingProcessMessages = "metric.messaging.process.messages"; +OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricMessagingProcessMessages = "Deprecated. Use `messaging.client.consumed.messages` instead."; +OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricMessagingProcessMessages = "{message}"; +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncInt64MetricMessagingProcessMessages(metrics::Meter *meter) { @@ -227,6 +230,7 @@ CreateSyncInt64MetricMessagingProcessMessages(metrics::Meter *meter) unitMetricMessagingProcessMessages); } +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncDoubleMetricMessagingProcessMessages(metrics::Meter *meter) { @@ -235,6 +239,7 @@ CreateSyncDoubleMetricMessagingProcessMessages(metrics::Meter *meter) unitMetricMessagingProcessMessages); } +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncInt64MetricMessagingProcessMessages(metrics::Meter *meter) { @@ -243,6 +248,7 @@ CreateAsyncInt64MetricMessagingProcessMessages(metrics::Meter *meter) unitMetricMessagingProcessMessages); } +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncDoubleMetricMessagingProcessMessages(metrics::Meter *meter) { @@ -261,10 +267,13 @@ CreateAsyncDoubleMetricMessagingProcessMessages(metrics::Meter *meter) */ OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricMessagingPublishDuration = "metric.messaging.publish.duration"; +OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricMessagingPublishDuration = "Deprecated. Use `messaging.client.operation.duration` instead."; +OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricMessagingPublishDuration = "s"; +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncInt64MetricMessagingPublishDuration(metrics::Meter *meter) { @@ -273,6 +282,7 @@ CreateSyncInt64MetricMessagingPublishDuration(metrics::Meter *meter) unitMetricMessagingPublishDuration); } +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncDoubleMetricMessagingPublishDuration(metrics::Meter *meter) { @@ -283,6 +293,7 @@ CreateSyncDoubleMetricMessagingPublishDuration(metrics::Meter *meter) #ifdef OPENTELEMETRY_LATER // Unsupported: Async histogram +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncInt64MetricMessagingPublishDuration(metrics::Meter *meter) { @@ -291,6 +302,7 @@ CreateAsyncInt64MetricMessagingPublishDuration(metrics::Meter *meter) unitMetricMessagingPublishDuration); } +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncDoubleMetricMessagingPublishDuration(metrics::Meter *meter) { @@ -310,10 +322,13 @@ CreateAsyncDoubleMetricMessagingPublishDuration(metrics::Meter *meter) */ OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricMessagingPublishMessages = "metric.messaging.publish.messages"; +OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricMessagingPublishMessages = "Deprecated. Use `messaging.client.produced.messages` instead."; +OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricMessagingPublishMessages = "{message}"; +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncInt64MetricMessagingPublishMessages(metrics::Meter *meter) { @@ -322,6 +337,7 @@ CreateSyncInt64MetricMessagingPublishMessages(metrics::Meter *meter) unitMetricMessagingPublishMessages); } +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncDoubleMetricMessagingPublishMessages(metrics::Meter *meter) { @@ -330,6 +346,7 @@ CreateSyncDoubleMetricMessagingPublishMessages(metrics::Meter *meter) unitMetricMessagingPublishMessages); } +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncInt64MetricMessagingPublishMessages(metrics::Meter *meter) { @@ -338,6 +355,7 @@ CreateAsyncInt64MetricMessagingPublishMessages(metrics::Meter *meter) unitMetricMessagingPublishMessages); } +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncDoubleMetricMessagingPublishMessages(metrics::Meter *meter) { @@ -356,10 +374,13 @@ CreateAsyncDoubleMetricMessagingPublishMessages(metrics::Meter *meter) */ OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricMessagingReceiveDuration = "metric.messaging.receive.duration"; +OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricMessagingReceiveDuration = "Deprecated. Use `messaging.client.operation.duration` instead."; +OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricMessagingReceiveDuration = "s"; +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncInt64MetricMessagingReceiveDuration(metrics::Meter *meter) { @@ -368,6 +389,7 @@ CreateSyncInt64MetricMessagingReceiveDuration(metrics::Meter *meter) unitMetricMessagingReceiveDuration); } +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncDoubleMetricMessagingReceiveDuration(metrics::Meter *meter) { @@ -378,6 +400,7 @@ CreateSyncDoubleMetricMessagingReceiveDuration(metrics::Meter *meter) #ifdef OPENTELEMETRY_LATER // Unsupported: Async histogram +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncInt64MetricMessagingReceiveDuration(metrics::Meter *meter) { @@ -386,6 +409,7 @@ CreateAsyncInt64MetricMessagingReceiveDuration(metrics::Meter *meter) unitMetricMessagingReceiveDuration); } +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncDoubleMetricMessagingReceiveDuration(metrics::Meter *meter) { @@ -405,10 +429,13 @@ CreateAsyncDoubleMetricMessagingReceiveDuration(metrics::Meter *meter) */ OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricMessagingReceiveMessages = "metric.messaging.receive.messages"; +OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricMessagingReceiveMessages = "Deprecated. Use `messaging.client.consumed.messages` instead."; +OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricMessagingReceiveMessages = "{message}"; +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncInt64MetricMessagingReceiveMessages(metrics::Meter *meter) { @@ -417,6 +444,7 @@ CreateSyncInt64MetricMessagingReceiveMessages(metrics::Meter *meter) unitMetricMessagingReceiveMessages); } +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncDoubleMetricMessagingReceiveMessages(metrics::Meter *meter) { @@ -425,6 +453,7 @@ CreateSyncDoubleMetricMessagingReceiveMessages(metrics::Meter *meter) unitMetricMessagingReceiveMessages); } +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncInt64MetricMessagingReceiveMessages(metrics::Meter *meter) { @@ -433,6 +462,7 @@ CreateAsyncInt64MetricMessagingReceiveMessages(metrics::Meter *meter) unitMetricMessagingReceiveMessages); } +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncDoubleMetricMessagingReceiveMessages(metrics::Meter *meter) { diff --git a/buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 b/buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 index 79afd67191..61b321bf0f 100644 --- a/buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 +++ b/buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 @@ -33,7 +33,7 @@ - Some instruments are not supported in the SDK. For these, we still generate the code, protected with OPENTELEMETRY_LATER (which should be undefined). - - Using #ifdef OPENTELEMETRY_LATER is prefered to #if 0, + - Using #ifdef OPENTELEMETRY_LATER is preferred to #if 0, so that clang format generates clean code. #} {# ========================================================================== #} @@ -147,13 +147,22 @@ OPENTELEMETRY_DEPRECATED {{ [metric.brief, "\n", metric.note, "\n", metric.instrument] | comment(ident=2) }} {% endif %} static constexpr const char *{{v_metric_name}} = "{{metric.id}}"; + {% if metric is deprecated %} +OPENTELEMETRY_DEPRECATED + {% endif %} static constexpr const char *{{descr}} = "{{metric.brief}}"; + {% if metric is deprecated %} +OPENTELEMETRY_DEPRECATED + {% endif %} static constexpr const char *{{unit}} = "{{metric.unit}}"; {% if sync_support is false %} #ifdef OPENTELEMETRY_LATER // Unsupported: Sync {{ metric.instrument }} {% endif %} + {% if metric is deprecated %} +OPENTELEMETRY_DEPRECATED + {% endif %} static inline nostd::unique_ptr<{{sync_int64_type-}}> CreateSyncInt64{{f_metric_name-}}(metrics::Meter *meter) { @@ -163,6 +172,9 @@ CreateSyncInt64{{f_metric_name-}}(metrics::Meter *meter) {{unit}}); } + {% if metric is deprecated %} +OPENTELEMETRY_DEPRECATED + {% endif %} static inline nostd::unique_ptr<{{sync_double_type-}}> CreateSyncDouble{{f_metric_name-}}(metrics::Meter *meter) { @@ -179,6 +191,9 @@ CreateSyncDouble{{f_metric_name-}}(metrics::Meter *meter) #ifdef OPENTELEMETRY_LATER // Unsupported: Async {{ metric.instrument }} {% endif %} + {% if metric is deprecated %} +OPENTELEMETRY_DEPRECATED + {% endif %} static inline nostd::shared_ptr<{{async_type-}}> CreateAsyncInt64{{f_metric_name-}}(metrics::Meter *meter) { @@ -188,6 +203,9 @@ CreateAsyncInt64{{f_metric_name-}}(metrics::Meter *meter) {{unit}}); } + {% if metric is deprecated %} +OPENTELEMETRY_DEPRECATED + {% endif %} static inline nostd::shared_ptr<{{async_type-}}> CreateAsyncDouble{{f_metric_name-}}(metrics::Meter *meter) { diff --git a/examples/common/metrics_foo_library/foo_library.cc b/examples/common/metrics_foo_library/foo_library.cc index d464e585b0..6ab9832725 100644 --- a/examples/common/metrics_foo_library/foo_library.cc +++ b/examples/common/metrics_foo_library/foo_library.cc @@ -21,7 +21,7 @@ #include "opentelemetry/nostd/shared_ptr.h" #include "opentelemetry/nostd/variant.h" #include "opentelemetry/semconv/http_metrics.h" -#include "opentelemetry/semconv/incubating/messaging_metrics.h" +#include "opentelemetry/semconv/incubating/container_metrics.h" #include "opentelemetry/semconv/incubating/system_metrics.h" namespace metrics_api = opentelemetry::metrics; @@ -135,7 +135,7 @@ void foo_library::semconv_counter_example() auto provider = metrics_api::Provider::GetMeterProvider(); opentelemetry::nostd::shared_ptr meter = provider->GetMeter("demo", "1.2.0"); auto double_counter = - opentelemetry::semconv::messaging::CreateSyncDoubleMetricMessagingClientConsumedMessages( + opentelemetry::semconv::container::CreateSyncDoubleMetricContainerDiskIo( meter.get()); for (uint32_t i = 0; i < 20; ++i) From 0d56601713fcdc8ea7efe420d159a7967e5972b0 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Wed, 30 Oct 2024 23:23:11 +0100 Subject: [PATCH 09/16] cleanup --- .../trace/semantic_conventions.h | 3 - .../templates/SemanticAttributes.h.j2 | 123 ------------------ .../templates/registry/common.j2 | 17 --- .../common/metrics_foo_library/foo_library.cc | 3 +- .../sdk/resource/semantic_conventions.h | 3 - 5 files changed, 1 insertion(+), 148 deletions(-) delete mode 100644 buildscripts/semantic-convention/templates/SemanticAttributes.h.j2 diff --git a/api/include/opentelemetry/trace/semantic_conventions.h b/api/include/opentelemetry/trace/semantic_conventions.h index f99075380f..fb26385fbc 100644 --- a/api/include/opentelemetry/trace/semantic_conventions.h +++ b/api/include/opentelemetry/trace/semantic_conventions.h @@ -3,9 +3,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -// FIXME, DEBUG -#error "Die" - /* DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.h.j2 diff --git a/buildscripts/semantic-convention/templates/SemanticAttributes.h.j2 b/buildscripts/semantic-convention/templates/SemanticAttributes.h.j2 deleted file mode 100644 index 0ed9ce8dab..0000000000 --- a/buildscripts/semantic-convention/templates/SemanticAttributes.h.j2 +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright The OpenTelemetry Authors - * SPDX-License-Identifier: Apache-2.0 - */ -{# - Adapted from: - https://github.com/open-telemetry/semantic-conventions-java/blob/main/buildscripts/templates/SemanticAttributes.java.j2 - for opentelemetry-cpp - - For doc on the template syntax: - https://jinja.palletsprojects.com/en/3.0.x/ - - For doc on the semantic convention: - https://github.com/open-telemetry/build-tools/tree/main/semantic-conventions -#} -{%- macro to_cpp_return_type(type) -%} - {%- if type == "string" -%} - char * - {%- elif type == "string[]" -%} - char *[] - {%- elif type == "boolean" -%} - bool - {%- elif type == "int" -%} - int - {%- elif type == "double" -%} - double - {%- else -%} - {{type}} - {%- endif -%} -{%- endmacro %} -{%- macro print_value(type, value) -%} - {{ "\"" if type == "char *"}}{{value}}{{ "\"" if type == "char *"}} -{%- endmacro %} -{%- macro upFirst(text) -%} - {{ text[0]|upper}}{{text[1:] }} -{%- endmacro %} -{%- macro lowerFirst(text) -%} - {{ text[0]|lower}}{{text[1:] }} -{%- endmacro %} - -/* - DO NOT EDIT, this is an Auto-generated file - from buildscripts/semantic-convention{{template}} -*/ - -#pragma once - -#include "opentelemetry/common/macros.h" -#include "opentelemetry/version.h" - -OPENTELEMETRY_BEGIN_NAMESPACE -{{namespace_open}} - -namespace {{class}} -{ -/** - * The URL of the OpenTelemetry schema for these keys and values. - */ -static constexpr const char *kSchemaUrl = "{{schemaUrl}}"; - {%- for attribute in attributes if attribute.is_local and not attribute.ref %} -{# - MAINTAINER: - semconv "messaging.client_id" is deprecated - semconv "messaging.client.id" is to be used instead - - Now, because we use k{{attribute.fqn | to_camelcase(True)}}, - both names collide on C++ symbol kMessagingClientId. - - Do not generate code for semconv "messaging.client_id" -#} -{%- if (attribute.fqn != "messaging.client_id") %} -/** - * {{attribute.brief | render_markdown(code="{{@code {0}}}", paragraph="{0}")}} - {%- if attribute.note %} - * - *

Notes: -

    {{attribute.note | render_markdown(code="{{@code {0}}}", paragraph="
  • {0}
  • ", list="{0}")}}
- {%- endif %} -{%- if (attribute.deprecated) %} - * - * @deprecated {{attribute.brief | to_doc_brief}}. - {%- endif %} - */ - {%- if (attribute.deprecated) %} -OPENTELEMETRY_DEPRECATED - {%- endif %} -static constexpr const char *k{{attribute.fqn | to_camelcase(True)}} = "{{attribute.fqn}}"; -{%- endif %} -{%- endfor %} - -// Enum definitions -{%- for attribute in attributes if attribute.is_local and not attribute.ref %} -{%- if attribute.is_enum %} -{%- set enum_name = attribute.fqn | to_camelcase(True) ~ "Values" %} -{%- set type = to_cpp_return_type(attribute.attr_type.enum_type) %} -namespace {{enum_name}} -{ - {%- for member in attribute.attr_type.members %} - /** {% filter escape %}{{member.brief | to_doc_brief}}.{% endfilter %} */ - static constexpr const {{ type }} k{{ member.member_id | to_camelcase(True) }} = {{ print_value(type, member.value) }}; - {%- endfor %} -} -{% endif %} -{%- endfor %} - -{# - {%- if class == "SemanticAttributes" %} - // Manually defined and not YET in the YAML - /** - * The name of an event describing an exception. - * - *

Typically an event with that name should not be manually created. Instead {@link - * io.opentelemetry.api.trace.Span#recordException(Throwable)} should be used. - */ - static constexpr const char *EXCEPTION_EVENT_NAME = "exception"; - - {% endif %} -#} - -} // namespace {{class}} -{{namespace_close}} -OPENTELEMETRY_END_NAMESPACE - diff --git a/buildscripts/semantic-convention/templates/registry/common.j2 b/buildscripts/semantic-convention/templates/registry/common.j2 index 1b7eb47e08..7ba4aa5266 100644 --- a/buildscripts/semantic-convention/templates/registry/common.j2 +++ b/buildscripts/semantic-convention/templates/registry/common.j2 @@ -35,20 +35,3 @@ {% endmacro -%} -{%- macro str_or_empty(str) -%} -{% if str is none %}{{""}}{% else %}{{str}}{% endif %} -{%- endmacro %} - -{%- macro remove_trailing_dots(str) -%} -{%- if str[-1:] == '.' -%}{{ remove_trailing_dots(str[:-1]) }}{%- else -%}{{ str }}{%- endif -%} -{%- endmacro -%} - -{%- macro comment_with_prefix(str, prefix) -%} -{{remove_trailing_dots(str | trim(' \n')) | comment_with_prefix(prefix) | replace("\\", "\\\\")}} -{%- endmacro %} - -{%- macro import_deprecated(semconv) -%} - {%- if (semconv | select("deprecated") | list | count > 0) or (ctx.filter == "any" and semconv | select("stable") | list | count > 0) -%} -from deprecated import deprecated - {%- endif -%} -{%- endmacro-%} diff --git a/examples/common/metrics_foo_library/foo_library.cc b/examples/common/metrics_foo_library/foo_library.cc index 6ab9832725..1bd16d8a36 100644 --- a/examples/common/metrics_foo_library/foo_library.cc +++ b/examples/common/metrics_foo_library/foo_library.cc @@ -135,8 +135,7 @@ void foo_library::semconv_counter_example() auto provider = metrics_api::Provider::GetMeterProvider(); opentelemetry::nostd::shared_ptr meter = provider->GetMeter("demo", "1.2.0"); auto double_counter = - opentelemetry::semconv::container::CreateSyncDoubleMetricContainerDiskIo( - meter.get()); + opentelemetry::semconv::container::CreateSyncDoubleMetricContainerDiskIo(meter.get()); for (uint32_t i = 0; i < 20; ++i) { diff --git a/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h b/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h index 020d9e78f4..9ff985be4d 100644 --- a/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h +++ b/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h @@ -3,9 +3,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -// FIXME, DEBUG -#error "Die" - /* DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.h.j2 From 8472ddb89b001ddf191fe2befe5d4835f5975cb6 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Thu, 31 Oct 2024 00:05:15 +0100 Subject: [PATCH 10/16] cleanup --- examples/common/metrics_foo_library/foo_library.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/common/metrics_foo_library/foo_library.cc b/examples/common/metrics_foo_library/foo_library.cc index 1bd16d8a36..81cb840718 100644 --- a/examples/common/metrics_foo_library/foo_library.cc +++ b/examples/common/metrics_foo_library/foo_library.cc @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -168,9 +169,10 @@ void foo_library::semconv_histogram_example() for (uint32_t i = 0; i < 20; ++i) { double val = (rand() % 700) + 1.1; + uint64_t int_val = std::llround(val); std::map labels = get_random_attr(); auto labelkv = opentelemetry::common::KeyValueIterableView{labels}; - histogram_counter->Record(val, labelkv, context); + histogram_counter->Record(int_val, labelkv, context); std::this_thread::sleep_for(std::chrono::milliseconds(250)); } } From 0653c7a70194e6d5c1ec1753846443e7767f9bcf Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Thu, 31 Oct 2024 23:54:24 +0100 Subject: [PATCH 11/16] code cleanup --- .../templates/registry/common.j2 | 37 ------------------- .../templates/registry/schema_url-h.j2 | 1 - .../registry/semantic_attributes-h.j2 | 13 ++++--- .../templates/registry/semantic_metrics-h.j2 | 1 - .../templates/registry/weaver.yaml | 11 ++++++ 5 files changed, 18 insertions(+), 45 deletions(-) delete mode 100644 buildscripts/semantic-convention/templates/registry/common.j2 diff --git a/buildscripts/semantic-convention/templates/registry/common.j2 b/buildscripts/semantic-convention/templates/registry/common.j2 deleted file mode 100644 index 7ba4aa5266..0000000000 --- a/buildscripts/semantic-convention/templates/registry/common.j2 +++ /dev/null @@ -1,37 +0,0 @@ -{# - Copyright The OpenTelemetry Authors - SPDX-License-Identifier: Apache-2.0 - - This file is: - - a Jinja template, - - used to generate semantic conventions, - - using weaver. - - For doc on the template syntax: - https://jinja.palletsprojects.com/en/3.0.x/ - - For doc on the semantic conventions: - https://github.com/open-telemetry/semantic-conventions - - For doc on weaver: - https://github.com/open-telemetry/weaver -#} - - -{%- macro file_header() -%} -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -{% endmacro -%} - diff --git a/buildscripts/semantic-convention/templates/registry/schema_url-h.j2 b/buildscripts/semantic-convention/templates/registry/schema_url-h.j2 index b53f0f02be..3b80927ed2 100644 --- a/buildscripts/semantic-convention/templates/registry/schema_url-h.j2 +++ b/buildscripts/semantic-convention/templates/registry/schema_url-h.j2 @@ -28,7 +28,6 @@ {# ========================================================================== #} {{ template.set_file_name("schema_url.h") }} -{% import 'common.j2' as c %} {# ========================================================================== #} diff --git a/buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 b/buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 index 206623d87f..5e5b4eac7d 100644 --- a/buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 +++ b/buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 @@ -26,12 +26,17 @@ * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 */ {# ========================================================================== #} +{# + DESIGN NOTES: + - Use the debug flag to dump the semantic convention data + in the generated output, to inspect it. +#} +{# ========================================================================== #} {% set debug = false %} {% set file_name = ctx.output + (ctx.root_namespace | snake_case) ~ "_attributes.h" %} {{ template.set_file_name(file_name) }} -{% import 'common.j2' as c %} {% set attributes = ctx.attributes | list %} {% set enum_attributes = attributes | select("enum") | rejectattr("name", "in", ctx.excluded_attributes) | list %} @@ -45,7 +50,7 @@ k{{ attribute.name | pascal_case }} {% endmacro %} {% macro attribute_type(attribute) %} -{{ attribute.type | enum_type | map_text("cpp_types", "FIXME") }} +{{ attribute.type | enum_type | map_text("cpp_types") }} {% endmacro %} {% macro enum_namespace_name(attribute) %} @@ -56,10 +61,6 @@ k{{ attribute.name | pascal_case }} k{{ member.id | pascal_case }} {% endmacro %} -{% macro stable_class_ref(const_name, separator) %} -{{ctx.stable_package_name}}.{{ctx.root_namespace}}_attributes{{separator}}{{const_name}} -{% endmacro %} - {% set cpp_attribute_namespace = attribute_namespace(ctx) %} {# ========================================================================== #} diff --git a/buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 b/buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 index 61b321bf0f..9e66c3f0d8 100644 --- a/buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 +++ b/buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 @@ -42,7 +42,6 @@ {% set file_name = ctx.output + (ctx.root_namespace | snake_case) ~ "_metrics.h" %} {{ template.set_file_name(file_name) }} -{% import 'common.j2' as c %} {% set metrics = ctx.metrics | list %} diff --git a/buildscripts/semantic-convention/templates/registry/weaver.yaml b/buildscripts/semantic-convention/templates/registry/weaver.yaml index beb2e21abe..12d047e77e 100644 --- a/buildscripts/semantic-convention/templates/registry/weaver.yaml +++ b/buildscripts/semantic-convention/templates/registry/weaver.yaml @@ -1,6 +1,17 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +# This file is the main file for weaver, +# used to generate semantic conventions, +# for opentelemetry-cpp. +# +# For doc on weaver: +# https://github.com/open-telemetry/weaver +# +# For doc on the semantic conventions: +# https://github.com/open-telemetry/semantic-conventions +# + params: # excluded namespaces will not be generated excluded_namespaces: [ios, aspnetcore, signalr, android, dotnet, jvm, kestrel, v8js, veightjs, go, nodejs] From a47ff208c220405ff91cd913b9f894888b3278d8 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Sat, 9 Nov 2024 18:34:27 +0100 Subject: [PATCH 12/16] Deprecation, changelog. --- CHANGELOG.md | 15 +++++++-- DEPRECATED.md | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d8ca3317f..88535ee032 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,12 @@ Increment the: * [API] Jaeger Propagator should not be deprecated [#3086](https://github.com/open-telemetry/opentelemetry-cpp/pull/3086) +* Upgrade to prometheus 1.3.0 + [#3122](https://github.com/open-telemetry/opentelemetry-cpp/pull/3122) + +* [SEMANTIC CONVENTIONS] Migration to weaver + [#3105](https://github.com/open-telemetry/opentelemetry-cpp/pull/3105) + Important changes: * [API] Jaeger Propagator should not be deprecated @@ -32,8 +38,13 @@ Important changes: as the Jaeger propagator can be used without the (now removed) Jaeger exporter. -* Upgrade to prometheus 1.3.0 - [#3122](https://github.com/open-telemetry/opentelemetry-cpp/pull/3122) +* [SEMANTIC CONVENTIONS] Migration to weaver + [#3105](https://github.com/open-telemetry/opentelemetry-cpp/pull/3105) + + * `semantic_convention.h` header files are deprecated, + replaced by `semconv/xxx_attributes.h` header files, + for each `xxx` semantic attribute group. + * See file DEPRECATED.md for details. * [EXPORTER] Change log resources location for ElasticsearchLogRecordExporter [#3119](https://github.com/open-telemetry/opentelemetry-cpp/pull/3131) diff --git a/DEPRECATED.md b/DEPRECATED.md index eea861ffe6..0f5cbcdc3e 100644 --- a/DEPRECATED.md +++ b/DEPRECATED.md @@ -59,3 +59,87 @@ N/A ## [Documentation] N/A + +## Semantic conventions + +### Header files "semantic_conventions.h" + +#### Announcement (semantic_conventions.h) + +Deprecation is announced as part of the migration to weaver: + +* `Version:` release following opentelemetry-cpp 1.17.0 +* `Date:` Nov 9, 2024 +* `PR:` https://github.com/open-telemetry/opentelemetry-cpp/pull/3105 + +#### Motivation (semantic_conventions.h) + +The header files for semantic conventions are generated automatically. +The tooling to generate these files is changing: + +* before, the build-tool repository was used +* now, the weaver repository is used + +Changes in tooling allows to generate code that is better organized, +with dedicated header files per group of semantic conventions, +instead of a single header file for everything. + +#### Scope (semantic_conventions.h) + +The following files: + +* `api/include/opentelemetry/trace/semantic_conventions.h` +* `sdk/include/opentelemetry/sdk/resource/semantic_conventions.h` + +are now deprecated. + +They correspond to semantic conventions v1.27.0, +and will no longer be maintained up to date. + +These files will be removed in the future. + +#### Mitigation (semantic_conventions.h) + +Two things have changed: + +* the header file to use +* the symbol name to use. + +Before, the semantic convention for `url.full` was: + +* declared in file `semantic_conventions.h` +* declared as symbol `SemanticConventions::kUrlFull` + +Now, the `url.full` convention, which is part or the `url` group, is: + +* declared in file `semconv/url_attributes.h` +* declared as symbol `semconv::url::kUrlFull` + +Application code that uses semantic conventions must be adjusted +accordingly. + +In addition, semantic conventions that are not marked as stable +are generated in a different header file, placed under directory +`incubating`, to better separate stable and non stable code. + +For example, file `semconv/incubating/url_attributes.h` +defines `semconv::url::kUrlDomain`, +which is not marked as stable in semconv v1.27.0 + +#### Planned removal (semantic_conventions.h) + +The following files: + +* `api/include/opentelemetry/trace/semantic_conventions.h` +* `sdk/include/opentelemetry/sdk/resource/semantic_conventions.h` + +will be eventually removed. + +No date is given now, this can happen at the earliest for release 1.19.0: + +* opentelemetry-cpp v1.17.0 only contain old header files +* opentelemetry-cpp v1.18.0 will contain both old and new header files +* opentelemetry-cpp v1.19.0 may only contain new header files (removing old) + +This allows a full release cycle for applications to adjust. + From 2237416ebfa3a50949cbb8d32f4da906ca45f387 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Sat, 9 Nov 2024 18:42:23 +0100 Subject: [PATCH 13/16] Markdown cleanup --- CHANGELOG.md | 14 +++++++------- DEPRECATED.md | 3 +-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88535ee032..3e3521797d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,8 +15,8 @@ Increment the: ## [Unreleased] -* [API] Comply with W3C Trace Context [#3115](https://github.com/open-telemetry/opentelemetry-cpp/pull/3115) - * Also adds CI check to ensure continued compliance +* [API] Comply with W3C Trace Context + [#3115](https://github.com/open-telemetry/opentelemetry-cpp/pull/3115) * [API] Jaeger Propagator should not be deprecated [#3086](https://github.com/open-telemetry/opentelemetry-cpp/pull/3086) @@ -38,6 +38,11 @@ Important changes: as the Jaeger propagator can be used without the (now removed) Jaeger exporter. +* [EXPORTER] Change log resources location for ElasticsearchLogRecordExporter + [#3119](https://github.com/open-telemetry/opentelemetry-cpp/pull/3131) + + * Moved from `root/resources` to `root` + * [SEMANTIC CONVENTIONS] Migration to weaver [#3105](https://github.com/open-telemetry/opentelemetry-cpp/pull/3105) @@ -46,11 +51,6 @@ Important changes: for each `xxx` semantic attribute group. * See file DEPRECATED.md for details. -* [EXPORTER] Change log resources location for ElasticsearchLogRecordExporter - [#3119](https://github.com/open-telemetry/opentelemetry-cpp/pull/3131) - - * Moved from `root/resources` to `root` - ## [1.17 2024-10-07] * [CI] Add a clang-tidy build diff --git a/DEPRECATED.md b/DEPRECATED.md index 0f5cbcdc3e..2b2f138525 100644 --- a/DEPRECATED.md +++ b/DEPRECATED.md @@ -70,7 +70,7 @@ Deprecation is announced as part of the migration to weaver: * `Version:` release following opentelemetry-cpp 1.17.0 * `Date:` Nov 9, 2024 -* `PR:` https://github.com/open-telemetry/opentelemetry-cpp/pull/3105 +* `PR:` [PR 3105](https://github.com/open-telemetry/opentelemetry-cpp/pull/3105) #### Motivation (semantic_conventions.h) @@ -142,4 +142,3 @@ No date is given now, this can happen at the earliest for release 1.19.0: * opentelemetry-cpp v1.19.0 may only contain new header files (removing old) This allows a full release cycle for applications to adjust. - From 3a42cd47dd9a6dd6dc671f9e33f3a01324f14b2d Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Tue, 12 Nov 2024 21:34:29 +0100 Subject: [PATCH 14/16] Set deprecation date. --- DEPRECATED.md | 11 +++-------- .../opentelemetry/trace/semantic_conventions.h | 10 +++++++--- .../opentelemetry/sdk/resource/semantic_conventions.h | 10 +++++++--- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/DEPRECATED.md b/DEPRECATED.md index 2b2f138525..ec97f420fe 100644 --- a/DEPRECATED.md +++ b/DEPRECATED.md @@ -133,12 +133,7 @@ The following files: * `api/include/opentelemetry/trace/semantic_conventions.h` * `sdk/include/opentelemetry/sdk/resource/semantic_conventions.h` -will be eventually removed. +will be removed. -No date is given now, this can happen at the earliest for release 1.19.0: - -* opentelemetry-cpp v1.17.0 only contain old header files -* opentelemetry-cpp v1.18.0 will contain both old and new header files -* opentelemetry-cpp v1.19.0 may only contain new header files (removing old) - -This allows a full release cycle for applications to adjust. +The removal date is planned for July 1, 2025. +This allows more than six months for applications to adjust. diff --git a/api/include/opentelemetry/trace/semantic_conventions.h b/api/include/opentelemetry/trace/semantic_conventions.h index fb26385fbc..d6d6591149 100644 --- a/api/include/opentelemetry/trace/semantic_conventions.h +++ b/api/include/opentelemetry/trace/semantic_conventions.h @@ -4,9 +4,13 @@ */ /* - DO NOT EDIT, this is an Auto-generated file - from buildscripts/semantic-convention/templates/SemanticAttributes.h.j2 -*/ + * This file is DEPRECATED, and no longer updated. + * See file DEPRECATED.md for details. + */ + +#ifdef OPENTELEMETRY_NO_DEPRECATED_CODE +# error "header is deprecated." +#endif #pragma once diff --git a/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h b/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h index 9ff985be4d..1c11ba68f9 100644 --- a/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h +++ b/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h @@ -4,9 +4,13 @@ */ /* - DO NOT EDIT, this is an Auto-generated file - from buildscripts/semantic-convention/templates/SemanticAttributes.h.j2 -*/ + * This file is DEPRECATED, and no longer updated. + * See file DEPRECATED.md for details. + */ + +#ifdef OPENTELEMETRY_NO_DEPRECATED_CODE +# error "header is deprecated." +#endif #pragma once From 1077265ec0ea10cf561a5a365d4ee37ee7187e05 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Tue, 12 Nov 2024 23:15:53 +0100 Subject: [PATCH 15/16] Implemented code review comments. --- .../opentelemetry/semconv/http_metrics.h | 38 ---- .../semconv/incubating/db_metrics.h | 139 ------------- .../semconv/incubating/dns_metrics.h | 17 -- .../semconv/incubating/faas_metrics.h | 85 -------- .../semconv/incubating/gen_ai_metrics.h | 95 --------- .../semconv/incubating/http_metrics.h | 133 ------------- .../semconv/incubating/messaging_metrics.h | 80 -------- .../semconv/incubating/process_metrics.h | 6 +- .../semconv/incubating/rpc_metrics.h | 182 ------------------ .../semconv/incubating/system_metrics.h | 30 +-- buildscripts/semantic-convention/generate.sh | 10 +- .../templates/registry/semantic_metrics-h.j2 | 59 +++--- .../templates/registry/weaver.yaml | 41 ++-- 13 files changed, 73 insertions(+), 842 deletions(-) diff --git a/api/include/opentelemetry/semconv/http_metrics.h b/api/include/opentelemetry/semconv/http_metrics.h index d41594ed15..f83172e80e 100644 --- a/api/include/opentelemetry/semconv/http_metrics.h +++ b/api/include/opentelemetry/semconv/http_metrics.h @@ -47,25 +47,6 @@ CreateSyncDoubleMetricHttpClientRequestDuration(metrics::Meter *meter) unitMetricHttpClientRequestDuration); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricHttpClientRequestDuration(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricHttpClientRequestDuration, - descrMetricHttpClientRequestDuration, - unitMetricHttpClientRequestDuration); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricHttpClientRequestDuration(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricHttpClientRequestDuration, - descrMetricHttpClientRequestDuration, - unitMetricHttpClientRequestDuration); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Duration of HTTP server requests. *

@@ -93,25 +74,6 @@ CreateSyncDoubleMetricHttpServerRequestDuration(metrics::Meter *meter) unitMetricHttpServerRequestDuration); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricHttpServerRequestDuration(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricHttpServerRequestDuration, - descrMetricHttpServerRequestDuration, - unitMetricHttpServerRequestDuration); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricHttpServerRequestDuration(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricHttpServerRequestDuration, - descrMetricHttpServerRequestDuration, - unitMetricHttpServerRequestDuration); -} -#endif /* OPENTELEMETRY_LATER */ - } // namespace http } // namespace semconv OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/db_metrics.h b/api/include/opentelemetry/semconv/incubating/db_metrics.h index 610306de72..6ea8e095c7 100644 --- a/api/include/opentelemetry/semconv/incubating/db_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/db_metrics.h @@ -88,25 +88,6 @@ CreateSyncDoubleMetricDbClientConnectionCreateTime(metrics::Meter *meter) unitMetricDbClientConnectionCreateTime); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricDbClientConnectionCreateTime(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricDbClientConnectionCreateTime, - descrMetricDbClientConnectionCreateTime, - unitMetricDbClientConnectionCreateTime); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricDbClientConnectionCreateTime(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricDbClientConnectionCreateTime, - descrMetricDbClientConnectionCreateTime, - unitMetricDbClientConnectionCreateTime); -} -#endif /* OPENTELEMETRY_LATER */ - /** * The maximum number of idle open connections allowed *

@@ -349,25 +330,6 @@ CreateSyncDoubleMetricDbClientConnectionUseTime(metrics::Meter *meter) unitMetricDbClientConnectionUseTime); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricDbClientConnectionUseTime(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricDbClientConnectionUseTime, - descrMetricDbClientConnectionUseTime, - unitMetricDbClientConnectionUseTime); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricDbClientConnectionUseTime(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricDbClientConnectionUseTime, - descrMetricDbClientConnectionUseTime, - unitMetricDbClientConnectionUseTime); -} -#endif /* OPENTELEMETRY_LATER */ - /** * The time it took to obtain an open connection from the pool *

@@ -395,25 +357,6 @@ CreateSyncDoubleMetricDbClientConnectionWaitTime(metrics::Meter *meter) unitMetricDbClientConnectionWaitTime); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricDbClientConnectionWaitTime(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricDbClientConnectionWaitTime, - descrMetricDbClientConnectionWaitTime, - unitMetricDbClientConnectionWaitTime); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricDbClientConnectionWaitTime(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricDbClientConnectionWaitTime, - descrMetricDbClientConnectionWaitTime, - unitMetricDbClientConnectionWaitTime); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Deprecated, use @code db.client.connection.create_time @endcode instead. Note: the unit also * changed from @code ms @endcode to @code s @endcode.

@@ -449,27 +392,6 @@ CreateSyncDoubleMetricDbClientConnectionsCreateTimeDeprecated(metrics::Meter *me unitMetricDbClientConnectionsCreateTimeDeprecated); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -OPENTELEMETRY_DEPRECATED -static inline nostd::shared_ptr -CreateAsyncInt64MetricDbClientConnectionsCreateTimeDeprecated(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricDbClientConnectionsCreateTimeDeprecated, - descrMetricDbClientConnectionsCreateTimeDeprecated, - unitMetricDbClientConnectionsCreateTimeDeprecated); -} - -OPENTELEMETRY_DEPRECATED -static inline nostd::shared_ptr -CreateAsyncDoubleMetricDbClientConnectionsCreateTimeDeprecated(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricDbClientConnectionsCreateTimeDeprecated, - descrMetricDbClientConnectionsCreateTimeDeprecated, - unitMetricDbClientConnectionsCreateTimeDeprecated); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Deprecated, use @code db.client.connection.idle.max @endcode instead. *

@@ -825,27 +747,6 @@ CreateSyncDoubleMetricDbClientConnectionsUseTimeDeprecated(metrics::Meter *meter unitMetricDbClientConnectionsUseTimeDeprecated); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -OPENTELEMETRY_DEPRECATED -static inline nostd::shared_ptr -CreateAsyncInt64MetricDbClientConnectionsUseTimeDeprecated(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricDbClientConnectionsUseTimeDeprecated, - descrMetricDbClientConnectionsUseTimeDeprecated, - unitMetricDbClientConnectionsUseTimeDeprecated); -} - -OPENTELEMETRY_DEPRECATED -static inline nostd::shared_ptr -CreateAsyncDoubleMetricDbClientConnectionsUseTimeDeprecated(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricDbClientConnectionsUseTimeDeprecated, - descrMetricDbClientConnectionsUseTimeDeprecated, - unitMetricDbClientConnectionsUseTimeDeprecated); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Deprecated, use @code db.client.connection.wait_time @endcode instead. Note: the unit also * changed from @code ms @endcode to @code s @endcode.

@@ -881,27 +782,6 @@ CreateSyncDoubleMetricDbClientConnectionsWaitTimeDeprecated(metrics::Meter *mete unitMetricDbClientConnectionsWaitTimeDeprecated); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -OPENTELEMETRY_DEPRECATED -static inline nostd::shared_ptr -CreateAsyncInt64MetricDbClientConnectionsWaitTimeDeprecated(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricDbClientConnectionsWaitTimeDeprecated, - descrMetricDbClientConnectionsWaitTimeDeprecated, - unitMetricDbClientConnectionsWaitTimeDeprecated); -} - -OPENTELEMETRY_DEPRECATED -static inline nostd::shared_ptr -CreateAsyncDoubleMetricDbClientConnectionsWaitTimeDeprecated(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricDbClientConnectionsWaitTimeDeprecated, - descrMetricDbClientConnectionsWaitTimeDeprecated, - unitMetricDbClientConnectionsWaitTimeDeprecated); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Duration of database client operations. *

@@ -931,25 +811,6 @@ CreateSyncDoubleMetricDbClientOperationDuration(metrics::Meter *meter) unitMetricDbClientOperationDuration); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricDbClientOperationDuration(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricDbClientOperationDuration, - descrMetricDbClientOperationDuration, - unitMetricDbClientOperationDuration); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricDbClientOperationDuration(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricDbClientOperationDuration, - descrMetricDbClientOperationDuration, - unitMetricDbClientOperationDuration); -} -#endif /* OPENTELEMETRY_LATER */ - } // namespace db } // namespace semconv OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/dns_metrics.h b/api/include/opentelemetry/semconv/incubating/dns_metrics.h index ccdb91de84..7f3915870b 100644 --- a/api/include/opentelemetry/semconv/incubating/dns_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/dns_metrics.h @@ -44,23 +44,6 @@ static inline nostd::unique_ptr> CreateSyncDoubleMetr unitMetricDnsLookupDuration); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricDnsLookupDuration(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram( - kMetricDnsLookupDuration, descrMetricDnsLookupDuration, unitMetricDnsLookupDuration); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricDnsLookupDuration(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram( - kMetricDnsLookupDuration, descrMetricDnsLookupDuration, unitMetricDnsLookupDuration); -} -#endif /* OPENTELEMETRY_LATER */ - } // namespace dns } // namespace semconv OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/faas_metrics.h b/api/include/opentelemetry/semconv/incubating/faas_metrics.h index 10d2196d93..73dc2989a6 100644 --- a/api/include/opentelemetry/semconv/incubating/faas_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/faas_metrics.h @@ -80,23 +80,6 @@ static inline nostd::unique_ptr> CreateSyncDoubleMetr unitMetricFaasCpuUsage); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr CreateAsyncInt64MetricFaasCpuUsage( - metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricFaasCpuUsage, descrMetricFaasCpuUsage, - unitMetricFaasCpuUsage); -} - -static inline nostd::shared_ptr CreateAsyncDoubleMetricFaasCpuUsage( - metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricFaasCpuUsage, descrMetricFaasCpuUsage, - unitMetricFaasCpuUsage); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Number of invocation errors *

@@ -156,23 +139,6 @@ static inline nostd::unique_ptr> CreateSyncDoubleMetr unitMetricFaasInitDuration); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricFaasInitDuration(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricFaasInitDuration, descrMetricFaasInitDuration, - unitMetricFaasInitDuration); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricFaasInitDuration(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram( - kMetricFaasInitDuration, descrMetricFaasInitDuration, unitMetricFaasInitDuration); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Number of successful invocations *

@@ -234,23 +200,6 @@ CreateSyncDoubleMetricFaasInvokeDuration(metrics::Meter *meter) unitMetricFaasInvokeDuration); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricFaasInvokeDuration(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram( - kMetricFaasInvokeDuration, descrMetricFaasInvokeDuration, unitMetricFaasInvokeDuration); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricFaasInvokeDuration(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram( - kMetricFaasInvokeDuration, descrMetricFaasInvokeDuration, unitMetricFaasInvokeDuration); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Distribution of max memory usage per invocation *

@@ -275,23 +224,6 @@ static inline nostd::unique_ptr> CreateSyncDoubleMetr unitMetricFaasMemUsage); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr CreateAsyncInt64MetricFaasMemUsage( - metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricFaasMemUsage, descrMetricFaasMemUsage, - unitMetricFaasMemUsage); -} - -static inline nostd::shared_ptr CreateAsyncDoubleMetricFaasMemUsage( - metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricFaasMemUsage, descrMetricFaasMemUsage, - unitMetricFaasMemUsage); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Distribution of net I/O usage per invocation *

@@ -313,23 +245,6 @@ static inline nostd::unique_ptr> CreateSyncDoubleMetr return meter->CreateDoubleHistogram(kMetricFaasNetIo, descrMetricFaasNetIo, unitMetricFaasNetIo); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr CreateAsyncInt64MetricFaasNetIo( - metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricFaasNetIo, descrMetricFaasNetIo, - unitMetricFaasNetIo); -} - -static inline nostd::shared_ptr CreateAsyncDoubleMetricFaasNetIo( - metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricFaasNetIo, descrMetricFaasNetIo, - unitMetricFaasNetIo); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Number of invocation timeouts *

diff --git a/api/include/opentelemetry/semconv/incubating/gen_ai_metrics.h b/api/include/opentelemetry/semconv/incubating/gen_ai_metrics.h index 04ba77aa18..6a9064c3e7 100644 --- a/api/include/opentelemetry/semconv/incubating/gen_ai_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/gen_ai_metrics.h @@ -46,25 +46,6 @@ CreateSyncDoubleMetricGenAiClientOperationDuration(metrics::Meter *meter) unitMetricGenAiClientOperationDuration); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricGenAiClientOperationDuration(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricGenAiClientOperationDuration, - descrMetricGenAiClientOperationDuration, - unitMetricGenAiClientOperationDuration); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricGenAiClientOperationDuration(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricGenAiClientOperationDuration, - descrMetricGenAiClientOperationDuration, - unitMetricGenAiClientOperationDuration); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Measures number of input and output tokens used *

@@ -91,25 +72,6 @@ CreateSyncDoubleMetricGenAiClientTokenUsage(metrics::Meter *meter) unitMetricGenAiClientTokenUsage); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricGenAiClientTokenUsage(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricGenAiClientTokenUsage, - descrMetricGenAiClientTokenUsage, - unitMetricGenAiClientTokenUsage); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricGenAiClientTokenUsage(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricGenAiClientTokenUsage, - descrMetricGenAiClientTokenUsage, - unitMetricGenAiClientTokenUsage); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Generative AI server request duration such as time-to-last byte or last output token *

@@ -137,25 +99,6 @@ CreateSyncDoubleMetricGenAiServerRequestDuration(metrics::Meter *meter) unitMetricGenAiServerRequestDuration); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricGenAiServerRequestDuration(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricGenAiServerRequestDuration, - descrMetricGenAiServerRequestDuration, - unitMetricGenAiServerRequestDuration); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricGenAiServerRequestDuration(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricGenAiServerRequestDuration, - descrMetricGenAiServerRequestDuration, - unitMetricGenAiServerRequestDuration); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Time per output token generated after the first token for successful responses *

@@ -183,25 +126,6 @@ CreateSyncDoubleMetricGenAiServerTimePerOutputToken(metrics::Meter *meter) unitMetricGenAiServerTimePerOutputToken); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricGenAiServerTimePerOutputToken(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricGenAiServerTimePerOutputToken, - descrMetricGenAiServerTimePerOutputToken, - unitMetricGenAiServerTimePerOutputToken); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricGenAiServerTimePerOutputToken(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricGenAiServerTimePerOutputToken, - descrMetricGenAiServerTimePerOutputToken, - unitMetricGenAiServerTimePerOutputToken); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Time to generate first token for successful responses *

@@ -229,25 +153,6 @@ CreateSyncDoubleMetricGenAiServerTimeToFirstToken(metrics::Meter *meter) unitMetricGenAiServerTimeToFirstToken); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricGenAiServerTimeToFirstToken(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricGenAiServerTimeToFirstToken, - descrMetricGenAiServerTimeToFirstToken, - unitMetricGenAiServerTimeToFirstToken); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricGenAiServerTimeToFirstToken(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricGenAiServerTimeToFirstToken, - descrMetricGenAiServerTimeToFirstToken, - unitMetricGenAiServerTimeToFirstToken); -} -#endif /* OPENTELEMETRY_LATER */ - } // namespace gen_ai } // namespace semconv OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/http_metrics.h b/api/include/opentelemetry/semconv/incubating/http_metrics.h index d3a084235e..9142b6c44f 100644 --- a/api/include/opentelemetry/semconv/incubating/http_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/http_metrics.h @@ -89,25 +89,6 @@ CreateSyncDoubleMetricHttpClientConnectionDuration(metrics::Meter *meter) unitMetricHttpClientConnectionDuration); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricHttpClientConnectionDuration(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricHttpClientConnectionDuration, - descrMetricHttpClientConnectionDuration, - unitMetricHttpClientConnectionDuration); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricHttpClientConnectionDuration(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricHttpClientConnectionDuration, - descrMetricHttpClientConnectionDuration, - unitMetricHttpClientConnectionDuration); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Number of outbound HTTP connections that are currently active or idle on the client. *

@@ -181,25 +162,6 @@ CreateSyncDoubleMetricHttpClientRequestBodySize(metrics::Meter *meter) unitMetricHttpClientRequestBodySize); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricHttpClientRequestBodySize(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricHttpClientRequestBodySize, - descrMetricHttpClientRequestBodySize, - unitMetricHttpClientRequestBodySize); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricHttpClientRequestBodySize(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricHttpClientRequestBodySize, - descrMetricHttpClientRequestBodySize, - unitMetricHttpClientRequestBodySize); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Duration of HTTP client requests. *

@@ -227,25 +189,6 @@ CreateSyncDoubleMetricHttpClientRequestDuration(metrics::Meter *meter) unitMetricHttpClientRequestDuration); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricHttpClientRequestDuration(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricHttpClientRequestDuration, - descrMetricHttpClientRequestDuration, - unitMetricHttpClientRequestDuration); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricHttpClientRequestDuration(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricHttpClientRequestDuration, - descrMetricHttpClientRequestDuration, - unitMetricHttpClientRequestDuration); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Size of HTTP client response bodies. *

@@ -276,25 +219,6 @@ CreateSyncDoubleMetricHttpClientResponseBodySize(metrics::Meter *meter) unitMetricHttpClientResponseBodySize); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricHttpClientResponseBodySize(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricHttpClientResponseBodySize, - descrMetricHttpClientResponseBodySize, - unitMetricHttpClientResponseBodySize); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricHttpClientResponseBodySize(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricHttpClientResponseBodySize, - descrMetricHttpClientResponseBodySize, - unitMetricHttpClientResponseBodySize); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Number of active HTTP server requests. *

@@ -367,25 +291,6 @@ CreateSyncDoubleMetricHttpServerRequestBodySize(metrics::Meter *meter) unitMetricHttpServerRequestBodySize); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricHttpServerRequestBodySize(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricHttpServerRequestBodySize, - descrMetricHttpServerRequestBodySize, - unitMetricHttpServerRequestBodySize); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricHttpServerRequestBodySize(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricHttpServerRequestBodySize, - descrMetricHttpServerRequestBodySize, - unitMetricHttpServerRequestBodySize); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Duration of HTTP server requests. *

@@ -413,25 +318,6 @@ CreateSyncDoubleMetricHttpServerRequestDuration(metrics::Meter *meter) unitMetricHttpServerRequestDuration); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricHttpServerRequestDuration(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricHttpServerRequestDuration, - descrMetricHttpServerRequestDuration, - unitMetricHttpServerRequestDuration); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricHttpServerRequestDuration(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricHttpServerRequestDuration, - descrMetricHttpServerRequestDuration, - unitMetricHttpServerRequestDuration); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Size of HTTP server response bodies. *

@@ -462,25 +348,6 @@ CreateSyncDoubleMetricHttpServerResponseBodySize(metrics::Meter *meter) unitMetricHttpServerResponseBodySize); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricHttpServerResponseBodySize(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricHttpServerResponseBodySize, - descrMetricHttpServerResponseBodySize, - unitMetricHttpServerResponseBodySize); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricHttpServerResponseBodySize(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricHttpServerResponseBodySize, - descrMetricHttpServerResponseBodySize, - unitMetricHttpServerResponseBodySize); -} -#endif /* OPENTELEMETRY_LATER */ - } // namespace http } // namespace semconv OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/messaging_metrics.h b/api/include/opentelemetry/semconv/incubating/messaging_metrics.h index ae80e2c88a..5da042da2d 100644 --- a/api/include/opentelemetry/semconv/incubating/messaging_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/messaging_metrics.h @@ -95,25 +95,6 @@ CreateSyncDoubleMetricMessagingClientOperationDuration(metrics::Meter *meter) unitMetricMessagingClientOperationDuration); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricMessagingClientOperationDuration(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricMessagingClientOperationDuration, - descrMetricMessagingClientOperationDuration, - unitMetricMessagingClientOperationDuration); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricMessagingClientOperationDuration(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricMessagingClientOperationDuration, - descrMetricMessagingClientOperationDuration, - unitMetricMessagingClientOperationDuration); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Number of messages producer attempted to publish to the broker. *

@@ -186,25 +167,6 @@ CreateSyncDoubleMetricMessagingProcessDuration(metrics::Meter *meter) unitMetricMessagingProcessDuration); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricMessagingProcessDuration(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricMessagingProcessDuration, - descrMetricMessagingProcessDuration, - unitMetricMessagingProcessDuration); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricMessagingProcessDuration(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricMessagingProcessDuration, - descrMetricMessagingProcessDuration, - unitMetricMessagingProcessDuration); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Deprecated. Use @code messaging.client.consumed.messages @endcode instead. *

@@ -291,27 +253,6 @@ CreateSyncDoubleMetricMessagingPublishDuration(metrics::Meter *meter) unitMetricMessagingPublishDuration); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -OPENTELEMETRY_DEPRECATED -static inline nostd::shared_ptr -CreateAsyncInt64MetricMessagingPublishDuration(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricMessagingPublishDuration, - descrMetricMessagingPublishDuration, - unitMetricMessagingPublishDuration); -} - -OPENTELEMETRY_DEPRECATED -static inline nostd::shared_ptr -CreateAsyncDoubleMetricMessagingPublishDuration(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricMessagingPublishDuration, - descrMetricMessagingPublishDuration, - unitMetricMessagingPublishDuration); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Deprecated. Use @code messaging.client.produced.messages @endcode instead. *

@@ -398,27 +339,6 @@ CreateSyncDoubleMetricMessagingReceiveDuration(metrics::Meter *meter) unitMetricMessagingReceiveDuration); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -OPENTELEMETRY_DEPRECATED -static inline nostd::shared_ptr -CreateAsyncInt64MetricMessagingReceiveDuration(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricMessagingReceiveDuration, - descrMetricMessagingReceiveDuration, - unitMetricMessagingReceiveDuration); -} - -OPENTELEMETRY_DEPRECATED -static inline nostd::shared_ptr -CreateAsyncDoubleMetricMessagingReceiveDuration(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricMessagingReceiveDuration, - descrMetricMessagingReceiveDuration, - unitMetricMessagingReceiveDuration); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Deprecated. Use @code messaging.client.consumed.messages @endcode instead. *

diff --git a/api/include/opentelemetry/semconv/incubating/process_metrics.h b/api/include/opentelemetry/semconv/incubating/process_metrics.h index a7cdddd7bc..b071a9c138 100644 --- a/api/include/opentelemetry/semconv/incubating/process_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/process_metrics.h @@ -110,8 +110,8 @@ static constexpr const char *descrMetricProcessCpuUtilization = "number of CPUs available to the process."; static constexpr const char *unitMetricProcessCpuUtilization = "1"; -#ifdef OPENTELEMETRY_LATER -// Unsupported: Sync gauge +#if OPENTELEMETRY_ABI_VERSION_NO >= 2 + static inline nostd::unique_ptr> CreateSyncInt64MetricProcessCpuUtilization(metrics::Meter *meter) { @@ -125,7 +125,7 @@ static inline nostd::unique_ptr> CreateSyncDoubleMetricPr return meter->CreateDoubleGauge(kMetricProcessCpuUtilization, descrMetricProcessCpuUtilization, unitMetricProcessCpuUtilization); } -#endif /* OPENTELEMETRY_LATER */ +#endif /* OPENTELEMETRY_ABI_VERSION_NO */ static inline nostd::shared_ptr CreateAsyncInt64MetricProcessCpuUtilization(metrics::Meter *meter) diff --git a/api/include/opentelemetry/semconv/incubating/rpc_metrics.h b/api/include/opentelemetry/semconv/incubating/rpc_metrics.h index b0ffac3a8e..30e95ce710 100644 --- a/api/include/opentelemetry/semconv/incubating/rpc_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/rpc_metrics.h @@ -49,23 +49,6 @@ static inline nostd::unique_ptr> CreateSyncDoubleMetr unitMetricRpcClientDuration); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricRpcClientDuration(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram( - kMetricRpcClientDuration, descrMetricRpcClientDuration, unitMetricRpcClientDuration); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricRpcClientDuration(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram( - kMetricRpcClientDuration, descrMetricRpcClientDuration, unitMetricRpcClientDuration); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Measures the size of RPC request messages (uncompressed). *

@@ -92,23 +75,6 @@ CreateSyncDoubleMetricRpcClientRequestSize(metrics::Meter *meter) unitMetricRpcClientRequestSize); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricRpcClientRequestSize(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram( - kMetricRpcClientRequestSize, descrMetricRpcClientRequestSize, unitMetricRpcClientRequestSize); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricRpcClientRequestSize(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram( - kMetricRpcClientRequestSize, descrMetricRpcClientRequestSize, unitMetricRpcClientRequestSize); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Measures the number of messages received per RPC. *

@@ -139,25 +105,6 @@ CreateSyncDoubleMetricRpcClientRequestsPerRpc(metrics::Meter *meter) unitMetricRpcClientRequestsPerRpc); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricRpcClientRequestsPerRpc(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricRpcClientRequestsPerRpc, - descrMetricRpcClientRequestsPerRpc, - unitMetricRpcClientRequestsPerRpc); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricRpcClientRequestsPerRpc(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricRpcClientRequestsPerRpc, - descrMetricRpcClientRequestsPerRpc, - unitMetricRpcClientRequestsPerRpc); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Measures the size of RPC response messages (uncompressed). *

@@ -186,25 +133,6 @@ CreateSyncDoubleMetricRpcClientResponseSize(metrics::Meter *meter) unitMetricRpcClientResponseSize); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricRpcClientResponseSize(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricRpcClientResponseSize, - descrMetricRpcClientResponseSize, - unitMetricRpcClientResponseSize); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricRpcClientResponseSize(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricRpcClientResponseSize, - descrMetricRpcClientResponseSize, - unitMetricRpcClientResponseSize); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Measures the number of messages sent per RPC. *

@@ -236,25 +164,6 @@ CreateSyncDoubleMetricRpcClientResponsesPerRpc(metrics::Meter *meter) unitMetricRpcClientResponsesPerRpc); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricRpcClientResponsesPerRpc(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricRpcClientResponsesPerRpc, - descrMetricRpcClientResponsesPerRpc, - unitMetricRpcClientResponsesPerRpc); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricRpcClientResponsesPerRpc(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricRpcClientResponsesPerRpc, - descrMetricRpcClientResponsesPerRpc, - unitMetricRpcClientResponsesPerRpc); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Measures the duration of inbound RPC. *

@@ -283,23 +192,6 @@ static inline nostd::unique_ptr> CreateSyncDoubleMetr unitMetricRpcServerDuration); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricRpcServerDuration(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram( - kMetricRpcServerDuration, descrMetricRpcServerDuration, unitMetricRpcServerDuration); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricRpcServerDuration(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram( - kMetricRpcServerDuration, descrMetricRpcServerDuration, unitMetricRpcServerDuration); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Measures the size of RPC request messages (uncompressed). *

@@ -326,23 +218,6 @@ CreateSyncDoubleMetricRpcServerRequestSize(metrics::Meter *meter) unitMetricRpcServerRequestSize); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricRpcServerRequestSize(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram( - kMetricRpcServerRequestSize, descrMetricRpcServerRequestSize, unitMetricRpcServerRequestSize); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricRpcServerRequestSize(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram( - kMetricRpcServerRequestSize, descrMetricRpcServerRequestSize, unitMetricRpcServerRequestSize); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Measures the number of messages received per RPC. *

@@ -373,25 +248,6 @@ CreateSyncDoubleMetricRpcServerRequestsPerRpc(metrics::Meter *meter) unitMetricRpcServerRequestsPerRpc); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricRpcServerRequestsPerRpc(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricRpcServerRequestsPerRpc, - descrMetricRpcServerRequestsPerRpc, - unitMetricRpcServerRequestsPerRpc); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricRpcServerRequestsPerRpc(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricRpcServerRequestsPerRpc, - descrMetricRpcServerRequestsPerRpc, - unitMetricRpcServerRequestsPerRpc); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Measures the size of RPC response messages (uncompressed). *

@@ -420,25 +276,6 @@ CreateSyncDoubleMetricRpcServerResponseSize(metrics::Meter *meter) unitMetricRpcServerResponseSize); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricRpcServerResponseSize(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricRpcServerResponseSize, - descrMetricRpcServerResponseSize, - unitMetricRpcServerResponseSize); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricRpcServerResponseSize(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricRpcServerResponseSize, - descrMetricRpcServerResponseSize, - unitMetricRpcServerResponseSize); -} -#endif /* OPENTELEMETRY_LATER */ - /** * Measures the number of messages sent per RPC. *

@@ -470,25 +307,6 @@ CreateSyncDoubleMetricRpcServerResponsesPerRpc(metrics::Meter *meter) unitMetricRpcServerResponsesPerRpc); } -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async histogram -static inline nostd::shared_ptr -CreateAsyncInt64MetricRpcServerResponsesPerRpc(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableHistogram(kMetricRpcServerResponsesPerRpc, - descrMetricRpcServerResponsesPerRpc, - unitMetricRpcServerResponsesPerRpc); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricRpcServerResponsesPerRpc(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableHistogram(kMetricRpcServerResponsesPerRpc, - descrMetricRpcServerResponsesPerRpc, - unitMetricRpcServerResponsesPerRpc); -} -#endif /* OPENTELEMETRY_LATER */ - } // namespace rpc } // namespace semconv OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/system_metrics.h b/api/include/opentelemetry/semconv/incubating/system_metrics.h index 647c26c72c..4036d9ff46 100644 --- a/api/include/opentelemetry/semconv/incubating/system_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/system_metrics.h @@ -30,8 +30,8 @@ static constexpr const char *descrMetricSystemCpuFrequency = "Reports the current frequency of the CPU in Hz"; static constexpr const char *unitMetricSystemCpuFrequency = "{Hz}"; -#ifdef OPENTELEMETRY_LATER -// Unsupported: Sync gauge +#if OPENTELEMETRY_ABI_VERSION_NO >= 2 + static inline nostd::unique_ptr> CreateSyncInt64MetricSystemCpuFrequency( metrics::Meter *meter) { @@ -45,7 +45,7 @@ static inline nostd::unique_ptr> CreateSyncDoubleMetricSy return meter->CreateDoubleGauge(kMetricSystemCpuFrequency, descrMetricSystemCpuFrequency, unitMetricSystemCpuFrequency); } -#endif /* OPENTELEMETRY_LATER */ +#endif /* OPENTELEMETRY_ABI_VERSION_NO */ static inline nostd::shared_ptr CreateAsyncInt64MetricSystemCpuFrequency(metrics::Meter *meter) @@ -193,8 +193,8 @@ static constexpr const char *descrMetricSystemCpuUtilization = "number of logical CPUs"; static constexpr const char *unitMetricSystemCpuUtilization = "1"; -#ifdef OPENTELEMETRY_LATER -// Unsupported: Sync gauge +#if OPENTELEMETRY_ABI_VERSION_NO >= 2 + static inline nostd::unique_ptr> CreateSyncInt64MetricSystemCpuUtilization( metrics::Meter *meter) { @@ -208,7 +208,7 @@ static inline nostd::unique_ptr> CreateSyncDoubleMetricSy return meter->CreateDoubleGauge(kMetricSystemCpuUtilization, descrMetricSystemCpuUtilization, unitMetricSystemCpuUtilization); } -#endif /* OPENTELEMETRY_LATER */ +#endif /* OPENTELEMETRY_ABI_VERSION_NO */ static inline nostd::shared_ptr CreateAsyncInt64MetricSystemCpuUtilization(metrics::Meter *meter) @@ -469,8 +469,8 @@ static constexpr const char *kMetricSystemFilesystemUtilization = static constexpr const char *descrMetricSystemFilesystemUtilization = ""; static constexpr const char *unitMetricSystemFilesystemUtilization = "1"; -#ifdef OPENTELEMETRY_LATER -// Unsupported: Sync gauge +#if OPENTELEMETRY_ABI_VERSION_NO >= 2 + static inline nostd::unique_ptr> CreateSyncInt64MetricSystemFilesystemUtilization(metrics::Meter *meter) { @@ -486,7 +486,7 @@ CreateSyncDoubleMetricSystemFilesystemUtilization(metrics::Meter *meter) descrMetricSystemFilesystemUtilization, unitMetricSystemFilesystemUtilization); } -#endif /* OPENTELEMETRY_LATER */ +#endif /* OPENTELEMETRY_ABI_VERSION_NO */ static inline nostd::shared_ptr CreateAsyncInt64MetricSystemFilesystemUtilization(metrics::Meter *meter) @@ -727,8 +727,8 @@ static constexpr const char *kMetricSystemMemoryUtilization = "metric.system.mem static constexpr const char *descrMetricSystemMemoryUtilization = ""; static constexpr const char *unitMetricSystemMemoryUtilization = "1"; -#ifdef OPENTELEMETRY_LATER -// Unsupported: Sync gauge +#if OPENTELEMETRY_ABI_VERSION_NO >= 2 + static inline nostd::unique_ptr> CreateSyncInt64MetricSystemMemoryUtilization(metrics::Meter *meter) { @@ -744,7 +744,7 @@ CreateSyncDoubleMetricSystemMemoryUtilization(metrics::Meter *meter) descrMetricSystemMemoryUtilization, unitMetricSystemMemoryUtilization); } -#endif /* OPENTELEMETRY_LATER */ +#endif /* OPENTELEMETRY_ABI_VERSION_NO */ static inline nostd::shared_ptr CreateAsyncInt64MetricSystemMemoryUtilization(metrics::Meter *meter) @@ -1086,8 +1086,8 @@ static constexpr const char *kMetricSystemPagingUtilization = "metric.system.pag static constexpr const char *descrMetricSystemPagingUtilization = ""; static constexpr const char *unitMetricSystemPagingUtilization = "1"; -#ifdef OPENTELEMETRY_LATER -// Unsupported: Sync gauge +#if OPENTELEMETRY_ABI_VERSION_NO >= 2 + static inline nostd::unique_ptr> CreateSyncInt64MetricSystemPagingUtilization(metrics::Meter *meter) { @@ -1103,7 +1103,7 @@ CreateSyncDoubleMetricSystemPagingUtilization(metrics::Meter *meter) descrMetricSystemPagingUtilization, unitMetricSystemPagingUtilization); } -#endif /* OPENTELEMETRY_LATER */ +#endif /* OPENTELEMETRY_ABI_VERSION_NO */ static inline nostd::shared_ptr CreateAsyncInt64MetricSystemPagingUtilization(metrics::Meter *meter) diff --git a/buildscripts/semantic-convention/generate.sh b/buildscripts/semantic-convention/generate.sh index 65858a90a7..79becfefbd 100755 --- a/buildscripts/semantic-convention/generate.sh +++ b/buildscripts/semantic-convention/generate.sh @@ -92,7 +92,7 @@ generate() { docker run --rm --user ${MY_UID}:${MY_GID} \ -v ${SCRIPT_DIR}/semantic-conventions/model:/source${USE_MOUNT_OPTION} \ -v ${SCRIPT_DIR}/templates:/templates${USE_MOUNT_OPTION} \ - -v ${ROOT_DIR}/wip/:/output${USE_MOUNT_OPTION} \ + -v ${ROOT_DIR}/tmpgen/:/output${USE_MOUNT_OPTION} \ otel/weaver:$WEAVER_VERSION_TAG \ registry \ generate \ @@ -106,15 +106,15 @@ generate() { } # stable attributes and metrics -mkdir -p ${ROOT_DIR}/wip +mkdir -p ${ROOT_DIR}/tmpgen generate "./" "./" "stable" -mkdir -p ${ROOT_DIR}/wip/${INCUBATING_DIR} +mkdir -p ${ROOT_DIR}/tmpgen/${INCUBATING_DIR} generate "./" "./${INCUBATING_DIR}/" "any" -cp -r ${ROOT_DIR}/wip/*.h \ +cp -r ${ROOT_DIR}/tmpgen/*.h \ ${ROOT_DIR}/api/include/opentelemetry/semconv/ -cp -r ${ROOT_DIR}/wip/${INCUBATING_DIR}/*.h \ +cp -r ${ROOT_DIR}/tmpgen/${INCUBATING_DIR}/*.h \ ${ROOT_DIR}/api/include/opentelemetry/semconv/incubating diff --git a/buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 b/buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 index 9e66c3f0d8..f306367f89 100644 --- a/buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 +++ b/buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 @@ -31,10 +31,7 @@ - Use the debug flag to dump the semantic convention data in the generated output, to inspect it. - Some instruments are not supported in the SDK. - For these, we still generate the code, - protected with OPENTELEMETRY_LATER (which should be undefined). - - Using #ifdef OPENTELEMETRY_LATER is preferred to #if 0, - so that clang format generates clean code. + For these, we do not generate the code. #} {# ========================================================================== #} @@ -65,8 +62,8 @@ descr{{ metric.id | pascal_case }} unit{{ metric.id | pascal_case }} {% endmacro %} -{% macro sync_instrument_support(metric) %} -{{ metric.instrument | map_text("cpp_sync_support") }} +{% macro sync_instrument_min_abi_version(metric) %} +{{ metric.instrument | map_text("cpp_sync_min_abi_version") | trim }} {% endmacro %} {% macro sync_instrument_int64_type(metric) %} @@ -85,8 +82,8 @@ unit{{ metric.id | pascal_case }} {{ metric.instrument | map_text("cpp_sync_instrument_to_double_factory") }} {% endmacro %} -{% macro async_instrument_support(metric) %} -{{ metric.instrument | map_text("cpp_async_support") | trim }} +{% macro async_instrument_min_abi_version(metric) %} +{{ metric.instrument | map_text("cpp_async_min_abi_version") | trim }} {% endmacro %} {% macro async_instrument_type(metric) %} @@ -125,8 +122,8 @@ namespace {{ cpp_metric_namespace -}} {% set v_metric_name = var_metric_name(metric) %} {% set descr = descr_metric_name(metric) %} {% set unit = unit_metric_name(metric) %} - {% set sync_support = (sync_instrument_support(metric) | trim == "true") %} - {% set async_support = (async_instrument_support(metric) | trim == "true") %} + {% set sync_min_abi_version = (sync_instrument_min_abi_version(metric)) %} + {% set async_min_abi_version = (async_instrument_min_abi_version(metric)) %} {% set sync_int64_type = sync_instrument_int64_type(metric) %} {% set sync_double_type = sync_instrument_double_type(metric) %} {% set async_type = async_instrument_type(metric) %} @@ -155,13 +152,13 @@ OPENTELEMETRY_DEPRECATED {% endif %} static constexpr const char *{{unit}} = "{{metric.unit}}"; - {% if sync_support is false %} -#ifdef OPENTELEMETRY_LATER -// Unsupported: Sync {{ metric.instrument }} - {% endif %} - {% if metric is deprecated %} + {% if sync_min_abi_version|trim != "0" %} + {% if sync_min_abi_version|trim != "1" %} +#if OPENTELEMETRY_ABI_VERSION_NO >= {{sync_min_abi_version}} + {% endif %} + {% if metric is deprecated %} OPENTELEMETRY_DEPRECATED - {% endif %} + {% endif %} static inline nostd::unique_ptr<{{sync_int64_type-}}> CreateSyncInt64{{f_metric_name-}}(metrics::Meter *meter) { @@ -171,9 +168,9 @@ CreateSyncInt64{{f_metric_name-}}(metrics::Meter *meter) {{unit}}); } - {% if metric is deprecated %} + {% if metric is deprecated %} OPENTELEMETRY_DEPRECATED - {% endif %} + {% endif %} static inline nostd::unique_ptr<{{sync_double_type-}}> CreateSyncDouble{{f_metric_name-}}(metrics::Meter *meter) { @@ -182,17 +179,18 @@ CreateSyncDouble{{f_metric_name-}}(metrics::Meter *meter) {{descr}}, {{unit}}); } - {% if sync_support is false %} -#endif /* OPENTELEMETRY_LATER */ + {% if sync_min_abi_version|trim != "1" %} +#endif /* OPENTELEMETRY_ABI_VERSION_NO */ + {% endif %} {% endif %} - {% if async_support is false %} -#ifdef OPENTELEMETRY_LATER -// Unsupported: Async {{ metric.instrument }} - {% endif %} - {% if metric is deprecated %} + {% if async_min_abi_version|trim != "0" %} + {% if async_min_abi_version|trim != "1" %} +#if OPENTELEMETRY_ABI_VERSION_NO >= {{async_min_abi_version}} + {% endif %} + {% if metric is deprecated %} OPENTELEMETRY_DEPRECATED - {% endif %} + {% endif %} static inline nostd::shared_ptr<{{async_type-}}> CreateAsyncInt64{{f_metric_name-}}(metrics::Meter *meter) { @@ -202,9 +200,9 @@ CreateAsyncInt64{{f_metric_name-}}(metrics::Meter *meter) {{unit}}); } - {% if metric is deprecated %} + {% if metric is deprecated %} OPENTELEMETRY_DEPRECATED - {% endif %} + {% endif %} static inline nostd::shared_ptr<{{async_type-}}> CreateAsyncDouble{{f_metric_name-}}(metrics::Meter *meter) { @@ -213,8 +211,9 @@ CreateAsyncDouble{{f_metric_name-}}(metrics::Meter *meter) {{descr}}, {{unit}}); } - {% if async_support is false %} -#endif /* OPENTELEMETRY_LATER */ + {% if async_min_abi_version|trim != "1" %} +#endif /* OPENTELEMETRY_ABI_VERSION_NO */ + {% endif %} {% endif %} {% if excluded %} diff --git a/buildscripts/semantic-convention/templates/registry/weaver.yaml b/buildscripts/semantic-convention/templates/registry/weaver.yaml index 12d047e77e..f9c5c9355e 100644 --- a/buildscripts/semantic-convention/templates/registry/weaver.yaml +++ b/buildscripts/semantic-convention/templates/registry/weaver.yaml @@ -70,64 +70,65 @@ text_maps: template[string]: const char * template[string[]]: const char *[] - cpp_sync_support: - counter: "true" - histogram: "true" - updowncounter: "true" - gauge: "false" + # Minimum ABI_VERSION to support the feature: + # 0 - not supported + # 1 - supported in all versions + # 2 - supported in ABI_VERSION >= 2 + cpp_sync_min_abi_version: + counter: 1 + histogram: 1 + updowncounter: 1 + gauge: 2 cpp_sync_instrument_to_int64_type: counter: metrics::Counter histogram: metrics::Histogram updowncounter: metrics::UpDownCounter - # Not supported yet gauge: metrics::Gauge cpp_sync_instrument_to_double_type: counter: metrics::Counter histogram: metrics::Histogram updowncounter: metrics::UpDownCounter - # Not supported yet gauge: metrics::Gauge cpp_sync_instrument_to_int64_factory: counter: CreateUInt64Counter histogram: CreateUInt64Histogram updowncounter: CreateInt64UpDownCounter - # Not supported yet gauge: CreateUInt64Gauge cpp_sync_instrument_to_double_factory: counter: CreateDoubleCounter histogram: CreateDoubleHistogram updowncounter: CreateDoubleUpDownCounter - # Not supported yet gauge: CreateDoubleGauge - cpp_async_support: - counter: "true" - histogram: "false" - updowncounter: "true" - gauge: "true" + # Minimum ABI_VERSION to support the feature: + # 0 - not supported + # 1 - supported in all versions + # 2 - supported in ABI_VERSION >= 2 + cpp_async_min_abi_version: + counter: 1 + histogram: 0 + updowncounter: 1 + gauge: 1 cpp_async_instrument_to_type: counter: metrics::ObservableInstrument - # Not supported yet - histogram: metrics::ObservableInstrument + histogram: UNSUPPORTED updowncounter: metrics::ObservableInstrument gauge: metrics::ObservableInstrument cpp_async_instrument_to_int64_factory: counter: CreateInt64ObservableCounter - # Not supported yet - histogram: CreateInt64ObservableHistogram + histogram: UNSUPPORTED updowncounter: CreateInt64ObservableUpDownCounter gauge: CreateInt64ObservableGauge cpp_async_instrument_to_double_factory: counter: CreateDoubleObservableCounter - # Not supported yet - histogram: CreateDoubleObservableHistogram + histogram: UNSUPPORTED updowncounter: CreateDoubleObservableUpDownCounter gauge: CreateDoubleObservableGauge From d125af290747c22bcaa7ef24fb2207e28bbeb472 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Tue, 12 Nov 2024 23:34:32 +0100 Subject: [PATCH 16/16] Fixed gauges. --- .../semconv/incubating/process_metrics.h | 8 ++--- .../semconv/incubating/system_metrics.h | 34 +++++++++---------- .../templates/registry/weaver.yaml | 4 +-- 3 files changed, 22 insertions(+), 24 deletions(-) diff --git a/api/include/opentelemetry/semconv/incubating/process_metrics.h b/api/include/opentelemetry/semconv/incubating/process_metrics.h index b071a9c138..95a1853ccb 100644 --- a/api/include/opentelemetry/semconv/incubating/process_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/process_metrics.h @@ -112,11 +112,11 @@ static constexpr const char *unitMetricProcessCpuUtilization = "1"; #if OPENTELEMETRY_ABI_VERSION_NO >= 2 -static inline nostd::unique_ptr> -CreateSyncInt64MetricProcessCpuUtilization(metrics::Meter *meter) +static inline nostd::unique_ptr> CreateSyncInt64MetricProcessCpuUtilization( + metrics::Meter *meter) { - return meter->CreateUInt64Gauge(kMetricProcessCpuUtilization, descrMetricProcessCpuUtilization, - unitMetricProcessCpuUtilization); + return meter->CreateInt64Gauge(kMetricProcessCpuUtilization, descrMetricProcessCpuUtilization, + unitMetricProcessCpuUtilization); } static inline nostd::unique_ptr> CreateSyncDoubleMetricProcessCpuUtilization( diff --git a/api/include/opentelemetry/semconv/incubating/system_metrics.h b/api/include/opentelemetry/semconv/incubating/system_metrics.h index 4036d9ff46..b896015372 100644 --- a/api/include/opentelemetry/semconv/incubating/system_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/system_metrics.h @@ -32,11 +32,11 @@ static constexpr const char *unitMetricSystemCpuFrequency = "{Hz}"; #if OPENTELEMETRY_ABI_VERSION_NO >= 2 -static inline nostd::unique_ptr> CreateSyncInt64MetricSystemCpuFrequency( +static inline nostd::unique_ptr> CreateSyncInt64MetricSystemCpuFrequency( metrics::Meter *meter) { - return meter->CreateUInt64Gauge(kMetricSystemCpuFrequency, descrMetricSystemCpuFrequency, - unitMetricSystemCpuFrequency); + return meter->CreateInt64Gauge(kMetricSystemCpuFrequency, descrMetricSystemCpuFrequency, + unitMetricSystemCpuFrequency); } static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemCpuFrequency( @@ -195,11 +195,11 @@ static constexpr const char *unitMetricSystemCpuUtilization = "1"; #if OPENTELEMETRY_ABI_VERSION_NO >= 2 -static inline nostd::unique_ptr> CreateSyncInt64MetricSystemCpuUtilization( +static inline nostd::unique_ptr> CreateSyncInt64MetricSystemCpuUtilization( metrics::Meter *meter) { - return meter->CreateUInt64Gauge(kMetricSystemCpuUtilization, descrMetricSystemCpuUtilization, - unitMetricSystemCpuUtilization); + return meter->CreateInt64Gauge(kMetricSystemCpuUtilization, descrMetricSystemCpuUtilization, + unitMetricSystemCpuUtilization); } static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemCpuUtilization( @@ -471,12 +471,12 @@ static constexpr const char *unitMetricSystemFilesystemUtilization = "1"; #if OPENTELEMETRY_ABI_VERSION_NO >= 2 -static inline nostd::unique_ptr> +static inline nostd::unique_ptr> CreateSyncInt64MetricSystemFilesystemUtilization(metrics::Meter *meter) { - return meter->CreateUInt64Gauge(kMetricSystemFilesystemUtilization, - descrMetricSystemFilesystemUtilization, - unitMetricSystemFilesystemUtilization); + return meter->CreateInt64Gauge(kMetricSystemFilesystemUtilization, + descrMetricSystemFilesystemUtilization, + unitMetricSystemFilesystemUtilization); } static inline nostd::unique_ptr> @@ -729,12 +729,11 @@ static constexpr const char *unitMetricSystemMemoryUtilization = "1"; #if OPENTELEMETRY_ABI_VERSION_NO >= 2 -static inline nostd::unique_ptr> +static inline nostd::unique_ptr> CreateSyncInt64MetricSystemMemoryUtilization(metrics::Meter *meter) { - return meter->CreateUInt64Gauge(kMetricSystemMemoryUtilization, - descrMetricSystemMemoryUtilization, - unitMetricSystemMemoryUtilization); + return meter->CreateInt64Gauge(kMetricSystemMemoryUtilization, descrMetricSystemMemoryUtilization, + unitMetricSystemMemoryUtilization); } static inline nostd::unique_ptr> @@ -1088,12 +1087,11 @@ static constexpr const char *unitMetricSystemPagingUtilization = "1"; #if OPENTELEMETRY_ABI_VERSION_NO >= 2 -static inline nostd::unique_ptr> +static inline nostd::unique_ptr> CreateSyncInt64MetricSystemPagingUtilization(metrics::Meter *meter) { - return meter->CreateUInt64Gauge(kMetricSystemPagingUtilization, - descrMetricSystemPagingUtilization, - unitMetricSystemPagingUtilization); + return meter->CreateInt64Gauge(kMetricSystemPagingUtilization, descrMetricSystemPagingUtilization, + unitMetricSystemPagingUtilization); } static inline nostd::unique_ptr> diff --git a/buildscripts/semantic-convention/templates/registry/weaver.yaml b/buildscripts/semantic-convention/templates/registry/weaver.yaml index f9c5c9355e..e0543b2652 100644 --- a/buildscripts/semantic-convention/templates/registry/weaver.yaml +++ b/buildscripts/semantic-convention/templates/registry/weaver.yaml @@ -84,7 +84,7 @@ text_maps: counter: metrics::Counter histogram: metrics::Histogram updowncounter: metrics::UpDownCounter - gauge: metrics::Gauge + gauge: metrics::Gauge cpp_sync_instrument_to_double_type: counter: metrics::Counter @@ -96,7 +96,7 @@ text_maps: counter: CreateUInt64Counter histogram: CreateUInt64Histogram updowncounter: CreateInt64UpDownCounter - gauge: CreateUInt64Gauge + gauge: CreateInt64Gauge cpp_sync_instrument_to_double_factory: counter: CreateDoubleCounter