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

swarm/network: Keep span across roundtrip #19140

Merged
merged 9 commits into from
Feb 20, 2019

Conversation

nolash
Copy link
Contributor

@nolash nolash commented Feb 20, 2019

This PR addresses ethersphere/swarm#1209 (see copy of description below) which is an incremental part of ethersphere/swarm#1181

Until now, the spans are only valid within internal peer contexts, but we may want to trace durations from node makes request to node received delivery.

According to opentracing support, if a Span is to persist across asynchronous operations, it's the requester's responsibility to remember the Span and Finish() it accordingly. In other words, a Span cannot be recalled after passing through the tracer.Inject()/tracer.Extract() serialization, only new spans (ChildOf(), FollowFrom()) can be created from the SpanContext that's passed on.

To this end, I've introduced a "store" for spans to be remembered. This "store" is a singleton per swarm instance. It seems to me to belong in the swarm/tracing package, so I put it there.


Unlike LazyChunkReader.Read, we don't know how long a single Retrieve Request took. We should update the spans to record the full duration of a retrieve request, until it is actually delivered on the requestor node.

Good
screen shot 2019-02-08 at 15 26 04

Bad
screen shot 2019-02-08 at 15 26 21

@zelig zelig merged commit d36e974 into ethereum:master Feb 20, 2019
kiku-jw pushed a commit to kiku-jw/go-ethereum that referenced this pull request Mar 29, 2019
* swarm/newtork: WIP Span request span until delivery and put

* swarm/storage: Introduce new trace across single fetcher lifespan

* swarm/network: Put span ids for sendpriority in context value

* swarm: Add global span store in tracing

* swarm/tracing: Add context key constants

* swarm/tracing: Add comments

* swarm/storage: Remove redundant fix for filestore

* swarm/tracing: Elaborate constants comments

* swarm/network, swarm/storage, swarm:tracing: Minor cleanup
nonsense referenced this pull request in ethersphere/swarm May 8, 2019
* swarm/newtork: WIP Span request span until delivery and put

* swarm/storage: Introduce new trace across single fetcher lifespan

* swarm/network: Put span ids for sendpriority in context value

* swarm: Add global span store in tracing

* swarm/tracing: Add context key constants

* swarm/tracing: Add comments

* swarm/storage: Remove redundant fix for filestore

* swarm/tracing: Elaborate constants comments

* swarm/network, swarm/storage, swarm:tracing: Minor cleanup
@nolash nolash deleted the trace-request-across-protocol branch June 5, 2019 13:56
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.

3 participants