Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cosmos DB: Network Level Metrics #1543

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
80174eb
frist draft
sourabh1007 Nov 1, 2024
2d45f1d
removing trailing space
sourabh1007 Nov 2, 2024
8093230
netework level metrics
sourabh1007 Nov 2, 2024
7973d3f
fox space
sourabh1007 Nov 4, 2024
9914055
updated verbose
sourabh1007 Nov 4, 2024
415b1d3
updated format
sourabh1007 Nov 4, 2024
3a448aa
improved doc
sourabh1007 Nov 6, 2024
22a41e2
Exception example fixes
sourabh1007 Nov 6, 2024
dd8880f
remove trailing space
sourabh1007 Nov 6, 2024
10c5073
incorporate more comments
sourabh1007 Nov 7, 2024
3771463
Update model/database/registry.yaml
sourabh1007 Nov 7, 2024
d1ab3ce
Update model/database/cosmosdb-metrics.yaml
sourabh1007 Nov 7, 2024
87d8d36
fix dimension
sourabh1007 Nov 7, 2024
8395b36
fixed documentation
sourabh1007 Nov 11, 2024
237209c
Update common.yaml
sourabh1007 Nov 11, 2024
8395924
fix desc
sourabh1007 Nov 11, 2024
b6b6a53
uopdated desc
sourabh1007 Nov 11, 2024
5fd790d
updated region ifno
sourabh1007 Nov 12, 2024
852361c
new gen file
sourabh1007 Nov 13, 2024
762190b
fixed conflicts
sourabh1007 Nov 21, 2024
d730e5d
fix yaml
sourabh1007 Nov 21, 2024
0926a76
doc fix
sourabh1007 Nov 21, 2024
054eede
doc sttus
sourabh1007 Nov 21, 2024
4f614b0
Merge branch 'main' into users/sourabhjain/networklevelmetrics
sourabh1007 Nov 21, 2024
351e4b6
Merge branch 'main' into users/sourabhjain/networklevelmetrics
sourabh1007 Nov 23, 2024
0f1b451
updated desc
sourabh1007 Nov 23, 2024
996980b
Merge branch 'users/sourabhjain/networklevelmetrics' of https://githu…
sourabh1007 Nov 23, 2024
fb980d5
updated
sourabh1007 Nov 23, 2024
21d99bd
remove lint error
sourabh1007 Nov 23, 2024
98a27e2
updated desc
sourabh1007 Nov 23, 2024
c002915
updated statement
sourabh1007 Nov 23, 2024
9f200cb
Update .chloggen/users_sourabhjain_networklevelmetrics.yaml
sourabh1007 Nov 25, 2024
207c97c
Update .chloggen/users_sourabhjain_networklevelmetrics.yaml
sourabh1007 Nov 25, 2024
d23c65d
Update model/database/cosmosdb-metrics.yaml
sourabh1007 Nov 25, 2024
00b7ca2
Update model/database/common.yaml
sourabh1007 Nov 25, 2024
ec32476
Update model/database/common.yaml
sourabh1007 Nov 25, 2024
697ab33
updated
sourabh1007 Nov 25, 2024
1c2445d
updated doc
sourabh1007 Nov 25, 2024
288eef8
updated doc
sourabh1007 Nov 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .chloggen/users_sourabhjain_networklevelmetrics.yaml
Original file line number Diff line number Diff line change
@@ -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: db

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "Added network level metrics for Azure Cosmos DB."

# 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: [1495, 1543]

# (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:
25 changes: 19 additions & 6 deletions docs/attributes-registry/db.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- [General Database Attributes](#general-database-attributes)
- [Cassandra Attributes](#cassandra-attributes)
- [Azure Cosmos DB Attributes](#azure-cosmos-db-attributes)
- [Azure Cosmos DB Network level Attributes](#azure-cosmos-db-network-level-attributes)
- [Elasticsearch Attributes](#elasticsearch-attributes)
- [Deprecated Database Attributes](#deprecated-database-attributes)
- [Deprecated Database Metrics](#deprecated-database-metrics)
Expand Down Expand Up @@ -194,17 +195,17 @@ This group defines attributes for Cassandra.

## Azure Cosmos DB Attributes

This group defines attributes for Azure Cosmos DB.
This group defines attributes for Azure Cosmos DB Operation requested by the application.

| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
| <a id="db-cosmosdb-client-id" href="#db-cosmosdb-client-id">`db.cosmosdb.client_id`</a> | string | Unique Cosmos client instance id. | `3ba4827d-4422-483f-b59f-85b74211c11d` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="db-cosmosdb-connection-mode" href="#db-cosmosdb-connection-mode">`db.cosmosdb.connection_mode`</a> | string | Cosmos client connection mode. | `gateway`; `direct` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="db-cosmosdb-consistency-level" href="#db-cosmosdb-consistency-level">`db.cosmosdb.consistency_level`</a> | string | Account or request [consistency level](https://learn.microsoft.com/azure/cosmos-db/consistency-levels). | `Eventual`; `ConsistentPrefix`; `BoundedStaleness`; `Strong`; `Session` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="db-cosmosdb-connection-mode" href="#db-cosmosdb-connection-mode">`db.cosmosdb.connection_mode`</a> | string | Azure Cosmos DB client connection mode. | `gateway`; `direct` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="db-cosmosdb-consistency-level" href="#db-cosmosdb-consistency-level">`db.cosmosdb.consistency_level`</a> | string | Effective Request [consistency level](https://learn.microsoft.com/azure/cosmos-db/consistency-levels). This represents the applicable consistency level determined based on the hierarchy of settings: request-level, client instance-level, and account-level default consistency levels. | `Eventual`; `ConsistentPrefix`; `BoundedStaleness`; `Strong`; `Session` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="db-cosmosdb-regions-contacted" href="#db-cosmosdb-regions-contacted">`db.cosmosdb.regions_contacted`</a> | string[] | List of regions contacted during operation in the order that they were contacted. If there is more than one region listed, it indicates that the operation was performed on multiple regions i.e. cross-regional call. [10] | `["North Central US", "Australia East", "Australia Southeast"]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="db-cosmosdb-request-charge" href="#db-cosmosdb-request-charge">`db.cosmosdb.request_charge`</a> | double | Request units consumed for the operation. | `46.18`; `1.0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="db-cosmosdb-request-content-length" href="#db-cosmosdb-request-content-length">`db.cosmosdb.request_content_length`</a> | int | Request payload size in bytes. | | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="db-cosmosdb-sub-status-code" href="#db-cosmosdb-sub-status-code">`db.cosmosdb.sub_status_code`</a> | int | Cosmos DB sub status code. | `1000`; `1002` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="db-cosmosdb-sub-status-code" href="#db-cosmosdb-sub-status-code">`db.cosmosdb.sub_status_code`</a> | int | The Azure Cosmos DB sub-status code for an operation represents the final sub-status code after multiple network interactions have been completed during the operation. | `1000`; `1002` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

**[10] `db.cosmosdb.regions_contacted`:** Region name matches the format of `displayName` in [Azure Location API](https://learn.microsoft.com/rest/api/subscription/subscriptions/list-locations?view=rest-subscription-2021-10-01&tabs=HTTP#location)

Expand All @@ -229,16 +230,28 @@ This group defines attributes for Azure Cosmos DB.
| `Session` | session | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `Strong` | strong | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

## Azure Cosmos DB Network level Attributes

This group defines attributes for network calls to Azure Cosmos DB backend services, essential for monitoring and analysis, as the SDK employs retries, failovers, and may involve multiple calls to ensure operation success under varying conditions.

| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
| <a id="db-cosmosdb-network-response-status-code" href="#db-cosmosdb-network-response-status-code">`db.cosmosdb.network.response.status_code`</a> | int | The status code returned in response by the network call, made to Cosmos DB backend services. [11] | `200` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="db-cosmosdb-network-response-sub-status-code" href="#db-cosmosdb-network-response-sub-status-code">`db.cosmosdb.network.response.sub_status_code`</a> | int | The Azure Cosmos DB sub-status code for a network request, made to Cosmos DB backend services, during an operation. | `1002` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="db-cosmosdb-network-routing-id" href="#db-cosmosdb-network-routing-id">`db.cosmosdb.network.routing_id`</a> | string | Identifies the Azure Cosmos DB Partition Key Range ID for a Gateway call, or Partition ID/Replica ID for a Direct call. | `45678765678987/2345678906789s` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

**[11] `db.cosmosdb.network.response.status_code`:** The protocol reuses HTTP status codes.

## Elasticsearch Attributes

This group defines attributes for Elasticsearch.

| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
| <a id="db-elasticsearch-node-name" href="#db-elasticsearch-node-name">`db.elasticsearch.node.name`</a> | string | Represents the human-readable identifier of the node/instance to which a request was routed. | `instance-0000000001` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="db-elasticsearch-path-parts" href="#db-elasticsearch-path-parts">`db.elasticsearch.path_parts.<key>`</a> | string | A dynamic value in the url path. [11] | `db.elasticsearch.path_parts.index=test-index`; `db.elasticsearch.path_parts.doc_id=123` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="db-elasticsearch-path-parts" href="#db-elasticsearch-path-parts">`db.elasticsearch.path_parts.<key>`</a> | string | A dynamic value in the url path. [12] | `db.elasticsearch.path_parts.index=test-index`; `db.elasticsearch.path_parts.doc_id=123` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

**[11] `db.elasticsearch.path_parts`:** Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.<key>`, where `<key>` 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.
**[12] `db.elasticsearch.path_parts`:** Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.<key>`, where `<key>` 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.

## Deprecated Database Attributes

Expand Down
Loading
Loading