Open sourabh1007 opened 5 months ago
Sanitization reference: sanitization of db.query.text
Batch reference: Guidance throughout multiple areas of OTel database semantic convention common attributes
Span name reference: name
Adding a few more requirements for attribute changes from the new OTel specification Full list found in the database specification.
Attributes to rename
error
New attributes from spec not in our current implementation
Existing attributes to add to spec Is there a reason we left these off the spec? Once we have a GA release it’s probably good to document them.
CC: @sourabh1007
@jcocchi
server.port => is it port number used for RNTBD call? and for http it will be always 443? user_agent.original => it should be there https://github.com/Azure/azure-cosmos-dotnet-v3/blob/016e19f6de02742c87a75e4d95e816b6d277034e/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs#L153
Regarding other attributes, we decided to have these attributes but we left them for otel specs, because these were very specific to cosmos db.
We can leave off server.port
if it isn't useful for us, I just wanted to call out it's in the spec but missing from our implementation.
user_agent.original
didn't show up in the list of attributes in my App Insights traces when I ran my sample app yesterday, are you sure it's still populating correctly? Maybe App Insights just doesn't show it in the UI?
Once we GA I think it's okay to add all the attributes to the spec provided we don't plan to change them.
Span name is already <operationname><space><collectionname>
What do you think about changing, db.cosmosdb.operation_type
to db.operation.type
since we have db.operation.name
and db.operation.batch.size
?
Query sanitization (https://github.com/Azure/azure-cosmos-dotnet-v3/pull/4664)
Batch ( https://github.com/Azure/azure-cosmos-dotnet-v3/pull/4622 )
Bulk
Span name ( https://github.com/Azure/azure-cosmos-dotnet-v3/issues/4553#issuecomment-2264312696)
Change span name to<operation name> <target>
where target is the collection name if availableThis removes the<namespace>
or account name in our case from the span nameOperation Name
db.operation.name
(https://github.com/Azure/azure-cosmos-dotnet-v3/pull/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 https://github.com/Azure/azure-cosmos-dotnet-v3/issues/4553#issuecomment-2231991812
(https://github.com/Azure/azure-cosmos-dotnet-v3/pull/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 requestdb.cosmosdb.consistency_level
Inprogress
a) add
db.cosmosdb.regions_contacted
b) change casing for direct and gateway mode c) adddb.cosmosdb.row_count
Versioning
database
: Show only stable and new experimental attributesdatabase/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):