-
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
Policy: Add custom metrics #1188
Conversation
4dc5c28
to
476c2ee
Compare
|
||
## Caveats: | ||
|
||
Due to this needs some information from the upstream API, if the authrep with |
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.
I think it would be better to use the authorize and report endpoints instead of authrep.
That way we could authorize => call upstream => report. The problem with the current approach is that it can lose many reports.
@@ -0,0 +1,73 @@ | |||
# Custom metrics policies | |||
|
|||
This policy adds the availability to add metrics after the Upstream API |
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.
I'd add somewhere that every metric used in this policy needs to be created manually in the admin portal.
Some users might expect APIcast to automatically create them when needed.
c43f788
to
a768bfa
Compare
- This policy does not work with batching policy. | ||
- Metrics need to be created in the admin portal before submit it. | ||
|
||
## Request flow |
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.
Nice diagram! 👌
I was thinking that maybe we should clarify what's reported on each call to apisonator. For example, in the first request, the first call to authrep reports the "normal" metrics and the call to transactions.xml reports only the custom metrics. What do you think?
t/apicast-policy-custom-metrics.t
Outdated
--- no_error_log | ||
[error] | ||
|
||
=== TEST 4: Rule does not left, metric is not added |
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.
I'm not sure what you mean
This policy adds the avalability to add a new metric on the post_action, so user can report back things like metric upstream headers, status code or any other information. FIX THREESCALE-5098 Signed-off-by: Eloy Coto <[email protected]>
If not the post action will not run correctly Signed-off-by: Eloy Coto <[email protected]>
When the first call happens the authrep happened before upstream API, this fix will report the new usage out-of-band. Signed-off-by: Eloy Coto <[email protected]>
This policy adds the avalability to add a new metric on the post_action,
so user can report back things like metric upstream headers, status code
or any other information.
FIX THREESCALE-5098
Signed-off-by: Eloy Coto [email protected]