Skip to content

Distributed Tracing/Open Telemetry: Feature requests #4553

@sourabh1007

Description

@sourabh1007

Query sanitization (#4664)

  1. Parameterized queries shouldn't be sanitized (because the user self-sanitizes through parameters), and collecting parameter values will be an opt in config
  2. For all other queries, text should only be captured if it's sanitized. Literal values should be replaced by ?

Batch ( #4622 )

  1. New attribute to capture batch size
  2. Operation name should be prepended with BATCH for homogenous operations, or be just BATCH for heterogenous operations. If the DB system has a native name that makes sense we can use that (ex. our API names for ReadMany, TransactionalBatch etc.)

Bulk

  1. Operation name should be prepended with Bulk. : Covered as part of Open Telemetry: Fixes Operation name to follow Otel convention #4643
  2. Verify bulk user experience. : Done in Scrum Call

Span name ( #4553 (comment))

  1. Change span name to <operation name> <target> where target is the collection name if available
  2. This removes the <namespace> or account name in our case from the span name

Operation Name db.operation.name (#4643)

Batch/bulk operations:

  • execute_batch
  • execute_bulk
  • batch_< operation name >
  • bulk_< operation name >

Change feed operations:

  • query_change_feed

Conflicts operations:

  • delete_conflict
  • query_conflicts
  • read_all_conflicts
  • read_conflict

Container operations:

  • create_container
  • create_container_if_not_exists
  • delete_container
  • query_containers
  • read_all_containers
  • read_container
  • replace_container

Database operations:

  • create_database
  • create_database_if_not_exists
  • delete_database
  • query_databases
  • read_all_databases

Encryption key operations:

  • create_client_encryption_key
  • query_encryption_keys
  • read_all_encryption_keys
  • read_client_encryption_key
  • replace_client_encryption_key

Item operations:

  • create_item
  • delete_all_items_by_partition_key
  • delete_item
  • patch_item
  • query_items
  • read_all_items
  • read_all_items_of_logical_partition
  • read_many_items
  • read_item
  • replace_item
  • upsert_item

Permission operations:

  • create_permission
  • delete_permission
  • query_permissions
  • read_all_permissions
  • read_permission
  • replace_permission
  • upsert_permission

Stored procedure operations:

  • create_stored_procedure
  • delete_stored_procedure
  • execute_stored_procedure
  • query_stored_procedures
  • read_all_stored_procedures
  • read_stored_procedure
  • replace_stored_procedure

Throughput operations:

  • read_throughput
  • replace_throughput

Trigger operations:

  • create_trigger
  • delete_trigger
  • query_triggers
  • read_all_triggers
  • read_trigger
  • replace_trigger

User operations:

  • create_user
  • delete_user
  • query_users
  • read_all_users
  • read_user
  • replace_user
  • upsert_user

User-defined function operations:

  • create_user_defined_function
  • delete_user_defined_function
  • query_user_defined_functions
  • read_all_user_defined_functions
  • read_user_defined_function

Other changes, as mentioned in #4553 (comment)

(#4765)

db.cosmosdb.operation_type --> db.cosmosdb.operation.type (or we can get rid of this attribute entirely since we have clear operation names now, not sure this still adds any value)
db.cosmosdb.client_id --> db.cosmosdb.client.id (aligns with OTel messaging conventions)
db.cosmosdb.request_content_length --> db.cosmosdb.request.content_length (aligns with OTel HTTP conventions)
db.cosmosdb.request_charge, no change for this one since "request charge" is one thing rather than charge being an attribute of request
db.cosmosdb.consistency_level

Inprogress

a) add db.cosmosdb.regions_contacted
b) change casing for direct and gateway mode
c) add db.cosmosdb.row_count

Versioning

database : Show only stable and new experimental attributes
database/dup : Show both stable and old and new experimental attributes (it means attributes can be duplicated here, if an attribute name was changed from db.cosmos.xx -> db.cosmos.yy, then both the attributes will be emitted)
default: Show only old experimental(or stable) => old will target particular version in case of cosmos db, it is semantic-conventions/docs/database/cosmosdb.md at v1.25.0 · open-telemetry/semantic-conventions (github.com)

Few open requests for reference (might or might not be relevant):

  1. Distributed Tracing: Add db.query.text attribute #4375
  2. Do not treat 404 for a point read as a dependency failure #4095
  3. AI Integration: Get Request size from request diagnostics and optimize logic to get Response Size #3317

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions