Add external tag to opentrace events#2451
Merged
iilyak merged 1 commit intoapache:prototype/fdb-layerfrom Jan 21, 2020
Merged
Conversation
This PR adds an ability to selectively enable opentracing for HTTP requests
with X-B3-... headers. This is helpful in following cases:
- tracing all requests with X-B3-... headers
`all = (#{external := E}) when E == true -> true`
- tracing all requests to specific database with X-B3-... headers
```
all = (#{external := E, 'db.name' := Db})
when E == true andalso Db == <<"foo">> -> true
```
- tracing requests to specific endpoint with X-B3-... headers
```
db.design.view.read = (#{external := E, 'design.id' := Name})
when E == true andalso Name == <<"bar">> -> true
```
I want to remind that we support following X-B3-... headers:
- X-B3-TraceId
- X-B3-SpanId
- X-B3-ParentSpanId
- B3 which is in the following format
<TraceId>-<SpanId>-<1 | 0>-<ParentSpanId>
nickva
approved these changes
Jan 21, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Overview
This PR adds an ability to selectively enable opentracing for HTTP requests
with X-B3-... headers. This is helpful in following cases:
all = (#{external := E}) when E == true -> trueI want to remind that we support following X-B3-... headers:
X-B3-TraceIdX-B3-SpanIdX-B3-ParentSpanIdB3which is in the following format<TraceId>-<SpanId>-<1 | 0>-<ParentSpanId>Testing recommendations
docker run -d -p 6831:6831/udp -p 16686:16686 jaegertracing/all-in-one:1.14dev/run --admin=adm:passcurl -X PUT -u adm:pass http://127.0.0.1:15984/testcurl -X GET -u adm:pass http://127.0.0.1:15984/test -H 'X-B3-TraceId: 12345678901234567890123453782027'curl -X GET -u adm:pass http://127.0.0.1:15984/test#9As an alternative to Step 4, you can run the
jaeger-all-in-onebinary without arguments in a separate shell. The Jaeger project provides prebuilt binaries for download.Related Issues or Pull Requests
Checklist
rel/overlay/etc/default.ini