Skip to content

Commit

Permalink
semantic-conventions: update to v1.4.0 spec (#570)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtescher authored Jun 10, 2021
1 parent d70a537 commit efbc842
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
46 changes: 46 additions & 0 deletions opentelemetry-semantic-conventions/src/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
41 changes: 41 additions & 0 deletions opentelemetry-semantic-conventions/src/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");

0 comments on commit efbc842

Please sign in to comment.