diff --git a/semantic_conventions/trace/database.yaml b/semantic_conventions/trace/database.yaml index 6273ed49186..57b972590f5 100644 --- a/semantic_conventions/trace/database.yaml +++ b/semantic_conventions/trace/database.yaml @@ -507,6 +507,4 @@ groups: - include: 'db.redis' - include: 'db.mongodb' - include: 'db.sql' - - include: 'db.cosmosdb' - - + - include: 'db.cosmosdb' \ No newline at end of file diff --git a/specification/trace/semantic_conventions/database.md b/specification/trace/semantic_conventions/database.md index d28325603b9..d69b52498b2 100644 --- a/specification/trace/semantic_conventions/database.md +++ b/specification/trace/semantic_conventions/database.md @@ -268,44 +268,46 @@ Furthermore, `db.name` is not specified as there is no database name in Redis an | `db.operation` | `"findAndModify"` | | `db.mongodb.collection` | `"products"` | -### CosmosDB +### Microsoft Azure Cosmos DB -CosmosDb SDK (Currently only .Net) emit Activity at operation level with following attributes/information. +Microsoft Azure Cosmos DB SDK (Currently only .Net) emit Activity at operation level with following attributes/information. + | Attribute | Value | Comment | | -------- | ------------------- | --------------------- | -| _kind_ | _client_ | _IGNORE, By Default, setting them as part of diagnostic scope_ | -| _az.namespace_| _Microsoft.DocumentDB_ | _IGNORE, By Default, setting them as part of diagnostic scope_ | -|db.system| cosmosdb | Open Telemetry Convention To identify type of Db ref. https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/database.md#notes-and-well-known-identifiers-for-dbsystem| -| db.name | < Database Name > | | -| db.operation| ReadItemAsync, DeleteItemStreamAsync etc | Database Operation ~Type~ Name | -| net.peer.name | e.g. sourabhjaintemp | Account Name + Cloud | +| _kind_ | _client_ | _IGNORE, By Default, setting them as part of diagnostic scope_ | +| _az.namespace_| _Microsoft.DocumentDB_ | _IGNORE, By Default, setting them as part of diagnostic scope_ | +|db.system| cosmosdb | Open Telemetry Convention To identify type of Db | +| db.name | < Database Name > | | +| db.operation| ReadItemAsync, DeleteItemStreamAsync etc | Database Operation ~Type~ Name | +| net.peer.name | e.g. sourabhjaintemp | Account Name + Cloud | | db.cosmosdb.client_id| Unique Client Id| Combination of client id and machine id can tell us, if customer is following best practices to create singleton client | | db.cosmosdb.machine_id| Unique Machine Id| | -| db.cosmosdb.user_agent| < User Agent With SDK version> | Useful to identify the SDK version | -| db.cosmosdb.connection_mode | Direct/Gateway | go through | +| db.cosmosdb.user_agent| < User Agent With SDK version> | Useful to identify the SDK version | +| db.cosmosdb.connection_mode | Direct/Gateway | go through | | db.cosmosdb.container| Container | | | db.cosmosdb.request_content_length_bytes | Size of request payload | | -| db.cosmosdb.response_content_length_bytes | Size of response Payload | | -| db.cosmosdb.status_code | 201/200/204 | Cosmos Db Http Status Code, it tells if particular cosmosdb call/request is passed/failed with which HttpStatusCode | -| db.cosmosdb.sub_status_code | 1000/1002 | Cosmos Db SubStatus Code | -| db.cosmosdb.request_charge | < double type number > | RU consumed for that operation | +| db.cosmosdb.response_content_length_bytes | Size of response Payload | | +| db.cosmosdb.status_code | 201/200/204 | Cosmos Db Http Status Code, it tells if particular cosmosdb call/request is passed/failed with which HttpStatusCode | +| db.cosmosdb.sub_status_code | 1000/1002 | Cosmos Db SubStatus Code | +| db.cosmosdb.request_charge | < double type number > | RU consumed for that operation | | db.cosmosdb.regions_contacted| Region Cosmos Db| | | db.cosmosdb.retry_count| Number of retries| | | db.cosmosdb.operation_type| Query/Read/Create | | -| db.cosmosdb.item_count | < int number> | Number of items returned by the operation, only Feed Operation | +| db.cosmosdb.item_count | | Number of items returned by the operation, only Feed Operation | | db.cosmosdb.activity_id | Guid | Unique Id for the operation and can be helpful to debug particular operation in backend logs | | db.cosmosdb.correlated_activity_id| Guid | It will be populated only in case of query operation to allow correlating query pages retrieved for the same multi-page or cross-partition query. | -| exception.type| `java.net.ConnectException; ``OSError `| ref. https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/exceptions.md | -| exception.message| `Division by zero; Can't convert 'int' object to str implicitly `| ref. https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/exceptions.md | -| exception.stacktrace| `Exception in thread "main" java.lang.RuntimeException: Test exception\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n at com.example.GenerateTrace.main(GenerateTrace.java:5)` | ref. https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/exceptions.md | +| exception.type| `java.net.ConnectException; ``OSError `| | +| exception.message| `Division by zero; Can't convert 'int' object to str implicitly `| | +| exception.stacktrace| `Exception in thread "main" java.lang.RuntimeException: Test exception\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n at com.example.GenerateTrace.main(GenerateTrace.java:5)` | | CosmosDb SDK (Currently only .Net) emit Activity at Network level with following attributes/information. + | Attribute | Value | Comment | | -------- | ------------------- | --------------------- | | rntbd.url | | rntbd url with partitionid and replicaid | | rntbd.operation_type | | Operation Type | -| rntbd.resource_type | | Resource Type | -| rntbd.status_code | 201/200/204 | network status code | -| rntbd.sub_status_code | 1000/1002 | Cosmos Db SubStatus Code | \ No newline at end of file +| rntbd.resource_type | | Resource Type | +| rntbd.status_code | 201/200/204 | network status code | +| rntbd.sub_status_code | 1000/1002 | Cosmos Db SubStatus Code | \ No newline at end of file