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: Operation Level Metrics #1438

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
3e8e101
wip
sourabh1007 Sep 30, 2024
d43b298
cosmosdb operation level metrics
sourabh1007 Sep 30, 2024
a323aec
Update model/database/metrics.yaml
sourabh1007 Sep 30, 2024
fd6c5da
Update model/database/metrics.yaml
sourabh1007 Sep 30, 2024
74078ea
Update model/database/metrics.yaml
sourabh1007 Sep 30, 2024
c1f2efa
Update model/database/metrics.yaml
sourabh1007 Sep 30, 2024
54ef995
Update model/database/metrics.yaml
sourabh1007 Sep 30, 2024
f71ebb7
added consistency level
sourabh1007 Sep 30, 2024
7678272
cosmosdb name change
sourabh1007 Sep 30, 2024
e324ded
wip
sourabh1007 Oct 1, 2024
8c5f65c
consistency level fix
sourabh1007 Oct 1, 2024
0dac6eb
updatred toc
sourabh1007 Oct 1, 2024
0547b5a
fix dimentions
sourabh1007 Oct 2, 2024
cc66b77
better metrics name
sourabh1007 Oct 2, 2024
fb44bc1
Update model/database/cosmosdb-metrics.yaml
sourabh1007 Oct 3, 2024
2535df1
Update model/database/cosmosdb-metrics.yaml
sourabh1007 Oct 3, 2024
dcf101b
Update model/database/registry.yaml
sourabh1007 Oct 3, 2024
70fb428
fix typos
sourabh1007 Oct 3, 2024
67d92ef
improved docuemnation
sourabh1007 Oct 3, 2024
ffbe797
fixed documenation
sourabh1007 Oct 3, 2024
891a62b
Update model/database/metrics.yaml
sourabh1007 Oct 7, 2024
f162565
addressed comments
sourabh1007 Oct 7, 2024
10ecde0
toc update
sourabh1007 Oct 7, 2024
e996837
fix merge rebase
sourabh1007 Oct 9, 2024
167618e
wip
sourabh1007 Oct 9, 2024
15fa6fb
removed query imit metrics
sourabh1007 Oct 10, 2024
fc03c7c
add cosmos.md
sourabh1007 Oct 10, 2024
dcb6f1d
removed operation type
sourabh1007 Oct 11, 2024
547d7c9
Update model/database/cosmosdb-metrics.yaml
sourabh1007 Oct 11, 2024
051561d
Update model/database/metrics.yaml
sourabh1007 Oct 11, 2024
790a9ee
revert unrelated files
sourabh1007 Oct 11, 2024
47d53b1
updated requrst charge url
sourabh1007 Oct 11, 2024
80ab66d
added consistency level link
sourabh1007 Oct 11, 2024
82dee70
deprecated operation_type
sourabh1007 Oct 11, 2024
4f441fa
Update model/database/registry.yaml
sourabh1007 Oct 11, 2024
f9a24b7
Update .chloggen/users_sourabhjain_otelcosmosmetrics.yaml
sourabh1007 Oct 11, 2024
1861264
Update .chloggen/users_sourabhjain_otelcosmosmetrics.yaml
sourabh1007 Oct 11, 2024
5e8b1b5
Update model/database/cosmosdb-metrics.yaml
sourabh1007 Oct 11, 2024
210222c
Update model/database/cosmosdb-metrics.yaml
sourabh1007 Oct 11, 2024
dbd8b8e
Update model/database/registry.yaml
sourabh1007 Oct 11, 2024
28a4f28
Update model/database/metrics.yaml
sourabh1007 Oct 11, 2024
25f0327
fix ebvrything
sourabh1007 Oct 11, 2024
35df1a7
updated docuemnattaion
sourabh1007 Oct 14, 2024
4c32638
Update model/database/registry.yaml
sourabh1007 Oct 14, 2024
1a0cb8f
Update model/database/registry.yaml
sourabh1007 Oct 14, 2024
cdcc6b4
Updated docs
sourabh1007 Oct 14, 2024
1e5da5a
fix lint review
sourabh1007 Oct 14, 2024
d27af0f
Update model/database/registry.yaml
sourabh1007 Oct 15, 2024
8c54e01
Update model/database/registry.yaml
sourabh1007 Oct 15, 2024
c8c2222
Update docs/database/database-metrics.md
sourabh1007 Oct 15, 2024
7272b9a
wip
sourabh1007 Oct 15, 2024
68f8444
improved doc
sourabh1007 Oct 15, 2024
dad7e47
bettre doc
sourabh1007 Oct 15, 2024
ed71a97
remove hstogram buckets
sourabh1007 Oct 15, 2024
04a4331
updated after conflict
sourabh1007 Oct 16, 2024
277bff8
Update model/database/spans.yaml
sourabh1007 Oct 16, 2024
7d2ba80
Update model/database/registry.yaml
sourabh1007 Oct 16, 2024
02a880b
Update model/database/metrics.yaml
sourabh1007 Oct 16, 2024
a800740
Update docs/database/database-metrics.md
sourabh1007 Oct 16, 2024
927a414
Update docs/database/cosmosdb.md
sourabh1007 Oct 16, 2024
cb2078a
updated histogram boundaried for row_count
sourabh1007 Oct 16, 2024
1ce3f28
updated doc
sourabh1007 Oct 16, 2024
b22d885
update database metrics
sourabh1007 Oct 16, 2024
d6482d3
updated docs
sourabh1007 Oct 16, 2024
df9563d
added eos
sourabh1007 Oct 16, 2024
4a0aec0
fix identation
sourabh1007 Oct 16, 2024
48dbde6
Update docs/attributes-registry/db.md
sourabh1007 Oct 16, 2024
3165fbc
Update docs/database/cosmosdb.md
sourabh1007 Oct 16, 2024
bf35cfd
Update docs/database/cosmosdb.md
sourabh1007 Oct 16, 2024
a1dbe89
Update docs/attributes-registry/db.md
sourabh1007 Oct 16, 2024
18fd7dc
Update docs/attributes-registry/db.md
sourabh1007 Oct 16, 2024
6b62a17
update text change
sourabh1007 Oct 16, 2024
974f77c
resolved merge conflicts
sourabh1007 Oct 18, 2024
182b8e9
Merge branch 'main' into users/sourabhjain/otelcosmosmetrics
sourabh1007 Oct 18, 2024
cb1d45a
updated docs
sourabh1007 Oct 19, 2024
56690b4
Merge branch 'main' into users/sourabhjain/otelcosmosmetrics
sourabh1007 Oct 19, 2024
70b3a4a
Merge branch 'main' into users/sourabhjain/otelcosmosmetrics
sourabh1007 Oct 22, 2024
89b3b55
updateed docs
sourabh1007 Oct 22, 2024
b7244bb
Update model/database/registry.yaml
sourabh1007 Oct 22, 2024
80f5659
Update model/database/registry.yaml
sourabh1007 Oct 22, 2024
7db12e8
updated docs
sourabh1007 Oct 22, 2024
e614752
renamed metrics
sourabh1007 Oct 23, 2024
5f2e999
Merge branch 'main' into users/sourabhjain/otelcosmosmetrics
sourabh1007 Oct 23, 2024
c09c398
Merge branch 'main' into users/sourabhjain/otelcosmosmetrics
sourabh1007 Oct 24, 2024
d6c0f6a
Merge branch 'main' into users/sourabhjain/otelcosmosmetrics
sourabh1007 Oct 25, 2024
4237355
Merge branch 'main' into users/sourabhjain/otelcosmosmetrics
sourabh1007 Oct 25, 2024
3f0efe3
fix row count metrics name
sourabh1007 Oct 25, 2024
8abd299
Merge branch 'users/sourabhjain/otelcosmosmetrics' of https://github.…
sourabh1007 Oct 25, 2024
11f1faa
updated row_count to retiurned_rows
sourabh1007 Oct 26, 2024
9a8cb9a
Update model/database/metrics.yaml
sourabh1007 Oct 27, 2024
1daad9c
update docs
sourabh1007 Oct 27, 2024
164d7e9
added returned_rows attribute
sourabh1007 Oct 28, 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
Prev Previous commit
Next Next commit
updated row_count to retiurned_rows
  • Loading branch information
sourabh1007 committed Oct 26, 2024
commit 11f1faa6282ccef0cd9e907e1019cc5c56dfd5fe
2 changes: 1 addition & 1 deletion .chloggen/users_sourabhjain_otelcosmosmetrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ change_type: enhancement
component: db

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "Added new common `db.response.returned_rows` database metric and several operation level metrics for Azure Cosmos DB."
note: "Added new common `db.client.response.returned_rows` database metric and several operation 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.
Expand Down
2 changes: 1 addition & 1 deletion docs/attributes-registry/db.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ This group defines the attributes used to describe telemetry in the context of d
| <a id="db-query-parameter" href="#db-query-parameter">`db.query.parameter.<key>`</a> | string | A query parameter used in `db.query.text`, with `<key>` being the parameter name, and the attribute value being a string representation of the parameter value. [5] | `someval`; `55` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="db-query-summary" href="#db-query-summary">`db.query.summary`</a> | string | Low cardinality representation of a database query text. [6] | `SELECT wuser_table`; `INSERT shipping_details SELECT orders`; `get user by id` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="db-query-text" href="#db-query-text">`db.query.text`</a> | string | The database query being executed. [7] | `SELECT * FROM wuser_table where username = ?`; `SET mykey ?` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="db-response-row-count" href="#db-response-row-count">`db.response.row_count`</a> | int | Number of rows returned by the operation. | `10`; `30`; `1000` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="db-response-returned-rows" href="#db-response-returned-rows">`db.response.returned_rows`</a> | int | Number of rows returned by the operation. | `10`; `30`; `1000` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="db-response-status-code" href="#db-response-status-code">`db.response.status_code`</a> | string | Database response status code. [8] | `102`; `ORA-17002`; `08P01`; `404` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="db-system" href="#db-system">`db.system`</a> | string | The database management system (DBMS) product as identified by the client instrumentation. [9] | `other_sql`; `adabas`; `cache` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

Expand Down
8 changes: 4 additions & 4 deletions docs/database/cosmosdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ linkTitle: Cosmos DB
- [Example](#example)
- [Operation Level Metrics](#operation-level-metrics)
- [Metric: `db.client.operation.duration`](#metric-dbclientoperationduration)
- [Metric: `db.response.returned_rows`](#metric-dbresponsereturned_rows)
- [Metric: `db.client.response.returned_rows`](#metric-dbclientresponsereturned_rows)
- [Metric: `db.client.cosmosdb.operation.request_charge`](#metric-dbclientcosmosdboperationrequest_charge)
- [Metric: `db.client.cosmosdb.active_instance.count`](#metric-dbclientcosmosdbactive_instancecount)

Expand Down Expand Up @@ -46,7 +46,7 @@ Cosmos DB instrumentation includes call-level (public API) surface spans and net
| [`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) |
| [`db.namespace`](/docs/attributes-registry/db.md) | string | The name of the database, fully qualified within the server address and port. | `customers`; `test.users` | `Conditionally Required` If available. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`db.operation.name`](/docs/attributes-registry/db.md) | string | The name of the operation or command being executed. [3] | `create_item`; `query_items`; `read_item` | `Conditionally Required` [4] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`db.response.row_count`](/docs/attributes-registry/db.md) | int | Cosmos DB row count in result set. | `10`; `20` | `Conditionally Required` if response was received and returned any rows | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`db.response.returned_rows`](/docs/attributes-registry/db.md) | int | Cosmos DB row count in result set. | `10`; `20` | `Conditionally Required` if response was received and returned any rows | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`db.response.status_code`](/docs/attributes-registry/db.md) | string | Cosmos DB status code. [5] | `200`; `201` | `Conditionally Required` if response was received | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [6] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [7] | `80`; `8080`; `443` | `Conditionally Required` If not default (443). | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
Expand Down Expand Up @@ -298,11 +298,11 @@ It captures the total time taken by an Azure Cosmos DB operation. This metric fo

Refer [db.client.cosmosdb.operation.request_charge](#metric-dbclientcosmosdboperationrequest_charge) metrics for dimensions.

### Metric: `db.response.returned_rows`
### Metric: `db.client.response.returned_rows`

This metric is [required][MetricRequired].

It captures the number of items returned by a query or feed operation in Azure Cosmos DB. It helps identify response sizes that may contribute to high latency, increased memory/CPU usage, or network call failures. This metric follows the common [db.response.returned_rows](/docs/database/database-metrics.md#metric-dbclientresponserow_count) definition.
It captures the number of items returned by a query or feed operation in Azure Cosmos DB. It helps identify response sizes that may contribute to high latency, increased memory/CPU usage, or network call failures. This metric follows the common [db.client.response.returned_rows](/docs/database/database-metrics.md##metric-dbclientresponsereturned_rows) definition.

Refer [db.client.cosmosdb.operation.request_charge](#metric-dbclientcosmosdboperationrequest_charge) metrics for dimensions.

Expand Down
8 changes: 4 additions & 4 deletions docs/database/database-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ linkTitle: Metrics
- [Metric: `db.client.operation.duration`](#metric-dbclientoperationduration)
- [Experimental](#experimental)
- [Database Response](#database-response)
sourabh1007 marked this conversation as resolved.
Show resolved Hide resolved
- [Metric: `db.client.response.row_count`](#metric-dbclientresponserow_count)
- [Metric: `db.client.response.returned_rows`](#metric-dbclientresponsereturned_rows)
- [Connection pools](#connection-pools)
- [Metric: `db.client.connection.count`](#metric-dbclientconnectioncount)
- [Metric: `db.client.connection.idle.max`](#metric-dbclientconnectionidlemax)
Expand Down Expand Up @@ -245,7 +245,7 @@ and SHOULD be provided **at span creation time** (if provided at all):

The following metric instruments describe database query response.

#### Metric: `db.client.response.row_count`
#### Metric: `db.client.response.returned_rows`

This metric is [recommended][MetricRecommended].
sourabh1007 marked this conversation as resolved.
Show resolved Hide resolved

Expand All @@ -260,7 +260,7 @@ Explaining bucket configuration:
3. 2000, 5000: These boundaries capture scenarios where the query returns large datasets. These larger page sizes can potentially increase memory or CPU usage and may lead to longer query execution times, making it important to track performance in these ranges.
4. 10000: This boundary is included to capture rare, very large response sizes. Such queries can put significant strain on system resources, including memory, CPU, and network bandwidth, and can often lead to performance issues such as high latency or even network drops.

<!-- semconv metric.db.response.returned_rows -->
<!-- semconv metric.db.client.response.returned_rows -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->
Expand All @@ -269,7 +269,7 @@ Explaining bucket configuration:

| Name | Instrument Type | Unit (UCUM) | Description | Stability |
| -------- | --------------- | ----------- | -------------- | --------- |
| `db.response.returned_rows` | Histogram | `{row}` | The actual number of records returned by the database operation. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `db.client.response.returned_rows` | Histogram | `{row}` | The actual number of records returned by the database operation. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
Expand Down
4 changes: 2 additions & 2 deletions model/database/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ groups:
- ref: db.client.connection.pool.name
sourabh1007 marked this conversation as resolved.
Show resolved Hide resolved
requirement_level: required

- id: metric.db.response.returned_rows
- id: metric.db.client.response.returned_rows
type: metric
metric_name: db.response.returned_rows
metric_name: db.client.response.returned_rows
brief: "The actual number of records returned by the database operation."
instrument: histogram
unit: "{row}"
Expand Down
2 changes: 1 addition & 1 deletion model/database/registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ groups:

This attribute has stability level RELEASE CANDIDATE.
examples: ["102", "ORA-17002", "08P01", "404"]
- id: db.response.row_count
- id: db.response.returned_rows
type: int
stability: experimental
brief: Number of rows returned by the operation.
Expand Down
2 changes: 1 addition & 1 deletion model/database/spans.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ groups:
examples: ["200", "201"]
requirement_level:
conditionally_required: if response was received
- ref: db.response.row_count
- ref: db.response.returned_rows
brief: >
Cosmos DB row count in result set.
examples: [10, 20]
Expand Down
Loading