Skip to content

Commit

Permalink
better metrics name
Browse files Browse the repository at this point in the history
  • Loading branch information
sourabh1007 committed Oct 2, 2024
1 parent 0335204 commit c0bd5ed
Show file tree
Hide file tree
Showing 7 changed files with 472 additions and 113 deletions.
31 changes: 10 additions & 21 deletions docs/attributes-registry/db.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,27 +155,16 @@ This group defines attributes for Cassandra.

This group defines attributes for Azure Cosmos DB.

<<<<<<< HEAD
| Attribute | Type | Description | Examples | Stability |
| ------------------------------------ | ------ | --------------------------------- | -------------------------------------- | ---------------------------------------------------------------- |
| `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`; `direct` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `db.cosmosdb.operation_type` | string | Cosmos DB Operation Type. | `batch`; `create`; `delete` | ![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) |
| `db.cosmosdb.sub_status_code` | int | Cosmos DB sub status code. | `1000`; `1002` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
=======
| Attribute | Type | Description | Examples | Stability |
| ------------------------------------ | ------ | ------------------------------------- | ----------------------------------------------------------------------- | ---------------------------------------------------------------- |
| `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`; `direct` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `db.cosmosdb.consistency_level` | string | Account or Request Consistency Level. | `Eventual`; `ConsistentPrefix`; `BoundedStaleness`; `Strong or Session` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `db.cosmosdb.operation_type` | string | Cosmos DB Operation Type. | `batch`; `create`; `delete` | ![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) |
| `db.cosmosdb.status_code` | int | Cosmos DB status code. | `200`; `201` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `db.cosmosdb.sub_status_code` | int | Cosmos DB sub status code. | `1000`; `1002` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
>>>>>>> fb55db0 (wip)
| Attribute | Type | Description | Examples | Stability |
| ------------------------------------ | ------ | ---------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
| `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`; `direct` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `db.cosmosdb.consistency_level` | string | Account or Request Consistency Level. | `Eventual`; `ConsistentPrefix`; `BoundedStaleness`; `Strong or Session` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `db.cosmosdb.machine_id` | string | Azure VM Id or hashed machine name or unique generate GUID, whatever is available. | `vmId:4d5ab1c4-d821-43fe-aacf-b61ea1f9c918`; `hashedMachineName:910dc3c9-7d90-074d-95bf-c930100d14d4`; `uuid:703e5e25-1bd3-4a53-ad53-f42f6ec50042` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `db.cosmosdb.operation_type` | string | Cosmos DB Operation Type. | `batch`; `create`; `delete` | ![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) |
| `db.cosmosdb.sub_status_code` | int | Cosmos DB sub status code. | `1000`; `1002` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

`db.cosmosdb.connection_mode` 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.

Expand Down
3 changes: 2 additions & 1 deletion docs/database/cosmosdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ 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.cosmosdb.consistency_level`](/docs/attributes-registry/db.md) | string | Account or Request Consistency Level. | `Eventual`; `ConsistentPrefix`; `BoundedStaleness`; `Strong or Session` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`db.collection.name`](/docs/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`](/docs/attributes-registry/db.md) | string | Cosmos client connection mode. | `gateway`; `direct` | `Conditionally Required` [2] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`db.cosmosdb.consistency_level`](/docs/attributes-registry/db.md) | string | Account or Request Consistency Level. | `Eventual`; `ConsistentPrefix`; `BoundedStaleness`; `Strong or Session` | `Conditionally Required` If available. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`db.cosmosdb.machine_id`](/docs/attributes-registry/db.md) | string | Azure VM Id or hashed machine name or unique generate GUID, whatever is available. | `vmId:4d5ab1c4-d821-43fe-aacf-b61ea1f9c918`; `hashedMachineName:910dc3c9-7d90-074d-95bf-c930100d14d4`; `uuid:703e5e25-1bd3-4a53-ad53-f42f6ec50042` | `Conditionally Required` If available. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`db.cosmosdb.operation_type`](/docs/attributes-registry/db.md) | string | Cosmos DB Operation Type. | `batch`; `create`; `delete` | `Conditionally Required` when performing one of the operations in this list | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`db.cosmosdb.request_charge`](/docs/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.sub_status_code`](/docs/attributes-registry/db.md) | int | Cosmos DB sub status code. | `1000`; `1002` | `Conditionally Required` when response was received and contained sub-code. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
Expand Down
Loading

0 comments on commit c0bd5ed

Please sign in to comment.