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

Opentracing: Added new tag #1223

Merged
merged 1 commit into from
Aug 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Support Proxy Protocol [PR #1211](https://github.com/3scale/APIcast/pull/1211) [THREESCALE-5366](https://issues.redhat.com/browse/THREESCALE-5366)
- Enable support to log credentials on logging policy [PR #1217](https://github.com/3scale/APIcast/pull/1217) [THREESCALE-5273](https://issues.redhat.com/browse/THREESCALE-5273)
- Add a way to support more than 1000 services in a single instance [PR #1222](https://github.com/3scale/APIcast/pull/1222) [THREESCALE-5308](https://issues.redhat.com/browse/THREESCALE-5308)
- Added new original_request_uri tag on Opentracing [PR #1223](https://github.com/3scale/APIcast/pull/1223) [THREESCALE-5669](https://issues.redhat.com/browse/THREESCALE-5669)


### Fixed
Expand Down
1 change: 1 addition & 0 deletions gateway/conf.d/apicast.conf
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ location / {

set $post_action_impact '';
set $original_request_id '';
set $original_request_uri '$scheme://$host$request_uri';

# Variables needed by Websocket policy
set $upstream_connection_header '';
Expand Down
1 change: 1 addition & 0 deletions gateway/http.d/apicast.conf.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ server {
{% if opentracing_tracer != empty %}
opentracing_operation_name "apicast";
opentracing_trace_locations on;
opentracing_tag original_request_uri $original_request_uri;
{% endif %}

{% include "http.d/ssl.conf" %}
Expand Down
50 changes: 50 additions & 0 deletions t/opentracing.t
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,53 @@ GET /a_path?
--- udp_query eval
qr/jaeger.version/
--- wait: 10

=== TEST 3: original_request_uri tag
Opentracing custom tag fix for THREESCALE-5669
-- env eval
(
'OPENTRACING_FORWARD_HEADER' => "foobar"
)
--- configuration
{
"services": [
{
"id": 42,
"system_name": "foo",
"proxy": {
"policy_chain": [
{
"name": "apicast.policy.upstream",
"configuration": {
"rules": [
{
"regex": "/",
"url": "http://test:$TEST_NGINX_SERVER_PORT"
}
]
}
}
]
}
}
]
}
--- upstream
location / {
content_by_lua_block {
local headers = ngx.req.get_headers()
assert(headers["foobar"] == "value")
}
}
--- request
GET /a_path?
--- more_headers eval
"foobar: value"
--- error_code: 200
--- no_error_log
[error]
--- udp_listen: 6831
--- udp_reply
--- udp_query eval
qr/original_request_uri/
--- wait: 10