Skip to content
This repository has been archived by the owner on Jun 14, 2023. It is now read-only.

Commit

Permalink
Add missing documentation (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
arugal authored Jun 17, 2020
1 parent e61c0b1 commit 140002c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,13 @@ will inject the context generated by its parent.

```go
//Create a new context
entrySpan, entryCtx, err := h.tracer.CreateEntrySpan(context.Background(), ...)
entrySpan, entryCtx, err := tracer.CreateEntrySpan(context.Background(), ...)

// Some operation
...

// Link two spans by injecting entrySpan context into exitSpan
exitSpan, err := t.tracer.CreateExitSpan(entryCtx, ...)

exitSpan, err := tracer.CreateExitSpan(entryCtx, ...)
```

### Crossing process
Expand All @@ -102,19 +101,18 @@ upstream service.

```go
//Extract context from HTTP request header `sw8`
span, ctx, err := h.tracer.CreateEntrySpan(r.Context(), "/api/login", func() (string, error) {
span, ctx, err := tracer.CreateEntrySpan(r.Context(), "/api/login", func() (string, error) {
return r.Header.Get("sw8"), nil
})

// Some operation
...

// Inject context into HTTP request header `sw8`
span, err := t.tracer.CreateExitSpan(req.Context(), "/service/validate", "tomcat-service:8080", func(header string) error {
span, err := tracer.CreateExitSpan(req.Context(), "/service/validate", "tomcat-service:8080", func(header string) error {
req.Header.Set(propagation.Header, header)
return nil
})

```

## Tag
Expand Down
1 change: 1 addition & 0 deletions docs/GRPC-Reporter-Option.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
| ---------- | --- |
| `reporter.WithLogger` | setup logger for gRPC reporter |
| `reporter.WithCheckInterval` | setup service and endpoint registry check interval |
| `reporter.WithMaxSendQueueSize` | setup send span queue buffer length |
| `reporter.WithInstanceProps` | setup service instance properties eg: org=SkyAPM |
| `reporter.WithTransportCredentials` | setup transport layer security |
| `reporter.WithAuthentication` | used Authentication for gRPC |

0 comments on commit 140002c

Please sign in to comment.