Skip to content

Commit

Permalink
Add diagram and tweaks ti fix client mode
Browse files Browse the repository at this point in the history
Signed-off-by: Swarvanu Sengupta <[email protected]>
  • Loading branch information
s8sg committed Aug 17, 2018
1 parent 4aceea0 commit e9cda20
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,27 @@ cat data | faas-cli invoke --async -f test-chain.yml test-chain
Function submitted asynchronously.
```

## Request Tracking
## Request Tracking by ID
Request can be tracked from the log by `RequestId`. For each new Request a unique `RequestId` is generated.
```bash
2018/08/13 07:51:59 [request `bdojh7oi7u6bl8te4r0g`] Created
2018/08/13 07:52:03 [Request `bdojh7oi7u6bl8te4r0g`] Received
```

## Request Tracing by Open-Tracing
Request tracing can be enabled by providing by specifying
```yaml
enable_tracing: true
trace_server: "jaegertracing:5775"
```
Below is an example of tracing for an async request with 3 phases
![alt multi phase](https://github.com/s8sg/faaschain/blob/tracing/doc/tracing.png)
> *Due to some unresolved issue we can't extend the req span over multiple phases
> we use the waterfall model as an workaround
> For more details visit : https://github.com/opentracing/specification/issues/81
## TODO:
- [ ] Export support for Debug
> Request Execution Status.
Expand Down
Binary file added doc/tracing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 10 additions & 9 deletions template/faaschain/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,16 @@ func startPhaseSpan(phase int, reqId string) {
}

phasename := fmt.Sprintf("%d", phase)
// TODO: Now its always true
if reqSpan == nil {
phaseSpan = opentracing.GlobalTracer().StartSpan(
phasename, ext.RPCServerOption(reqSpanCtx))
phaseSpan.SetTag("async", 1)
} else {
phaseSpan = opentracing.GlobalTracer().StartSpan(
phasename, opentracing.ChildOf(reqSpan.Context()))
}
phaseSpan = opentracing.GlobalTracer().StartSpan(
phasename, ext.RPCServerOption(reqSpanCtx))
phaseSpan.SetTag("async", 1)
/*
if reqSpan == nil {
} else {
phaseSpan = opentracing.GlobalTracer().StartSpan(
phasename, opentracing.ChildOf(reqSpan.Context()))
}*/
phaseSpan.SetTag("request", reqId)
phaseSpan.SetTag("phase", phase)
phaseSpans[phase] = phaseSpan
Expand Down

0 comments on commit e9cda20

Please sign in to comment.