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 docs
  • Loading branch information
sourabh1007 committed Oct 18, 2024
commit d6482d3d6256e89c7c2f8795859714c4bedd155f
57 changes: 5 additions & 52 deletions docs/database/cosmosdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,61 +429,14 @@ It captures the number of active instances at any given time. Best practices dic

| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| [`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.consistency_level`](/docs/attributes-registry/db.md) | string | Account or request [consistency level](https://learn.microsoft.com/azure/cosmos-db/consistency-levels). | `Eventual`; `ConsistentPrefix`; `BoundedStaleness`; `Strong`; `Session` | `Conditionally Required` If 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) |
| [`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. [2] | `findAndModify`; `HMSET`; `SELECT` | `Conditionally Required` [3] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`db.response.status_code`](/docs/attributes-registry/db.md) | string | Database response status code. [4] | `102`; `ORA-17002`; `08P01`; `404` | `Conditionally Required` [5] | ![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` [8] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [9] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

**[1]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.

**[2]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
If the operation name is parsed from the query text, it SHOULD be the first operation name found in the query.
For batch operations, if the individual operations are known to have the same operation name then that operation name SHOULD be used prepended by `BATCH `, otherwise `db.operation.name` SHOULD be `BATCH` or some other database system specific term if more applicable.
This attribute has stability level RELEASE CANDIDATE.

**[3]:** If readily available. The operation name MAY be parsed from the query text, in which case it SHOULD be the first operation name found in the query.

**[4]:** The status code returned by the database. Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes.
Semantic conventions for individual database systems SHOULD document what `db.response.status_code` means in the context of that system.
This attribute has stability level RELEASE CANDIDATE.

**[5]:** If the operation failed and status code is available.

**[6]:** The `error.type` SHOULD match the `db.response.status_code` returned by the database or the client library, or the canonical name of exception that occurred.
When using canonical exception type name, instrumentation SHOULD do the best effort to report the most relevant type. For example, if the original exception is wrapped into a generic one, the original exception SHOULD be preferred.
Instrumentations SHOULD document how `error.type` is populated.

**[7]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available.

**[8]:** If using a port other than the default port for this DBMS and if `server.address` is set.

**[9]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available.

The following attributes can be important for making sampling decisions
and SHOULD be provided **at span creation time** (if provided at all):

* [`db.namespace`](/docs/attributes-registry/db.md)
| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [1] | `80`; `8080`; `443` | `Conditionally Required` [2] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [3] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

`db.cosmosdb.consistency_level` 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.
**[1]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available.

| Value | Description | Stability |
|---|---|---|
| `BoundedStaleness` | bounded_staleness | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `ConsistentPrefix` | consistent_prefix | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `Eventual` | eventual | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `Session` | session | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `Strong` | strong | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

`error.type` 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.
**[2]:** If using a port other than the default port for this DBMS and if `server.address` is set.

| Value | Description | Stability |
|---|---|---|
| `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
**[3]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available.

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
Expand Down
12 changes: 11 additions & 1 deletion model/database/cosmosdb-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,14 @@ groups:
instrument: updowncounter
unit: "{instance}"
stability: experimental
extends: attributes.db.cosmosdb.minimal
attributes:
# TODO: add db.system once https://github.com/open-telemetry/build-tools/issues/192 is possible
# - ref: db.system
# requirement_level:
# conditionally_required: if available
- ref: server.address
brief: >
Name of the database host.
- ref: server.port
requirement_level:
conditionally_required: If using a port other than the default port for this DBMS and if `server.address` is set.