-
Notifications
You must be signed in to change notification settings - Fork 765
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
update HttpSemanticConventions for Instrumentation.SqlClient #4644
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #4644 +/- ##
==========================================
+ Coverage 84.94% 84.98% +0.04%
==========================================
Files 314 314
Lines 12689 12698 +9
==========================================
+ Hits 10779 10792 +13
+ Misses 1910 1906 -4
|
Co-authored-by: Vishwesh Bankwar <vishweshbankwar@users.noreply.github.com>
src/OpenTelemetry.Instrumentation.SqlClient/SqlClientInstrumentationOptions.cs
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.SqlClient/SqlClientInstrumentationOptions.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - Please add the tests as well
sqlActivity.SetTag(SemanticConventions.AttributeNetPeerName, connectionDetails.ServerHostName); | ||
} | ||
else | ||
if (!string.IsNullOrEmpty(connectionDetails.InstanceName)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to this PR, but why is this method in the options class instead of the listener?
We should probably move this code to the listener. That would also make us consistent with other instrumentation libraries for how we read the environment variable.
test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlClientInstrumentationOptionsTests.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made some suggestions to update the tests.
Assert.Equal(expectedPort, activity.GetTagValue(SemanticConventions.AttributeServerPort)); | ||
} | ||
|
||
// Tests for newer HTTP v1.21.0 Semantic Conventions and older attributes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems we still have confusion here, what exactly is "HTTP v1.21.0 Semantic Conventions", @TimothyMothra could you put a concrete link?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected this. New text:
// Tests for v1.21.0 Semantic Conventions for database client calls.
// see the spec https://github.com/open-telemetry/opentelemetry-specification/blob/v1.21.0/specification/trace/semantic_conventions/database.md
// This test emits both the new and older attributes.
// This test method can be deleted when this library is GA.
@@ -2,6 +2,12 @@ | |||
|
|||
## Unreleased | |||
|
|||
* Updated [Semantic Conventions](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.21.0/specification/trace/semantic_conventions/database.md). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're lacking clarity here, https://github.com/open-telemetry/opentelemetry-specification/blob/v1.21.0/CHANGELOG.md#v1210-2023-05-09 clearly called out that semconv got moved to a new repo so it doesn't seem to be part of v1.21.0 release, yet we're referring to 1.21.0 database link, what does that mean and what exactly are we trying to follow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was already discussed. #4538 (comment)
The semantic-conventions repo doesn't have any versioned releases for me to link to.
@utpilla asked me to link to the former repo which does have versioned tags to link to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me change the question, which exact semantic convention version do we want to implement in this PR? (I don't think the goal to implement the link that you put here)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to implement the breaking changes to the HTTP Semantic Conventions.
These changes are described in the v1.21.0 of the opentelemetry-specification.
https://github.com/open-telemetry/opentelemetry-specification/tree/v1.21.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI for all persons here.
Semantic-Conventions repo is readying their first release. The version will be v1.21.0. No ETA because they're building out the processes.
https://github.com/open-telemetry/semantic-conventions/blob/df8e53054147acf49918582bd446d0f524170071/CHANGELOG.md
Trask advised that we should link to "main" for now.
I need some time to update all the comments and links. Will need to create a new PR to correct everything that merged already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No ETA because they're building out the processes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to understand what this PR is trying to follow https://github.com/open-telemetry/opentelemetry-dotnet/pull/4644/files#r1261585780.
Unblocking the PR, please follow up and bring clarity
I've updated all the comments and changelog with the links to the correct spec (in the new repo). |
Design discussion issue #4484
Changes
Instrumentation.SqlClient
SqlClientInstrumentationOptions
to emit new attributes.SqlClientInstrumentationOptions_EnableConnectionLevelAttributes_New()
to test the new attributes.
When this library is GA, this method will replace
SqlClientInstrumentationOptions_EnableConnectionLevelAttributes()
SqlClientInstrumentationOptions_EnableConnectionLevelAttributes_Dupe()
to test the scenario when this library emits both new and old attributes.
When this library is GA, this method can be removed.
Merge requirement checklist
CHANGELOG.md
files updated for non-trivial changes