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

Update ServerRequest to accept server name #3619

Merged
merged 7 commits into from
Jan 26, 2023

Conversation

MrAlias
Copy link
Contributor

@MrAlias MrAlias commented Jan 25, 2023

The net.host.name and net.host.port need to be set to the primary server name if it is known1. Currently, the ServerRequest function provided by the httpconv packages do not include this in the processing of relevant attributes. This means for a user of these packages that know the primary server name, they need to manually added the attribute after a call to ServerRequest. This relies on the last-one-wins semantics of a span SetAttributes method which is not common knowledge, nor should it be needed for a user to correctly have their attributes defined.

Instead, update the ServerRequest method accept the server and use it to decide on how to construct the appropriate attributes.

Footnotes

  1. https://github.com/open-telemetry/opentelemetry-specification/blob/v1.17.0/specification/trace/semantic_conventions/http.md#http-server-semantic-conventions

@MrAlias MrAlias added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Jan 25, 2023
@MrAlias MrAlias added this to the Release v1.12.0 milestone Jan 25, 2023
@codecov
Copy link

codecov bot commented Jan 25, 2023

Codecov Report

Merging #3619 (b8b98d2) into main (7e5d903) will increase coverage by 0.0%.
The diff coverage is 100.0%.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #3619   +/-   ##
=====================================
  Coverage   79.4%   79.4%           
=====================================
  Files        170     170           
  Lines      12645   12654    +9     
=====================================
+ Hits       10043   10052    +9     
  Misses      2392    2392           
  Partials     210     210           
Impacted Files Coverage Δ
semconv/internal/v2/http.go 100.0% <100.0%> (ø)
exporters/jaeger/jaeger.go 90.3% <0.0%> (-0.9%) ⬇️
sdk/trace/batch_span_processor.go 81.1% <0.0%> (+0.8%) ⬆️

@dmathieu
Copy link
Member

Isn't this a breaking change for the semconv/vxxx/httpconv packages? Shouldn't there be a changelog entry?

@MrAlias
Copy link
Contributor Author

MrAlias commented Jan 26, 2023

Isn't this a breaking change for the semconv/vxxx/httpconv packages? Shouldn't there be a changelog entry?

The code this changes hasn't been released yet.

@MrAlias MrAlias merged commit af3db6e into open-telemetry:main Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants