From 3ac1e18fdba9705e2197b6e715c36f0284291047 Mon Sep 17 00:00:00 2001 From: Alexandra Konrad <10500694+trisch-me@users.noreply.github.com> Date: Mon, 8 Apr 2024 10:18:52 +0200 Subject: [PATCH 01/14] [chore] move aws lambda and sdk to registry (#893) Co-authored-by: Joao Grassi <5938087+joaopgrassi@users.noreply.github.com> --- docs/attributes-registry/aws.md | 77 ++++++++++++++++ docs/cloud-providers/aws-sdk.md | 2 +- docs/faas/aws-lambda.md | 2 +- docs/object-stores/s3.md | 12 +-- model/registry/aws.yaml | 116 ++++++++++++++++++++++++ model/trace/aws/lambda.yaml | 11 +-- model/trace/instrumentation/aws-sdk.yml | 104 +++------------------ 7 files changed, 217 insertions(+), 107 deletions(-) diff --git a/docs/attributes-registry/aws.md b/docs/attributes-registry/aws.md index b6fa59ac40..824b0f95ff 100644 --- a/docs/attributes-registry/aws.md +++ b/docs/attributes-registry/aws.md @@ -2,13 +2,23 @@ +- [AWS Generic Attributes](#aws-generic-attributes) - [AWS DynamoDB Attributes](#aws-dynamodb-attributes) - [AWS ECS Attributes](#aws-ecs-attributes) - [AWS EKS Attributes](#aws-eks-attributes) +- [AWS Lambda Attributes](#aws-lambda-attributes) - [AWS Logs Attributes](#aws-logs-attributes) +- [AWS S3 Attributes](#aws-s3-attributes) +## AWS Generic Attributes + +| Attribute | Type | Description | Examples | Stability | +|---|---|---|---|---| +| `aws.request_id` | string | The AWS request ID as returned in the response headers `x-amz-request-id` or `x-amz-requestid`. | `79b9da39-b7ae-508a-a6bc-864b2829c622`; `C9ER4AJX75574TDJ` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + + ## AWS DynamoDB Attributes | Attribute | Type | Description | Examples | Stability | @@ -64,6 +74,15 @@ | `aws.eks.cluster.arn` | string | The ARN of an EKS cluster. | `arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +## AWS Lambda Attributes + +| Attribute | Type | Description | Examples | Stability | +|---|---|---|---|---| +| `aws.lambda.invoked_arn` | string | The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable). [1] | `arn:aws:lambda:us-east-1:123456:function:myfunction:myalias` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[1]:** This may be different from `cloud.resource_id` if an alias is involved. + + ## AWS Logs Attributes | Attribute | Type | Description | Examples | Stability | @@ -78,4 +97,62 @@ **[2]:** 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. **[3]:** See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream. + + +## AWS S3 Attributes + +| Attribute | Type | Description | Examples | Stability | +|---|---|---|---|---| +| `aws.s3.bucket` | string | The S3 bucket name the request refers to. Corresponds to the `--bucket` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. [1] | `some-bucket-name` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `aws.s3.copy_source` | string | The source object (in the form `bucket`/`key`) for the copy operation. [2] | `someFile.yml` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `aws.s3.delete` | string | The delete request container that specifies the objects to be deleted. [3] | `Objects=[{Key=string,VersionId=string},{Key=string,VersionId=string}],Quiet=boolean` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `aws.s3.key` | string | The S3 object key the request refers to. Corresponds to the `--key` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. [4] | `someFile.yml` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `aws.s3.part_number` | int | The part number of the part being uploaded in a multipart-upload operation. This is a positive integer between 1 and 10,000. [5] | `3456` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `aws.s3.upload_id` | string | Upload ID that identifies the multipart upload. [6] | `dfRtDYWFbkRONycy.Yxwh66Yjlx.cph0gtNBtJ` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[1]:** The `bucket` 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 `list-buckets`. + +**[2]:** The `copy_source` attribute applies to S3 copy operations and corresponds to the `--copy-source` parameter +of the [copy-object operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html). +This applies in particular to the following operations: + +- [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) +- [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) + +**[3]:** The `delete` attribute is only applicable to the [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) operation. +The `delete` attribute corresponds to the `--delete` parameter of the +[delete-objects operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html). + +**[4]:** The `key` 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](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) +- [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) +- [get-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/get-object.html) +- [head-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/head-object.html) +- [put-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object.html) +- [restore-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/restore-object.html) +- [select-object-content](https://docs.aws.amazon.com/cli/latest/reference/s3api/select-object-content.html) +- [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html) +- [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html) +- [create-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/create-multipart-upload.html) +- [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) +- [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) +- [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) + +**[5]:** The `part_number` attribute is only applicable to the [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) +and [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) operations. +The `part_number` attribute corresponds to the `--part-number` parameter of the +[upload-part operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html). + +**[6]:** The `upload_id` attribute applies to S3 multipart-upload operations and corresponds to the `--upload-id` parameter +of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) multipart operations. +This applies in particular to the following operations: + +- [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html) +- [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html) +- [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) +- [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) +- [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) \ No newline at end of file diff --git a/docs/cloud-providers/aws-sdk.md b/docs/cloud-providers/aws-sdk.md index 3ebbf26a9b..487ae23a9b 100644 --- a/docs/cloud-providers/aws-sdk.md +++ b/docs/cloud-providers/aws-sdk.md @@ -28,7 +28,7 @@ with the naming guidelines for RPC client spans. | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`rpc.system`](../attributes-registry/rpc.md) | string | The value `aws-api`. | `aws-api` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `aws.request_id` | string | The AWS request ID as returned in the response headers `x-amz-request-id` or `x-amz-requestid`. | `79b9da39-b7ae-508a-a6bc-864b2829c622`; `C9ER4AJX75574TDJ` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`aws.request_id`](../attributes-registry/aws.md) | string | The AWS request ID as returned in the response headers `x-amz-request-id` or `x-amz-requestid`. | `79b9da39-b7ae-508a-a6bc-864b2829c622`; `C9ER4AJX75574TDJ` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`rpc.method`](../attributes-registry/rpc.md) | string | The name of the operation corresponding to the request, as returned by the AWS SDK [1] | `GetItem`; `PutItem` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`rpc.service`](../attributes-registry/rpc.md) | string | The name of the service to which a request is made, as returned by the AWS SDK. [2] | `DynamoDB`; `S3` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | diff --git a/docs/faas/aws-lambda.md b/docs/faas/aws-lambda.md index 82c0a4c332..273eb71eeb 100644 --- a/docs/faas/aws-lambda.md +++ b/docs/faas/aws-lambda.md @@ -47,7 +47,7 @@ and the [cloud resource conventions][cloud]. The following AWS Lambda-specific a | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| -| `aws.lambda.invoked_arn` | string | The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable). [1] | `arn:aws:lambda:us-east-1:123456:function:myfunction:myalias` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`aws.lambda.invoked_arn`](../attributes-registry/aws.md) | string | The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable). [1] | `arn:aws:lambda:us-east-1:123456:function:myfunction:myalias` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** This may be different from `cloud.resource_id` if an alias is involved. diff --git a/docs/object-stores/s3.md b/docs/object-stores/s3.md index cde1a48f32..3ac6a0ab8f 100644 --- a/docs/object-stores/s3.md +++ b/docs/object-stores/s3.md @@ -14,12 +14,12 @@ described on this page. | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| -| `aws.s3.bucket` | string | The S3 bucket name the request refers to. Corresponds to the `--bucket` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. [1] | `some-bucket-name` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `aws.s3.copy_source` | string | The source object (in the form `bucket`/`key`) for the copy operation. [2] | `someFile.yml` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `aws.s3.delete` | string | The delete request container that specifies the objects to be deleted. [3] | `Objects=[{Key=string,VersionId=string},{Key=string,VersionId=string}],Quiet=boolean` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `aws.s3.key` | string | The S3 object key the request refers to. Corresponds to the `--key` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. [4] | `someFile.yml` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `aws.s3.part_number` | int | The part number of the part being uploaded in a multipart-upload operation. This is a positive integer between 1 and 10,000. [5] | `3456` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `aws.s3.upload_id` | string | Upload ID that identifies the multipart upload. [6] | `dfRtDYWFbkRONycy.Yxwh66Yjlx.cph0gtNBtJ` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`aws.s3.bucket`](../attributes-registry/aws.md) | string | The S3 bucket name the request refers to. Corresponds to the `--bucket` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. [1] | `some-bucket-name` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`aws.s3.copy_source`](../attributes-registry/aws.md) | string | The source object (in the form `bucket`/`key`) for the copy operation. [2] | `someFile.yml` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`aws.s3.delete`](../attributes-registry/aws.md) | string | The delete request container that specifies the objects to be deleted. [3] | `Objects=[{Key=string,VersionId=string},{Key=string,VersionId=string}],Quiet=boolean` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`aws.s3.key`](../attributes-registry/aws.md) | string | The S3 object key the request refers to. Corresponds to the `--key` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. [4] | `someFile.yml` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`aws.s3.part_number`](../attributes-registry/aws.md) | int | The part number of the part being uploaded in a multipart-upload operation. This is a positive integer between 1 and 10,000. [5] | `3456` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`aws.s3.upload_id`](../attributes-registry/aws.md) | string | Upload ID that identifies the multipart upload. [6] | `dfRtDYWFbkRONycy.Yxwh66Yjlx.cph0gtNBtJ` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** The `bucket` 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 `list-buckets`. diff --git a/model/registry/aws.yaml b/model/registry/aws.yaml index 149d82ad7f..6214375852 100644 --- a/model/registry/aws.yaml +++ b/model/registry/aws.yaml @@ -1,4 +1,17 @@ groups: + - id: registry.aws + prefix: aws + type: attribute_group + brief: > + This document defines generic attributes for AWS services. + attributes: + - id: request_id + type: string + stability: experimental + brief: "The AWS request ID as returned in the response headers `x-amz-request-id` or `x-amz-requestid`." + examples: + - 79b9da39-b7ae-508a-a6bc-864b2829c622 + - C9ER4AJX75574TDJ - id: registry.aws.dynamodb prefix: aws.dynamodb type: attribute_group @@ -354,3 +367,106 @@ groups: [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream. + + - id: registry.aws.lambda + prefix: aws.lambda + type: attribute_group + brief: > + This document defines attributes for AWS Lambda. + attributes: + - id: invoked_arn + type: string + stability: experimental + brief: > + The full invoked ARN as provided on the `Context` passed to the function + (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable). + note: This may be different from `cloud.resource_id` if an alias is involved. + examples: ['arn:aws:lambda:us-east-1:123456:function:myfunction:myalias'] + - id: registry.aws.s3 + prefix: aws.s3 + type: attribute_group + brief: > + This document defines attributes for AWS S3. + attributes: + - id: bucket + type: string + stability: experimental + brief: "The S3 bucket name the request refers to. Corresponds to the `--bucket` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations." + examples: + - some-bucket-name + note: | + The `bucket` 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 `list-buckets`. + - id: key + type: string + stability: experimental + brief: "The S3 object key the request refers to. Corresponds to the `--key` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations." + examples: + - someFile.yml + note: | + The `key` 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](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) + - [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) + - [get-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/get-object.html) + - [head-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/head-object.html) + - [put-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object.html) + - [restore-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/restore-object.html) + - [select-object-content](https://docs.aws.amazon.com/cli/latest/reference/s3api/select-object-content.html) + - [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html) + - [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html) + - [create-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/create-multipart-upload.html) + - [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) + - [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) + - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) + - id: copy_source + type: string + stability: experimental + brief: "The source object (in the form `bucket`/`key`) for the copy operation." + examples: + - someFile.yml + note: | + The `copy_source` attribute applies to S3 copy operations and corresponds to the `--copy-source` parameter + of the [copy-object operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html). + This applies in particular to the following operations: + + - [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) + - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) + - id: upload_id + type: string + stability: experimental + brief: "Upload ID that identifies the multipart upload." + examples: + - 'dfRtDYWFbkRONycy.Yxwh66Yjlx.cph0gtNBtJ' + note: | + The `upload_id` attribute applies to S3 multipart-upload operations and corresponds to the `--upload-id` parameter + of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) multipart operations. + This applies in particular to the following operations: + + - [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html) + - [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html) + - [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) + - [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) + - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) + - id: delete + type: string + stability: experimental + brief: "The delete request container that specifies the objects to be deleted." + examples: + - 'Objects=[{Key=string,VersionId=string},{Key=string,VersionId=string}],Quiet=boolean' + note: | + The `delete` attribute is only applicable to the [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) operation. + The `delete` attribute corresponds to the `--delete` parameter of the + [delete-objects operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html). + - id: part_number + type: int + stability: experimental + brief: "The part number of the part being uploaded in a multipart-upload operation. This is a positive integer between 1 and 10,000." + examples: + - 3456 + note: | + The `part_number` attribute is only applicable to the [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) + and [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) operations. + The `part_number` attribute corresponds to the `--part-number` parameter of the + [upload-part operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html). diff --git a/model/trace/aws/lambda.yaml b/model/trace/aws/lambda.yaml index 795736f5ed..41943ab8cb 100644 --- a/model/trace/aws/lambda.yaml +++ b/model/trace/aws/lambda.yaml @@ -1,15 +1,8 @@ groups: - id: aws.lambda - prefix: aws.lambda type: span brief: > Span attributes used by AWS Lambda (in addition to general `faas` attributes). attributes: - - id: invoked_arn - type: string - stability: experimental - brief: > - The full invoked ARN as provided on the `Context` passed to the function - (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable). - note: This may be different from `cloud.resource_id` if an alias is involved. - examples: ['arn:aws:lambda:us-east-1:123456:function:myfunction:myalias'] + - ref: aws.lambda.invoked_arn + requirement_level: recommended diff --git a/model/trace/instrumentation/aws-sdk.yml b/model/trace/instrumentation/aws-sdk.yml index 6b6f541544..216f8d1f7f 100644 --- a/model/trace/instrumentation/aws-sdk.yml +++ b/model/trace/instrumentation/aws-sdk.yml @@ -26,13 +26,8 @@ groups: examples: - GetItem - PutItem - - id: request_id - type: string - stability: experimental - brief: "The AWS request ID as returned in the response headers `x-amz-request-id` or `x-amz-requestid`." - examples: - - 79b9da39-b7ae-508a-a6bc-864b2829c622 - - C9ER4AJX75574TDJ + - ref: aws.request_id + requirement_level: recommended - id: dynamodb.all type: span @@ -298,89 +293,18 @@ groups: - id: aws.s3 extends: aws - prefix: aws.s3 type: span brief: "Attributes that exist for S3 request types." attributes: - - id: bucket - type: string - stability: experimental - brief: "The S3 bucket name the request refers to. Corresponds to the `--bucket` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations." - examples: - - some-bucket-name - note: | - The `bucket` 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 `list-buckets`. - - id: key - type: string - stability: experimental - brief: "The S3 object key the request refers to. Corresponds to the `--key` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations." - examples: - - someFile.yml - note: | - The `key` 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](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) - - [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) - - [get-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/get-object.html) - - [head-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/head-object.html) - - [put-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object.html) - - [restore-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/restore-object.html) - - [select-object-content](https://docs.aws.amazon.com/cli/latest/reference/s3api/select-object-content.html) - - [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html) - - [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html) - - [create-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/create-multipart-upload.html) - - [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) - - [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) - - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) - - id: copy_source - type: string - stability: experimental - brief: "The source object (in the form `bucket`/`key`) for the copy operation." - examples: - - someFile.yml - note: | - The `copy_source` attribute applies to S3 copy operations and corresponds to the `--copy-source` parameter - of the [copy-object operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html). - This applies in particular to the following operations: - - - [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) - - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) - - id: upload_id - type: string - stability: experimental - brief: "Upload ID that identifies the multipart upload." - examples: - - 'dfRtDYWFbkRONycy.Yxwh66Yjlx.cph0gtNBtJ' - note: | - The `upload_id` attribute applies to S3 multipart-upload operations and corresponds to the `--upload-id` parameter - of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) multipart operations. - This applies in particular to the following operations: - - - [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html) - - [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html) - - [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) - - [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) - - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) - - id: delete - type: string - stability: experimental - brief: "The delete request container that specifies the objects to be deleted." - examples: - - 'Objects=[{Key=string,VersionId=string},{Key=string,VersionId=string}],Quiet=boolean' - note: | - The `delete` attribute is only applicable to the [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) operation. - The `delete` attribute corresponds to the `--delete` parameter of the - [delete-objects operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html). - - id: part_number - type: int - stability: experimental - brief: "The part number of the part being uploaded in a multipart-upload operation. This is a positive integer between 1 and 10,000." - examples: - - 3456 - note: | - The `part_number` attribute is only applicable to the [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) - and [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) operations. - The `part_number` attribute corresponds to the `--part-number` parameter of the - [upload-part operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html). + - ref: aws.s3.bucket + requirement_level: recommended + - ref: aws.s3.key + requirement_level: recommended + - ref: aws.s3.copy_source + requirement_level: recommended + - ref: aws.s3.upload_id + requirement_level: recommended + - ref: aws.s3.delete + requirement_level: recommended + - ref: aws.s3.part_number + requirement_level: recommended From 2023cbdaa6f6f7726e5abc911e21cf05d65cf91d Mon Sep 17 00:00:00 2001 From: Alexander Wert Date: Mon, 8 Apr 2024 15:56:34 +0200 Subject: [PATCH 02/14] Adjust readme for the registry to include stability level. (#902) Signed-off-by: Alexander Wert --- docs/attributes-registry/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/attributes-registry/README.md b/docs/attributes-registry/README.md index 4d87791234..b69c63fefa 100644 --- a/docs/attributes-registry/README.md +++ b/docs/attributes-registry/README.md @@ -9,6 +9,7 @@ The attributes registry is the place where attributes are defined. An attribute - the `id` (the fully qualified name) of the attribute - the `type` of the attribute +- the `stability` of the attribute - a `brief` description of the attribute and optionally a longer `note` - example values From 0d2f7deb5c7069ed283128a76f3fa7e575935e45 Mon Sep 17 00:00:00 2001 From: Alexandra Konrad <10500694+trisch-me@users.noreply.github.com> Date: Mon, 8 Apr 2024 16:48:15 +0200 Subject: [PATCH 03/14] [chore] change prefix for deprecated attributes (#898) --- docs/attributes-registry/container.md | 15 ++++++++++++++ docs/attributes-registry/db.md | 14 +------------ docs/attributes-registry/http.md | 9 ++++++++- docs/attributes-registry/k8s.md | 17 +++++++++++++++- docs/attributes-registry/messaging.md | 2 +- docs/attributes-registry/network.md | 9 ++++++++- docs/attributes-registry/otel.md | 18 ++++++++++++++++- docs/attributes-registry/rpc.md | 25 ++++++++++++++++++++++++ model/registry/deprecated/container.yaml | 2 +- model/registry/deprecated/db.yaml | 2 +- model/registry/deprecated/http.yaml | 2 +- model/registry/deprecated/k8s.yaml | 2 +- model/registry/deprecated/messaging.yaml | 2 +- model/registry/deprecated/network.yaml | 2 +- model/registry/deprecated/otel.yaml | 7 +++---- model/registry/deprecated/rpc.yaml | 2 +- model/registry/deprecated/system.yaml | 2 +- 17 files changed, 102 insertions(+), 30 deletions(-) diff --git a/docs/attributes-registry/container.md b/docs/attributes-registry/container.md index b8b37373c6..d3d41467db 100644 --- a/docs/attributes-registry/container.md +++ b/docs/attributes-registry/container.md @@ -3,6 +3,13 @@ # Container + + +- [Container Attributes](#container-attributes) +- [Deprecated Container Attributes](#deprecated-container-attributes) + + + ## Container Attributes @@ -37,3 +44,11 @@ The ID is assinged by the container runtime and can vary in different environmen | `system` | When CPU is used by the system (host OS) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `kernel` | When tasks of the cgroup are in kernel mode (Linux). When all container processes are in kernel mode (Windows). | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +## Deprecated Container Attributes + + +| Attribute | Type | Description | Examples | Stability | +|---|---|---|---|---| +| `container.labels.` | string | Deprecated, use `container.label` instead. | `container.label.app=nginx` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `container.label`. | + diff --git a/docs/attributes-registry/db.md b/docs/attributes-registry/db.md index e60c2d3741..7ed3b02f92 100644 --- a/docs/attributes-registry/db.md +++ b/docs/attributes-registry/db.md @@ -14,7 +14,6 @@ - [Redis Attributes](#redis-attributes) - [SQL Attributes](#sql-attributes) - [Deprecated DB Attributes](#deprecated-db-attributes) - - [Deprecated Elasticsearch Attributes](#deprecated-elasticsearch-attributes) @@ -213,18 +212,7 @@ ## Deprecated DB Attributes - -| Attribute | Type | Description | Examples | Stability | -|---|---|---|---|---| -| `db.connection_string` | string | Deprecated, use `server.address`, `server.port` attributes instead. | `Server=(localdb)\v11.0;Integrated Security=true;` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
"Replaced by `server.address` and `server.port`." | -| `db.elasticsearch.node.name` | string | Deprecated, use `db.instance.id` instead. | `instance-0000000001` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.instance.id`. | -| `db.jdbc.driver_classname` | string | Removed, no replacement at this time. | `org.postgresql.Driver`; `com.microsoft.sqlserver.jdbc.SQLServerDriver` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed as not used. | -| `db.operation` | string | Deprecated, use `db.operation.name` instead. | `findAndModify`; `HMSET`; `SELECT` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.operation.name`. | - - -### Deprecated Elasticsearch Attributes - - + | Attribute | Type | Description | Examples | Stability | |---|---|---|---|---| | `db.connection_string` | string | Deprecated, use `server.address`, `server.port` attributes instead. | `Server=(localdb)\v11.0;Integrated Security=true;` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
"Replaced by `server.address` and `server.port`." | diff --git a/docs/attributes-registry/http.md b/docs/attributes-registry/http.md index e25443590d..c3d92a7b33 100644 --- a/docs/attributes-registry/http.md +++ b/docs/attributes-registry/http.md @@ -3,6 +3,13 @@ # HTTP + + +- [HTTP Attributes](#http-attributes) +- [Deprecated HTTP Attributes](#deprecated-http-attributes) + + + ## HTTP Attributes @@ -74,7 +81,7 @@ SHOULD include the [application root](/docs/http/http-spans.md#http-server-defin ## Deprecated HTTP Attributes - + | Attribute | Type | Description | Examples | Stability | |---|---|---|---|---| | `http.flavor` | string | Deprecated, use `network.protocol.name` instead. | `1.0` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `network.protocol.name`. | diff --git a/docs/attributes-registry/k8s.md b/docs/attributes-registry/k8s.md index ea7c55d6fc..d60f610782 100644 --- a/docs/attributes-registry/k8s.md +++ b/docs/attributes-registry/k8s.md @@ -1,6 +1,13 @@ # Kubernetes -## Kubernetes Resource Attributes + + +- [Kubernetes Attributes](#kubernetes-attributes) +- [Deprecated Kubernetes Attributes](#deprecated-kubernetes-attributes) + + + +## Kubernetes Attributes | Attribute | Type | Description | Examples | Stability | @@ -52,3 +59,11 @@ Which states: Therefore, UIDs between clusters should be extremely unlikely to conflict. + +## Deprecated Kubernetes Attributes + + +| Attribute | Type | Description | Examples | Stability | +|---|---|---|---|---| +| `k8s.pod.labels.` | string | Deprecated, use `k8s.pod.label` instead. | `k8s.pod.label.app=my-app` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `k8s.pod.label`. | + \ No newline at end of file diff --git a/docs/attributes-registry/messaging.md b/docs/attributes-registry/messaging.md index 3e713cdd5a..ba7f61aec3 100644 --- a/docs/attributes-registry/messaging.md +++ b/docs/attributes-registry/messaging.md @@ -174,7 +174,7 @@ size should be used. ## Deprecated Messaging Attributes - + | Attribute | Type | Description | Examples | Stability | |---|---|---|---|---| | `messaging.kafka.destination.partition` | int | "Deprecated, use `messaging.destination.partition.id` instead." | `2` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `messaging.destination.partition.id`. | diff --git a/docs/attributes-registry/network.md b/docs/attributes-registry/network.md index 497a575c31..48dabc6512 100644 --- a/docs/attributes-registry/network.md +++ b/docs/attributes-registry/network.md @@ -5,6 +5,13 @@ These attributes may be used for any network related operation. + + +- [Network Attributes](#network-attributes) +- [Deprecated Network Attributes](#deprecated-network-attributes) + + + ## Network Attributes @@ -100,7 +107,7 @@ different processes could be listening on TCP port 12345 and UDP port 12345. ## Deprecated Network Attributes - + | Attribute | Type | Description | Examples | Stability | |---|---|---|---|---| | `net.host.name` | string | Deprecated, use `server.address`. | `example.com` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `server.address`. | diff --git a/docs/attributes-registry/otel.md b/docs/attributes-registry/otel.md index 730ef8a14c..92c94105c5 100644 --- a/docs/attributes-registry/otel.md +++ b/docs/attributes-registry/otel.md @@ -3,7 +3,14 @@ # OpenTelemetry -## Scope Attributes + + +- [OpenTelemetry Attributes](#opentelemetry-attributes) +- [Deprecated OpenTelemetry Attributes](#deprecated-opentelemetry-attributes) + + + +## OpenTelemetry Attributes | Attribute | Type | Description | Examples | Stability | @@ -11,3 +18,12 @@ | `otel.scope.name` | string | The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). | `io.opentelemetry.contrib.mongodb` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `otel.scope.version` | string | The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). | `1.0.0` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | + +## Deprecated OpenTelemetry Attributes + + +| Attribute | Type | Description | Examples | Stability | +|---|---|---|---|---| +| `otel.library.name` | string | None | `io.opentelemetry.contrib.mongodb` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
use the `otel.scope.name` attribute. | +| `otel.library.version` | string | None | `1.0.0` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
use the `otel.scope.version` attribute. | + \ No newline at end of file diff --git a/docs/attributes-registry/rpc.md b/docs/attributes-registry/rpc.md index 25f7a29087..f8d8e67844 100644 --- a/docs/attributes-registry/rpc.md +++ b/docs/attributes-registry/rpc.md @@ -3,6 +3,13 @@ # RPC + + +- [RPC Attributes](#rpc-attributes) +- [Deprecated RPC Attributes](#deprecated-rpc-attributes) + + + ## RPC Attributes RPC attributes are intended to be used in the context of events related to remote procedure calls (RPC). @@ -102,3 +109,21 @@ RPC attributes are intended to be used in the context of events related to remot | `apache_dubbo` | Apache Dubbo | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `connect_rpc` | Connect RPC | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +## Deprecated RPC Attributes + + +| Attribute | Type | Description | Examples | Stability | +|---|---|---|---|---| +| `message.compressed_size` | int | Deprecated, use `rpc.message.compressed_size` instead. | | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `rpc.message.compressed_size`. | +| `message.id` | int | Deprecated, use `rpc.message.id` instead. | | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `rpc.message.id`. | +| `message.type` | string | Deprecated, use `rpc.message.type` instead. | `SENT` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `rpc.message.type`. | +| `message.uncompressed_size` | int | Deprecated, use `rpc.message.uncompressed_size` instead. | | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `rpc.message.uncompressed_size`. | + +`message.type` MUST be one of the following: + +| Value | Description | Stability | +|---|---|---| +| `SENT` | sent | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `RECEIVED` | received | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + \ No newline at end of file diff --git a/model/registry/deprecated/container.yaml b/model/registry/deprecated/container.yaml index 49190f6918..77f3466f02 100644 --- a/model/registry/deprecated/container.yaml +++ b/model/registry/deprecated/container.yaml @@ -1,5 +1,5 @@ groups: - - id: attributes.container.deprecated + - id: registry.container.deprecated type: attribute_group brief: "Describes deprecated container attributes." attributes: diff --git a/model/registry/deprecated/db.yaml b/model/registry/deprecated/db.yaml index 3d384948c9..2adef825d3 100644 --- a/model/registry/deprecated/db.yaml +++ b/model/registry/deprecated/db.yaml @@ -1,5 +1,5 @@ groups: - - id: attributes.db.deprecated + - id: registry.db.deprecated prefix: db type: attribute_group brief: > diff --git a/model/registry/deprecated/http.yaml b/model/registry/deprecated/http.yaml index 746d8f1db4..4eaaa6ce19 100644 --- a/model/registry/deprecated/http.yaml +++ b/model/registry/deprecated/http.yaml @@ -1,5 +1,5 @@ groups: - - id: attributes.http.deprecated + - id: registry.http.deprecated type: attribute_group brief: "Describes deprecated HTTP attributes." prefix: http diff --git a/model/registry/deprecated/k8s.yaml b/model/registry/deprecated/k8s.yaml index ae471dd896..e2785dd08e 100644 --- a/model/registry/deprecated/k8s.yaml +++ b/model/registry/deprecated/k8s.yaml @@ -1,5 +1,5 @@ groups: - - id: attributes.k8s.deprecated + - id: registry.k8s.deprecated type: attribute_group brief: "Describes deprecated k8s attributes." attributes: diff --git a/model/registry/deprecated/messaging.yaml b/model/registry/deprecated/messaging.yaml index 97da3c55bb..a2675c7c47 100644 --- a/model/registry/deprecated/messaging.yaml +++ b/model/registry/deprecated/messaging.yaml @@ -1,5 +1,5 @@ groups: - - id: attributes.messaging.deprecated + - id: registry.messaging.deprecated type: attribute_group brief: "Describes deprecated messaging attributes." attributes: diff --git a/model/registry/deprecated/network.yaml b/model/registry/deprecated/network.yaml index 8377f727e6..6614467174 100644 --- a/model/registry/deprecated/network.yaml +++ b/model/registry/deprecated/network.yaml @@ -1,5 +1,5 @@ groups: - - id: attributes.network.deprecated + - id: registry.network.deprecated prefix: net type: attribute_group brief: > diff --git a/model/registry/deprecated/otel.yaml b/model/registry/deprecated/otel.yaml index 23456367bc..c52a51fe8c 100644 --- a/model/registry/deprecated/otel.yaml +++ b/model/registry/deprecated/otel.yaml @@ -1,9 +1,8 @@ groups: - - id: otel.library + - id: registry.otel.library.deprecated prefix: otel.library - type: resource - brief: > - Span attributes used by non-OTLP exporters to represent OpenTelemetry Scope's concepts. + type: attribute_group + brief: "Describes deprecated otel.library attributes." attributes: - id: name type: string diff --git a/model/registry/deprecated/rpc.yaml b/model/registry/deprecated/rpc.yaml index c6c36710fe..1d9d22c2d4 100644 --- a/model/registry/deprecated/rpc.yaml +++ b/model/registry/deprecated/rpc.yaml @@ -1,5 +1,5 @@ groups: - - id: attributes.rpc.deprecated + - id: registry.rpc.deprecated type: attribute_group brief: 'Deprecated rpc message attributes.' attributes: diff --git a/model/registry/deprecated/system.yaml b/model/registry/deprecated/system.yaml index bda1dc0e9b..700023ab57 100644 --- a/model/registry/deprecated/system.yaml +++ b/model/registry/deprecated/system.yaml @@ -1,5 +1,5 @@ groups: - - id: attributes.system.deprecated + - id: registry.system.deprecated type: attribute_group brief: "Deprecated system attributes." attributes: From a776eaf3fc41621e9f9f933686bf94ad3b845d7c Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Mon, 8 Apr 2024 08:16:06 -0700 Subject: [PATCH 04/14] Deprecate `db.user` (#894) --- .chloggen/894.yaml | 4 ++++ docs/attributes-registry/db.md | 2 +- docs/database/database-spans.md | 2 -- docs/database/mongodb.md | 1 - docs/database/redis.md | 1 - docs/database/sql.md | 1 - docs/general/attribute-naming.md | 2 +- model/registry/db.yaml | 7 ------- model/registry/deprecated/db.yaml | 6 ++++++ model/trace/database.yaml | 1 - 10 files changed, 12 insertions(+), 15 deletions(-) create mode 100644 .chloggen/894.yaml diff --git a/.chloggen/894.yaml b/.chloggen/894.yaml new file mode 100644 index 0000000000..23f73b1f2c --- /dev/null +++ b/.chloggen/894.yaml @@ -0,0 +1,4 @@ +change_type: breaking +component: db +note: Deprecate the `db.user` attribute. +issues: [ 885 ] diff --git a/docs/attributes-registry/db.md b/docs/attributes-registry/db.md index 7ed3b02f92..ea89a0c930 100644 --- a/docs/attributes-registry/db.md +++ b/docs/attributes-registry/db.md @@ -27,7 +27,6 @@ | `db.operation.name` | string | The name of the operation or command being executed. | `findAndModify`; `HMSET`; `SELECT` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `db.statement` | string | The database statement being executed. | `SELECT * FROM wuser_table`; `SET mykey "WuValue"` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `db.system` | string | An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. | `other_sql` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.user` | string | Username for accessing the database. | `readonly_user`; `reporting_user` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). @@ -219,4 +218,5 @@ | `db.elasticsearch.node.name` | string | Deprecated, use `db.instance.id` instead. | `instance-0000000001` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.instance.id`. | | `db.jdbc.driver_classname` | string | Removed, no replacement at this time. | `org.postgresql.Driver`; `com.microsoft.sqlserver.jdbc.SQLServerDriver` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed as not used. | | `db.operation` | string | Deprecated, use `db.operation.name` instead. | `findAndModify`; `HMSET`; `SELECT` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.operation.name`. | +| `db.user` | string | Deprecated, no replacement at this time. | `readonly_user`; `reporting_user` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
No replacement at this time. | diff --git a/docs/database/database-spans.md b/docs/database/database-spans.md index 4b2f1d0d7a..339313e282 100644 --- a/docs/database/database-spans.md +++ b/docs/database/database-spans.md @@ -68,7 +68,6 @@ with all retries. ## Common attributes These attributes will usually be the same for all operations performed over the same database connection. -Some database systems may allow a connection to switch to a different `db.user`, for example, and other database systems may not even have the concept of a connection at all. | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | @@ -79,7 +78,6 @@ Some database systems may allow a connection to switch to a different `db.user`, | [`server.port`](../attributes-registry/server.md) | int | Server port number. [3] | `80`; `8080`; `443` | `Conditionally Required` [4] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`db.instance.id`](../attributes-registry/db.md) | string | An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. | `mysql-e26b99z.example.com` | `Recommended` If different from the `server.address` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.statement`](../attributes-registry/db.md) | string | The database statement being executed. | `SELECT * FROM wuser_table`; `SET mykey "WuValue"` | `Recommended` [5] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`db.user`](../attributes-registry/db.md) | string | Username for accessing the database. | `readonly_user`; `reporting_user` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`network.peer.address`](../attributes-registry/network.md) | string | Peer address of the database node where the operation was performed. [6] | `10.1.2.80`; `/tmp/my.sock` | `Recommended` If applicable for this database system. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`network.peer.port`](../attributes-registry/network.md) | int | Peer port number of the network connection. | `65123` | `Recommended` if and only if `network.peer.address` is set. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`server.address`](../attributes-registry/server.md) | string | Name of the database host. [7] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | diff --git a/docs/database/mongodb.md b/docs/database/mongodb.md index 7be3e0559e..473cf4c137 100644 --- a/docs/database/mongodb.md +++ b/docs/database/mongodb.md @@ -31,7 +31,6 @@ described on this page. | :---------------------- | :----------------------------------------------------------- | | Span name | `"products.findAndModify"` | | `db.system` | `"mongodb"` | -| `db.user` | `"the_user"` | | `server.address` | `"mongodb0.example.com"` | | `server.port` | `27017` | | `network.peer.address` | `"192.0.2.14"` | diff --git a/docs/database/redis.md b/docs/database/redis.md index da70edf142..6007bb57b1 100644 --- a/docs/database/redis.md +++ b/docs/database/redis.md @@ -38,7 +38,6 @@ Furthermore, `db.name` is not specified as there is no database name in Redis an |:--------------------------| :-------------------------------------------- | | Span name | `"HMSET myhash"` | | `db.system` | `"redis"` | -| `db.user` | not set | | `network.peer.address` | `"/tmp/redis.sock"` | | `network.transport` | `"unix"` | | `db.name` | not set | diff --git a/docs/database/sql.md b/docs/database/sql.md index 7c53a45e5d..0427c20872 100644 --- a/docs/database/sql.md +++ b/docs/database/sql.md @@ -34,7 +34,6 @@ This is an example of attributes for a MySQL database span: |:------------------------| :----------------------------------------------------------- | | Span name | `"SELECT ShopDb.orders"` | | `db.system` | `"mysql"` | -| `db.user` | `"billing_user"` | | `server.address` | `"shopdb.example.com"` | | `server.port` | `3306` | | `network.peer.address` | `"192.0.2.12"` | diff --git a/docs/general/attribute-naming.md b/docs/general/attribute-naming.md index 9f4e93dd45..57a99b62cd 100644 --- a/docs/general/attribute-naming.md +++ b/docs/general/attribute-naming.md @@ -60,7 +60,7 @@ Names SHOULD follow these rules: ## Name Pluralization guidelines - When an attribute represents a single entity, the attribute name SHOULD be - singular. Examples: `host.name`, `db.user`, `container.id`. + singular. Examples: `host.name`, `container.id`. - When attribute can represent multiple entities, the attribute name SHOULD be pluralized and the value type SHOULD be an array. E.g. `process.command_args` diff --git a/model/registry/db.yaml b/model/registry/db.yaml index ec67346e39..83b71d16a6 100644 --- a/model/registry/db.yaml +++ b/model/registry/db.yaml @@ -494,13 +494,6 @@ groups: stability: experimental stability: experimental tag: db-generic - - id: user - type: string - stability: experimental - brief: > - Username for accessing the database. - examples: ['readonly_user', 'reporting_user'] - tag: db-generic - id: instance.id tag: db-generic type: string diff --git a/model/registry/deprecated/db.yaml b/model/registry/deprecated/db.yaml index 2adef825d3..b861dd7fd6 100644 --- a/model/registry/deprecated/db.yaml +++ b/model/registry/deprecated/db.yaml @@ -30,3 +30,9 @@ groups: stability: experimental deprecated: "Replaced by `db.operation.name`." examples: ['findAndModify', 'HMSET', 'SELECT'] + - id: user + type: string + brief: 'Deprecated, no replacement at this time.' + deprecated: "No replacement at this time." + stability: experimental + examples: ['readonly_user', 'reporting_user'] diff --git a/model/trace/database.yaml b/model/trace/database.yaml index 6b0dac762f..5ca47c4f91 100644 --- a/model/trace/database.yaml +++ b/model/trace/database.yaml @@ -5,7 +5,6 @@ groups: attributes: - ref: db.system requirement_level: required - - ref: db.user - ref: db.name requirement_level: conditionally_required: If applicable. From c65428b52eeea15db850cf98503e6d28bbdf7fe9 Mon Sep 17 00:00:00 2001 From: Alexandra Konrad <10500694+trisch-me@users.noreply.github.com> Date: Mon, 8 Apr 2024 17:23:19 +0200 Subject: [PATCH 05/14] [chore] move opentracing to the registry (#900) Co-authored-by: Joao Grassi <5938087+joaopgrassi@users.noreply.github.com> Co-authored-by: Liudmila Molkova --- .github/ISSUE_TEMPLATE/bug_report.yaml | 1 + .github/ISSUE_TEMPLATE/change_proposal.yaml | 1 + .github/ISSUE_TEMPLATE/new-conventions.yaml | 1 + docs/attributes-registry/README.md | 1 + docs/attributes-registry/opentracing.md | 21 ++++++++++++++++++++ docs/general/trace-compatibility.md | 6 +++--- model/registry/opentracing.yaml | 22 +++++++++++++++++++++ model/trace/compatibility.yaml | 19 ++---------------- 8 files changed, 52 insertions(+), 20 deletions(-) create mode 100644 docs/attributes-registry/opentracing.md create mode 100644 model/registry/opentracing.yaml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 6abd8a9103..138ec6c592 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -49,6 +49,7 @@ body: - area:messaging - area:network - area:oci + - area:opentracing - area:os - area:otel - area:peer diff --git a/.github/ISSUE_TEMPLATE/change_proposal.yaml b/.github/ISSUE_TEMPLATE/change_proposal.yaml index c064231a77..117491cb40 100644 --- a/.github/ISSUE_TEMPLATE/change_proposal.yaml +++ b/.github/ISSUE_TEMPLATE/change_proposal.yaml @@ -42,6 +42,7 @@ body: - area:messaging - area:network - area:oci + - area:opentracing - area:os - area:otel - area:peer diff --git a/.github/ISSUE_TEMPLATE/new-conventions.yaml b/.github/ISSUE_TEMPLATE/new-conventions.yaml index 0b75deac83..f663263c59 100644 --- a/.github/ISSUE_TEMPLATE/new-conventions.yaml +++ b/.github/ISSUE_TEMPLATE/new-conventions.yaml @@ -51,6 +51,7 @@ body: - area:messaging - area:network - area:oci + - area:opentracing - area:os - area:otel - area:peer diff --git a/docs/attributes-registry/README.md b/docs/attributes-registry/README.md index b69c63fefa..c9f832ec74 100644 --- a/docs/attributes-registry/README.md +++ b/docs/attributes-registry/README.md @@ -57,6 +57,7 @@ Currently, the following namespaces exist: * [Network](network.md) * [OCI](oci.md) * [OpenTelemetry](otel.md) +* [OpenTracing](opentracing.md) * [OS](os.md) * [Peer](peer.md) * [Process](process.md) diff --git a/docs/attributes-registry/opentracing.md b/docs/attributes-registry/opentracing.md new file mode 100644 index 0000000000..727271b544 --- /dev/null +++ b/docs/attributes-registry/opentracing.md @@ -0,0 +1,21 @@ + + +# OpenTracing + +## OpenTracing Attributes + + +| Attribute | Type | Description | Examples | Stability | +|---|---|---|---|---| +| `opentracing.ref_type` | string | Parent-child Reference type [1] | `child_of` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[1]:** The causal relationship between a child Span and a parent Span. + +`opentracing.ref_type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. + +| Value | Description | Stability | +|---|---|---| +| `child_of` | The parent Span depends on the child Span in some capacity | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `follows_from` | The parent Span doesn't depend in any way on the result of the child Span | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + diff --git a/docs/general/trace-compatibility.md b/docs/general/trace-compatibility.md index 28d142cdf3..958e6c5b4f 100644 --- a/docs/general/trace-compatibility.md +++ b/docs/general/trace-compatibility.md @@ -24,14 +24,14 @@ with one of the accepted values, describing the direct causal relationships between a child Span and a parent Span, as defined by [OpenTracing](https://github.com/opentracing/specification/blob/master/specification.md). - + | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| -| `opentracing.ref_type` | string | Parent-child Reference type [1] | `child_of` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`opentracing.ref_type`](../attributes-registry/opentracing.md) | string | Parent-child Reference type [1] | `child_of` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** The causal relationship between a child Span and a parent Span. -`opentracing.ref_type` MUST be one of the following: +`opentracing.ref_type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | |---|---|---| diff --git a/model/registry/opentracing.yaml b/model/registry/opentracing.yaml new file mode 100644 index 0000000000..fd9d68e380 --- /dev/null +++ b/model/registry/opentracing.yaml @@ -0,0 +1,22 @@ +groups: + - id: registry.opentracing + prefix: opentracing + type: attribute_group + brief: Attributes used by the OpenTracing Shim layer. + attributes: + - id: ref_type + brief: 'Parent-child Reference type' + stability: experimental + note: > + The causal relationship between a child Span and a parent Span. + type: + allow_custom_values: true + members: + - id: child_of + value: 'child_of' + brief: "The parent Span depends on the child Span in some capacity" + stability: experimental + - id: follows_from + value: 'follows_from' + brief: "The parent Span doesn't depend in any way on the result of the child Span" + stability: experimental diff --git a/model/trace/compatibility.yaml b/model/trace/compatibility.yaml index 2ed1de06b4..3f906d18cf 100644 --- a/model/trace/compatibility.yaml +++ b/model/trace/compatibility.yaml @@ -1,24 +1,9 @@ groups: - id: opentracing - prefix: opentracing type: span brief: 'This document defines semantic conventions for the OpenTracing Shim' note: > These conventions are used by the OpenTracing Shim layer. attributes: - - id: ref_type - brief: 'Parent-child Reference type' - stability: experimental - note: > - The causal relationship between a child Span and a parent Span. - type: - allow_custom_values: false - members: - - id: child_of - value: 'child_of' - brief: "The parent Span depends on the child Span in some capacity" - stability: experimental - - id: follows_from - value: 'follows_from' - brief: "The parent Span doesn't depend in any way on the result of the child Span" - stability: experimental + - ref: opentracing.ref_type + requirement_level: recommended From b5b2409b52157cabb0debd54ed14bc90f38d7bd9 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Mon, 8 Apr 2024 09:48:04 -0700 Subject: [PATCH 06/14] Rename `db.statement` to `db.query.text` and introduce `db.query.parameter.` (#866) --- .chloggen/866.yaml | 4 ++++ docs/attributes-registry/db.md | 11 ++++++++--- docs/database/cassandra.md | 2 +- docs/database/database-spans.md | 6 +++++- docs/database/elasticsearch.md | 2 +- docs/database/mssql.md | 2 +- docs/database/redis.md | 4 ++-- docs/database/sql.md | 2 +- model/registry/db.yaml | 23 ++++++++++++++++++----- model/registry/deprecated/db.yaml | 6 ++++++ model/trace/database.yaml | 12 +++++++----- schema-next.yaml | 4 ++++ 12 files changed, 58 insertions(+), 20 deletions(-) create mode 100644 .chloggen/866.yaml diff --git a/.chloggen/866.yaml b/.chloggen/866.yaml new file mode 100644 index 0000000000..43ee49568b --- /dev/null +++ b/.chloggen/866.yaml @@ -0,0 +1,4 @@ +change_type: breaking +component: db +note: Rename `db.statement` to `db.query.text` and introduce `db.query.parameter.` +issues: [ 716 ] diff --git a/docs/attributes-registry/db.md b/docs/attributes-registry/db.md index ea89a0c930..7cbe0819f9 100644 --- a/docs/attributes-registry/db.md +++ b/docs/attributes-registry/db.md @@ -25,11 +25,15 @@ | `db.instance.id` | string | An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. | `mysql-e26b99z.example.com` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `db.name` | string | This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). [1] | `customers`; `main` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `db.operation.name` | string | The name of the operation or command being executed. | `findAndModify`; `HMSET`; `SELECT` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.statement` | string | The database statement being executed. | `SELECT * FROM wuser_table`; `SET mykey "WuValue"` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.query.parameter.` | string | The query parameters used in `db.query.text`, with `` being the parameter name, and the attribute value being the parameter value. [2] | `someval`; `55` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.query.text` | string | The database query being executed. | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `db.system` | string | An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. | `other_sql` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). +**[2]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders. +If a parameter has no name and instead is referenced only by index, then `` SHOULD be the 0-based index. + `db.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | @@ -101,7 +105,7 @@ | `db.cassandra.speculative_execution_count` | int | The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. | `0`; `2` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `db.cassandra.table` | string | The name of the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable). [1] | `mytable` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -**[1]:** This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. +**[1]:** This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.query.text` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. `db.cassandra.consistency_level` MUST be one of the following: @@ -206,7 +210,7 @@ |---|---|---|---|---| | `db.sql.table` | string | The name of the primary table that the operation is acting upon, including the database name (if applicable). [1] | `public.users`; `customers` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -**[1]:** It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. +**[1]:** It is not recommended to attempt any client-side parsing of `db.query.text` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. ## Deprecated DB Attributes @@ -218,5 +222,6 @@ | `db.elasticsearch.node.name` | string | Deprecated, use `db.instance.id` instead. | `instance-0000000001` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.instance.id`. | | `db.jdbc.driver_classname` | string | Removed, no replacement at this time. | `org.postgresql.Driver`; `com.microsoft.sqlserver.jdbc.SQLServerDriver` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed as not used. | | `db.operation` | string | Deprecated, use `db.operation.name` instead. | `findAndModify`; `HMSET`; `SELECT` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.operation.name`. | +| `db.statement` | string | The database statement being executed. | `SELECT * FROM wuser_table`; `SET mykey "WuValue"` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.query.text`. | | `db.user` | string | Deprecated, no replacement at this time. | `readonly_user`; `reporting_user` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
No replacement at this time. | diff --git a/docs/database/cassandra.md b/docs/database/cassandra.md index 342fdc4053..efcb9b5915 100644 --- a/docs/database/cassandra.md +++ b/docs/database/cassandra.md @@ -30,7 +30,7 @@ described on this page. **[1]:** For Cassandra the `db.name` should be set to the Cassandra keyspace name. -**[2]:** This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. +**[2]:** This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.query.text` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. **[3]:** If a database operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. diff --git a/docs/database/database-spans.md b/docs/database/database-spans.md index 339313e282..9a1f2222fb 100644 --- a/docs/database/database-spans.md +++ b/docs/database/database-spans.md @@ -77,10 +77,11 @@ These attributes will usually be the same for all operations performed over the | [`db.operation.name`](../attributes-registry/db.md) | string | The name of the operation or command being executed. | `findAndModify`; `HMSET`; `SELECT` | `Conditionally Required` [2] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`server.port`](../attributes-registry/server.md) | int | Server port number. [3] | `80`; `8080`; `443` | `Conditionally Required` [4] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`db.instance.id`](../attributes-registry/db.md) | string | An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. | `mysql-e26b99z.example.com` | `Recommended` If different from the `server.address` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`db.statement`](../attributes-registry/db.md) | string | The database statement being executed. | `SELECT * FROM wuser_table`; `SET mykey "WuValue"` | `Recommended` [5] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.query.text`](../attributes-registry/db.md) | string | The database query being executed. | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` | `Recommended` [5] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`network.peer.address`](../attributes-registry/network.md) | string | Peer address of the database node where the operation was performed. [6] | `10.1.2.80`; `/tmp/my.sock` | `Recommended` If applicable for this database system. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`network.peer.port`](../attributes-registry/network.md) | int | Peer port number of the network connection. | `65123` | `Recommended` if and only if `network.peer.address` is set. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`server.address`](../attributes-registry/server.md) | string | Name of the database host. [7] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.query.parameter.`](../attributes-registry/db.md) | string | The query parameters used in `db.query.text`, with `` being the parameter name, and the attribute value being the parameter value. [8] | `someval`; `55` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). @@ -97,6 +98,9 @@ If a database operation involved multiple network calls (for example retries), t **[7]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. +**[8]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders. +If a parameter has no name and instead is referenced only by index, then `` SHOULD be the 0-based index. + `db.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | diff --git a/docs/database/elasticsearch.md b/docs/database/elasticsearch.md index d700e4917d..c04c894ca0 100644 --- a/docs/database/elasticsearch.md +++ b/docs/database/elasticsearch.md @@ -33,7 +33,7 @@ If the endpoint id is not available, the span name SHOULD be the `http.request.m | [`server.port`](../attributes-registry/server.md) | int | Server port number. [5] | `80`; `8080`; `443` | `Conditionally Required` [6] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`db.elasticsearch.cluster.name`](../attributes-registry/db.md) | string | Represents the identifier of an Elasticsearch cluster. | `e9106fc68e3044f0b1475b04bf4ffd5f` | `Recommended` [7] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.instance.id`](../attributes-registry/db.md) | string | An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. | `mysql-e26b99z.example.com` | `Recommended` [8] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`db.statement`](../attributes-registry/db.md) | string | The request body for a [search-type query](https://www.elastic.co/guide/en/elasticsearch/reference/current/search.html), as a json string. | `"{\"query\":{\"term\":{\"user.id\":\"kimchy\"}}}"` | `Recommended` [9] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.query.text`](../attributes-registry/db.md) | string | The request body for a [search-type query](https://www.elastic.co/guide/en/elasticsearch/reference/current/search.html), as a json string. | `"{\"query\":{\"term\":{\"user.id\":\"kimchy\"}}}"` | `Recommended` [9] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`network.peer.address`](../attributes-registry/network.md) | string | Peer address of the database node where the operation was performed. [10] | `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`network.peer.port`](../attributes-registry/network.md) | int | Peer port number of the network connection. | `65123` | `Recommended` if and only if `network.peer.address` is set. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`server.address`](../attributes-registry/server.md) | string | Name of the database host. [11] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | diff --git a/docs/database/mssql.md b/docs/database/mssql.md index e7e1178c55..47ed5a0012 100644 --- a/docs/database/mssql.md +++ b/docs/database/mssql.md @@ -28,7 +28,7 @@ In the case of `EXEC`, this SHOULD be the stored procedure name that is being ex **[3]:** If setting a `db.mssql.instance_name`, `server.port` is no longer required (but still recommended if non-standard). -**[4]:** It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. +**[4]:** It is not recommended to attempt any client-side parsing of `db.query.text` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. [DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.31.0/specification/document-status.md diff --git a/docs/database/redis.md b/docs/database/redis.md index 6007bb57b1..2011dc67e7 100644 --- a/docs/database/redis.md +++ b/docs/database/redis.md @@ -18,11 +18,11 @@ described on this page. | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`db.redis.database_index`](../attributes-registry/db.md) | int | The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. | `0`; `1`; `15` | `Conditionally Required` If other than the default database (`0`). | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`db.statement`](../attributes-registry/db.md) | string | The full syntax of the Redis CLI command. [1] | `HMSET myhash field1 'Hello' field2 'World'` | `Recommended` [2] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.query.text`](../attributes-registry/db.md) | string | The full syntax of the Redis CLI command. [1] | `HMSET myhash field1 'Hello' field2 'World'` | `Recommended` [2] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`network.peer.address`](../attributes-registry/network.md) | string | Peer address of the database node where the operation was performed. [3] | `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`network.peer.port`](../attributes-registry/network.md) | int | Peer port number of the network connection. | `65123` | `Recommended` if and only if `network.peer.address` is set. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -**[1]:** For **Redis**, the value provided for `db.statement` SHOULD correspond to the syntax of the Redis CLI. If, for example, the [`HMSET` command](https://redis.io/commands/hmset) is invoked, `"HMSET myhash field1 'Hello' field2 'World'"` would be a suitable value for `db.statement`. +**[1]:** For **Redis**, the value provided for `db.query.text` SHOULD correspond to the syntax of the Redis CLI. If, for example, the [`HMSET` command](https://redis.io/commands/hmset) is invoked, `"HMSET myhash field1 'Hello' field2 'World'"` would be a suitable value for `db.query.text`. **[2]:** Should be collected by default only if there is sanitization that excludes sensitive information. diff --git a/docs/database/sql.md b/docs/database/sql.md index 0427c20872..002fff4d06 100644 --- a/docs/database/sql.md +++ b/docs/database/sql.md @@ -23,7 +23,7 @@ In the case of `EXEC`, this SHOULD be the stored procedure name that is being ex **[2]:** If readily available. Otherwise, if the instrumentation library parses `db.statement` to capture `db.operation.name`, then it SHOULD be the first operation name found in the query. -**[3]:** It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. +**[3]:** It is not recommended to attempt any client-side parsing of `db.query.text` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. ## Example diff --git a/model/registry/db.yaml b/model/registry/db.yaml index 83b71d16a6..f967fdbe64 100644 --- a/model/registry/db.yaml +++ b/model/registry/db.yaml @@ -86,7 +86,7 @@ groups: note: > This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of - `db.statement` just to get this property, but it should be set if + `db.query.text` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. @@ -266,18 +266,31 @@ groups: brief: The name of the primary table that the operation is acting upon, including the database name (if applicable). note: > It is not recommended to attempt any client-side parsing of - `db.statement` just to get this property, but it should be set if + `db.query.text` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. examples: ['public.users', 'customers'] tag: tech-specific-sql - - id: statement + - id: query.text type: string stability: experimental brief: > - The database statement being executed. - examples: ['SELECT * FROM wuser_table', 'SET mykey "WuValue"'] + The database query being executed. + examples: ['SELECT * FROM wuser_table where username = ?', 'SET mykey "WuValue"'] + tag: db-generic + - id: query.parameter + type: template[string] + stability: experimental + brief: > + The query parameters used in `db.query.text`, with `` being the parameter name, + and the attribute value being the parameter value. + note: > + Query parameters should only be captured when `db.query.text` is parameterized with placeholders. + + If a parameter has no name and instead is referenced only by index, + then `` SHOULD be the 0-based index. + examples: ['someval', '55'] tag: db-generic - id: system brief: An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. diff --git a/model/registry/deprecated/db.yaml b/model/registry/deprecated/db.yaml index b861dd7fd6..1fec703f81 100644 --- a/model/registry/deprecated/db.yaml +++ b/model/registry/deprecated/db.yaml @@ -36,3 +36,9 @@ groups: deprecated: "No replacement at this time." stability: experimental examples: ['readonly_user', 'reporting_user'] + - id: statement + type: string + brief: The database statement being executed. + deprecated: "Replaced by `db.query.text`." + stability: experimental + examples: ['SELECT * FROM wuser_table', 'SET mykey "WuValue"'] diff --git a/model/trace/database.yaml b/model/trace/database.yaml index 5ca47c4f91..8c6f973b39 100644 --- a/model/trace/database.yaml +++ b/model/trace/database.yaml @@ -8,10 +8,12 @@ groups: - ref: db.name requirement_level: conditionally_required: If applicable. - - ref: db.statement + - ref: db.query.text requirement_level: recommended: > Should be collected by default only if there is sanitization that excludes sensitive information. + - ref: db.query.parameter + requirement_level: opt_in - ref: db.operation.name requirement_level: conditionally_required: > @@ -136,14 +138,14 @@ groups: requirement_level: conditionally_required: If other than the default database (`0`). tag: tech-specific - - ref: db.statement + - ref: db.query.text tag: tech-specific brief: > The full syntax of the Redis CLI command. examples: ["HMSET myhash field1 'Hello' field2 'World'"] note: > - For **Redis**, the value provided for `db.statement` SHOULD correspond to the syntax of the Redis CLI. - If, for example, the [`HMSET` command](https://redis.io/commands/hmset) is invoked, `"HMSET myhash field1 'Hello' field2 'World'"` would be a suitable value for `db.statement`. + For **Redis**, the value provided for `db.query.text` SHOULD correspond to the syntax of the Redis CLI. + If, for example, the [`HMSET` command](https://redis.io/commands/hmset) is invoked, `"HMSET myhash field1 'Hello' field2 'World'"` would be a suitable value for `db.query.text`. - id: db.mongodb type: span @@ -180,7 +182,7 @@ groups: requirement_level: required examples: [ 'https://localhost:9200/index/_search?q=user.id:kimchy' ] tag: tech-specific - - ref: db.statement + - ref: db.query.text requirement_level: recommended: > Should be collected by default for search-type queries and only if there is sanitization that excludes diff --git a/schema-next.yaml b/schema-next.yaml index 638d717e8c..6a217cea7f 100644 --- a/schema-next.yaml +++ b/schema-next.yaml @@ -14,6 +14,10 @@ versions: - rename_attributes: attribute_map: db.operation: db.operation.name + # https://github.com/open-telemetry/semantic-conventions/pull/866 + - rename_attributes: + attribute_map: + db.statement: db.query.text metrics: changes: # https://github.com/open-telemetry/semantic-conventions/pull/484 From ff49c9b6fa0a8b90b4e8a49ffa2ba2ccb0149ea8 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Mon, 8 Apr 2024 10:14:27 -0700 Subject: [PATCH 07/14] DB: rename table/container/etc to collection (#870) --- .chloggen/870.yaml | 4 +++ docs/attributes-registry/db.md | 39 +++++++++-------------------- docs/database/cassandra.md | 14 ++++++----- docs/database/cosmosdb.md | 16 ++++++------ docs/database/couchdb.md | 2 +- docs/database/database-spans.md | 39 ++++++++++++++++------------- docs/database/mongodb.md | 10 +++++--- docs/database/mssql.md | 18 ++++++++------ docs/database/sql.md | 16 ++++++------ model/registry/db.yaml | 41 +++++-------------------------- model/registry/deprecated/db.yaml | 24 ++++++++++++++++++ model/trace/database.yaml | 21 ++++++++++++---- schema-next.yaml | 7 ++++++ 13 files changed, 133 insertions(+), 118 deletions(-) create mode 100644 .chloggen/870.yaml diff --git a/.chloggen/870.yaml b/.chloggen/870.yaml new file mode 100644 index 0000000000..dd5dc6fe37 --- /dev/null +++ b/.chloggen/870.yaml @@ -0,0 +1,4 @@ +change_type: breaking +component: db +note: Renames `db.sql.table`, `db.cassandra.table`, `db.mongodb.collection`, and `db.cosmosdb.container` attributes to `db.collection.name` +issues: [ 870 ] diff --git a/docs/attributes-registry/db.md b/docs/attributes-registry/db.md index 7cbe0819f9..45c73f0997 100644 --- a/docs/attributes-registry/db.md +++ b/docs/attributes-registry/db.md @@ -9,10 +9,8 @@ - [Cassandra Attributes](#cassandra-attributes) - [CosmosDB Attributes](#cosmosdb-attributes) - [Elasticsearch Attributes](#elasticsearch-attributes) -- [MongoDB Attributes](#mongodb-attributes) - [MSSQL Attributes](#mssql-attributes) - [Redis Attributes](#redis-attributes) -- [SQL Attributes](#sql-attributes) - [Deprecated DB Attributes](#deprecated-db-attributes) @@ -22,16 +20,19 @@ | Attribute | Type | Description | Examples | Stability | |---|---|---|---|---| +| `db.collection.name` | string | The name of a collection (table, container) within the database. [1] | `public.users`; `customers` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `db.instance.id` | string | An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. | `mysql-e26b99z.example.com` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.name` | string | This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). [1] | `customers`; `main` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.name` | string | This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). [2] | `customers`; `main` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `db.operation.name` | string | The name of the operation or command being executed. | `findAndModify`; `HMSET`; `SELECT` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.query.parameter.` | string | The query parameters used in `db.query.text`, with `` being the parameter name, and the attribute value being the parameter value. [2] | `someval`; `55` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.query.parameter.` | string | The query parameters used in `db.query.text`, with `` being the parameter name, and the attribute value being the parameter value. [3] | `someval`; `55` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `db.query.text` | string | The database query being executed. | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `db.system` | string | An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. | `other_sql` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -**[1]:** In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). +**[1]:** If the collection name is parsed from the query, it SHOULD match the value provided in the query and may be qualified with the schema and database name. -**[2]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders. +**[2]:** In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). + +**[3]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders. If a parameter has no name and instead is referenced only by index, then `` SHOULD be the 0-based index. `db.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. @@ -103,9 +104,6 @@ If a parameter has no name and instead is referenced only by index, then `` | `db.cassandra.idempotence` | boolean | Whether or not the query is idempotent. | | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `db.cassandra.page_size` | int | The fetch size used for paging, i.e. how many rows will be returned at once. | `5000` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `db.cassandra.speculative_execution_count` | int | The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. | `0`; `2` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.cassandra.table` | string | The name of the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable). [1] | `mytable` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - -**[1]:** This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.query.text` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. `db.cassandra.consistency_level` MUST be one of the following: @@ -131,7 +129,6 @@ If a parameter has no name and instead is referenced only by index, then `` |---|---|---|---|---| | `db.cosmosdb.client_id` | string | Unique Cosmos client instance id. | `3ba4827d-4422-483f-b59f-85b74211c11d` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `db.cosmosdb.connection_mode` | string | Cosmos client connection mode. | `gateway` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.cosmosdb.container` | string | Cosmos DB container name. | `anystring` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `db.cosmosdb.operation_type` | string | CosmosDB Operation Type. | `Invalid` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `db.cosmosdb.request_charge` | double | RU consumed for that operation | `46.18`; `1.0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `db.cosmosdb.request_content_length` | int | Request payload size in bytes | | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -177,14 +174,6 @@ If a parameter has no name and instead is referenced only by index, then `` **[1]:** Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.`, where `` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. -## MongoDB Attributes - - -| Attribute | Type | Description | Examples | Stability | -|---|---|---|---|---| -| `db.mongodb.collection` | string | The MongoDB collection being accessed within the database stated in `db.name`. | `customers`; `products` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - ## MSSQL Attributes @@ -203,25 +192,19 @@ If a parameter has no name and instead is referenced only by index, then `` | `db.redis.database_index` | int | The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. | `0`; `1`; `15` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -## SQL Attributes - - -| Attribute | Type | Description | Examples | Stability | -|---|---|---|---|---| -| `db.sql.table` | string | The name of the primary table that the operation is acting upon, including the database name (if applicable). [1] | `public.users`; `customers` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - -**[1]:** It is not recommended to attempt any client-side parsing of `db.query.text` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. - - ## Deprecated DB Attributes | Attribute | Type | Description | Examples | Stability | |---|---|---|---|---| +| `db.cassandra.table` | string | Deprecated, use `db.collection.name` instead. | `mytable` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.collection.name`. | | `db.connection_string` | string | Deprecated, use `server.address`, `server.port` attributes instead. | `Server=(localdb)\v11.0;Integrated Security=true;` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
"Replaced by `server.address` and `server.port`." | +| `db.cosmosdb.container` | string | Deprecated, use `db.collection.name` instead. | `mytable` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.collection.name`. | | `db.elasticsearch.node.name` | string | Deprecated, use `db.instance.id` instead. | `instance-0000000001` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.instance.id`. | | `db.jdbc.driver_classname` | string | Removed, no replacement at this time. | `org.postgresql.Driver`; `com.microsoft.sqlserver.jdbc.SQLServerDriver` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed as not used. | +| `db.mongodb.collection` | string | Deprecated, use `db.collection.name` instead. | `mytable` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.collection.name`. | | `db.operation` | string | Deprecated, use `db.operation.name` instead. | `findAndModify`; `HMSET`; `SELECT` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.operation.name`. | +| `db.sql.table` | string | Deprecated, use `db.collection.name` instead. | `mytable` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.collection.name`. | | `db.statement` | string | The database statement being executed. | `SELECT * FROM wuser_table`; `SET mykey "WuValue"` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.query.text`. | | `db.user` | string | Deprecated, no replacement at this time. | `readonly_user`; `reporting_user` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
No replacement at this time. | diff --git a/docs/database/cassandra.md b/docs/database/cassandra.md index efcb9b5915..b726721e92 100644 --- a/docs/database/cassandra.md +++ b/docs/database/cassandra.md @@ -17,22 +17,24 @@ described on this page. | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| -| [`db.name`](../attributes-registry/db.md) | string | The keyspace name in Cassandra. [1] | `mykeyspace` | `Conditionally Required` If applicable. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.collection.name`](../attributes-registry/db.md) | string | The name of the Cassandra table that the operation is acting upon. [1] | `public.users`; `customers` | `Conditionally Required` [2] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.name`](../attributes-registry/db.md) | string | The keyspace name in Cassandra. [3] | `mykeyspace` | `Conditionally Required` If applicable. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.cassandra.consistency_level`](../attributes-registry/db.md) | string | 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). | `all` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.cassandra.coordinator.dc`](../attributes-registry/db.md) | string | The data center of the coordinating node for a query. | `us-west-2` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.cassandra.coordinator.id`](../attributes-registry/db.md) | string | The ID of the coordinating node for a query. | `be13faa2-8574-4d71-926d-27f16cf8a7af` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.cassandra.idempotence`](../attributes-registry/db.md) | boolean | Whether or not the query is idempotent. | | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.cassandra.page_size`](../attributes-registry/db.md) | int | The fetch size used for paging, i.e. how many rows will be returned at once. | `5000` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.cassandra.speculative_execution_count`](../attributes-registry/db.md) | int | The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. | `0`; `2` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`db.cassandra.table`](../attributes-registry/db.md) | string | The name of the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable). [2] | `mytable` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`network.peer.address`](../attributes-registry/network.md) | string | Peer address of the database node where the operation was performed. [3] | `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`network.peer.address`](../attributes-registry/network.md) | string | Peer address of the database node where the operation was performed. [4] | `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`network.peer.port`](../attributes-registry/network.md) | int | Peer port number of the network connection. | `65123` | `Recommended` if and only if `network.peer.address` is set. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -**[1]:** For Cassandra the `db.name` should be set to the Cassandra keyspace name. +**[1]:** If the collection name is parsed from the query, it SHOULD match the value provided in the query and may be qualified with the schema and database name. -**[2]:** This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.query.text` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. +**[2]:** If readily available. Otherwise, if the instrumentation library parses `db.query.text` to capture `db.collection.name`, then it SHOULD be the first collection name found in the query. -**[3]:** If a database operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. +**[3]:** For Cassandra the `db.name` should be set to the Cassandra keyspace name. + +**[4]:** If a database operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. `db.cassandra.consistency_level` MUST be one of the following: diff --git a/docs/database/cosmosdb.md b/docs/database/cosmosdb.md index 5ec6dd24dc..499d453db6 100644 --- a/docs/database/cosmosdb.md +++ b/docs/database/cosmosdb.md @@ -20,21 +20,23 @@ Cosmos DB instrumentation includes call-level (public API) surface spans and net | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| +| [`db.collection.name`](../attributes-registry/db.md) | string | Cosmos DB container name. [1] | `public.users`; `customers` | `Conditionally Required` if available | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.cosmosdb.connection_mode`](../attributes-registry/db.md) | string | Cosmos client connection mode. | `gateway` | `Conditionally Required` if not `direct` (or pick gw as default) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`db.cosmosdb.container`](../attributes-registry/db.md) | string | Cosmos DB container name. | `anystring` | `Conditionally Required` if available | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`db.cosmosdb.operation_type`](../attributes-registry/db.md) | string | CosmosDB Operation Type. | `Invalid` | `Conditionally Required` [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.cosmosdb.operation_type`](../attributes-registry/db.md) | string | CosmosDB Operation Type. | `Invalid` | `Conditionally Required` [2] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.cosmosdb.request_charge`](../attributes-registry/db.md) | double | RU consumed for that operation | `46.18`; `1.0` | `Conditionally Required` when available | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.cosmosdb.status_code`](../attributes-registry/db.md) | int | Cosmos DB status code. | `200`; `201` | `Conditionally Required` if response was received | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`db.cosmosdb.sub_status_code`](../attributes-registry/db.md) | int | Cosmos DB sub status code. | `1000`; `1002` | `Conditionally Required` [2] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.cosmosdb.sub_status_code`](../attributes-registry/db.md) | int | Cosmos DB sub status code. | `1000`; `1002` | `Conditionally Required` [3] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.cosmosdb.client_id`](../attributes-registry/db.md) | string | Unique Cosmos client instance id. | `3ba4827d-4422-483f-b59f-85b74211c11d` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`db.cosmosdb.request_content_length`](../attributes-registry/db.md) | int | Request payload size in bytes | | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`user_agent.original`](../attributes-registry/user-agent.md) | string | Full user-agent string is generated by Cosmos DB SDK [3] | `cosmos-netstandard-sdk/3.23.0\|3.23.1\|1\|X64\|Linux 5.4.0-1098-azure 104 18\|.NET Core 3.1.32\|S\|` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`user_agent.original`](../attributes-registry/user-agent.md) | string | Full user-agent string is generated by Cosmos DB SDK [4] | `cosmos-netstandard-sdk/3.23.0\|3.23.1\|1\|X64\|Linux 5.4.0-1098-azure 104 18\|.NET Core 3.1.32\|S\|` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -**[1]:** when performing one of the operations in this list +**[1]:** If the collection name is parsed from the query, it SHOULD match the value provided in the query and may be qualified with the schema and database name. -**[2]:** when response was received and contained sub-code. +**[2]:** when performing one of the operations in this list -**[3]:** The user-agent value is generated by SDK which is a combination of
`sdk_version` : Current version of SDK. e.g. 'cosmos-netstandard-sdk/3.23.0'
`direct_pkg_version` : Direct package version used by Cosmos DB SDK. e.g. '3.23.1'
`number_of_client_instances` : Number of cosmos client instances created by the application. e.g. '1'
`type_of_machine_architecture` : Machine architecture. e.g. 'X64'
`operating_system` : Operating System. e.g. 'Linux 5.4.0-1098-azure 104 18'
`runtime_framework` : Runtime Framework. e.g. '.NET Core 3.1.32'
`failover_information` : Generated key to determine if region failover enabled. +**[3]:** when response was received and contained sub-code. + +**[4]:** The user-agent value is generated by SDK which is a combination of
`sdk_version` : Current version of SDK. e.g. 'cosmos-netstandard-sdk/3.23.0'
`direct_pkg_version` : Direct package version used by Cosmos DB SDK. e.g. '3.23.1'
`number_of_client_instances` : Number of cosmos client instances created by the application. e.g. '1'
`type_of_machine_architecture` : Machine architecture. e.g. 'X64'
`operating_system` : Operating System. e.g. 'Linux 5.4.0-1098-azure 104 18'
`runtime_framework` : Runtime Framework. e.g. '.NET Core 3.1.32'
`failover_information` : Generated key to determine if region failover enabled. Format Reg-{D (Disabled discovery)}-S(application region)|L(List of preferred regions)|N(None, user did not configure it). Default value is "NS". diff --git a/docs/database/couchdb.md b/docs/database/couchdb.md index 20d4963add..6c3ad89c72 100644 --- a/docs/database/couchdb.md +++ b/docs/database/couchdb.md @@ -21,7 +21,7 @@ described on this page. **[1]:** In **CouchDB**, `db.operation.name` should be set to the HTTP method + the target REST route according to the API reference documentation. For example, when retrieving a document, `db.operation.name` would be set to (literally, i.e., without replacing the placeholders with concrete values): [`GET /{db}/{docid}`](https://docs.couchdb.org/en/stable/api/document/common.html#get--db-docid). -**[2]:** If readily available. Otherwise, if the instrumentation library parses `db.statement` to capture `db.operation.name`, then it SHOULD be the first operation name found in the query. +**[2]:** If readily available. Otherwise, if the instrumentation library parses `db.query.text` to capture `db.operation.name`, then it SHOULD be the first operation name found in the query. [DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.31.0/specification/document-status.md diff --git a/docs/database/database-spans.md b/docs/database/database-spans.md index 9a1f2222fb..937e8a5770 100644 --- a/docs/database/database-spans.md +++ b/docs/database/database-spans.md @@ -55,8 +55,8 @@ The **span name** SHOULD be set to a low cardinality value representing the stat It MAY be a stored procedure name (without arguments), DB statement without variable arguments, operation name, etc. Since SQL statements may have very high cardinality even without arguments, SQL spans SHOULD be named the following way, unless the statement is known to be of low cardinality: -` .`, provided that `db.operation` and `db.sql.table` are available. -If `db.sql.table` is not available due to its semantics, the span SHOULD be named ` `. +` .`, provided that `db.operation` and `db.collection.name` are available. +If `db.collection.name` is not available due to its semantics, the span SHOULD be named ` `. It is not recommended to attempt any client-side parsing of `db.statement` just to get these properties, they should only be used if the library being instrumented already provides them. When it's otherwise impossible to get any meaningful span name, `db.name` or the tech-specific database name MAY be used. @@ -73,32 +73,37 @@ These attributes will usually be the same for all operations performed over the | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| | [`db.system`](../attributes-registry/db.md) | string | An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. | `other_sql` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`db.name`](../attributes-registry/db.md) | string | This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). [1] | `customers`; `main` | `Conditionally Required` If applicable. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`db.operation.name`](../attributes-registry/db.md) | string | The name of the operation or command being executed. | `findAndModify`; `HMSET`; `SELECT` | `Conditionally Required` [2] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`server.port`](../attributes-registry/server.md) | int | Server port number. [3] | `80`; `8080`; `443` | `Conditionally Required` [4] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.collection.name`](../attributes-registry/db.md) | string | The name of a collection (table, container) within the database. [1] | `public.users`; `customers` | `Conditionally Required` [2] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.name`](../attributes-registry/db.md) | string | This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). [3] | `customers`; `main` | `Conditionally Required` If applicable. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.operation.name`](../attributes-registry/db.md) | string | The name of the operation or command being executed. | `findAndModify`; `HMSET`; `SELECT` | `Conditionally Required` [4] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`server.port`](../attributes-registry/server.md) | int | Server port number. [5] | `80`; `8080`; `443` | `Conditionally Required` [6] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`db.instance.id`](../attributes-registry/db.md) | string | An identifier (address, unique name, or any other identifier) of the database instance that is executing queries or mutations on the current connection. This is useful in cases where the database is running in a clustered environment and the instrumentation is able to record the node executing the query. The client may obtain this value in databases like MySQL using queries like `select @@hostname`. | `mysql-e26b99z.example.com` | `Recommended` If different from the `server.address` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`db.query.text`](../attributes-registry/db.md) | string | The database query being executed. | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` | `Recommended` [5] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`network.peer.address`](../attributes-registry/network.md) | string | Peer address of the database node where the operation was performed. [6] | `10.1.2.80`; `/tmp/my.sock` | `Recommended` If applicable for this database system. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.query.text`](../attributes-registry/db.md) | string | The database query being executed. | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` | `Recommended` [7] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`network.peer.address`](../attributes-registry/network.md) | string | Peer address of the database node where the operation was performed. [8] | `10.1.2.80`; `/tmp/my.sock` | `Recommended` If applicable for this database system. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`network.peer.port`](../attributes-registry/network.md) | int | Peer port number of the network connection. | `65123` | `Recommended` if and only if `network.peer.address` is set. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`server.address`](../attributes-registry/server.md) | string | Name of the database host. [7] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`db.query.parameter.`](../attributes-registry/db.md) | string | The query parameters used in `db.query.text`, with `` being the parameter name, and the attribute value being the parameter value. [8] | `someval`; `55` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`server.address`](../attributes-registry/server.md) | string | Name of the database host. [9] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.query.parameter.`](../attributes-registry/db.md) | string | The query parameters used in `db.query.text`, with `` being the parameter name, and the attribute value being the parameter value. [10] | `someval`; `55` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -**[1]:** In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). +**[1]:** If the collection name is parsed from the query, it SHOULD match the value provided in the query and may be qualified with the schema and database name. -**[2]:** If readily available. Otherwise, if the instrumentation library parses `db.statement` to capture `db.operation.name`, then it SHOULD be the first operation name found in the query. +**[2]:** If readily available. Otherwise, if the instrumentation library parses `db.query.text` to capture `db.collection.name`, then it SHOULD be the first collection name found in the query. -**[3]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. +**[3]:** In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name). -**[4]:** If using a port other than the default port for this DBMS and if `server.address` is set. +**[4]:** If readily available. Otherwise, if the instrumentation library parses `db.query.text` to capture `db.operation.name`, then it SHOULD be the first operation name found in the query. -**[5]:** Should be collected by default only if there is sanitization that excludes sensitive information. +**[5]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. -**[6]:** Semantic conventions for individual database systems SHOULD document whether `network.peer.*` attributes are applicable. Network peer address and port are useful when the application interacts with individual database nodes directly. +**[6]:** If using a port other than the default port for this DBMS and if `server.address` is set. + +**[7]:** Should be collected by default only if there is sanitization that excludes sensitive information. + +**[8]:** Semantic conventions for individual database systems SHOULD document whether `network.peer.*` attributes are applicable. Network peer address and port are useful when the application interacts with individual database nodes directly. If a database operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used. -**[7]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. +**[9]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. -**[8]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders. +**[10]:** Query parameters should only be captured when `db.query.text` is parameterized with placeholders. If a parameter has no name and instead is referenced only by index, then `` SHOULD be the 0-based index. `db.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. diff --git a/docs/database/mongodb.md b/docs/database/mongodb.md index 473cf4c137..de02a0b6ba 100644 --- a/docs/database/mongodb.md +++ b/docs/database/mongodb.md @@ -17,12 +17,14 @@ described on this page. | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| -| [`db.mongodb.collection`](../attributes-registry/db.md) | string | The MongoDB collection being accessed within the database stated in `db.name`. | `customers`; `products` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`db.operation.name`](../attributes-registry/db.md) | string | The name of the command being executed. [1] | `findAndModify`; `getMore`; `update` | `Conditionally Required` [2] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.collection.name`](../attributes-registry/db.md) | string | The MongoDB collection being accessed within the database stated in `db.name`. [1] | `public.users`; `customers` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.operation.name`](../attributes-registry/db.md) | string | The name of the command being executed. [2] | `findAndModify`; `getMore`; `update` | `Conditionally Required` [3] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -**[1]:** See [MongoDB database commands](https://www.mongodb.com/docs/manual/reference/command/). +**[1]:** If the collection name is parsed from the query, it SHOULD match the value provided in the query and may be qualified with the schema and database name. -**[2]:** If readily available. Otherwise, if the instrumentation library parses `db.statement` to capture `db.operation.name`, then it SHOULD be the first operation name found in the query. +**[2]:** See [MongoDB database commands](https://www.mongodb.com/docs/manual/reference/command/). + +**[3]:** If readily available. Otherwise, if the instrumentation library parses `db.query.text` to capture `db.operation.name`, then it SHOULD be the first operation name found in the query. ## Example diff --git a/docs/database/mssql.md b/docs/database/mssql.md index 47ed5a0012..e4c0774857 100644 --- a/docs/database/mssql.md +++ b/docs/database/mssql.md @@ -17,18 +17,20 @@ described on this page. | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| -| [`db.operation.name`](../attributes-registry/db.md) | string | The name of the operation or command being executed. [1] | `SELECT`; `INSERT`; `UPDATE`; `DELETE`; `CREATE`; `mystoredproc` | `Conditionally Required` [2] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`db.mssql.instance_name`](../attributes-registry/db.md) | string | The Microsoft SQL Server [instance name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. [3] | `MSSQLSERVER` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`db.sql.table`](../attributes-registry/db.md) | string | The name of the primary table that the operation is acting upon, including the database name (if applicable). [4] | `public.users`; `customers` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.collection.name`](../attributes-registry/db.md) | string | The name of the SQL table that the operation is acting upon. [1] | `public.users`; `customers` | `Conditionally Required` [2] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.operation.name`](../attributes-registry/db.md) | string | The name of the operation or command being executed. [3] | `SELECT`; `INSERT`; `UPDATE`; `DELETE`; `CREATE`; `mystoredproc` | `Conditionally Required` [4] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.mssql.instance_name`](../attributes-registry/db.md) | string | The Microsoft SQL Server [instance name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. [5] | `MSSQLSERVER` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -**[1]:** This SHOULD be the SQL command such as `SELECT`, `INSERT`, `UPDATE`, `CREATE`, `DROP`. -In the case of `EXEC`, this SHOULD be the stored procedure name that is being executed. +**[1]:** If the collection name is parsed from the query, it SHOULD match the value provided in the query and may be qualified with the schema and database name. + +**[2]:** If readily available. Otherwise, if the instrumentation library parses `db.query.text` to capture `db.collection.name`, then it SHOULD be the first collection name found in the query. -**[2]:** If readily available. Otherwise, if the instrumentation library parses `db.statement` to capture `db.operation.name`, then it SHOULD be the first operation name found in the query. +**[3]:** This SHOULD be the SQL command such as `SELECT`, `INSERT`, `UPDATE`, `CREATE`, `DROP`. +In the case of `EXEC`, this SHOULD be the stored procedure name that is being executed. -**[3]:** If setting a `db.mssql.instance_name`, `server.port` is no longer required (but still recommended if non-standard). +**[4]:** If readily available. Otherwise, if the instrumentation library parses `db.query.text` to capture `db.operation.name`, then it SHOULD be the first operation name found in the query. -**[4]:** It is not recommended to attempt any client-side parsing of `db.query.text` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. +**[5]:** If setting a `db.mssql.instance_name`, `server.port` is no longer required (but still recommended if non-standard). [DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.31.0/specification/document-status.md diff --git a/docs/database/sql.md b/docs/database/sql.md index 002fff4d06..60bf0b8cf8 100644 --- a/docs/database/sql.md +++ b/docs/database/sql.md @@ -15,15 +15,17 @@ described on this page. | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| -| [`db.operation.name`](../attributes-registry/db.md) | string | The name of the operation or command being executed. [1] | `SELECT`; `INSERT`; `UPDATE`; `DELETE`; `CREATE`; `mystoredproc` | `Conditionally Required` [2] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`db.sql.table`](../attributes-registry/db.md) | string | The name of the primary table that the operation is acting upon, including the database name (if applicable). [3] | `public.users`; `customers` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.collection.name`](../attributes-registry/db.md) | string | The name of the SQL table that the operation is acting upon. [1] | `public.users`; `customers` | `Conditionally Required` [2] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`db.operation.name`](../attributes-registry/db.md) | string | The name of the operation or command being executed. [3] | `SELECT`; `INSERT`; `UPDATE`; `DELETE`; `CREATE`; `mystoredproc` | `Conditionally Required` [4] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -**[1]:** This SHOULD be the SQL command such as `SELECT`, `INSERT`, `UPDATE`, `CREATE`, `DROP`. -In the case of `EXEC`, this SHOULD be the stored procedure name that is being executed. +**[1]:** If the collection name is parsed from the query, it SHOULD match the value provided in the query and may be qualified with the schema and database name. + +**[2]:** If readily available. Otherwise, if the instrumentation library parses `db.query.text` to capture `db.collection.name`, then it SHOULD be the first collection name found in the query. -**[2]:** If readily available. Otherwise, if the instrumentation library parses `db.statement` to capture `db.operation.name`, then it SHOULD be the first operation name found in the query. +**[3]:** This SHOULD be the SQL command such as `SELECT`, `INSERT`, `UPDATE`, `CREATE`, `DROP`. +In the case of `EXEC`, this SHOULD be the stored procedure name that is being executed. -**[3]:** It is not recommended to attempt any client-side parsing of `db.query.text` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. +**[4]:** If readily available. Otherwise, if the instrumentation library parses `db.query.text` to capture `db.operation.name`, then it SHOULD be the first operation name found in the query. ## Example @@ -42,6 +44,6 @@ This is an example of attributes for a MySQL database span: | `db.name` | `"ShopDb"` | | `db.statement` | `"SELECT * FROM orders WHERE order_id = 'o4711'"` | | `db.operation` | `"SELECT"` | -| `db.sql.table` | `"orders"` | +| `db.collection.name` | `"orders"` | [DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.31.0/specification/document-status.md diff --git a/model/registry/db.yaml b/model/registry/db.yaml index f967fdbe64..cce3c33972 100644 --- a/model/registry/db.yaml +++ b/model/registry/db.yaml @@ -79,19 +79,15 @@ groups: The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. examples: [0, 2] tag: tech-specific-cassandra - - id: cassandra.table + - id: collection.name type: string stability: experimental - brief: The name of the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable). + brief: The name of a collection (table, container) within the database. note: > - This mirrors the db.sql.table attribute but references cassandra rather than sql. - It is not recommended to attempt any client-side parsing of - `db.query.text` just to get this property, but it should be set if - it is provided by the library being instrumented. - If the operation is acting upon an anonymous table, or more than one table, this - value MUST NOT be set. - examples: 'mytable' - tag: tech-specific-cassandra + If the collection name is parsed from the query, it SHOULD match the value provided + in the query and may be qualified with the schema and database name. + tag: db-generic + examples: ['public.users', 'customers'] - id: cosmosdb.client_id type: string stability: experimental @@ -113,12 +109,6 @@ groups: stability: experimental brief: Cosmos client connection mode. tag: tech-specific-cosmosdb - - id: cosmosdb.container - type: string - stability: experimental - brief: Cosmos DB container name. - examples: 'anystring' - tag: tech-specific-cosmosdb - id: cosmosdb.operation_type type: allow_custom_values: true @@ -213,13 +203,6 @@ groups: in order to map the path part values to their names. examples: ['db.elasticsearch.path_parts.index=test-index', 'db.elasticsearch.path_parts.doc_id=123'] tag: tech-specific-elasticsearch - - id: mongodb.collection - type: string - stability: experimental - brief: > - The MongoDB collection being accessed within the database stated in `db.name`. - examples: [ 'customers', 'products' ] - tag: tech-specific-mongodb - id: mssql.instance_name type: string stability: experimental @@ -260,18 +243,6 @@ groups: To be used instead of the generic `db.name` attribute. examples: [0, 1, 15] tag: tech-specific-redis - - id: sql.table - type: string - stability: experimental - brief: The name of the primary table that the operation is acting upon, including the database name (if applicable). - note: > - It is not recommended to attempt any client-side parsing of - `db.query.text` just to get this property, but it should be set if - it is provided by the library being instrumented. - If the operation is acting upon an anonymous table, or more than one table, this - value MUST NOT be set. - examples: ['public.users', 'customers'] - tag: tech-specific-sql - id: query.text type: string stability: experimental diff --git a/model/registry/deprecated/db.yaml b/model/registry/deprecated/db.yaml index 1fec703f81..a5a6390b1b 100644 --- a/model/registry/deprecated/db.yaml +++ b/model/registry/deprecated/db.yaml @@ -42,3 +42,27 @@ groups: deprecated: "Replaced by `db.query.text`." stability: experimental examples: ['SELECT * FROM wuser_table', 'SET mykey "WuValue"'] + - id: cassandra.table + type: string + stability: experimental + brief: 'Deprecated, use `db.collection.name` instead.' + deprecated: "Replaced by `db.collection.name`." + examples: 'mytable' + - id: cosmosdb.container + type: string + stability: experimental + brief: 'Deprecated, use `db.collection.name` instead.' + deprecated: "Replaced by `db.collection.name`." + examples: 'mytable' + - id: mongodb.collection + type: string + stability: experimental + brief: 'Deprecated, use `db.collection.name` instead.' + deprecated: "Replaced by `db.collection.name`." + examples: 'mytable' + - id: sql.table + type: string + stability: experimental + brief: 'Deprecated, use `db.collection.name` instead.' + deprecated: "Replaced by `db.collection.name`." + examples: 'mytable' diff --git a/model/trace/database.yaml b/model/trace/database.yaml index 8c6f973b39..b4ed7d0da6 100644 --- a/model/trace/database.yaml +++ b/model/trace/database.yaml @@ -17,7 +17,7 @@ groups: - ref: db.operation.name requirement_level: conditionally_required: > - If readily available. Otherwise, if the instrumentation library parses `db.statement` to capture + If readily available. Otherwise, if the instrumentation library parses `db.query.text` to capture `db.operation.name`, then it SHOULD be the first operation name found in the query. - ref: server.address brief: > @@ -28,6 +28,11 @@ groups: - ref: db.instance.id requirement_level: recommended: If different from the `server.address` + - ref: db.collection.name + requirement_level: + conditionally_required: > + If readily available. Otherwise, if the instrumentation library parses `db.query.text` to capture + `db.collection.name`, then it SHOULD be the first collection name found in the query. - ref: network.peer.address brief: Peer address of the database node where the operation was performed. requirement_level: @@ -86,7 +91,8 @@ groups: tag: tech-specific - ref: db.cassandra.consistency_level tag: tech-specific - - ref: db.cassandra.table + - ref: db.collection.name + brief: The name of the Cassandra table that the operation is acting upon. tag: tech-specific - ref: db.cassandra.idempotence tag: tech-specific @@ -160,7 +166,9 @@ groups: See [MongoDB database commands](https://www.mongodb.com/docs/manual/reference/command/). examples: ['findAndModify', 'getMore', 'update'] tag: tech-specific - - ref: db.mongodb.collection + - ref: db.collection.name + brief: + The MongoDB collection being accessed within the database stated in `db.name`. requirement_level: required tag: tech-specific @@ -222,7 +230,8 @@ groups: In the case of `EXEC`, this SHOULD be the stored procedure name that is being executed. examples: ['SELECT', 'INSERT', 'UPDATE', 'DELETE', 'CREATE', 'mystoredproc'] tag: tech-specific - - ref: db.sql.table + - ref: db.collection.name + brief: The name of the SQL table that the operation is acting upon. tag: tech-specific - id: db.cosmosdb @@ -257,7 +266,9 @@ groups: requirement_level: conditionally_required: if not `direct` (or pick gw as default) tag: tech-specific - - ref: db.cosmosdb.container + - ref: db.collection.name + brief: > + Cosmos DB container name. requirement_level: conditionally_required: if available tag: tech-specific diff --git a/schema-next.yaml b/schema-next.yaml index 6a217cea7f..b893a50d4e 100644 --- a/schema-next.yaml +++ b/schema-next.yaml @@ -6,6 +6,13 @@ versions: 1.25.0: spans: changes: + # https://github.com/open-telemetry/semantic-conventions/pull/870 + - rename_attributes: + attribute_map: + db.sql.table: db.collection.name + db.mongodb.collection: db.collection.name + db.cosmosdb.container: db.collection.name + db.cassandra.table: db.collection.name # https://github.com/open-telemetry/semantic-conventions/pull/798 - rename_attributes: attribute_map: From 49669266d979d925b1152885bd0be886929c7f22 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Mon, 8 Apr 2024 13:05:09 -0700 Subject: [PATCH 08/14] Update references from `db.operation` to `db.operation.name` (#904) --- docs/database/cosmosdb.md | 2 +- docs/database/database-spans.md | 4 ++-- docs/database/elasticsearch.md | 4 ++-- docs/database/mongodb.md | 6 +++--- docs/database/redis.md | 2 +- docs/database/sql.md | 26 ++++++++++++------------- model/trace/instrumentation/aws-sdk.yml | 2 +- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/docs/database/cosmosdb.md b/docs/database/cosmosdb.md index 499d453db6..f6a32606fa 100644 --- a/docs/database/cosmosdb.md +++ b/docs/database/cosmosdb.md @@ -80,7 +80,7 @@ In addition to Cosmos DB attributes, all spans include | `az.namespace` | `"Microsoft.DocumentDB"` | | `db.system` | `"cosmosdb"` | | `db.name` | `"database name"` | -| `db.operation` | `"ReadItemsAsync"` | +| `db.operation.name` | `"ReadItemsAsync"` | | `server.address` | `"account.documents.azure.com"` | | `db.cosmosdb.client_id` | `3ba4827d-4422-483f-b59f-85b74211c11d` | | `db.cosmosdb.operation_type` | `Read` | diff --git a/docs/database/database-spans.md b/docs/database/database-spans.md index 937e8a5770..3a758bf223 100644 --- a/docs/database/database-spans.md +++ b/docs/database/database-spans.md @@ -55,8 +55,8 @@ The **span name** SHOULD be set to a low cardinality value representing the stat It MAY be a stored procedure name (without arguments), DB statement without variable arguments, operation name, etc. Since SQL statements may have very high cardinality even without arguments, SQL spans SHOULD be named the following way, unless the statement is known to be of low cardinality: -` .`, provided that `db.operation` and `db.collection.name` are available. -If `db.collection.name` is not available due to its semantics, the span SHOULD be named ` `. +` .`, provided that `db.operation` and `db.collection.name` are available. +If `db.collection.name` is not available due to its semantics, the span SHOULD be named ` `. It is not recommended to attempt any client-side parsing of `db.statement` just to get these properties, they should only be used if the library being instrumented already provides them. When it's otherwise impossible to get any meaningful span name, `db.name` or the tech-specific database name MAY be used. diff --git a/docs/database/elasticsearch.md b/docs/database/elasticsearch.md index c04c894ca0..1ef894e18a 100644 --- a/docs/database/elasticsearch.md +++ b/docs/database/elasticsearch.md @@ -101,10 +101,10 @@ Tracing instrumentations that do so, MUST also set `http.request.method_original | `server.port` | `9200` | | `http.request.method` | `"GET"` | | `db.statement` | `"{\"query\":{\"term\":{\"user.id\":\"kimchy\"}}}"` | -| `db.operation` | `"search"` | +| `db.operation.name` | `"search"` | | `url.full` | `"https://elasticsearch.mydomain.com:9200/my-index-000001/_search?from=40&size=20"` | | `db.elasticsearch.path_parts.index` | `"my-index-000001"` | | `db.elasticsearch.cluster.name` | `"e9106fc68e3044f0b1475b04bf4ffd5f"` | -| `db.instance.id` | `"instance-0000000001"` | +| `db.instance.id` | `"instance-0000000001"` | [DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.31.0/specification/document-status.md diff --git a/docs/database/mongodb.md b/docs/database/mongodb.md index de02a0b6ba..8f375ca88b 100644 --- a/docs/database/mongodb.md +++ b/docs/database/mongodb.md @@ -29,8 +29,8 @@ described on this page. ## Example -| Key | Value | -| :---------------------- | :----------------------------------------------------------- | +| Key | Value | +|:------------------------| :----------------------------------------------------------- | | Span name | `"products.findAndModify"` | | `db.system` | `"mongodb"` | | `server.address` | `"mongodb0.example.com"` | @@ -40,7 +40,7 @@ described on this page. | `network.transport` | `"tcp"` | | `db.name` | `"shopDb"` | | `db.statement` | not set | -| `db.operation` | `"findAndModify"` | +| `db.operation.name` | `"findAndModify"` | | `db.mongodb.collection` | `"products"` | [DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.31.0/specification/document-status.md diff --git a/docs/database/redis.md b/docs/database/redis.md index 2011dc67e7..6a8e94e057 100644 --- a/docs/database/redis.md +++ b/docs/database/redis.md @@ -42,7 +42,7 @@ Furthermore, `db.name` is not specified as there is no database name in Redis an | `network.transport` | `"unix"` | | `db.name` | not set | | `db.statement` | `"HMSET myhash field1 'Hello' field2 'World"` | -| `db.operation` | not set | +| `db.operation.name` | not set | | `db.redis.database_index` | `15` | [DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.31.0/specification/document-status.md diff --git a/docs/database/sql.md b/docs/database/sql.md index 60bf0b8cf8..12d24d3448 100644 --- a/docs/database/sql.md +++ b/docs/database/sql.md @@ -32,18 +32,18 @@ In the case of `EXEC`, this SHOULD be the stored procedure name that is being ex This is an example of attributes for a MySQL database span: -| Key | Value | -|:------------------------| :----------------------------------------------------------- | -| Span name | `"SELECT ShopDb.orders"` | -| `db.system` | `"mysql"` | -| `server.address` | `"shopdb.example.com"` | -| `server.port` | `3306` | -| `network.peer.address` | `"192.0.2.12"` | -| `network.peer.port` | `3306` | -| `network.transport` | `"tcp"` | -| `db.name` | `"ShopDb"` | -| `db.statement` | `"SELECT * FROM orders WHERE order_id = 'o4711'"` | -| `db.operation` | `"SELECT"` | -| `db.collection.name` | `"orders"` | +| Key | Value | +|:-----------------------| :----------------------------------------------------------- | +| Span name | `"SELECT ShopDb.orders"` | +| `db.system` | `"mysql"` | +| `server.address` | `"shopdb.example.com"` | +| `server.port` | `3306` | +| `network.peer.address` | `"192.0.2.12"` | +| `network.peer.port` | `3306` | +| `network.transport` | `"tcp"` | +| `db.name` | `"ShopDb"` | +| `db.statement` | `"SELECT * FROM orders WHERE order_id = 'o4711'"` | +| `db.operation.name` | `"SELECT"` | +| `db.collection.name` | `"orders"` | [DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.31.0/specification/document-status.md diff --git a/model/trace/instrumentation/aws-sdk.yml b/model/trace/instrumentation/aws-sdk.yml index 216f8d1f7f..aac648e688 100644 --- a/model/trace/instrumentation/aws-sdk.yml +++ b/model/trace/instrumentation/aws-sdk.yml @@ -44,7 +44,7 @@ groups: type: span brief: "Attributes that exist for multiple DynamoDB request types." attributes: - - ref: db.operation + - ref: db.operation.name brief: "The same value as `rpc.method`." examples: - GetItem From ccb6db6f3dbc6fdb4c2ec16b0ed8fccd1e783e4b Mon Sep 17 00:00:00 2001 From: Steve Rao Date: Tue, 9 Apr 2024 10:54:58 +0800 Subject: [PATCH 09/14] Update missing modification from `db.operation` to `db.operation.name` (#912) --- docs/database/database-spans.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/database/database-spans.md b/docs/database/database-spans.md index 3a758bf223..d43277f9d5 100644 --- a/docs/database/database-spans.md +++ b/docs/database/database-spans.md @@ -55,7 +55,7 @@ The **span name** SHOULD be set to a low cardinality value representing the stat It MAY be a stored procedure name (without arguments), DB statement without variable arguments, operation name, etc. Since SQL statements may have very high cardinality even without arguments, SQL spans SHOULD be named the following way, unless the statement is known to be of low cardinality: -` .`, provided that `db.operation` and `db.collection.name` are available. +` .`, provided that `db.operation.name` and `db.collection.name` are available. If `db.collection.name` is not available due to its semantics, the span SHOULD be named ` `. It is not recommended to attempt any client-side parsing of `db.statement` just to get these properties, they should only be used if the library being instrumented already provides them. From f731ca75375c0ad5f65c0121fcce649e59a342e7 Mon Sep 17 00:00:00 2001 From: Joao Grassi <5938087+joaopgrassi@users.noreply.github.com> Date: Tue, 9 Apr 2024 13:53:24 +0200 Subject: [PATCH 10/14] Move webengine attributes to the registry (#901) Co-authored-by: Armin Ruech <7052238+arminru@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/bug_report.yaml | 1 + .github/ISSUE_TEMPLATE/change_proposal.yaml | 1 + .github/ISSUE_TEMPLATE/new-conventions.yaml | 1 + docs/attributes-registry/README.md | 1 + docs/attributes-registry/webengine.md | 14 ++++++++++++ docs/resource/webengine.md | 6 ++--- model/registry/webengine.yaml | 25 +++++++++++++++++++++ model/resource/webengine.yaml | 24 +++++--------------- 8 files changed, 51 insertions(+), 22 deletions(-) create mode 100644 docs/attributes-registry/webengine.md create mode 100644 model/registry/webengine.yaml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 138ec6c592..850464b1ca 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -64,6 +64,7 @@ body: - area:tls - area:url - area:user-agent + - area:webengine # End semconv area list - type: textarea attributes: diff --git a/.github/ISSUE_TEMPLATE/change_proposal.yaml b/.github/ISSUE_TEMPLATE/change_proposal.yaml index 117491cb40..69dec212c1 100644 --- a/.github/ISSUE_TEMPLATE/change_proposal.yaml +++ b/.github/ISSUE_TEMPLATE/change_proposal.yaml @@ -57,6 +57,7 @@ body: - area:tls - area:url - area:user-agent + - area:webengine # End semconv area list - type: textarea attributes: diff --git a/.github/ISSUE_TEMPLATE/new-conventions.yaml b/.github/ISSUE_TEMPLATE/new-conventions.yaml index f663263c59..aa3679844a 100644 --- a/.github/ISSUE_TEMPLATE/new-conventions.yaml +++ b/.github/ISSUE_TEMPLATE/new-conventions.yaml @@ -66,6 +66,7 @@ body: - area:tls - area:url - area:user-agent + - area:webengine # End semconv area list - type: textarea attributes: diff --git a/docs/attributes-registry/README.md b/docs/attributes-registry/README.md index c9f832ec74..766e390a94 100644 --- a/docs/attributes-registry/README.md +++ b/docs/attributes-registry/README.md @@ -71,5 +71,6 @@ Currently, the following namespaces exist: * [TLS](tls.md) * [URL](url.md) * [User agent](user-agent.md) +* [Webengine](webengine.md) [developers recommendations]: ../general/attribute-naming.md#recommendations-for-application-developers diff --git a/docs/attributes-registry/webengine.md b/docs/attributes-registry/webengine.md new file mode 100644 index 0000000000..784d7adc94 --- /dev/null +++ b/docs/attributes-registry/webengine.md @@ -0,0 +1,14 @@ + + +# Webengine + +## Webengine Attributes + + +| Attribute | Type | Description | Examples | Stability | +|---|---|---|---|---| +| `webengine.description` | string | Additional description of the web engine (e.g. detailed version and edition information). | `WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - 2.2.2.Final` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `webengine.name` | string | The name of the web engine. | `WildFly` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `webengine.version` | string | The version of the web engine. | `21.0.0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + diff --git a/docs/resource/webengine.md b/docs/resource/webengine.md index 0f136433ef..4ff192e9b4 100644 --- a/docs/resource/webengine.md +++ b/docs/resource/webengine.md @@ -9,9 +9,9 @@ | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| -| `webengine.name` | string | The name of the web engine. | `WildFly` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `webengine.description` | string | Additional description of the web engine (e.g. detailed version and edition information). | `WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - 2.2.2.Final` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `webengine.version` | string | The version of the web engine. | `21.0.0` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`webengine.name`](../attributes-registry/webengine.md) | string | The name of the web engine. | `WildFly` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`webengine.description`](../attributes-registry/webengine.md) | string | Additional description of the web engine (e.g. detailed version and edition information). | `WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - 2.2.2.Final` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`webengine.version`](../attributes-registry/webengine.md) | string | The version of the web engine. | `21.0.0` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | Information describing the web engine SHOULD be captured using the values acquired from the API provided by the web engine, preferably during runtime, to avoid maintenance burden on engine version upgrades. As an example - Java engines are often but not always packaged as application servers. For Java application servers supporting Servlet API the required information MAY be captured by invoking `ServletContext.getServerInfo()` during runtime and parsing the result. diff --git a/model/registry/webengine.yaml b/model/registry/webengine.yaml new file mode 100644 index 0000000000..a1579b7d24 --- /dev/null +++ b/model/registry/webengine.yaml @@ -0,0 +1,25 @@ +groups: + - id: registry.webengine + prefix: webengine + type: attribute_group + brief: > + This document defines the attributes used to describe the packaged software running the application code. + attributes: + - id: name + type: string + stability: experimental + brief: > + The name of the web engine. + examples: ['WildFly'] + - id: version + type: string + stability: experimental + brief: > + The version of the web engine. + examples: ['21.0.0'] + - id: description + type: string + stability: experimental + brief: > + Additional description of the web engine (e.g. detailed version and edition information). + examples: ['WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - 2.2.2.Final'] diff --git a/model/resource/webengine.yaml b/model/resource/webengine.yaml index 10485dcc18..9e8a586b0f 100644 --- a/model/resource/webengine.yaml +++ b/model/resource/webengine.yaml @@ -1,26 +1,12 @@ groups: - id: webengine_resource - prefix: webengine type: resource brief: > Resource describing the packaged software running the application code. Web engines are typically executed using process.runtime. attributes: - - id: name - type: string - stability: experimental + - ref: webengine.name requirement_level: required - brief: > - The name of the web engine. - examples: ['WildFly'] - - id: version - type: string - stability: experimental - brief: > - The version of the web engine. - examples: ['21.0.0'] - - id: description - type: string - stability: experimental - brief: > - Additional description of the web engine (e.g. detailed version and edition information). - examples: ['WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - 2.2.2.Final'] + - ref: webengine.version + requirement_level: recommended + - ref: webengine.description + requirement_level: recommended From c9b8445e09de1b4bc17ec4ba259727a83645c076 Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Tue, 9 Apr 2024 08:56:23 -0700 Subject: [PATCH 11/14] Add additional process attributes to registry (#564) Co-authored-by: Alexandra Konrad <10500694+trisch-me@users.noreply.github.com> --- .chloggen/564.yaml | 22 ++++++++ docs/attributes-registry/process.md | 15 +++++ model/registry/process.yaml | 85 ++++++++++++++++++++++++++++- 3 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 .chloggen/564.yaml diff --git a/.chloggen/564.yaml b/.chloggen/564.yaml new file mode 100644 index 0000000000..777f5f8b7b --- /dev/null +++ b/.chloggen/564.yaml @@ -0,0 +1,22 @@ +# Use this changelog template to create an entry for release notes. +# +# If your change doesn't affect end users you should instead start +# your pull request title with [chore] or use the "Skip Changelog" label. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db) +component: process + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Add additional attributes to process attribute registry + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +# The values here must be integers. +issues: [564] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: diff --git a/docs/attributes-registry/process.md b/docs/attributes-registry/process.md index 280cb7e851..0d0e005b66 100644 --- a/docs/attributes-registry/process.md +++ b/docs/attributes-registry/process.md @@ -11,12 +11,27 @@ | `process.command` | string | The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. | `cmd/otelcol` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.command_args` | string[] | 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 `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. | `[cmd/otecol, --config=config.yaml]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.command_line` | string | 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 `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. | `C:\cmd\otecol --config="my directory\config.yaml"` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `process.creation.time` | string | The date and time the process was created, in ISO 8601 format. | `2023-11-21T09:25:34.853Z` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.executable.name` | string | The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. | `otelcol` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.executable.path` | string | The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. | `/usr/bin/cmd/otelcol` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `process.exit.code` | int | The exit code of the process. | `127` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `process.exit.time` | string | The date and time the process exited, in ISO 8601 format. | `2023-11-21T09:26:12.315Z` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `process.group_leader.pid` | int | The PID of the process's group leader. This is also the process group ID (PGID) of the process. | `23` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `process.interactive` | boolean | Whether the process is connected to an interactive shell. | | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.owner` | string | The username of the user that owns the process. | `root` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.parent_pid` | int | Parent Process identifier (PPID). | `111` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.pid` | int | Process identifier (PID). | `1234` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `process.real_user.id` | int | The real user ID (RUID) of the process. | `1000` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `process.real_user.name` | string | The username of the real user of the process. | `operator` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.runtime.description` | string | An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. | `Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.runtime.name` | string | The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. | `OpenJDK Runtime Environment` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.runtime.version` | string | The version of the runtime of this process, as returned by the runtime without modification. | `14.0.2` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `process.saved_user.id` | int | The saved user ID (SUID) of the process. | `1002` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `process.saved_user.name` | string | The username of the saved user. | `operator` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `process.session_leader.pid` | int | The PID of the process's session leader. This is also the session ID (SID) of the process. | `14` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `process.user.id` | int | The effective user ID (EUID) of the process. | `1001` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `process.user.name` | string | The username of the effective user of the process. | `root` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `process.vpid` | int | Virtual process identifier. [1] | `12` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[1]:** 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. diff --git a/model/registry/process.yaml b/model/registry/process.yaml index 4279a9e33a..bccb070551 100644 --- a/model/registry/process.yaml +++ b/model/registry/process.yaml @@ -17,6 +17,30 @@ groups: brief: > Parent Process identifier (PPID). examples: [111] + - id: vpid + type: int + stability: experimental + brief: > + 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. + examples: [12] + - id: session_leader.pid + type: int + stability: experimental + brief: > + The PID of the process's session leader. This is also the session ID + (SID) of the process. + examples: [14] + - id: group_leader.pid + type: int + stability: experimental + brief: > + The PID of the process's group leader. This is also the process group + ID (PGID) of the process. + examples: [23] - id: executable.name type: string stability: experimental @@ -65,7 +89,43 @@ groups: stability: experimental brief: > The username of the user that owns the process. - examples: 'root' + examples: ['root'] + - id: user.id + type: int + stability: experimental + brief: > + The effective user ID (EUID) of the process. + examples: [1001] + - id: user.name + type: string + stability: experimental + brief: > + The username of the effective user of the process. + examples: ['root'] + - id: real_user.id + type: int + stability: experimental + brief: > + The real user ID (RUID) of the process. + examples: [1000] + - id: real_user.name + type: string + stability: experimental + brief: > + The username of the real user of the process. + examples: ['operator'] + - id: saved_user.id + type: int + stability: experimental + brief: > + The saved user ID (SUID) of the process. + examples: [1002] + - id: saved_user.name + type: string + stability: experimental + brief: > + The username of the saved user. + examples: ['operator'] - id: runtime.name type: string stability: experimental @@ -87,3 +147,26 @@ groups: An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. examples: 'Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0' + - id: creation.time + type: string + stability: experimental + brief: > + The date and time the process was created, in ISO 8601 format. + examples: ['2023-11-21T09:25:34.853Z'] + - id: exit.time + type: string + stability: experimental + brief: > + The date and time the process exited, in ISO 8601 format. + examples: ['2023-11-21T09:26:12.315Z'] + - id: exit.code + type: int + stability: experimental + brief: > + The exit code of the process. + examples: [127] + - id: interactive + type: boolean + stability: experimental + brief: > + Whether the process is connected to an interactive shell. From 82b2fb2b87b8c90d31dadeac18c3b21ee0c2b7e3 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Tue, 9 Apr 2024 09:25:52 -0700 Subject: [PATCH 12/14] Process: replace constraints with requirement levels and note (#863) --- .chloggen/863.yaml | 4 ++++ docs/resource/process.md | 33 +++++++++++++++++++++------------ model/resource/process.yaml | 17 +++++------------ 3 files changed, 30 insertions(+), 24 deletions(-) create mode 100644 .chloggen/863.yaml diff --git a/.chloggen/863.yaml b/.chloggen/863.yaml new file mode 100644 index 0000000000..6dc53c5dcf --- /dev/null +++ b/.chloggen/863.yaml @@ -0,0 +1,4 @@ +change_type: enhancement +component: process +note: Replace constraints with requirement_level in process attributes. +issues: [ 863 ] diff --git a/docs/resource/process.md b/docs/resource/process.md index aa9ccea63f..8b5c5f9619 100644 --- a/docs/resource/process.md +++ b/docs/resource/process.md @@ -7,6 +7,7 @@ - [Process](#process) + - [Selecting process attributes](#selecting-process-attributes) - [Process runtimes](#process-runtimes) - [Erlang Runtimes](#erlang-runtimes) - [Go Runtimes](#go-runtimes) @@ -27,32 +28,40 @@ | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| -| [`process.command`](../attributes-registry/process.md) | string | The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. | `cmd/otelcol` | `Conditionally Required` See alternative attributes below. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`process.command_args`](../attributes-registry/process.md) | string[] | 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 `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. | `[cmd/otecol, --config=config.yaml]` | `Conditionally Required` See alternative attributes below. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`process.command_line`](../attributes-registry/process.md) | string | 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 `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. | `C:\cmd\otecol --config="my directory\config.yaml"` | `Conditionally Required` See alternative attributes below. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`process.executable.name`](../attributes-registry/process.md) | string | The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. | `otelcol` | `Conditionally Required` See alternative attributes below. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`process.executable.path`](../attributes-registry/process.md) | string | The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. | `/usr/bin/cmd/otelcol` | `Conditionally Required` See alternative attributes below. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`process.command`](../attributes-registry/process.md) | string | The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. | `cmd/otelcol` | `Conditionally Required` [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`process.command_args`](../attributes-registry/process.md) | string[] | 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 `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. | `[cmd/otecol, --config=config.yaml]` | `Conditionally Required` [2] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`process.command_line`](../attributes-registry/process.md) | string | 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 `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. | `C:\cmd\otecol --config="my directory\config.yaml"` | `Conditionally Required` [3] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`process.executable.name`](../attributes-registry/process.md) | string | The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. | `otelcol` | `Conditionally Required` [4] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`process.executable.path`](../attributes-registry/process.md) | string | The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. | `/usr/bin/cmd/otelcol` | `Conditionally Required` [5] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`process.owner`](../attributes-registry/process.md) | string | The username of the user that owns the process. | `root` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`process.parent_pid`](../attributes-registry/process.md) | int | Parent Process identifier (PPID). | `111` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`process.pid`](../attributes-registry/process.md) | int | Process identifier (PID). | `1234` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -**Additional attribute requirements:** At least one of the following sets of attributes is required: +**[1]:** See [Selecting process attributes](#selecting-process-attributes) for details. + +**[2]:** See [Selecting process attributes](#selecting-process-attributes) for details. + +**[3]:** See [Selecting process attributes](#selecting-process-attributes) for details. + +**[4]:** See [Selecting process attributes](#selecting-process-attributes) for details. + +**[5]:** See [Selecting process attributes](#selecting-process-attributes) for details. + + +### Selecting process attributes + +At least one of the following attributes is required: * [`process.executable.name`](../attributes-registry/process.md) * [`process.executable.path`](../attributes-registry/process.md) * [`process.command`](../attributes-registry/process.md) * [`process.command_line`](../attributes-registry/process.md) * [`process.command_args`](../attributes-registry/process.md) - Between `process.command_args` and `process.command_line`, usually `process.command_args` should be preferred. On Windows and other systems where the native format of process commands is a single string, `process.command_line` can additionally (or instead) be used. -For backwards compatibility with older versions of this semantic convention, -it is possible but deprecated to use an array as type for `process.command_line`. -In that case it MUST be interpreted as if it was `process.command_args`. - ## Process runtimes **type:** `process.runtime` @@ -94,7 +103,7 @@ Go Runtimes SHOULD fill in the as follows: ```go import "runtime" - + func getRuntimeName() string { if runtime.Compiler == "gc" { return "go" diff --git a/model/resource/process.yaml b/model/resource/process.yaml index 61223d61ce..36becc7606 100644 --- a/model/resource/process.yaml +++ b/model/resource/process.yaml @@ -9,27 +9,20 @@ groups: - ref: process.parent_pid - ref: process.executable.name requirement_level: - conditionally_required: See alternative attributes below. + conditionally_required: See [Selecting process attributes](#selecting-process-attributes) for details. - ref: process.executable.path requirement_level: - conditionally_required: See alternative attributes below. + conditionally_required: See [Selecting process attributes](#selecting-process-attributes) for details. - ref: process.command requirement_level: - conditionally_required: See alternative attributes below. + conditionally_required: See [Selecting process attributes](#selecting-process-attributes) for details. - ref: process.command_line requirement_level: - conditionally_required: See alternative attributes below. + conditionally_required: See [Selecting process attributes](#selecting-process-attributes) for details. - ref: process.command_args requirement_level: - conditionally_required: See alternative attributes below. + conditionally_required: See [Selecting process attributes](#selecting-process-attributes) for details. - ref: process.owner - constraints: - - any_of: - - process.executable.name - - process.executable.path - - process.command - - process.command_line - - process.command_args - id: process.runtime prefix: process.runtime From 51813f68cabbf07bc0f1c3a30471d2cb65b0417c Mon Sep 17 00:00:00 2001 From: Alexandra Konrad <10500694+trisch-me@users.noreply.github.com> Date: Wed, 10 Apr 2024 08:06:05 +0200 Subject: [PATCH 13/14] [chore] move event to registry (#907) Co-authored-by: Alexander Wert Co-authored-by: Liudmila Molkova --- .github/ISSUE_TEMPLATE/bug_report.yaml | 1 + .github/ISSUE_TEMPLATE/change_proposal.yaml | 1 + .github/ISSUE_TEMPLATE/new-conventions.yaml | 1 + docs/attributes-registry/README.md | 1 + docs/attributes-registry/event.md | 15 +++++++++++++++ docs/general/events.md | 2 +- model/logs/events.yaml | 13 +------------ model/registry/event.yaml | 18 ++++++++++++++++++ 8 files changed, 39 insertions(+), 13 deletions(-) create mode 100644 docs/attributes-registry/event.md create mode 100644 model/registry/event.yaml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 850464b1ca..2639c99423 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -35,6 +35,7 @@ body: - area:dns - area:enduser - area:error + - area:event - area:exception - area:faas - area:feature-flag diff --git a/.github/ISSUE_TEMPLATE/change_proposal.yaml b/.github/ISSUE_TEMPLATE/change_proposal.yaml index 69dec212c1..46733b2f73 100644 --- a/.github/ISSUE_TEMPLATE/change_proposal.yaml +++ b/.github/ISSUE_TEMPLATE/change_proposal.yaml @@ -28,6 +28,7 @@ body: - area:dns - area:enduser - area:error + - area:event - area:exception - area:faas - area:feature-flag diff --git a/.github/ISSUE_TEMPLATE/new-conventions.yaml b/.github/ISSUE_TEMPLATE/new-conventions.yaml index aa3679844a..a89d94a13e 100644 --- a/.github/ISSUE_TEMPLATE/new-conventions.yaml +++ b/.github/ISSUE_TEMPLATE/new-conventions.yaml @@ -37,6 +37,7 @@ body: - area:dns - area:enduser - area:error + - area:event - area:exception - area:faas - area:feature-flag diff --git a/docs/attributes-registry/README.md b/docs/attributes-registry/README.md index 766e390a94..4669206415 100644 --- a/docs/attributes-registry/README.md +++ b/docs/attributes-registry/README.md @@ -43,6 +43,7 @@ Currently, the following namespaces exist: * [Disk](disk.md) * [End user](enduser.md) * [Error](error.md) +* [Event](event.md) * [Exception](exception.md) * [FaaS](faas.md) * [Feature Flag](feature-flag.md) diff --git a/docs/attributes-registry/event.md b/docs/attributes-registry/event.md new file mode 100644 index 0000000000..c377cf5068 --- /dev/null +++ b/docs/attributes-registry/event.md @@ -0,0 +1,15 @@ + + +# Event + +## Event Attributes + + +| Attribute | Type | Description | Examples | Stability | +|---|---|---|---|---| +| `event.name` | string | Identifies the class / type of event. [1] | `browser.mouse.click`; `device.app.lifecycle` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +**[1]:** Event names are subject to the same rules as [attribute names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.31.0/specification/common/attribute-naming.md). 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. + diff --git a/docs/general/events.md b/docs/general/events.md index 73668bb423..1cf9f33abb 100644 --- a/docs/general/events.md +++ b/docs/general/events.md @@ -55,7 +55,7 @@ that identify the class of Events but not the instance of the Event. | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| -| `event.name` | string | Identifies the class / type of event. [1] | `browser.mouse.click`; `device.app.lifecycle` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`event.name`](../attributes-registry/event.md) | string | Identifies the class / type of event. [1] | `browser.mouse.click`; `device.app.lifecycle` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** Event names are subject to the same rules as [attribute names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.31.0/specification/common/attribute-naming.md). 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. diff --git a/model/logs/events.yaml b/model/logs/events.yaml index 1576901054..b07e25a8df 100644 --- a/model/logs/events.yaml +++ b/model/logs/events.yaml @@ -1,19 +1,8 @@ groups: - id: event type: attribute_group - prefix: event brief: > This document defines attributes for Events represented using Log Records. attributes: - - id: name - type: string - stability: experimental + - ref: event.name requirement_level: required - brief: > - Identifies the class / type of event. - note: > - Event names are subject to the same rules as [attribute names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.31.0/specification/common/attribute-naming.md). - 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. - examples: ['browser.mouse.click', 'device.app.lifecycle'] diff --git a/model/registry/event.yaml b/model/registry/event.yaml new file mode 100644 index 0000000000..aa69709b69 --- /dev/null +++ b/model/registry/event.yaml @@ -0,0 +1,18 @@ +groups: + - id: registry.event + prefix: event + type: attribute_group + brief: > + Attributes for Events represented using Log Records. + attributes: + - id: name + type: string + stability: experimental + brief: > + Identifies the class / type of event. + note: > + Event names are subject to the same rules as [attribute names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.31.0/specification/common/attribute-naming.md). + 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. + examples: ['browser.mouse.click', 'device.app.lifecycle'] From 768a23c3627e4bd96146d9f713db214bee7aecf3 Mon Sep 17 00:00:00 2001 From: Joao Grassi <5938087+joaopgrassi@users.noreply.github.com> Date: Wed, 10 Apr 2024 09:57:09 +0200 Subject: [PATCH 14/14] [chore] Move otel.* attributes to registry (#891) --- docs/attributes-registry/otel.md | 21 +++++++++++++++++++-- model/registry/otel.yaml | 24 ++++++++++++++++++++++++ model/trace/exporter/exporter.yaml | 24 ++++-------------------- 3 files changed, 47 insertions(+), 22 deletions(-) diff --git a/docs/attributes-registry/otel.md b/docs/attributes-registry/otel.md index 92c94105c5..a064129e90 100644 --- a/docs/attributes-registry/otel.md +++ b/docs/attributes-registry/otel.md @@ -5,12 +5,29 @@ -- [OpenTelemetry Attributes](#opentelemetry-attributes) +- [General Attributes](#general-attributes) +- [Scope Attributes](#scope-attributes) - [Deprecated OpenTelemetry Attributes](#deprecated-opentelemetry-attributes) -## OpenTelemetry Attributes +## General Attributes + + +| Attribute | Type | Description | Examples | Stability | +|---|---|---|---|---| +| `otel.status_code` | string | Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET. | `OK` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| `otel.status_description` | string | Description of the Status if it has a value, otherwise not set. | `resource not found` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | + +`otel.status_code` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. + +| Value | Description | Stability | +|---|---|---| +| `OK` | The operation has been validated by an Application developer or Operator to have completed successfully. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| `ERROR` | The operation contains an error. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | + + +## Scope Attributes | Attribute | Type | Description | Examples | Stability | diff --git a/model/registry/otel.yaml b/model/registry/otel.yaml index 1fa7f0da45..7da6ece282 100644 --- a/model/registry/otel.yaml +++ b/model/registry/otel.yaml @@ -1,4 +1,28 @@ groups: + - id: registry.otel + prefix: otel + type: attribute_group + brief: Attributes reserved for OpenTelemetry + attributes: + - id: status_code + type: + allow_custom_values: true + members: + - id: ok + value: OK + brief: 'The operation has been validated by an Application developer or Operator to have completed successfully.' + stability: stable + - id: error + value: ERROR + brief: 'The operation contains an error.' + stability: stable + brief: Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET. + stability: stable + - id: status_description + type: string + brief: "Description of the Status if it has a value, otherwise not set." + examples: ['resource not found'] + stability: stable - id: registry.otel.scope prefix: otel.scope type: resource diff --git a/model/trace/exporter/exporter.yaml b/model/trace/exporter/exporter.yaml index 124c5da191..0c4e8c6a8f 100644 --- a/model/trace/exporter/exporter.yaml +++ b/model/trace/exporter/exporter.yaml @@ -1,25 +1,9 @@ groups: - id: otel_span - prefix: otel type: span brief: Span attributes used by non-OTLP exporters to represent OpenTelemetry Span's concepts. attributes: - - id: status_code - type: - allow_custom_values: false - members: - - id: ok - value: OK - brief: 'The operation has been validated by an Application developer or Operator to have completed successfully.' - stability: experimental - - id: error - value: ERROR - brief: 'The operation contains an error.' - stability: experimental - brief: Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET. - stability: stable - - id: status_description - type: string - brief: "Description of the Status if it has a value, otherwise not set." - examples: ['resource not found'] - stability: stable + - ref: otel.status_code + requirement_level: recommended + - ref: otel.status_description + requirement_level: recommended