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

Feat/groundwork for zipkin #3842

Closed
wants to merge 3 commits into from

Conversation

Projects
None yet
4 participants
@kikito
Copy link
Member

commented Oct 10, 2018

This PR adds a couple features to the PDK:

  • kong.request.get_start_time(), which wraps ngx.req.start_time()
  • kong.request.get_raw_path_and_query()

It also fix a (possible?) problem when ngx.request_uri is nil.

It is needed for the zipkin update: Kong/kong-plugin-zipkin#24

@kikito kikito changed the base branch from master to next Oct 10, 2018

@kikito kikito force-pushed the feat/pdk-extensions-for-zipkin branch from 82666cf to f9137bc Oct 10, 2018

@kikito kikito changed the title Feat/pdk extensions for zipkin Feat/groundwork for zipkin Oct 16, 2018

@kikito kikito force-pushed the feat/pdk-extensions-for-zipkin branch from ebbc696 to 4830d28 Oct 16, 2018

Show resolved Hide resolved kong/runloop/handler.lua Outdated

@kikito kikito force-pushed the feat/pdk-extensions-for-zipkin branch from 359f24b to 2241fbd Oct 16, 2018

-- -- Given a request to https://example.com:1234/v1/movies?movie=foo
--
-- kong.request.get_path_and_querystring() -- "/v1/movies?movie=foo"
function _REQUEST.get_path_and_querystring()

This comment has been minimized.

Copy link
@bungle

bungle Oct 16, 2018

Member

I left comment about the name here:
#3859 (review)

@bungle
Copy link
Member

left a comment

deleted

@kikito kikito force-pushed the feat/pdk-extensions-for-zipkin branch from 2241fbd to 9f2a159 Oct 17, 2018

@bungle

This comment has been minimized.

Copy link
Member

commented Oct 17, 2018

I am not sure if ngx.var.request_uri can ever be nil, at least with http module. How could it be?

@bungle
Copy link
Member

left a comment

deleted

@kikito kikito force-pushed the feat/pdk-extensions-for-zipkin branch from 9f2a159 to 5aa253b Oct 17, 2018

@bungle

bungle approved these changes Oct 17, 2018

Copy link
Member

left a comment

LGTM

kikito added some commits Oct 10, 2018

feat(pdk) add kong.response.get_raw_path_and_query
When the path + querystring is needed, this prevents having to manually check wether the querystring is present and concatenating the path + "?" + the query string every time.

Needed for the zipkin plugin.
fix(pdk) ngx.request_uri can be nil
This came out while reviewing the zipkin plugin. I was not able to
reproduce the problem in our tests. It certainly does not hurt to have
the extra `or ""` anyway

@kikito kikito force-pushed the feat/pdk-extensions-for-zipkin branch from 5aa253b to 5ef4583 Oct 17, 2018

thibaultcha added a commit that referenced this pull request Oct 17, 2018

feat(pdk) implement kong.response.get_path_with_query()
When the path + querystring is needed, this prevents having to manually
check wether the querystring is present and concatenating the path + "?"
+ the query string every time.

From #3842

Signed-off-by: Thibault Charbonnier <thibaultcha@me.com>

thibaultcha added a commit that referenced this pull request Oct 17, 2018

fix(pdk) catch a case in which $request_uri is nil
This came out while reviewing the zipkin plugin. I was not able to
reproduce the problem in our tests. It certainly does not hurt to have
the extra `or ""` anyway.

From #3842

Signed-off-by: Thibault Charbonnier <thibaultcha@me.com>
@thibaultcha

This comment has been minimized.

Copy link
Member

commented Oct 17, 2018

Merged to next with adjustments; except for the timing API commit

@thibaultcha thibaultcha deleted the feat/pdk-extensions-for-zipkin branch Oct 17, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.