-
Notifications
You must be signed in to change notification settings - Fork 841
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
Add db.cosmosdb.partition_key as a span attr on item ops #23664
base: main
Are you sure you want to change the base?
Conversation
Thank you for your contribution @kjg! We will review the pull request and get back to you soon. |
@FabianMeiswinkel @sourabh1007 @jcocchi - any thoughts here on the impact of this? |
My main concern is PII leakage. The query text and parameters are in the Semantic Conventions but with explicit notes about sanitization. The partition key could be considered PII in some cases. I don't know for sure if we currently emit I'm OK having it as an option, it does seem quite useful if you know your PKs are not PII. |
azcosmos does not yet emit For my team's use case, I could see us wanting to emit |
I absolutely think we need One thought is to have a list of "enabled tracing attributes" in options := azcosmos.ClientOptions {
EnabledTracingAttributes: []string { "db.query.text", "db.cosmosdb.partition_key" },
} But I don't know if that's feasible. There's also the element of having to scan this list every time we build a span, to identify which attributes to specify. I'd be curious what, if anything, other SDKs (both other Azure services' Go SDKs and Azure SDKs for other languages) do here 🤔 . Might poke around a bit and see what I can find. |
@analogrelay We have added |
As @analogrelay pointed out, the primary concern here is protecting PII, particularly if referencing logical partition keys tied to customer data. Instead, we could use physical identifiers such as partitionid (and replicaid) or pkrangeid, which would help in identifying potential hot partition issues without exposing sensitive information. In the Cosmos DB SDK, we currently don't emit traces at the network level, as network interactions can involve multiple partition IDs per operation. Therefore, we haven't included this data in traces yet. However, we are planning to introduce it as an optional dimension in network-level OpenTelemetry (OTel) metrics (ref here). This would allow users to opt in as needed, helping to manage cardinality effectively. |
It would be useful to have the partition_key as an attribute on Item operations to make it easier to see if there are any performance based patterns in certain partitions, what are you thoughts on including it?
I know that
db.cosmosdb.partition_key
isn't in the OpenTelemetry Semantic Conventions (yet) as an attribute, but we could open a PR for that as well.