-
Notifications
You must be signed in to change notification settings - Fork 893
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
Semantic convention for HTTP start / end times #591
Comments
I am not sure if these details should be under "semantic conventions" or other section, but I do agree that they are important to be documented. |
Any suggestions on a new location? otherwise I can just fire a PR. |
Actually, re-thinking through it, "semantic_conventions" may still the be right location, since it's describing what the meanings of specific values should be. I believe it could expand to things like timings, since that ascribes meaning to the number. |
I feel like much of this could be generalized and covered in the docs for span's start/end. |
@Oberon00 +1. Why would we want to call this out just for HTTP spans? It is a general principle - if span represents an operation (be it an RPC or an internal function), its timestamps should be as close to operation start and end as possible. |
I've updated the PR to incorporate an example. re-reading the API spec, I do believe that the existing spec is fairly clear on the measurement:
But I think the example further clarifies around nuances like:
|
I am actually neutral on this as a requirement, I think "it depends". Especially because tracing itself can be implemented as a middleware and the author of that middleware may not have much control over whether it's mounted as the outer-most mw/interceptor, or something in the middle of the MW stack. |
How people think about layering OT/OTel has always been confusing to me. These are the events: tcp.client.start Personally, I think it makes sense to arrange them as:
...and throw on as many layers to that as you want, or ignore them. But don't try to squish or rearrange them in weird ways. |
I think it's good to provide some level of guidance or best practice. To your point there are situations where what is desired is not entirely possible (such as control over the middleware layering order), but at the same time there are expectations that if a timing names itself the http method and the route, it will encompass all time spent on that operation.
@pauldraper Sorry, I'm not clear on how to incorporate this into the issue. Can you give an example of how one is squishing or re-arranging the request/response stack you posted, and how we can modify the specification to ensure that doesn't happen? |
@toumorokoshi sorry there was some stuff that leaked in from #526 that didn't belong. On topic....
|
sounds good. I believe this does cover an example in the api/trace.md that addresses your concerns, albeit a little less explicitly: One challenge I'm having with the PR is the desire to make this a more high-level explanation, but the immediate need to clarify things like what a top level server span should or shouldn't encompass for http. |
My opinion is that the client and server HTTP spans should contain just HTTP information: headers, statuses, agents, etc. Everything else, e.g. invoking a Java servlet handler if the URL matches a known pattern, or running middleware, should be a new child span. |
It doesn't seem that there's a defined semantic convention for when an http instrumentation span should start and end. There's some ambiguity that would be worth clarifying, namely whether these measurements should also consider the duration of additional middleware layers.
As a start, I would argue we should declare that instrumentations should consider the full request/response cycle of a web application (include middlewares).
Reference for discussion origination: open-telemetry/opentelemetry-python#659
This is a more specific discussion of #330.
The text was updated successfully, but these errors were encountered: