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
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
improved docuemnation
  • Loading branch information
sourabh1007 committed Oct 18, 2024
commit 67d92efb64b703418ab2b26a1939b4d52511aa3d
48 changes: 34 additions & 14 deletions docs/database/database-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -569,37 +569,57 @@ The following metric instruments describe Azure Cosmos DB client behaviour.

### Metric: `db.client.operation.duration`

This metric is [recommended][MetricRecommended].
It captures the total time taken by an Azure Cosmos DB operation. This metric follows the common [db.client.operation.duration] (#metric-dbclientoperationduration)b definition.
sourabh1007 marked this conversation as resolved.
Show resolved Hide resolved
sourabh1007 marked this conversation as resolved.
Show resolved Hide resolved

this metric SHOULD be specified with
This metric SHOULD be specified with
[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/metrics/api.md#instrument-advisory-parameters)
of `[ .010, .200, .400, .600, .800, 1.000 ]`.
of `[ 0.001, 0.005, 0.010, 0.050, 0.100, 0.200, 0.500, 1.000, 2.000, 5.000 ]`.
sourabh1007 marked this conversation as resolved.
Show resolved Hide resolved

Explaining bucket configuration:

1. 0.001, 0.005, 0.010 seconds: : These boundaries provide high precision for high-performance workloads, especially when dealing with microservices or low-latency queries.
2. 0.050, 0.100, 0.200 seconds: These intervals capture typical latencies between 50ms and 200ms, common in web applications, offering detailed tracking for normal operational performance.
3. 0.500, 1.000 seconds: These boundaries identify operations that take longer, highlighting potential bottlenecks or slower requests that may need optimization.
4. 2.000, 5.000 seconds: Although Azure Cosmos DB is optimized for sub-second latencies, these buckets are included to track rare, long-running outliers that might exceed 1 second.

Refer `db.cosmosdb.operation.request_charge` metrics for dimensions.

### Metric: `db.query.limit`

This metric is [recommended][MetricRecommended].
It captures the requested page size for Query or Feed operations in Azure Cosmos DB. It helps in identifying patterns in page size requests that could contribute to higher latencies or other performance issues.

this metric SHOULD be specified with
This metric SHOULD be specified with
[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/metrics/api.md#instrument-advisory-parameters)
of `[ 100, 500, 1000, 1500, 2000, 2500]`.
of `[50, 100, 250, 500, 1000, 2000, 5000]`.

Explaining bucket configuration:

1. 50, 100, 250, 500: These small page sizes are common for lightweight queries where quick responses are essential, such as in real-time applications.
2. 1000, 2000: These boundaries capture scenarios where larger datasets are returned in fewer queries, which can be more efficient but might result in longer query execution times.
3. 5000: This boundary is used to capture rare cases where very large page sizes are requested. Although Cosmos DB generally handles larger datasets efficiently, large page sizes can sometimes lead to performance bottlenecks due to increased processing times or network bandwidth limitations.

Refer `db.cosmosdb.operation.request_charge` metrics for dimensions.

### Metric: `db.query.response.item_count`

This metric is [recommended][MetricRecommended].
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 SHOULD be specified with
This metric SHOULD be specified with
[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/metrics/api.md#instrument-advisory-parameters)
of `[ 100, 500, 1000, 1500, 2000, 2500]`.
of `[10, 50, 100, 250, 500, 1000, 2000, 5000, 10000]`.
sourabh1007 marked this conversation as resolved.
Show resolved Hide resolved

Explaining bucket configuration:

1. 10, 50, 100: These buckets are useful for capturing scenarios where only a small number of items are returned. Such small queries are common in real-time or interactive applications where performance and quick responses are critical.
2. 250, 500, 1000: These values represent typical workloads where moderate amounts of data are returned in each query.
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.

sourabh1007 marked this conversation as resolved.
Show resolved Hide resolved
Refer `db.cosmosdb.operation.request_charge` metrics for dimensions.
sourabh1007 marked this conversation as resolved.
Show resolved Hide resolved

### Metric: `db.cosmosdb.operation.request_charge`

This metric is [recommended][MetricRecommended].
It captures the Request Units consumed by each operation in Azure Cosmos DB. Since Request Units serve as a form of currency within the Azure Cosmos DB database, monitoring their usage is crucial to avoid throttling.

this metric SHOULD be specified with
[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/metrics/api.md#instrument-advisory-parameters)
Expand Down Expand Up @@ -720,11 +740,11 @@ It is RECOMMENDED to capture the value as provided by the application without at

### Metric: `db.cosmosdb.operation.regions_contacted`

This metric is [recommended][MetricRecommended].
It captures the number of regions contacted by the SDK in a multi-region setup. Understanding the SDK's interaction with multiple regions is crucial, as it may contribute to higher latency. In a single-region setup, this value will remain at 1

this metric SHOULD be specified with
[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/metrics/api.md#instrument-advisory-parameters)
of `[ 3, 6, 9, 10, 50]`.
of `[1, 2, 3, 5, 10, 20, 50]`.

<!-- semconv metric.db.cosmosdb.operation.regions_contacted -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
Expand Down Expand Up @@ -841,11 +861,11 @@ It is RECOMMENDED to capture the value as provided by the application without at

### Metric: `db.cosmosdb.client.active_instances`

This metric is [recommended][MetricRecommended].
It aptures the number of active instances at any given time. Best practices dictate that there should ideally be only one instance of the SDK client per process. Having multiple instances of the SDK client can lead to CPU or memory-related issues.

this metric SHOULD be specified with
[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/metrics/api.md#instrument-advisory-parameters)
of `[ 2, 10, 50, 100]`.
of `[1, 2, 3, 5, 10, 50, 100]`.

<!-- semconv metric.db.cosmosdb.client.active_instances -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
Expand Down