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

Distributed Tracing: Operation name not being populated after 3.43.0 #4768

Closed
asos-fernandopiccin opened this issue Oct 8, 2024 · 5 comments
Assignees
Labels
customer-reported Issue created by a customer needs-investigation

Comments

@asos-fernandopiccin
Copy link

Describe the bug
We have upgraded to the latest version of cosmos (3.43.1) - upgrade from 3.41.0 and we have noticed that Cosmos Dependency Tracking on App Insights Dependency table doesn't have the following information:

  • target
  • name

These aren't being populated and currently show as n/a in App Insight's dependencies table.

To Reproduce
Install the packages: Microsoft.Azure.Cosmos 3.43.1 (latest at time of writing)
Install latest package of ApplicationInsights: Microsoft.ApplicationInsights 2.22.0
Make SDK operations to Cosmos e.g. CreateItemStreamAsync or ReadItemStreamAsync.

Expected behavior
Expected to see target and name populated correctly in the dependencies table in app insights- like previous nuget package (3.41.0)
image

Actual behavior
image
Target and name are showing as n/a in the dependencies table in app insights.

Environment summary
SDK Version: 3.43.1
OS Version (e.g. Windows, Linux, MacOSX): .net8 (linux & win11)

Additional context
Based on quick look at Cosmos and Application Insights source code, App Insights expects the db.operation and db.name to populate the name and target fields. Link here.
However, these tag names have been recently changed in the Cosmos SDK as part of this change.
image

Is this an intentional change? Is there any intention for this to be fixed?

@philipthomas-MSFT
Copy link
Contributor

Is this an intentional change? Is there any intention for this to be fixed?

Hello @asos-fernandopiccin,

First, we greatly appreciate you reaching out to us, and we’re excited that you are using our product! Let me attempt to answer your question and help resolve this issue.

Based on the following PR #4622 in the Cosmos DB .NET SDK repository, there has been a shift to align with OpenTelemetry conventions. You can find more details in the OpenTelemetry Semantic Conventions for Microsoft Cosmos DB.

Regarding the specific attributes:

  • The db.operation attribute has been replaced by db.operation.name. This change reflects a more descriptive and explicit naming for the operation being performed, such as "ReadItem", "WriteItem", or "Query". The goal is to provide clearer insights into the specific type of operation happening within Cosmos DB.
  • The db.name attribute has been replaced by db.namespace. This change allows for better differentiation in scenarios where multiple databases might be used across a single telemetry session. The db.namespace provides a more structured identifier, representing the fully qualified name or context of the database, enabling improved observability.

These changes were made to standardize tracing and ensure compatibility with OpenTelemetry, which is widely adopted for distributed tracing and observability.

If you have any further questions, please feel free to ask. We’re here to help!

@sourabh1007 Feel free to give your insight.

@asos-fernandopiccin
Copy link
Author

Hi @philipthomas-MSFT , thank you for your input!

I was wondering if any consideration was given to the idea of publishing both the new and old attribute names, allowing clients some time to adapt before renaming them? This could help avoid breaking changes, perhaps by marking the old attributes as obsolete and setting a future date for when they’d need to be updated.

Do you know if there’s any plan from the Cosmos SDK maintainers to reintroduce the old attributes, marking them as obsolete, or is the current expectation that clients wait for a fix from the App Insights SDK?

Thank you!

@philipthomas-MSFT
Copy link
Contributor

Do you know if there’s any plan from the Cosmos SDK maintainers to reintroduce the old attributes, marking them as obsolete, or is the current expectation that clients wait for a fix from the App Insights SDK?

Hello @asos-fernandopiccin,

We are currently working on a PR and hotfix release to reintroduce the db.operation and db.name attributes. Thank you for bringing this to our attention. We’ll be sure to take additional precautions in the future to prevent similar issues. We appreciate your continued support and contributions in making our product a success.

@asos-fernandopiccin
Copy link
Author

Perfect. Thank you very much.

@sourabh1007
Copy link
Contributor

Please upgrade to this version https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.44.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported Issue created by a customer needs-investigation
Projects
Status: Done
Development

No branches or pull requests

3 participants