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

feature: supported zipkin plugin. #304

Merged
merged 9 commits into from Jul 26, 2019
Merged

feature: supported zipkin plugin. #304

merged 9 commits into from Jul 26, 2019

Conversation

moonming
Copy link
Member

@moonming moonming commented Jul 24, 2019

todo:

  • copyright

  • doc

@@ -7,7 +7,8 @@ local get_headers = ngx.req.get_headers
local _M = {version = 0.1}


local function _headers(ctx)
local function _headers()
local ctx = ngx.ctx.api_ctx
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bad change, we should keep the advantages of the old code.

local plugin_name = "zipkin"


-- You can follow this document to write schema:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about we remove this comment?



local function create_tracer(conf)
local tracer = new_tracer(new_reporter(conf), new_random_sampler(conf))
Copy link
Member

@membphis membphis Jul 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bad indentation, and pls fix other points like this.

function _M.log(conf, ctx)
local tracer = ctx.opentracing.tracer
local reporter = tracer.reporter
local ok, err = ngx.timer.at(0, report2endpoint, reporter)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that a bad way to create a timer for each request.
we can add a todo comment first, will fix it later.

@membphis
Copy link
Member

You still need some time to complete this PR @moonming

@moonming
Copy link
Member Author

it is a Draft now.

properties = {
endpoint = {type = "string"},
sample_ratio = {type = "number",
default = 0.001, minimum = 0.00001, maximum = 1}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value here may be invalid, it is best to add a use case to cover this case.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

json schema in rapidjson not support default value :(

lua/apisix/plugins/zipkin.lua Outdated Show resolved Hide resolved
lua/apisix/plugins/zipkin.lua Outdated Show resolved Hide resolved
--- config
location /t {
content_by_lua_block {
local t = require("lib.test_admin").test
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the size of code block is more than 1k, it may failed. we need to make it smaller.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to fix other similar issues.

t/plugin/zipkin.t Show resolved Hide resolved
doc/plugins/zipkin.md Outdated Show resolved Hide resolved
doc/plugins/zipkin.md Outdated Show resolved Hide resolved
doc/plugins/zipkin.md Show resolved Hide resolved
@moonming moonming merged commit 148bc40 into apache:master Jul 26, 2019
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.

None yet

2 participants