diff --git a/api/include/opentelemetry/semconv/incubating/app_attributes.h b/api/include/opentelemetry/semconv/incubating/app_attributes.h new file mode 100644 index 0000000000..1731b460c5 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/app_attributes.h @@ -0,0 +1,52 @@ +/* + * 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 app +{ + +/** + * A unique identifier representing the installation of an application on a specific device + *

+ * Its value SHOULD persist across launches of the same application installation, including through + * application upgrades. It SHOULD change if the application is uninstalled or if all applications + * of the vendor are uninstalled. Additionally, users might be able to reset this value (e.g. by + * clearing application data). If an app is installed multiple times on the same device (e.g. in + * different accounts on Android), each @code app.installation.id @endcode SHOULD have a different + * value. If multiple OpenTelemetry SDKs are used within the same application, they SHOULD use the + * same value for @code app.installation.id @endcode. Hardware IDs (e.g. serial number, IMEI, MAC + * address) MUST NOT be used as the @code app.installation.id @endcode.

For iOS, this value + * SHOULD be equal to the vendor + * identifier.

For Android, examples of @code app.installation.id @endcode implementations + * include:

+ *

+ * More information about Android identifier best practices can be found here. + */ +static constexpr const char *kAppInstallationId = "app.installation.id"; + +} // namespace app +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/code_attributes.h b/api/include/opentelemetry/semconv/incubating/code_attributes.h index c0bcbc628e..42845241c0 100644 --- a/api/include/opentelemetry/semconv/incubating/code_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/code_attributes.h @@ -68,8 +68,8 @@ OPENTELEMETRY_DEPRECATED static constexpr const char *kCodeFunction = "code.func *

  • Java method: @code com.example.MyHttpService.serveRequest @endcode
  • *
  • Java anonymous class method: @code com.mycompany.Main$1.myMethod @endcode
  • *
  • Java lambda method: @code com.mycompany.Main$$Lambda/0x0000748ae4149c00.myMethod - * @endcode
  • PHP function: `GuzzleHttp\Client::transfer
  • Go function: @code - * github.com/my/repo/pkg.foo.func5 @endcode
  • Elixir: @code OpenTelemetry.Ctx.new + * @endcode
  • PHP function: @code GuzzleHttp\Client::transfer @endcode
  • Go function: + * @code github.com/my/repo/pkg.foo.func5 @endcode
  • Elixir: @code OpenTelemetry.Ctx.new * @endcode
  • Erlang: @code opentelemetry_ctx:new @endcode
  • Rust: @code * playground::my_module::my_cool_func @endcode
  • C function: @code fopen @endcode
  • * diff --git a/api/include/opentelemetry/semconv/incubating/cpython_attributes.h b/api/include/opentelemetry/semconv/incubating/cpython_attributes.h new file mode 100644 index 0000000000..bcdb59d25d --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/cpython_attributes.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_attributes-h.j2 + */ + +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace cpython +{ + +/** + * Value of the garbage collector collection generation. + */ +static constexpr const char *kCpythonGcGeneration = "cpython.gc.generation"; + +namespace CpythonGcGenerationValues +{ +/** + * Generation 0 + */ +static constexpr int kGeneration0 = 0; + +/** + * Generation 1 + */ +static constexpr int kGeneration1 = 1; + +/** + * Generation 2 + */ +static constexpr int kGeneration2 = 2; + +} // namespace CpythonGcGenerationValues + +} // namespace cpython +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/cpython_metrics.h b/api/include/opentelemetry/semconv/incubating/cpython_metrics.h new file mode 100644 index 0000000000..94d1561c56 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/cpython_metrics.h @@ -0,0 +1,154 @@ +/* + * 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/metrics/meter.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace cpython +{ + +/** + * The total number of objects collected inside a generation since interpreter start. + *

    + * This metric reports data from @code gc.stats() @endcode.

    + * counter + */ +static constexpr const char *kMetricCpythonGcCollectedObjects = "cpython.gc.collected_objects"; +static constexpr const char *descrMetricCpythonGcCollectedObjects = + "The total number of objects collected inside a generation since interpreter start."; +static constexpr const char *unitMetricCpythonGcCollectedObjects = "{object}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricCpythonGcCollectedObjects(metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricCpythonGcCollectedObjects, + descrMetricCpythonGcCollectedObjects, + unitMetricCpythonGcCollectedObjects); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricCpythonGcCollectedObjects(metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricCpythonGcCollectedObjects, + descrMetricCpythonGcCollectedObjects, + unitMetricCpythonGcCollectedObjects); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricCpythonGcCollectedObjects(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricCpythonGcCollectedObjects, + descrMetricCpythonGcCollectedObjects, + unitMetricCpythonGcCollectedObjects); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricCpythonGcCollectedObjects(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricCpythonGcCollectedObjects, + descrMetricCpythonGcCollectedObjects, + unitMetricCpythonGcCollectedObjects); +} + +/** + * The number of times a generation was collected since interpreter start. + *

    + * This metric reports data from @code gc.stats() @endcode.

    + * counter + */ +static constexpr const char *kMetricCpythonGcCollections = "cpython.gc.collections"; +static constexpr const char *descrMetricCpythonGcCollections = + "The number of times a generation was collected since interpreter start."; +static constexpr const char *unitMetricCpythonGcCollections = "{collection}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricCpythonGcCollections(metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricCpythonGcCollections, descrMetricCpythonGcCollections, + unitMetricCpythonGcCollections); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricCpythonGcCollections(metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricCpythonGcCollections, descrMetricCpythonGcCollections, + unitMetricCpythonGcCollections); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricCpythonGcCollections(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter( + kMetricCpythonGcCollections, descrMetricCpythonGcCollections, unitMetricCpythonGcCollections); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricCpythonGcCollections(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter( + kMetricCpythonGcCollections, descrMetricCpythonGcCollections, unitMetricCpythonGcCollections); +} + +/** + * The total number of objects which were found to be uncollectable inside a generation since + * interpreter start.

    This metric reports data from @code gc.stats() @endcode.

    + * counter + */ +static constexpr const char *kMetricCpythonGcUncollectableObjects = + "cpython.gc.uncollectable_objects"; +static constexpr const char *descrMetricCpythonGcUncollectableObjects = + "The total number of objects which were found to be uncollectable inside a generation since " + "interpreter start."; +static constexpr const char *unitMetricCpythonGcUncollectableObjects = "{object}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricCpythonGcUncollectableObjects(metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricCpythonGcUncollectableObjects, + descrMetricCpythonGcUncollectableObjects, + unitMetricCpythonGcUncollectableObjects); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricCpythonGcUncollectableObjects(metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricCpythonGcUncollectableObjects, + descrMetricCpythonGcUncollectableObjects, + unitMetricCpythonGcUncollectableObjects); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricCpythonGcUncollectableObjects(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricCpythonGcUncollectableObjects, + descrMetricCpythonGcUncollectableObjects, + unitMetricCpythonGcUncollectableObjects); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricCpythonGcUncollectableObjects(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricCpythonGcUncollectableObjects, + descrMetricCpythonGcUncollectableObjects, + unitMetricCpythonGcUncollectableObjects); +} + +} // namespace cpython +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/db_attributes.h b/api/include/opentelemetry/semconv/incubating/db_attributes.h index ee74981969..e14dcd5a8a 100644 --- a/api/include/opentelemetry/semconv/incubating/db_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/db_attributes.h @@ -343,6 +343,9 @@ static constexpr const char *kDbOperationBatchSize = "db.operation.batch.size"; * The operation name SHOULD NOT be extracted from @code db.query.text @endcode, * when the database system supports cross-table queries in non-batch operations. *

    + * If spaces can occur in the operation name, multiple consecutive spaces + * SHOULD be normalized to a single space. + *

    * 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 @@ -357,6 +360,7 @@ static constexpr const char *kDbOperationName = "db.operation.name"; * index. If @code db.query.text @endcode is also captured, then @code db.operation.parameter. * @endcode SHOULD match up with the parameterized placeholders present in @code db.query.text * @endcode. + * @code db.operation.parameter. @endcode SHOULD NOT be captured on batch operations. */ static constexpr const char *kDbOperationParameter = "db.operation.parameter"; @@ -422,10 +426,12 @@ static constexpr const char *kDbResponseReturnedRows = "db.response.returned_row static constexpr const char *kDbResponseStatusCode = "db.response.status_code"; /** - * Deprecated, use @code db.collection.name @endcode instead. + * Deprecated, use @code db.collection.name @endcode instead, but only if not extracting the value + * from @code db.query.text @endcode. * * @deprecated - * {"note": "Replaced by @code db.collection.name @endcode.", "reason": "uncategorized"} + * {"note": "Replaced by @code db.collection.name @endcode, but only if not extracting the value + * from @code db.query.text @endcode.", "reason": "uncategorized"} */ OPENTELEMETRY_DEPRECATED static constexpr const char *kDbSqlTable = "db.sql.table"; @@ -437,6 +443,17 @@ OPENTELEMETRY_DEPRECATED static constexpr const char *kDbSqlTable = "db.sql.tabl */ OPENTELEMETRY_DEPRECATED static constexpr const char *kDbStatement = "db.statement"; +/** + * The name of a stored procedure within the database. + *

    + * It is RECOMMENDED to capture the value as provided by the application + * without attempting to do any case normalization. + *

    + * For batch operations, if the individual operations are known to have the same + * stored procedure name then that stored procedure name SHOULD be used. + */ +static constexpr const char *kDbStoredProcedureName = "db.stored_procedure.name"; + /** * Deprecated, use @code db.system.name @endcode instead. * diff --git a/api/include/opentelemetry/semconv/incubating/device_attributes.h b/api/include/opentelemetry/semconv/incubating/device_attributes.h index c2c80f5fd2..a1fb5bc5e9 100644 --- a/api/include/opentelemetry/semconv/incubating/device_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/device_attributes.h @@ -22,17 +22,24 @@ namespace device /** * A unique identifier representing the device *

    - * 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. + * Its value SHOULD be identical for all apps on a device and it SHOULD NOT change if an app is + * uninstalled and re-installed. However, it might be resettable by the user for all apps on a + * device. Hardware IDs (e.g. vendor-specific serial number, IMEI or MAC address) MAY be used as + * values.

    More information about Android identifier best practices can be found here.

    + * [!WARNING] + *

    + * This attribute may contain sensitive (PII) information. 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. + *

    + * Due to these reasons, this identifier is not recommended for consumer applications and will + * likely result in rejection from both Google Play and App Store. However, it may be appropriate + * for specific enterprise scenarios, such as kiosk devices or enterprise-managed devices, with + * appropriate compliance clearance. Any instrumentation providing this identifier MUST implement it + * as an opt-in feature.

    See @code app.installation.id + * @endcode for a more privacy-preserving alternative.

    */ static constexpr const char *kDeviceId = "device.id"; diff --git a/api/include/opentelemetry/semconv/incubating/error_attributes.h b/api/include/opentelemetry/semconv/incubating/error_attributes.h index c68cdeda9f..cdb45f0d41 100644 --- a/api/include/opentelemetry/semconv/incubating/error_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/error_attributes.h @@ -19,6 +19,18 @@ namespace semconv namespace error { +/** + * A message providing more detail about an error in human-readable form. + *

    + * @code error.message @endcode should provide additional context and detail about an error. + * It is NOT RECOMMENDED to duplicate the value of @code error.type @endcode in @code error.message + * @endcode. It is also NOT RECOMMENDED to duplicate the value of @code exception.message @endcode + * in @code error.message @endcode.

    + * @code error.message @endcode is NOT RECOMMENDED for metrics or spans due to its unbounded + * cardinality and overlap with span status. + */ +static constexpr const char *kErrorMessage = "error.message"; + /** * Describes a class of error the operation ended with. *

    diff --git a/api/include/opentelemetry/semconv/incubating/feature_flag_attributes.h b/api/include/opentelemetry/semconv/incubating/feature_flag_attributes.h index 9616fc14e0..56f2d0b522 100644 --- a/api/include/opentelemetry/semconv/incubating/feature_flag_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/feature_flag_attributes.h @@ -31,9 +31,13 @@ static constexpr const char *kFeatureFlagEvaluationErrorMessage = "feature_flag.evaluation.error.message"; /** - * The reason code which shows how a feature flag value was determined. + * Deprecated, use @code feature_flag.result.reason @endcode instead. + * + * @deprecated + * {"note": "Replaced by @code feature_flag.result.reason @endcode.", "reason": "uncategorized"} */ -static constexpr const char *kFeatureFlagEvaluationReason = "feature_flag.evaluation.reason"; +OPENTELEMETRY_DEPRECATED static constexpr const char *kFeatureFlagEvaluationReason = + "feature_flag.evaluation.reason"; /** * The lookup key of the feature flag. @@ -46,10 +50,9 @@ static constexpr const char *kFeatureFlagKey = "feature_flag.key"; static constexpr const char *kFeatureFlagProviderName = "feature_flag.provider_name"; /** - * The identifier of the flag - * set to which the feature flag belongs. + * The reason code which shows how a feature flag value was determined. */ -static constexpr const char *kFeatureFlagSetId = "feature_flag.set.id"; +static constexpr const char *kFeatureFlagResultReason = "feature_flag.result.reason"; /** * A semantic identifier for an evaluated flag value. @@ -59,7 +62,21 @@ static constexpr const char *kFeatureFlagSetId = "feature_flag.set.id"; * 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. */ -static constexpr const char *kFeatureFlagVariant = "feature_flag.variant"; +static constexpr const char *kFeatureFlagResultVariant = "feature_flag.result.variant"; + +/** + * The identifier of the flag + * set to which the feature flag belongs. + */ +static constexpr const char *kFeatureFlagSetId = "feature_flag.set.id"; + +/** + * Deprecated, use @code feature_flag.result.variant @endcode instead. + * + * @deprecated + * {"note": "Replaced by @code feature_flag.result.variant @endcode.", "reason": "uncategorized"} + */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kFeatureFlagVariant = "feature_flag.variant"; /** * The version of the ruleset used during the evaluation. This may be any stable value which @@ -118,6 +135,57 @@ static constexpr const char *kError = "error"; } // namespace FeatureFlagEvaluationReasonValues +namespace FeatureFlagResultReasonValues +{ +/** + * The resolved value is static (no dynamic evaluation). + */ +static constexpr const char *kStatic = "static"; + +/** + * The resolved value fell back to a pre-configured value (no dynamic evaluation occurred or dynamic + * evaluation yielded no result). + */ +static constexpr const char *kDefault = "default"; + +/** + * The resolved value was the result of a dynamic evaluation, such as a rule or specific + * user-targeting. + */ +static constexpr const char *kTargetingMatch = "targeting_match"; + +/** + * The resolved value was the result of pseudorandom assignment. + */ +static constexpr const char *kSplit = "split"; + +/** + * The resolved value was retrieved from cache. + */ +static constexpr const char *kCached = "cached"; + +/** + * The resolved value was the result of the flag being disabled in the management system. + */ +static constexpr const char *kDisabled = "disabled"; + +/** + * The reason for the resolved value could not be determined. + */ +static constexpr const char *kUnknown = "unknown"; + +/** + * The resolved value is non-authoritative or possibly out of date + */ +static constexpr const char *kStale = "stale"; + +/** + * The resolved value was the result of an error. + */ +static constexpr const char *kError = "error"; + +} // namespace FeatureFlagResultReasonValues + } // namespace feature_flag } // namespace semconv OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/gcp_attributes.h b/api/include/opentelemetry/semconv/incubating/gcp_attributes.h index 53518251bb..1674ef2654 100644 --- a/api/include/opentelemetry/semconv/incubating/gcp_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/gcp_attributes.h @@ -19,6 +19,67 @@ namespace semconv namespace gcp { +/** + * The container within GCP where the AppHub application is defined. + */ +static constexpr const char *kGcpApphubApplicationContainer = "gcp.apphub.application.container"; + +/** + * The name of the application as configured in AppHub. + */ +static constexpr const char *kGcpApphubApplicationId = "gcp.apphub.application.id"; + +/** + * The GCP zone or region where the application is defined. + */ +static constexpr const char *kGcpApphubApplicationLocation = "gcp.apphub.application.location"; + +/** + * Criticality of a service indicates its importance to the business. + *

    + * See AppHub type + * enum + */ +static constexpr const char *kGcpApphubServiceCriticalityType = + "gcp.apphub.service.criticality_type"; + +/** + * Environment of a service is the stage of a software lifecycle. + *

    + * See AppHub + * environment type + */ +static constexpr const char *kGcpApphubServiceEnvironmentType = + "gcp.apphub.service.environment_type"; + +/** + * The name of the service as configured in AppHub. + */ +static constexpr const char *kGcpApphubServiceId = "gcp.apphub.service.id"; + +/** + * Criticality of a workload indicates its importance to the business. + *

    + * See AppHub type + * enum + */ +static constexpr const char *kGcpApphubWorkloadCriticalityType = + "gcp.apphub.workload.criticality_type"; + +/** + * Environment of a workload is the stage of a software lifecycle. + *

    + * See AppHub + * environment type + */ +static constexpr const char *kGcpApphubWorkloadEnvironmentType = + "gcp.apphub.workload.environment_type"; + +/** + * The name of the workload as configured in AppHub. + */ +static constexpr const char *kGcpApphubWorkloadId = "gcp.apphub.workload.id"; + /** * Identifies the Google Cloud service for which the official client library is intended. *

    @@ -59,6 +120,102 @@ static constexpr const char *kGcpGceInstanceHostname = "gcp.gce.instance.hostnam */ static constexpr const char *kGcpGceInstanceName = "gcp.gce.instance.name"; +namespace GcpApphubServiceCriticalityTypeValues +{ +/** + * Mission critical service. + */ +static constexpr const char *kMissionCritical = "MISSION_CRITICAL"; + +/** + * High impact. + */ +static constexpr const char *kHigh = "HIGH"; + +/** + * Medium impact. + */ +static constexpr const char *kMedium = "MEDIUM"; + +/** + * Low impact. + */ +static constexpr const char *kLow = "LOW"; + +} // namespace GcpApphubServiceCriticalityTypeValues + +namespace GcpApphubServiceEnvironmentTypeValues +{ +/** + * Production environment. + */ +static constexpr const char *kProduction = "PRODUCTION"; + +/** + * Staging environment. + */ +static constexpr const char *kStaging = "STAGING"; + +/** + * Test environment. + */ +static constexpr const char *kTest = "TEST"; + +/** + * Development environment. + */ +static constexpr const char *kDevelopment = "DEVELOPMENT"; + +} // namespace GcpApphubServiceEnvironmentTypeValues + +namespace GcpApphubWorkloadCriticalityTypeValues +{ +/** + * Mission critical service. + */ +static constexpr const char *kMissionCritical = "MISSION_CRITICAL"; + +/** + * High impact. + */ +static constexpr const char *kHigh = "HIGH"; + +/** + * Medium impact. + */ +static constexpr const char *kMedium = "MEDIUM"; + +/** + * Low impact. + */ +static constexpr const char *kLow = "LOW"; + +} // namespace GcpApphubWorkloadCriticalityTypeValues + +namespace GcpApphubWorkloadEnvironmentTypeValues +{ +/** + * Production environment. + */ +static constexpr const char *kProduction = "PRODUCTION"; + +/** + * Staging environment. + */ +static constexpr const char *kStaging = "STAGING"; + +/** + * Test environment. + */ +static constexpr const char *kTest = "TEST"; + +/** + * Development environment. + */ +static constexpr const char *kDevelopment = "DEVELOPMENT"; + +} // namespace GcpApphubWorkloadEnvironmentTypeValues + } // namespace gcp } // namespace semconv OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/otel_attributes.h b/api/include/opentelemetry/semconv/incubating/otel_attributes.h index 8299c2190e..2296ec9261 100644 --- a/api/include/opentelemetry/semconv/incubating/otel_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/otel_attributes.h @@ -98,6 +98,16 @@ static constexpr const char *kBatchingSpanProcessor = "batching_span_processor"; */ static constexpr const char *kSimpleSpanProcessor = "simple_span_processor"; +/** + * The builtin SDK Batching LogRecord Processor + */ +static constexpr const char *kBatchingLogProcessor = "batching_log_processor"; + +/** + * The builtin SDK Simple LogRecord Processor + */ +static constexpr const char *kSimpleLogProcessor = "simple_log_processor"; + /** * OTLP span exporter over gRPC with protobuf serialization */ @@ -113,6 +123,21 @@ static constexpr const char *kOtlpHttpSpanExporter = "otlp_http_span_exporter"; */ static constexpr const char *kOtlpHttpJsonSpanExporter = "otlp_http_json_span_exporter"; +/** + * OTLP LogRecord exporter over gRPC with protobuf serialization + */ +static constexpr const char *kOtlpGrpcLogExporter = "otlp_grpc_log_exporter"; + +/** + * OTLP LogRecord exporter over HTTP with protobuf serialization + */ +static constexpr const char *kOtlpHttpLogExporter = "otlp_http_log_exporter"; + +/** + * OTLP LogRecord exporter over HTTP with JSON serialization + */ +static constexpr const char *kOtlpHttpJsonLogExporter = "otlp_http_json_log_exporter"; + } // namespace OtelComponentTypeValues namespace OtelSpanSamplingResultValues diff --git a/api/include/opentelemetry/semconv/incubating/otel_metrics.h b/api/include/opentelemetry/semconv/incubating/otel_metrics.h index 0308a324b0..560672d2a3 100644 --- a/api/include/opentelemetry/semconv/incubating/otel_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/otel_metrics.h @@ -20,6 +20,96 @@ namespace semconv namespace otel { +/** + * The number of log records for which the export has finished, either successful or failed + *

    + * For successful exports, @code error.type @endcode MUST NOT be set. For failed exports, @code + * error.type @endcode must contain the failure cause. For exporters with partial success semantics + * (e.g. OTLP with @code rejected_log_records @endcode), rejected log records must count as failed + * and only non-rejected log records count as success. If no rejection reason is available, @code + * rejected @endcode SHOULD be used as value for @code error.type @endcode.

    counter + */ +static constexpr const char *kMetricOtelSdkExporterLogExported = "otel.sdk.exporter.log.exported"; +static constexpr const char *descrMetricOtelSdkExporterLogExported = + "The number of log records for which the export has finished, either successful or failed"; +static constexpr const char *unitMetricOtelSdkExporterLogExported = "{log_record}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricOtelSdkExporterLogExported(metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricOtelSdkExporterLogExported, + descrMetricOtelSdkExporterLogExported, + unitMetricOtelSdkExporterLogExported); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricOtelSdkExporterLogExported(metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricOtelSdkExporterLogExported, + descrMetricOtelSdkExporterLogExported, + unitMetricOtelSdkExporterLogExported); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricOtelSdkExporterLogExported(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricOtelSdkExporterLogExported, + descrMetricOtelSdkExporterLogExported, + unitMetricOtelSdkExporterLogExported); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricOtelSdkExporterLogExported(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricOtelSdkExporterLogExported, + descrMetricOtelSdkExporterLogExported, + unitMetricOtelSdkExporterLogExported); +} + +/** + * The number of log records which were passed to the exporter, but that have not been exported yet + * (neither successful, nor failed)

    For successful exports, @code error.type @endcode MUST NOT + * be set. For failed exports, @code error.type @endcode must contain the failure cause.

    + * updowncounter + */ +static constexpr const char *kMetricOtelSdkExporterLogInflight = "otel.sdk.exporter.log.inflight"; +static constexpr const char *descrMetricOtelSdkExporterLogInflight = + "The number of log records which were passed to the exporter, but that have not been exported " + "yet (neither successful, nor failed)"; +static constexpr const char *unitMetricOtelSdkExporterLogInflight = "{log_record}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricOtelSdkExporterLogInflight(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricOtelSdkExporterLogInflight, + descrMetricOtelSdkExporterLogInflight, + unitMetricOtelSdkExporterLogInflight); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricOtelSdkExporterLogInflight(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricOtelSdkExporterLogInflight, + descrMetricOtelSdkExporterLogInflight, + unitMetricOtelSdkExporterLogInflight); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricOtelSdkExporterLogInflight(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricOtelSdkExporterLogInflight, + descrMetricOtelSdkExporterLogInflight, + unitMetricOtelSdkExporterLogInflight); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricOtelSdkExporterLogInflight(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricOtelSdkExporterLogInflight, + descrMetricOtelSdkExporterLogInflight, + unitMetricOtelSdkExporterLogInflight); +} + /** * The number of spans for which the export has finished, either successful or failed *

    @@ -112,6 +202,178 @@ CreateAsyncDoubleMetricOtelSdkExporterSpanInflightCount(metrics::Meter *meter) unitMetricOtelSdkExporterSpanInflightCount); } +/** + * The number of logs submitted to enabled SDK Loggers + *

    + * counter + */ +static constexpr const char *kMetricOtelSdkLogCreated = "otel.sdk.log.created"; +static constexpr const char *descrMetricOtelSdkLogCreated = + "The number of logs submitted to enabled SDK Loggers"; +static constexpr const char *unitMetricOtelSdkLogCreated = "{log_record}"; + +static inline nostd::unique_ptr> CreateSyncInt64MetricOtelSdkLogCreated( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricOtelSdkLogCreated, descrMetricOtelSdkLogCreated, + unitMetricOtelSdkLogCreated); +} + +static inline nostd::unique_ptr> CreateSyncDoubleMetricOtelSdkLogCreated( + metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricOtelSdkLogCreated, descrMetricOtelSdkLogCreated, + unitMetricOtelSdkLogCreated); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricOtelSdkLogCreated(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricOtelSdkLogCreated, descrMetricOtelSdkLogCreated, + unitMetricOtelSdkLogCreated); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricOtelSdkLogCreated(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter( + kMetricOtelSdkLogCreated, descrMetricOtelSdkLogCreated, unitMetricOtelSdkLogCreated); +} + +/** + * The number of log records for which the processing has finished, either successful or failed + *

    + * For successful processing, @code error.type @endcode MUST NOT be set. For failed processing, + * @code error.type @endcode must contain the failure cause. For the SDK Simple and Batching Log + * Record Processor a log record is considered to be processed already when it has been submitted to + * the exporter, not when the corresponding export call has finished.

    counter + */ +static constexpr const char *kMetricOtelSdkProcessorLogProcessed = + "otel.sdk.processor.log.processed"; +static constexpr const char *descrMetricOtelSdkProcessorLogProcessed = + "The number of log records for which the processing has finished, either successful or failed"; +static constexpr const char *unitMetricOtelSdkProcessorLogProcessed = "{log_record}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricOtelSdkProcessorLogProcessed(metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricOtelSdkProcessorLogProcessed, + descrMetricOtelSdkProcessorLogProcessed, + unitMetricOtelSdkProcessorLogProcessed); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricOtelSdkProcessorLogProcessed(metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricOtelSdkProcessorLogProcessed, + descrMetricOtelSdkProcessorLogProcessed, + unitMetricOtelSdkProcessorLogProcessed); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricOtelSdkProcessorLogProcessed(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricOtelSdkProcessorLogProcessed, + descrMetricOtelSdkProcessorLogProcessed, + unitMetricOtelSdkProcessorLogProcessed); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricOtelSdkProcessorLogProcessed(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricOtelSdkProcessorLogProcessed, + descrMetricOtelSdkProcessorLogProcessed, + unitMetricOtelSdkProcessorLogProcessed); +} + +/** + * The maximum number of log records the queue of a given instance of an SDK Log Record processor + * can hold

    Only applies to Log Record processors which use a queue, e.g. the SDK Batching Log + * Record Processor.

    updowncounter + */ +static constexpr const char *kMetricOtelSdkProcessorLogQueueCapacity = + "otel.sdk.processor.log.queue.capacity"; +static constexpr const char *descrMetricOtelSdkProcessorLogQueueCapacity = + "The maximum number of log records the queue of a given instance of an SDK Log Record " + "processor can hold"; +static constexpr const char *unitMetricOtelSdkProcessorLogQueueCapacity = "{log_record}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricOtelSdkProcessorLogQueueCapacity(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricOtelSdkProcessorLogQueueCapacity, + descrMetricOtelSdkProcessorLogQueueCapacity, + unitMetricOtelSdkProcessorLogQueueCapacity); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricOtelSdkProcessorLogQueueCapacity(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricOtelSdkProcessorLogQueueCapacity, + descrMetricOtelSdkProcessorLogQueueCapacity, + unitMetricOtelSdkProcessorLogQueueCapacity); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricOtelSdkProcessorLogQueueCapacity(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricOtelSdkProcessorLogQueueCapacity, + descrMetricOtelSdkProcessorLogQueueCapacity, + unitMetricOtelSdkProcessorLogQueueCapacity); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricOtelSdkProcessorLogQueueCapacity(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricOtelSdkProcessorLogQueueCapacity, + descrMetricOtelSdkProcessorLogQueueCapacity, + unitMetricOtelSdkProcessorLogQueueCapacity); +} + +/** + * The number of log records in the queue of a given instance of an SDK log processor + *

    + * Only applies to log record processors which use a queue, e.g. the SDK Batching Log Record + * Processor.

    updowncounter + */ +static constexpr const char *kMetricOtelSdkProcessorLogQueueSize = + "otel.sdk.processor.log.queue.size"; +static constexpr const char *descrMetricOtelSdkProcessorLogQueueSize = + "The number of log records in the queue of a given instance of an SDK log processor"; +static constexpr const char *unitMetricOtelSdkProcessorLogQueueSize = "{log_record}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricOtelSdkProcessorLogQueueSize(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricOtelSdkProcessorLogQueueSize, + descrMetricOtelSdkProcessorLogQueueSize, + unitMetricOtelSdkProcessorLogQueueSize); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricOtelSdkProcessorLogQueueSize(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricOtelSdkProcessorLogQueueSize, + descrMetricOtelSdkProcessorLogQueueSize, + unitMetricOtelSdkProcessorLogQueueSize); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricOtelSdkProcessorLogQueueSize(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricOtelSdkProcessorLogQueueSize, + descrMetricOtelSdkProcessorLogQueueSize, + unitMetricOtelSdkProcessorLogQueueSize); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricOtelSdkProcessorLogQueueSize(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricOtelSdkProcessorLogQueueSize, + descrMetricOtelSdkProcessorLogQueueSize, + unitMetricOtelSdkProcessorLogQueueSize); +} + /** * The number of spans for which the processing has finished, either successful or failed *

    diff --git a/api/include/opentelemetry/semconv/incubating/profile_attributes.h b/api/include/opentelemetry/semconv/incubating/profile_attributes.h index 169434ce79..86e8e744e1 100644 --- a/api/include/opentelemetry/semconv/incubating/profile_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/profile_attributes.h @@ -42,10 +42,12 @@ static constexpr const char *kJvm = "jvm"; static constexpr const char *kKernel = "kernel"; /** - * C, C, C++, Go, Rust + * href="https://wikipedia.org/wiki/Go_(programming_language)">Go or Rust. If possible, a more + * precise value MUST be used. */ static constexpr const char *kNative = "native"; @@ -79,6 +81,16 @@ static constexpr const char *kV8js = "v8js"; */ static constexpr const char *kBeam = "beam"; +/** + * Go, + */ +static constexpr const char *kGo = "go"; + +/** + * Rust + */ +static constexpr const char *kRust = "rust"; + } // namespace ProfileFrameTypeValues } // namespace profile diff --git a/api/include/opentelemetry/semconv/incubating/vcs_attributes.h b/api/include/opentelemetry/semconv/incubating/vcs_attributes.h index 858479931a..60bab006af 100644 --- a/api/include/opentelemetry/semconv/incubating/vcs_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/vcs_attributes.h @@ -41,6 +41,16 @@ static constexpr const char *kVcsChangeTitle = "vcs.change.title"; */ static constexpr const char *kVcsLineChangeType = "vcs.line_change.type"; +/** + * The group owner within the version control system. + */ +static constexpr const char *kVcsOwnerName = "vcs.owner.name"; + +/** + * The name of the version control system provider. + */ +static constexpr const char *kVcsProviderName = "vcs.provider.name"; + /** * The name of the reference such as * branch or tag in the repository.

    @@ -228,6 +238,30 @@ static constexpr const char *kRemoved = "removed"; } // namespace VcsLineChangeTypeValues +namespace VcsProviderNameValues +{ +/** + * GitHub + */ +static constexpr const char *kGithub = "github"; + +/** + * GitLab + */ +static constexpr const char *kGitlab = "gitlab"; + +/** + * Gitea + */ +static constexpr const char *kGittea = "gittea"; + +/** + * Bitbucket + */ +static constexpr const char *kBitbucket = "bitbucket"; + +} // namespace VcsProviderNameValues + namespace VcsRefBaseTypeValues { /** diff --git a/api/include/opentelemetry/semconv/schema_url.h b/api/include/opentelemetry/semconv/schema_url.h index 34902e0416..2f3810796e 100644 --- a/api/include/opentelemetry/semconv/schema_url.h +++ b/api/include/opentelemetry/semconv/schema_url.h @@ -19,6 +19,6 @@ namespace semconv /** * The URL of the OpenTelemetry schema for these keys and values. */ -static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.31.0"; +static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.32.0"; } // namespace semconv OPENTELEMETRY_END_NAMESPACE diff --git a/buildscripts/semantic-convention/generate.sh b/buildscripts/semantic-convention/generate.sh index 061b5f9b74..fc04a11f55 100755 --- a/buildscripts/semantic-convention/generate.sh +++ b/buildscripts/semantic-convention/generate.sh @@ -16,7 +16,7 @@ ROOT_DIR="${SCRIPT_DIR}/../../" # freeze the spec & generator tools versions to make the generation reproducible # repository: https://github.com/open-telemetry/semantic-conventions -SEMCONV_VERSION=1.31.0 +SEMCONV_VERSION=1.32.0 # repository: https://github.com/open-telemetry/weaver WEAVER_VERSION=0.13.2