2019-10-31 09:27:28 +08:00
|
|
|
#
|
|
|
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
# contributor license agreements. See the NOTICE file distributed with
|
|
|
|
# this work for additional information regarding copyright ownership.
|
|
|
|
# The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
# (the "License"); you may not use this file except in compliance with
|
|
|
|
# the License. You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
#
|
2019-09-10 09:42:55 +08:00
|
|
|
use t::APISIX 'no_plan';
|
2019-07-26 17:16:31 +08:00
|
|
|
|
|
|
|
repeat_each(2);
|
|
|
|
no_long_string();
|
|
|
|
no_root_location();
|
|
|
|
log_level("info");
|
|
|
|
run_tests;
|
|
|
|
|
|
|
|
__DATA__
|
|
|
|
|
|
|
|
=== TEST 1: sanity
|
|
|
|
--- config
|
|
|
|
location /t {
|
|
|
|
content_by_lua_block {
|
|
|
|
local plugin = require("apisix.plugins.zipkin")
|
|
|
|
local ok, err = plugin.check_schema({endpoint = 'http://127.0.0.1', sample_ratio = 0.001})
|
|
|
|
if not ok then
|
|
|
|
ngx.say(err)
|
|
|
|
end
|
|
|
|
|
|
|
|
ngx.say("done")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--- request
|
|
|
|
GET /t
|
|
|
|
--- response_body
|
|
|
|
done
|
|
|
|
--- no_error_log
|
|
|
|
[error]
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-20 19:14:56 +08:00
|
|
|
=== TEST 2: wrong value of ratio
|
2019-07-26 17:16:31 +08:00
|
|
|
--- config
|
|
|
|
location /t {
|
|
|
|
content_by_lua_block {
|
|
|
|
local plugin = require("apisix.plugins.zipkin")
|
|
|
|
local ok, err = plugin.check_schema({endpoint = 'http://127.0.0.1', sample_ratio = -0.1})
|
|
|
|
if not ok then
|
|
|
|
ngx.say(err)
|
|
|
|
end
|
|
|
|
|
|
|
|
ngx.say("done")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--- request
|
|
|
|
GET /t
|
|
|
|
--- response_body
|
2019-10-23 12:58:10 +08:00
|
|
|
property "sample_ratio" validation failed: expected -0.1 to be greater than 1e-05
|
2019-07-26 17:16:31 +08:00
|
|
|
done
|
|
|
|
--- no_error_log
|
|
|
|
[error]
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-20 19:14:56 +08:00
|
|
|
=== TEST 3: wrong value of ratio
|
2019-07-26 17:16:31 +08:00
|
|
|
--- config
|
|
|
|
location /t {
|
|
|
|
content_by_lua_block {
|
|
|
|
local plugin = require("apisix.plugins.zipkin")
|
|
|
|
local ok, err = plugin.check_schema({endpoint = 'http://127.0.0.1', sample_ratio = 2})
|
|
|
|
if not ok then
|
|
|
|
ngx.say(err)
|
|
|
|
end
|
|
|
|
|
|
|
|
ngx.say("done")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--- request
|
|
|
|
GET /t
|
|
|
|
--- response_body
|
2019-10-23 12:58:10 +08:00
|
|
|
property "sample_ratio" validation failed: expected 2 to be smaller than 1
|
2019-07-26 17:16:31 +08:00
|
|
|
done
|
|
|
|
--- no_error_log
|
|
|
|
[error]
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-20 19:14:56 +08:00
|
|
|
=== TEST 4: add plugin
|
2019-07-26 17:16:31 +08:00
|
|
|
--- config
|
|
|
|
location /t {
|
|
|
|
content_by_lua_block {
|
|
|
|
local t = require("lib.test_admin").test
|
|
|
|
local code, body = t('/apisix/admin/routes/1',
|
|
|
|
ngx.HTTP_PUT,
|
|
|
|
[[{
|
|
|
|
"plugins": {
|
|
|
|
"zipkin": {
|
2021-03-23 20:19:16 +08:00
|
|
|
"endpoint": "http://127.0.0.1:1980/mock_zipkin?server_addr=127.0.0.1",
|
2020-04-08 08:47:41 +08:00
|
|
|
"sample_ratio": 1,
|
|
|
|
"service_name": "APISIX"
|
2019-07-26 17:16:31 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"upstream": {
|
|
|
|
"nodes": {
|
|
|
|
"127.0.0.1:1980": 1
|
|
|
|
},
|
|
|
|
"type": "roundrobin"
|
|
|
|
},
|
|
|
|
"uri": "/opentracing"
|
|
|
|
}]],
|
|
|
|
[[{
|
|
|
|
"node": {
|
|
|
|
"value": {
|
|
|
|
"plugins": {
|
|
|
|
"zipkin": {
|
2021-03-23 20:19:16 +08:00
|
|
|
"endpoint": "http://127.0.0.1:1980/mock_zipkin?server_addr=127.0.0.1",
|
2020-04-08 08:47:41 +08:00
|
|
|
"sample_ratio": 1,
|
|
|
|
"service_name":"APISIX"
|
2019-07-26 17:16:31 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"upstream": {
|
|
|
|
"nodes": {
|
|
|
|
"127.0.0.1:1980": 1
|
|
|
|
},
|
|
|
|
"type": "roundrobin"
|
|
|
|
},
|
|
|
|
"uri": "/opentracing"
|
|
|
|
},
|
|
|
|
"key": "/apisix/routes/1"
|
|
|
|
},
|
|
|
|
"action": "set"
|
|
|
|
}]]
|
|
|
|
)
|
|
|
|
|
|
|
|
if code >= 300 then
|
|
|
|
ngx.status = code
|
|
|
|
end
|
|
|
|
ngx.say(body)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--- request
|
|
|
|
GET /t
|
|
|
|
--- response_body
|
|
|
|
passed
|
|
|
|
--- no_error_log
|
|
|
|
[error]
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-20 19:14:56 +08:00
|
|
|
=== TEST 5: tiger zipkin
|
2019-07-26 17:16:31 +08:00
|
|
|
--- request
|
|
|
|
GET /opentracing
|
2021-03-23 20:19:16 +08:00
|
|
|
--- no_error_log
|
2020-11-19 11:31:07 +08:00
|
|
|
[error]
|
|
|
|
--- wait: 10
|
2019-07-26 17:16:31 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-20 19:14:56 +08:00
|
|
|
=== TEST 6: change sample ratio
|
2019-07-26 17:16:31 +08:00
|
|
|
--- config
|
|
|
|
location /t {
|
|
|
|
content_by_lua_block {
|
|
|
|
local t = require("lib.test_admin").test
|
|
|
|
local code, body = t('/apisix/admin/routes/1',
|
|
|
|
ngx.HTTP_PUT,
|
|
|
|
[[{
|
|
|
|
"plugins": {
|
|
|
|
"zipkin": {
|
2020-11-19 11:31:07 +08:00
|
|
|
"endpoint": "http://127.0.0.1:9999/mock_zipkin",
|
2019-07-26 17:16:31 +08:00
|
|
|
"sample_ratio": 0.00001
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"upstream": {
|
|
|
|
"nodes": {
|
|
|
|
"127.0.0.1:1980": 1
|
|
|
|
},
|
|
|
|
"type": "roundrobin"
|
|
|
|
},
|
|
|
|
"uri": "/opentracing"
|
|
|
|
}]],
|
|
|
|
[[{
|
|
|
|
"node": {
|
|
|
|
"value": {
|
|
|
|
"plugins": {
|
|
|
|
"zipkin": {
|
2020-11-19 11:31:07 +08:00
|
|
|
"endpoint": "http://127.0.0.1:9999/mock_zipkin",
|
2019-07-26 17:16:31 +08:00
|
|
|
"sample_ratio": 0.00001
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"upstream": {
|
|
|
|
"nodes": {
|
|
|
|
"127.0.0.1:1980": 1
|
|
|
|
},
|
|
|
|
"type": "roundrobin"
|
|
|
|
},
|
|
|
|
"uri": "/opentracing"
|
|
|
|
},
|
|
|
|
"key": "/apisix/routes/1"
|
|
|
|
},
|
|
|
|
"action": "set"
|
|
|
|
}]]
|
|
|
|
)
|
|
|
|
|
|
|
|
if code >= 300 then
|
|
|
|
ngx.status = code
|
|
|
|
end
|
|
|
|
ngx.say(body)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--- request
|
|
|
|
GET /t
|
|
|
|
--- response_body
|
|
|
|
passed
|
|
|
|
--- no_error_log
|
|
|
|
[error]
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-20 19:14:56 +08:00
|
|
|
=== TEST 7: not tiger zipkin
|
2019-07-26 17:16:31 +08:00
|
|
|
--- request
|
|
|
|
GET /opentracing
|
|
|
|
--- response_body
|
|
|
|
opentracing
|
|
|
|
--- no_error_log
|
2020-11-19 11:31:07 +08:00
|
|
|
[error]
|
2019-07-26 17:16:31 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-20 19:14:56 +08:00
|
|
|
=== TEST 8: disabled
|
2019-07-26 17:16:31 +08:00
|
|
|
--- config
|
|
|
|
location /t {
|
|
|
|
content_by_lua_block {
|
|
|
|
local t = require("lib.test_admin").test
|
|
|
|
local code, body = t('/apisix/admin/routes/1',
|
|
|
|
ngx.HTTP_PUT,
|
|
|
|
[[{
|
|
|
|
"plugins": {
|
|
|
|
},
|
|
|
|
"upstream": {
|
|
|
|
"nodes": {
|
|
|
|
"127.0.0.1:1980": 1
|
|
|
|
},
|
|
|
|
"type": "roundrobin"
|
|
|
|
},
|
|
|
|
"uri": "/opentracing"
|
|
|
|
}]],
|
|
|
|
[[{
|
|
|
|
"node": {
|
|
|
|
"value": {
|
|
|
|
"plugins": {
|
|
|
|
},
|
|
|
|
"upstream": {
|
|
|
|
"nodes": {
|
|
|
|
"127.0.0.1:1980": 1
|
|
|
|
},
|
|
|
|
"type": "roundrobin"
|
|
|
|
},
|
|
|
|
"uri": "/opentracing"
|
|
|
|
},
|
|
|
|
"key": "/apisix/routes/1"
|
|
|
|
},
|
|
|
|
"action": "set"
|
|
|
|
}]]
|
|
|
|
)
|
|
|
|
|
|
|
|
if code >= 300 then
|
|
|
|
ngx.status = code
|
|
|
|
end
|
|
|
|
ngx.say(body)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--- request
|
|
|
|
GET /t
|
|
|
|
--- response_body
|
|
|
|
passed
|
|
|
|
--- no_error_log
|
|
|
|
[error]
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-20 19:14:56 +08:00
|
|
|
=== TEST 9: not tiger zipkin
|
2019-07-26 17:16:31 +08:00
|
|
|
--- request
|
|
|
|
GET /opentracing
|
|
|
|
--- response_body
|
|
|
|
opentracing
|
|
|
|
--- no_error_log
|
2020-11-19 11:31:07 +08:00
|
|
|
[error]
|
2020-04-08 08:47:41 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-20 19:14:56 +08:00
|
|
|
=== TEST 10: set plugin with external ip address
|
2020-04-08 08:47:41 +08:00
|
|
|
--- config
|
|
|
|
location /t {
|
|
|
|
content_by_lua_block {
|
|
|
|
local t = require("lib.test_admin").test
|
|
|
|
local code, body = t('/apisix/admin/routes/1',
|
|
|
|
ngx.HTTP_PUT,
|
|
|
|
[[{
|
|
|
|
"plugins": {
|
|
|
|
"zipkin": {
|
2021-03-23 20:19:16 +08:00
|
|
|
"endpoint": "http://127.0.0.1:1980/mock_zipkin?server_addr=1.2.3.4",
|
2020-04-08 08:47:41 +08:00
|
|
|
"sample_ratio": 1,
|
|
|
|
"service_name": "apisix",
|
|
|
|
"server_addr": "1.2.3.4"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"upstream": {
|
|
|
|
"nodes": {
|
|
|
|
"127.0.0.1:1980": 1
|
|
|
|
},
|
|
|
|
"type": "roundrobin"
|
|
|
|
},
|
|
|
|
"uri": "/opentracing"
|
|
|
|
}]]
|
|
|
|
)
|
|
|
|
|
|
|
|
if code >= 300 then
|
|
|
|
ngx.status = code
|
|
|
|
end
|
|
|
|
ngx.say(body)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--- request
|
|
|
|
GET /t
|
|
|
|
--- response_body
|
|
|
|
passed
|
|
|
|
--- no_error_log
|
|
|
|
[error]
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-20 19:14:56 +08:00
|
|
|
=== TEST 11: tiger zipkin
|
2020-04-08 08:47:41 +08:00
|
|
|
--- request
|
|
|
|
GET /opentracing
|
2021-03-23 20:19:16 +08:00
|
|
|
--- no_error_log
|
2020-11-19 11:31:07 +08:00
|
|
|
[error]
|
|
|
|
--- wait: 10
|
2020-04-08 08:47:41 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-20 19:14:56 +08:00
|
|
|
=== TEST 12: sanity server_addr
|
2020-04-08 08:47:41 +08:00
|
|
|
--- config
|
|
|
|
location /t {
|
|
|
|
content_by_lua_block {
|
|
|
|
local plugin = require("apisix.plugins.zipkin")
|
|
|
|
local ok, err = plugin.check_schema({
|
|
|
|
endpoint = 'http://127.0.0.1',
|
|
|
|
sample_ratio = 0.001,
|
|
|
|
server_addr = 'badip'
|
|
|
|
})
|
|
|
|
if not ok then
|
|
|
|
ngx.say(err)
|
|
|
|
else
|
|
|
|
ngx.say("done")
|
|
|
|
end
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--- request
|
|
|
|
GET /t
|
|
|
|
--- response_body
|
|
|
|
property "server_addr" validation failed: failed to match pattern "^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$" with "badip"
|
|
|
|
--- no_error_log
|
|
|
|
[error]
|
2020-10-30 16:20:43 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-20 19:14:56 +08:00
|
|
|
=== TEST 13: check not error with limit count
|
2020-10-30 16:20:43 +08:00
|
|
|
--- config
|
|
|
|
location /t {
|
|
|
|
content_by_lua_block {
|
|
|
|
local t = require("lib.test_admin").test
|
|
|
|
local code, body = t('/apisix/admin/routes/1',
|
|
|
|
ngx.HTTP_PUT,
|
|
|
|
[[{
|
|
|
|
"plugins": {
|
|
|
|
"zipkin": {
|
2020-11-19 11:31:07 +08:00
|
|
|
"endpoint": "http://127.0.0.1:9999/mock_zipkin",
|
2020-10-30 16:20:43 +08:00
|
|
|
"sample_ratio": 1,
|
|
|
|
"service_name": "APISIX"
|
|
|
|
},
|
|
|
|
"limit-count": {
|
|
|
|
"count": 2,
|
|
|
|
"time_window": 60,
|
|
|
|
"rejected_code": 403,
|
|
|
|
"key": "remote_addr"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"upstream": {
|
|
|
|
"nodes": {
|
|
|
|
"127.0.0.1:1980": 1
|
|
|
|
},
|
|
|
|
"type": "roundrobin"
|
|
|
|
},
|
|
|
|
"uri": "/opentracing"
|
|
|
|
}]])
|
|
|
|
|
|
|
|
if code >= 300 then
|
|
|
|
ngx.status = code
|
|
|
|
end
|
|
|
|
ngx.say(body)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--- pipelined_requests eval
|
|
|
|
["GET /t", "GET /opentracing", "GET /opentracing", "GET /opentracing"]
|
|
|
|
--- error_code eval
|
|
|
|
[200, 200, 200, 403]
|
|
|
|
--- no_error_log
|
|
|
|
[error]
|
2021-02-04 23:39:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
=== TEST 14: check zipkin headers
|
|
|
|
--- config
|
|
|
|
location /t {
|
|
|
|
content_by_lua_block {
|
|
|
|
local t = require("lib.test_admin").test
|
|
|
|
local code, body = t('/apisix/admin/routes/1',
|
|
|
|
ngx.HTTP_PUT,
|
|
|
|
[[{
|
|
|
|
"plugins": {
|
|
|
|
"zipkin": {
|
|
|
|
"endpoint": "http://127.0.0.1:9999/mock_zipkin",
|
|
|
|
"sample_ratio": 1
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"upstream": {
|
|
|
|
"nodes": {
|
|
|
|
"127.0.0.1:1980": 1
|
|
|
|
},
|
|
|
|
"type": "roundrobin"
|
|
|
|
},
|
|
|
|
"uri": "/echo"
|
|
|
|
}]]
|
|
|
|
)
|
|
|
|
|
|
|
|
if code >= 300 then
|
|
|
|
ngx.status = code
|
|
|
|
end
|
|
|
|
ngx.say(body)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--- request
|
|
|
|
GET /t
|
|
|
|
--- response_body
|
|
|
|
passed
|
|
|
|
--- no_error_log
|
|
|
|
[error]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
=== TEST 15: set x-b3-sampled if sampled
|
|
|
|
--- request
|
|
|
|
GET /echo
|
|
|
|
--- response_headers
|
|
|
|
x-b3-sampled: 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
=== TEST 16: don't sample if disabled
|
|
|
|
--- request
|
|
|
|
GET /echo
|
|
|
|
--- more_headers
|
|
|
|
x-b3-sampled: 0
|
|
|
|
--- response_headers
|
|
|
|
x-b3-sampled: 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
=== TEST 17: don't sample if disabled (old way)
|
|
|
|
--- request
|
|
|
|
GET /echo
|
|
|
|
--- more_headers
|
|
|
|
x-b3-sampled: false
|
|
|
|
--- response_headers
|
|
|
|
x-b3-sampled: 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
=== TEST 18: sample according to the header
|
|
|
|
--- config
|
|
|
|
location /t {
|
|
|
|
content_by_lua_block {
|
|
|
|
local t = require("lib.test_admin").test
|
|
|
|
local code, body = t('/apisix/admin/routes/1',
|
|
|
|
ngx.HTTP_PUT,
|
|
|
|
[[{
|
|
|
|
"plugins": {
|
|
|
|
"zipkin": {
|
|
|
|
"endpoint": "http://127.0.0.1:9999/mock_zipkin",
|
|
|
|
"sample_ratio": 0.00001
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"upstream": {
|
|
|
|
"nodes": {
|
|
|
|
"127.0.0.1:1980": 1
|
|
|
|
},
|
|
|
|
"type": "roundrobin"
|
|
|
|
},
|
|
|
|
"uri": "/echo"
|
|
|
|
}]]
|
|
|
|
)
|
|
|
|
|
|
|
|
if code >= 300 then
|
|
|
|
ngx.status = code
|
|
|
|
end
|
|
|
|
ngx.say(body)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--- request
|
|
|
|
GET /t
|
|
|
|
--- response_body
|
|
|
|
passed
|
|
|
|
--- no_error_log
|
|
|
|
[error]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
=== TEST 19: don't sample by default
|
|
|
|
--- request
|
|
|
|
GET /echo
|
|
|
|
--- response_headers
|
|
|
|
x-b3-sampled: 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
=== TEST 20: sample if needed
|
|
|
|
--- request
|
|
|
|
GET /echo
|
|
|
|
--- more_headers
|
|
|
|
x-b3-sampled: 1
|
|
|
|
--- response_headers
|
|
|
|
x-b3-sampled: 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
=== TEST 21: sample if debug
|
|
|
|
--- request
|
|
|
|
GET /echo
|
|
|
|
--- more_headers
|
|
|
|
x-b3-flags: 1
|
|
|
|
--- response_headers
|
|
|
|
x-b3-sampled: 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
=== TEST 22: sample if needed (old way)
|
|
|
|
--- request
|
|
|
|
GET /echo
|
|
|
|
--- more_headers
|
|
|
|
x-b3-sampled: true
|
|
|
|
--- response_headers
|
|
|
|
x-b3-sampled: 1
|
2021-02-06 13:18:28 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
=== TEST 23: don't cache the per-req sample ratio
|
|
|
|
--- config
|
|
|
|
location /t {
|
|
|
|
content_by_lua_block {
|
|
|
|
local http = require "resty.http"
|
|
|
|
local httpc = http.new()
|
|
|
|
local uri = "http://127.0.0.1:" .. ngx.var.server_port
|
|
|
|
.. "/echo"
|
|
|
|
-- force to trace
|
|
|
|
local res, err = httpc:request_uri(uri, {
|
|
|
|
method = "GET",
|
|
|
|
headers = {
|
|
|
|
['x-b3-sampled'] = 1
|
|
|
|
}
|
|
|
|
})
|
|
|
|
if not res then
|
|
|
|
ngx.say(err)
|
|
|
|
return
|
|
|
|
end
|
|
|
|
ngx.say(res.headers['x-b3-sampled'])
|
|
|
|
|
|
|
|
-- force not to trace
|
|
|
|
local res, err = httpc:request_uri(uri, {
|
|
|
|
method = "GET",
|
|
|
|
headers = {
|
|
|
|
['x-b3-sampled'] = 0
|
|
|
|
}
|
|
|
|
})
|
|
|
|
if not res then
|
|
|
|
ngx.say(err)
|
|
|
|
return
|
|
|
|
end
|
|
|
|
ngx.say(res.headers['x-b3-sampled'])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--- request
|
|
|
|
GET /t
|
|
|
|
--- response_body
|
|
|
|
1
|
|
|
|
0
|