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

Enhance semantic conventions for HTTP #263

Merged
merged 38 commits into from
Oct 28, 2019

Conversation

Oberon00
Copy link
Member

@Oberon00 Oberon00 commented Sep 27, 2019

This PR aims to improve the semantic conventions for HTTP. For that, it also draws from experience at Dynatrace. We plan to later (hopefully soon) make similar PRs for other semantic convention areas, including a clean-up of the host.* and peer.* attributes used here.

@SergeyKanzhelev
Copy link
Member

I'm very sorry for bringing it late. But I think the same applies to http.app_root. I totally missed that there were two application attributes added. And I think they needs to be discussed together. Would you agree?

| `http.app_root` |The path prefix of the URL that identifies this HTTP application. If multiple roots exist, the one that was matched for this request should be used. | No |

Again, I'm very sorry for bringing it late

@Oberon00
Copy link
Member Author

Oberon00 commented Oct 25, 2019

I did actually think about removing http.app_root along with http.app, but since even within a single app there can be multiple app roots, I maintain that even with http.app moved to resources, it would make sense to have that attribute to determine which app_root was matched and thus be able to split the app-specific part from the URL.
But I think that attribute falls firmly in the "nice-to-have" category, so if after reading that argument, you still think that the attribute should be removed, I can do that in the interest of getting this moved forward.

@Oberon00
Copy link
Member Author

Also, if I follow @jmacd correctly, the decision whether some attribute should be put on resources would be demoted to an implementation detail/optimization decision that each instrumentation can make itself, which I would really like, it would make this discussion much easier.

@SergeyKanzhelev
Copy link
Member

@Oberon00 I feel strongly about it. I understand the need of the property, but, first, it may be a resource property and secondly it may not have an "http" prefix. Also not having it in this spec doesn't forbid to collect it.

I tried to commit the change myself so I can merge it, but I don't have permissions

@Oberon00
Copy link
Member Author

Oberon00 commented Oct 28, 2019

@SergeyKanzhelev

I tried to commit the change myself so I can merge it, but I don't have permissions

That's strange, I was sure that I ticked the "Allow maintainers to edit your PR" checkbox.

image

first, it may be a resource property and secondly it may not have an "http" prefix

That seems to apply to http.app but not http.app_root. The application root is an URL path prefix which seems very HTTP specific to me. Also, it might be a resource if your app only has one. But I think specifying this as a resource would be overly restraining. E.g. consider having the same application My nice WebShop under both shop.example.com/ (server_name = shop.example.com, app_root =/) and example.com/shop (server_name = example.com, app_root = /shop). Now assuming that resources are attached to the tracer (currently there is no API-level interface for resources, they are SDK-only so this would need more spec-work anyway), I'd need to do this (pseudo Python):

tracer= trace.get_factory().createTracer(
  'my.web.instrumentation',
  '1.2.3',
  extra_resources={
    'http.app_root': environ['CONTEXT_PREFIX'],
    'http.app': SOME_CONFIGURED_APP_ID
}

span = tracer.start_as_active_span(...)
span.set_attribute('http.server_name', environ['SERVER_NAME'])

And now I have a tracer+span that is created for only a single span. 😕

I created a PR I can merge to remove the application root against this PR. @SergeyKanzhelev if you are sure about that, I'll merge it and you can merge this PR right after 😃 dynatrace-oss-contrib#4

Oberon00 added a commit to dynatrace-oss-contrib/opentelemetry-specification that referenced this pull request Oct 28, 2019
@jmacd
Copy link
Contributor

jmacd commented Oct 28, 2019

And now I have a tracer+span that is created for only a single span. 😕

Do you see this as a problem? I have been thinking of the tracer returned in this case as merely a binding between the underlying SDK and some resource/component/service-name attributes.

@SergeyKanzhelev
Copy link
Member

This comment:

The application root is an URL path prefix which seems very HTTP specific to me. Also, it might be a resource if your app only has one.

Doesn't match to description in PR which says it "identifies the app":

The path prefix of the URL that identifies this HTTP application. If multiple roots exist, the one that was matched for this request should be used.

In any case I'm happy to get into this discussion, but I really don't want to block this PR any further. I think it will be more productive to merge this without app_root and discuss app_root separately. Thank you!

@Oberon00
Copy link
Member Author

@SergeyKanzhelev

It still sounds to me like you talk about the http.app attribute, not http.app_root. The http.app identifies the application, not the http.app_root (though the combination of http.app_root and http.server_name should also uniquely identify the app).

Anyway, I removed it for now, so I think this is now ready to be merged.

@SergeyKanzhelev
Copy link
Member

I was the last one blocking this PR. All concerns are now resolved. I'm merging now. Typically we would wait for some time after the last meaningful change. But in case of this long living PR I'd suggest to file an issue if this change was not aligned with what you have previously approved. Simply in interest of velocity

@SergeyKanzhelev SergeyKanzhelev merged commit 2b8b767 into open-telemetry:master Oct 28, 2019
@Oberon00 Oberon00 deleted the httpconv branch November 12, 2019 14:41
Oberon00 added a commit to dynatrace-oss-contrib/opentelemetry-python that referenced this pull request Nov 21, 2019
Oberon00 added a commit to dynatrace-oss-contrib/opentelemetry-python that referenced this pull request Nov 25, 2019
SergeyKanzhelev pushed a commit to SergeyKanzhelev/opentelemetry-specification that referenced this pull request Feb 18, 2020
* Update HTTP conventions.

* Improve HTTP, fix references to peer.*.

* Wording.

* typo a/an http

* host.name/host.port

* Clarify server_name.

* Typo, missing 'has'.

* Typo nginx link.

* Wording.

* Typo in span name convention.

Co-Authored-By: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>

* Wording for common HTTP intro.

In response to @SergeyKanzhelev
(open-telemetry#263 (comment)).

* Make http.flavor non-required.

In-reply-to: open-telemetry#263 (comment)

Co-authored-by: Sergey Kanzhelev <S.Kanzhelev@live.com>

* Clarify client's http.url.

In-reply-to: open-telemetry#263 (comment)

* HTTP server span name: reference `http.app_root`.

In-reply-to: open-telemetry#263 (comment)

* Split "Definitions" from conventions, clarify app_root.

In-reply-to: open-telemetry#263 (comment)

* Qualify order of http server attr preferences.

In-reply-to: open-telemetry#263 (comment)

* Address review comments.

* Typo.

* Make http.status_code conditionally required.

* Move http.host,target,scheme; clarify empty host.

* Fix misplaced paragraph.

* Fix client host/port requirement.

* Fix HTTP status code OC incompat annotations.

* Fix incomplete sentence.

* Markdown syntax.

* Update HTTP example (remove URL, add client).

In-reply-to: open-telemetry#263 (comment)

* Fix markdownlint.

* Typo.

* Remove http.app Span attribute.

In-reply-to: open-telemetry#263 (comment)
In-reply-to: open-telemetry#263 (comment)

* Fix lint.

./specification/data-semantic-conventions.md:155: MD036 Emphasis used instead of a header

* Add note about n:1 server_name + app_root => app.

* Typo.

* Remove http.app_root. (open-telemetry#4)

In-reply-to: open-telemetry#263 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.