Skip to content

Commit

Permalink
reformat files
Browse files Browse the repository at this point in the history
  • Loading branch information
sourabh1007 committed Jan 21, 2023
1 parent 0b27679 commit b1a9cb4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
4 changes: 1 addition & 3 deletions semantic_conventions/trace/database.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,4 @@ groups:
- include: 'db.redis'
- include: 'db.mongodb'
- include: 'db.sql'
- include: 'db.cosmosdb'


- include: 'db.cosmosdb'
44 changes: 23 additions & 21 deletions specification/trace/semantic_conventions/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<!-- semconv db.tech(tag=call-level-tech-specific-cosmosdb) -->
| 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.

<!-- semconv db.tech(tag=connection-level-cosmsodb) -->
| 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 |
| rntbd.resource_type | | Resource Type |
| rntbd.status_code | 201/200/204 | network status code |
| rntbd.sub_status_code | 1000/1002 | Cosmos Db SubStatus Code |

0 comments on commit b1a9cb4

Please sign in to comment.