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

Produce documentation that outlines http changes from 1.20.0 #43

Closed
tigrannajaryan opened this issue May 19, 2023 · 11 comments · Fixed by open-telemetry/opentelemetry.io#3472
Assignees

Comments

@tigrannajaryan
Copy link
Member

tigrannajaryan commented May 19, 2023

I was trying to understand what changes in http conventions and it is not easy to do since it seems the changes happened across more than one PR. One way to get his info is to use git history or git blame, but that's time consuming and error prone and also because we moved the repo I can't be sure I am comparing to the correct baseline (the 1.20.0 is in the spec repo).

It would be great if we could produce a side-by-side comparison of semconv 1.20.0 and <next version>.

@arminru
Copy link
Member

arminru commented May 23, 2023

I compiled the list below, hope this helps:

old attribute new attribute(s) PR
http.method http.request.method #3355
http.status_code http.response.status_code #3355
http.scheme url.scheme #3355
http.url url.full #3355
http.request_content_length http.request.body.size #3355
http.response_content_length http.response.body.size #3355
http.target url.path + url.query + url.fragment #3355
   
http.client_ip client.address #3402
   
net.peer.name server.address + client.address #3402
net.peer.port server.port + client.port #3402
net.host.name server.address (+ client.address) #3402
net.host.port server.port #3402
net.sock.peer.addr server.socket.address + client.socket.address #3402
net.sock.peer.port server.socket.port + client.socket.port #3402
net.sock.peer.name server.socket.domain #3402
net.sock.host.addr server.socket.address #3402
net.sock.host.port server.socket.port #3402
   
net.protocol.name network.protocol.name #3426
net.protocol.version network.protocol.version #3426
net.host.connection.type network.connection.type #3426
net.host.connection.subtype network.connection.subtype #3426
net.host.carrier.name network.carrier.name #3426
net.host.carrier.mcc network.carrier.mcc #3426
net.host.carrier.mnc network.carrier.mnc #3426
net.host.carrier.icc network.carrier.icc #3426
   
(new) network.transport #3433
(new) network.type #3433
 
net.transport (removed) #3433
net.sock.family (removed) #3433

@arminru
Copy link
Member

arminru commented May 23, 2023

@lmolkova @trask Would be great if you could double-check the list above for correctness and completeness since you worked on most if not all of these 🙂

@tigrannajaryan
Copy link
Member Author

This is a great way to represent it. Thanks @arminru

@lmolkova
Copy link
Contributor

Thanks a lot @arminru ! It looks great!

@cyrille-leclerc
Copy link
Member

Should http.route be changed as well? I'm not sure if http.request.route would be a better fit.

@Oberon00
Copy link
Member

Oberon00 commented Jun 21, 2023

@arminru Just looking a bit at the list you compiled, and have some notes:

@arminru
Copy link
Member

arminru commented Jun 21, 2023

Thanks for double-checking, @Oberon00. I updated the comment above.

@trask
Copy link
Member

trask commented Oct 4, 2023

(added this as a blocker for HTTP semconv stability to make sure it gets done since this will be important for both instrumenters and users who are upgrading their instrumentation to a version that implements the stable HTTP semconv)

@trask trask assigned trask and unassigned reyang Oct 17, 2023
@trask
Copy link
Member

trask commented Oct 27, 2023

Summary of changes to HTTP semantic conventions since version v1.20.0.

Common attributes across HTTP client and HTTP server spans:

v1.20.0 -> v1.23.0 (stable)

  • http.method -> http.request.method
    • Now captures only 9 common HTTP methods by default (configurable) plus _OTHER
  • http.status_code -> http.response.status_code
  • http.request.header.<key>
    • Dash ("-") to underscore ("_") normalization in <key> has been removed
    • HTTP Server spans: now must be provided to sampler
  • http.response.header.<key>
    • Dash ("-") to underscore ("_") normalization in <key> has been removed
  • http.request_content_length -> http.request.body.size
    • Recommended -> Opt-In
    • Not marked stable yet
  • http.response_content_length -> http.response.body.size
    • Recommended -> Opt-In
    • Not marked stable yet
  • user_agent.original
    • HTTP Client spans: Recommended -> Opt-In
    • HTTP Server spans: now must be provided to sampler
    • (see below if updating from version v1.18.0 or earlier)
  • net.protocol.name -> network.protocol.name
    • Recommended -> Conditionally required if not http and network.protocol.version is set
  • net.protocol.version -> network.protocol.version
    • Examples fixed: 2.0 -> 2 and 3.0 -> 3
    • (see below if updating from version v1.19.0 or earlier)
  • net.sock.family -> Removed
  • net.sock.peer.addr -> network.peer.address
    • HTTP server spans: if http.client_ip was unknown (i.e. no X-Forwarded-For, Forwarded#for headers), then also net.sock.peer.addr -> client.address (and note client.address must be provided to sampler)
  • net.sock.peer.port -> network.peer.port
    • Now captured even if same as server.port
  • net.sock.peer.name -> Removed
  • New: http.request.method_original
  • New: error.type

HTTP client span attributes:

v1.20.0 -> v1.23.0 (stable)

  • http.url -> url.full
  • http.resend_count -> http.request.resend_count
  • net.peer.name -> server.address
  • net.peer.port -> server.port
    • Now captured even when same as default port for scheme

HTTP server span attributes:

v1.20.0 -> v1.23.0 (stable)

HTTP client and server span names:

v1.20.0 -> v1.23.0 (stable)

The {http.method} portion of span names is replace by HTTP when {http.method} is _OTHER.

Note: see below if updating from version v1.17.0 or earlier.

HTTP client duration metric

v1.20.0 -> v1.23.0 (stable)

  • Name: http.client.duration -> http.client.request.duration
  • Unit: ms -> s
  • Description: Measures the duration of inbound HTTP requests. -> Duration of HTTP server requests.
  • Histogram buckets: boundaries updated to reflect change from milliseconds to seconds, and zero bucket boundary removed
  • Attribute changes:
    • http.method -> http.request.method
      • Now captures only 9 common HTTP methods by default plus _OTHER
    • http.status_code -> http.response.status_code
    • net.peer.name -> server.address
    • net.peer.port -> server.port
      • Now captured even when same as default port for scheme
    • net.sock.peer.addr -> Removed
    • net.protocol.name -> network.protocol.name
      • Recommended -> Opt-In
    • net.protocol.version -> network.protocol.version
      • Examples fixed: 2.0 -> 2 and 3.0 -> 3
      • Note: see below if updating from version v1.19.0 or earlier
    • New: error.type

HTTP server duration metric

v1.20.0 -> v1.23.0 (stable)

  • Name http.server.duration -> http.server.request.duration
  • Unit: ms -> s
  • Description: Measures the duration of inbound HTTP requests. -> Duration of HTTP server requests.
  • Histogram buckets: boundaries updated to reflect change from milliseconds to seconds, and zero bucket boundary removed
  • Attribute changes:
    • http.route (No change)
    • http.method -> http.request.method
      • Now captures only 9 common HTTP methods by default plus _OTHER
    • http.status_code -> http.response.status_code
    • http.scheme -> url.scheme
    • net.protocol.name -> network.protocol.name
      • Recommended -> Opt-In
    • net.protocol.version -> network.protocol.version
      • Examples fixed: 2.0 -> 2 and 3.0 -> 3
      • Note: see below if updating from version v1.19.0 or earlier
    • net.host.name -> server.address
    • net.host.port -> server.port
    • New: error.type

If you are coming from an earlier semantic convention version:

If updating from version v1.19.0 or earlier:

  • http.flavor -> network.protocol.version
    • Examples fixed: 2.0 -> 2 and 3.0 -> 3

If updating from version v1.18.0 or earlier:

  • http.user_agent -> user_agent.original

If updating from version v1.17.0 or earlier:

HTTP server span name:

  • when http.route is available
    • {http.route} -> {summary} {http.route}
  • when http.route is not available
    • HTTP {http.method} -> {summary}

where {summary} is {http.method}, unless {http.method} is _OTHER, in which case {summary} is HTTP.

HTTP client span name:

  • HTTP {http.method} -> {summary}

where {summary} is {http.method}, unless {http.method} is _OTHER, in which case {summary} is HTTP.

@tigrannajaryan
Copy link
Member Author

Thank you @trask for the summary.

@trask
Copy link
Member

trask commented Nov 9, 2023

Closed by https://opentelemetry.io/blog/2023/http-conventions-declared-stable/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

7 participants