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: Added regions_contacted as new dimension #1525

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
9ac83ea
updarted docs
sourabh1007 Oct 29, 2024
ee8a2ff
added changelog and fix formatting
sourabh1007 Oct 29, 2024
328dfc7
Update docs/database/cosmosdb.md
sourabh1007 Oct 30, 2024
d92a4df
Merge branch 'main' into users/sourabhjain/moreoperationmetrics
sourabh1007 Oct 30, 2024
bba497e
remove metrics changes
sourabh1007 Oct 30, 2024
35a9409
Merge branch 'main' into users/sourabhjain/moreoperationmetrics
sourabh1007 Oct 30, 2024
3887a20
Merge branch 'main' into users/sourabhjain/moreoperationmetrics
sourabh1007 Oct 30, 2024
635dac1
fix text
sourabh1007 Oct 30, 2024
649a13a
t pushMerge branch 'users/sourabhjain/moreoperationmetrics' of https:…
sourabh1007 Oct 30, 2024
9ec0e71
fix text length
sourabh1007 Oct 30, 2024
9db67a5
fix trailing space
sourabh1007 Oct 30, 2024
2e65268
Merge branch 'main' into users/sourabhjain/moreoperationmetrics
sourabh1007 Oct 31, 2024
51c832c
Merge branch 'main' into users/sourabhjain/moreoperationmetrics
sourabh1007 Nov 1, 2024
0a4b1df
string to string array
sourabh1007 Nov 1, 2024
bd51e51
updated yaml
sourabh1007 Nov 1, 2024
883ff90
Merge branch 'main' into users/sourabhjain/moreoperationmetrics
sourabh1007 Nov 4, 2024
5db7434
Merge branch 'main' into users/sourabhjain/moreoperationmetrics
sourabh1007 Nov 6, 2024
4b49603
Update .chloggen/users_sourabhjain_moreoperationmetrics.yaml
sourabh1007 Nov 7, 2024
aaa922c
Merge branch 'main' into users/sourabhjain/moreoperationmetrics
sourabh1007 Nov 7, 2024
cc79cdc
Merge branch 'main' into users/sourabhjain/moreoperationmetrics
sourabh1007 Nov 8, 2024
c98f70e
Merge branch 'main' into users/sourabhjain/moreoperationmetrics
sourabh1007 Nov 11, 2024
2864028
Merge branch 'main' into users/sourabhjain/moreoperationmetrics
sourabh1007 Nov 11, 2024
2d21a54
updated desc
sourabh1007 Nov 11, 2024
61d489f
updated doc
sourabh1007 Nov 11, 2024
ad5f06d
Update model/database/registry.yaml
sourabh1007 Nov 12, 2024
88e4158
added desc
sourabh1007 Nov 12, 2024
1a56ead
updated desc
sourabh1007 Nov 12, 2024
1d69ff8
Merge branch 'main' into users/sourabhjain/moreoperationmetrics
sourabh1007 Nov 13, 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_moreoperationmetrics.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: new_component

# 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 `db.client.operation.count` metric to track the number of operations performed by the client.
sourabh1007 marked this conversation as resolved.
Show resolved Hide resolved

# 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: [1525]

# (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:
1 change: 1 addition & 0 deletions docs/attributes-registry/db.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ This group defines attributes for Azure Cosmos DB.
| <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-regions-contacted" href="#db-cosmosdb-regions-contacted">`db.cosmosdb.regions_contacted`</a> | string | Comma separated list of regions contacted by the Azure Cosmos DB operation. | `North Central US,Central US`; `East US 2,North Central US` | ![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) |
Expand Down
54 changes: 29 additions & 25 deletions docs/database/cosmosdb.md

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions model/database/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ groups:
- ref: db.cosmosdb.consistency_level
requirement_level:
conditionally_required: If available.
- ref: db.cosmosdb.regions_contacted
brief: >
List of regions contacted by the client during a given operation.
requirement_level:
conditionally_required: If available

- id: attributes.db.client.with_query_and_collection
extends: attributes.db.client.minimal
Expand Down
28 changes: 28 additions & 0 deletions model/database/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,31 @@ groups:
conditionally_required: If available.
- ref: db.query.text
requirement_level: opt_in

- id: metric.db.client.operation.count
type: metric
metric_name: db.client.operation.count
brief: "The number of client operations."
instrument: counter
unit: "{operations}"
stability: experimental
extends: attributes.db.client.minimal
attributes:
- ref: db.system
# TODO: Not adding to the minimal because of https://github.com/open-telemetry/build-tools/issues/192
requirement_level: required
- ref: network.peer.address
brief: Peer address of the database node where the operation was performed.
requirement_level:
recommended: If applicable for this database system.
note: >
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.
- ref: network.peer.port
requirement_level:
recommended: If and only if `network.peer.address` is set.
- ref: db.namespace
requirement_level:
conditionally_required: If available.
6 changes: 5 additions & 1 deletion model/database/registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,11 @@ groups:
stability: experimental
brief: Account or request [consistency level](https://learn.microsoft.com/azure/cosmos-db/consistency-levels).
examples: ["Eventual", "ConsistentPrefix", "BoundedStaleness", "Strong", "Session"]

- id: db.cosmosdb.regions_contacted
type: string
sourabh1007 marked this conversation as resolved.
Show resolved Hide resolved
stability: experimental
brief: Comma separated list of regions contacted by the Azure Cosmos DB operation.
sourabh1007 marked this conversation as resolved.
Show resolved Hide resolved
examples: ["North Central US,Central US", "East US 2,North Central US"]
- id: registry.db.elasticsearch
type: attribute_group
display_name: Elasticsearch Attributes
Expand Down
5 changes: 5 additions & 0 deletions model/database/spans.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -726,3 +726,8 @@ groups:
- ref: db.cosmosdb.consistency_level
requirement_level:
conditionally_required: If available.
- ref: db.cosmosdb.regions_contacted
note: >
When the `db.cosmosdb.regions_contacted` attribute is populated, it indicates that the operation was performed on multiple regions i.e. cross-regional call.
requirement_level:
conditionally_required: If available.
Loading