diff --git a/opentelemetry-semantic-conventions/scripts/generate-consts-from-spec.sh b/opentelemetry-semantic-conventions/scripts/generate-consts-from-spec.sh index e96f45f1ce..19256366ef 100755 --- a/opentelemetry-semantic-conventions/scripts/generate-consts-from-spec.sh +++ b/opentelemetry-semantic-conventions/scripts/generate-consts-from-spec.sh @@ -5,8 +5,8 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" CRATE_DIR="${SCRIPT_DIR}/../" # freeze the spec version and generator version to make generation reproducible -SPEC_VERSION=v1.3.0 -SEMCOVGEN_VERSION=0.3.1 +SPEC_VERSION=v1.4.0 +SEMCOVGEN_VERSION=0.4.0 cd "$CRATE_DIR" diff --git a/opentelemetry-semantic-conventions/src/resource.rs b/opentelemetry-semantic-conventions/src/resource.rs index e2bec59309..3db2670544 100644 --- a/opentelemetry-semantic-conventions/src/resource.rs +++ b/opentelemetry-semantic-conventions/src/resource.rs @@ -201,6 +201,35 @@ pub const CONTAINER_IMAGE_TAG: Key = Key::from_static_str("container.image.tag") /// - production pub const DEPLOYMENT_ENVIRONMENT: Key = Key::from_static_str("deployment.environment"); +/// 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](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). 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](https://developer.android.com/training/articles/user-data-ids) 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. +/// +/// # Examples +/// +/// - 2ab2916d-a51f-4ac8-80ee-45ac31a28092 +pub const DEVICE_ID: Key = Key::from_static_str("device.id"); + +/// 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. +/// +/// # Examples +/// +/// - iPhone3,4 +/// - SM-G920F +pub const DEVICE_MODEL_IDENTIFIER: Key = Key::from_static_str("device.model.identifier"); + +/// 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. +/// +/// # Examples +/// +/// - iPhone 6s Plus +/// - Samsung Galaxy S6 +pub const DEVICE_MODEL_NAME: Key = Key::from_static_str("device.model.name"); + /// The name of the function being executed. /// /// # Examples @@ -430,6 +459,23 @@ pub const OS_TYPE: Key = Key::from_static_str("os.type"); /// - Ubuntu 18.04.1 LTS pub const OS_DESCRIPTION: Key = Key::from_static_str("os.description"); +/// Human readable operating system name. +/// +/// # Examples +/// +/// - iOS +/// - Android +/// - Ubuntu +pub const OS_NAME: Key = Key::from_static_str("os.name"); + +/// The version string of the operating system as defined in [Version Attributes](../../resource/semantic_conventions/README.md#version-attributes). +/// +/// # Examples +/// +/// - 14.2.1 +/// - 18.04.1 +pub const OS_VERSION: Key = Key::from_static_str("os.version"); + /// Process identifier (PID). /// /// # Examples diff --git a/opentelemetry-semantic-conventions/src/trace.rs b/opentelemetry-semantic-conventions/src/trace.rs index 20f08ea424..2542200aa9 100644 --- a/opentelemetry-semantic-conventions/src/trace.rs +++ b/opentelemetry-semantic-conventions/src/trace.rs @@ -861,3 +861,44 @@ pub const MESSAGING_KAFKA_TOMBSTONE: Key = Key::from_static_str("messaging.kafka /// - 1 /// - 16 pub const RPC_GRPC_STATUS_CODE: Key = Key::from_static_str("rpc.grpc.status_code"); + +/// Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 does not specify this, the value can be omitted. +/// +/// # Examples +/// +/// - 2.0 +/// - 1.0 +pub const RPC_JSONRPC_VERSION: Key = Key::from_static_str("rpc.jsonrpc.version"); + +/// `method` property from request. Unlike `rpc.method`, this may not relate to the actual method being called. Useful for client-side traces since client does not know what will be called on the server. +/// +/// # Examples +/// +/// - users.create +/// - get_users +pub const RPC_JSONRPC_METHOD: Key = Key::from_static_str("rpc.jsonrpc.method"); + +/// `id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification. +/// +/// # Examples +/// +/// - 10 +/// - request-7 +/// - +pub const RPC_JSONRPC_REQUEST_ID: Key = Key::from_static_str("rpc.jsonrpc.request_id"); + +/// `error.code` property of response if it is an error response. +/// +/// # Examples +/// +/// - -32700 +/// - 100 +pub const RPC_JSONRPC_ERROR_CODE: Key = Key::from_static_str("rpc.jsonrpc.error_code"); + +/// `error.message` property of response if it is an error response. +/// +/// # Examples +/// +/// - Parse error +/// - User already exists +pub const RPC_JSONRPC_ERROR_MESSAGE: Key = Key::from_static_str("rpc.jsonrpc.error_message");