-
Notifications
You must be signed in to change notification settings - Fork 501
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
HTTP Semconv migration Part3 Server - v1.24.0 support #5401
base: main
Are you sure you want to change the base?
HTTP Semconv migration Part3 Server - v1.24.0 support #5401
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5401 +/- ##
=======================================
+ Coverage 62.3% 62.5% +0.1%
=======================================
Files 189 190 +1
Lines 11575 11673 +98
=======================================
+ Hits 7221 7296 +75
- Misses 4145 4161 +16
- Partials 209 216 +7
|
Changelog will be part of follow on PR as part of #5331 |
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.
Could use a few more test cases, but LGTM otherwise
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.
There is missing test coverage.
} else { | ||
// Prioritize the primary server name. | ||
host, p = splitHostPort(server) | ||
if p < 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.
if p < 0 { | |
if host == "" && p < 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.
The goal of this if branch is only to change the port if one wasn't part of server
. This was logic from semconvutil:
opentelemetry-go-contrib/instrumentation/net/http/otelhttp/internal/semconvutil/httpconv.go
Lines 334 to 344 in 261b731
var host string | |
var p int | |
if server == "" { | |
host, p = splitHostPort(req.Host) | |
} else { | |
// Prioritize the primary server name. | |
host, p = splitHostPort(server) | |
if p < 0 { | |
_, p = splitHostPort(req.Host) | |
} | |
} |
resp: ResponseTelemetry{ | ||
StatusCode: 200, | ||
ReadBytes: 701, | ||
ReadError: fmt.Errorf("read error"), |
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.
ReadError: fmt.Errorf("read error"), | |
ReadError: errors.New("read error"), |
This change adds the new semantic version (v1.24.0) attribute producer to the semconv of otlehttp.
The full PR is #5092
Part of #5331