-
Notifications
You must be signed in to change notification settings - Fork 170
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
Routing: Fix issues with invalid metric update on routing policy. #1125
Conversation
460e931
to
a63400f
Compare
gateway/src/apicast/mapping_rule.lua
Outdated
@@ -123,7 +124,8 @@ function _M.from_proxy_rule(proxy_rule) | |||
proxy_rule.querystring_parameters, | |||
proxy_rule.metric_system_name, | |||
proxy_rule.delta, | |||
proxy_rule.last | |||
proxy_rule.last, | |||
tonumber(proxy_rule.owner_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you really want to use owner_id
here instead of the proposed backend_id
, then you will also need owner_type
. That's because the proxy rule can belong to a product (owner_type == "Proxy"
) or to a backend (owner_type == "BackendApi"
). In the first case, it should be considered for the match despite owner_id
, while in the latter case, only if owner_id
matches the one of the routing.
b736a59
to
3085a49
Compare
2b34620
to
e91ee50
Compare
I've reviewed the latest changes. I think the PR looks good except for this #1125 (comment) I think it's still an issue. |
e91ee50
to
9107aa5
Compare
Due to the changes in APIAP in 3Scale, a service can have multiple backends(using routing policy) and multiple mapping rules can be hit and it creates a bad behaviour around metrics reported to Apisonator. This commit adds a ownership field on routing and mapping rules, where a ownership can be used to filter the mapping rules that you want to report. Here an example: Routing policy: ``` path backend owner ---------------------------------- /foo/bar http://1.1.1.1/ t1 /foo http://2.2.2.2/ t2 ``` Mapping rules: ``` path metric owner ----------------------------------- /foo hits t2 /foo/bar barMetric t1 ``` In this case, due to the request is going to /foo/bar the metric that will be updated will be `barMetric` and it'll use `2.2.2.2` backend, the mapping rules to match will filter by the owner, in this case, t2. Signed-off-by: Eloy Coto <[email protected]>
9107aa5
to
34ac177
Compare
Due to the changes in APIAP in 3Scale, a service can have multiple
backends(using routing policy) and multiple mapping rules can be hit and
it creates a bad behaviour around metrics reported to Apisonator.
This commit adds ownership on routing and mapping rules, where a
ownership can be used to filter the mapping rules that you want to
report. Here an example:
Routing policy:
Mapping rules:
In this case, due to the request is going to /foo/bar the metric that
will be updated will be
barMetric
and it'll use2.2.2.2
backend, themapping rules to match will filter by the owner, in this case, t2.