MongoDB traces - update semantic conventions to v1.39.0#4791
MongoDB traces - update semantic conventions to v1.39.0#4791Kielek merged 70 commits intoopen-telemetry:mainfrom
Conversation
|
ActivitySource should also provide link to the schema |
Resolved and implemented! |
ysolomchenko
left a comment
There was a problem hiding this comment.
The following attributes should be set at span creation time rather than during execution.
https://github.com/open-telemetry/semantic-conventions/blob/v1.39.0/docs/db/mongodb.md?plain=1#L69
These attributes are not present on the formal span definition and having then in the examples is misleading - e.g. open-telemetry/opentelemetry-dotnet-instrumentation#4791 (comment)
Kielek
left a comment
There was a problem hiding this comment.
You have some issues with the tests.
What is more, I think it would be great to adjust expectations to cover new attributes.
|
SIG: @aviralgarg05 can you check the CI failures? |
Yes I will fix them |
Kielek
left a comment
There was a problem hiding this comment.
@aviralgarg05 thank you for the PR, I have pushed some direct feedback on your branch. I hope you are fine with these changes.
There is couple leftovers to be handled.
|
I have fixed and resolved the comments. |
It would be good to add tests for the error trace as well, since we have new logic here. |
|
Added tests for MongoDB error traces:
|
|
@aviralgarg05 can you check why the tests are failing and fix them? |
Updates db.system to db.system.name in accordance with OpenTelemetry Semantic Conventions v1.39.0 (open-telemetry#4786).
This is not related to your changes. It’s just a flaky test that fails sometimes. |
- Remove unrelated NoCodeTests.cs - Remove QueryWireProtocol instrumentation - Use DuckTyping for MongoCommandException.Code
QueryWireProtocol is valid for MongoDB versions earlier than 3.5
|
@aviralgarg05 I don’t have privileges to add direct commits, so I created them on my branch. Could you add them to this PR? It should fix the CI issues. |
Status codes are integers, not strings. Updated the test validation to check IntValue > 0 instead of checking StringValue.
MongoDB - update semantic convention to v1.39.0 (#4786)
Why
OpenTelemetry Semantic Conventions have standardized database attribute names to ensure consistency across different language implementations. Specifically, the attribute
db.systemhas been transitioned todb.system.namein the stable semantic conventions (finalized in v1.30.0 and kept in v1.39.0). This PR aligns the .NET AutoInstrumentation with these standards.What
DbSystemconstant from"db.system"to"db.system.name"in src/OpenTelemetry.AutoInstrumentation/Instrumentations/DatabaseAttributes.cs.db.system.nameattribute in emitted spans.Tests
DatabaseAttributes.Keys.DbSystemconstant, ensuring the change propagates automatically.db.system.name.grepto ensure no other hardcoded strings of"db.system"were missed in thesrcortestdirectories.Checklist