-
Notifications
You must be signed in to change notification settings - Fork 25
Add a document describing Redis storage keys #424
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
Conversation
5dbbbce to
c19aead
Compare
c19aead to
35c145f
Compare
jlledom
left a comment
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.
Thanks for doing this!! 🙏🙏
|
Wow, this is amazing work! I would just suggest to mention that the two kinds of data are stored in separate Redis databases. Also would be nice to mention somewhere that the statistical data is generated based on API calls from apicast as well I think we had something on porta side that was sending stats about providers accessing porta. |
Thank you! ❤️
That's not actually true. All of this data is stored in the same DB. I kind of mentioned that this document is talking about "storage", which is one DB. The other DB is called "queues", and it is managed by resque. I don't think we have anything "custom" there, but I'll double-check.
Well, actually, backend doesn't really care where the requests come from, the stats data are generated when usage is reported through I can add a note in the doc to clarify that. |
| | `application/service_id:SERVICE_ID/id:APP_ID/plan_name` | SERVICE_ID, APP_ID | string | `application/service_id:2/id:593a8c1a/plan_name` | `"Test plan"` | Getting the plan name of the application by its app ID and service ID | | ||
| | `application/service_id:SERVICE_ID/id:APP_ID/state` | SERVICE_ID, APP_ID | string | `application/service_id:2/id:593a8c1a/state` | `"active"`, or `"pending"`, or `"suspended"` | Getting the state of the application by its app ID and service ID | | ||
| | `application/service_id:SERVICE_ID/id:APP_ID/keys` | SERVICE_ID, APP_ID | set | `application/service_id:2/id:593a8c1a/keys` | `1) "91efe8a356c83e94b40e54cce211a1a4"` | List of application keys associated to the application (for App Id / App Key mode) | | ||
| | `application/service_id:SERVICE_ID/id:APP_ID/redirect_url` | SERVICE_ID, APP_ID | string | `application/service_id:2/id:593a8c1a/redirect_url` | `"https://example.com/redirect"` | Redirect URL of the aplication (for application of services with OAuth/OpenID Connect auth mode) | |
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 just added this line in the 2nd commit, the diff doesn't show it clearly because of reordering and fixing the columns widths.
|
@akostadinov hopefully I addressed your comments here: 57c5819 |
akostadinov
left a comment
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.
Extraordinary useful, thank you!
Just one suggestion if it makes sense to you.
| ### Stats | ||
|
|
||
| Stats keys hold the counters for application usage, reported through the Service Management API, specifically, `/transactions/authrep.xml`, `transactions/oauth_authrep.xml`, and `/transactions.xml` endpoints. For example, sending `usage[hits]=1` in authrep calls or `transactions[0][usage][hits]=1` in transaction calls will increase the counter for the metric "hits" by `1`. | ||
|
|
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.
| This API is usually used by the respective provider API gateway (e.g. APIcast) to indicate buyer's usage of their APIs, as well by system/porta to indicate providers accessing system's API. | |
Hope this makes sense. Feel free to ignore or revert if it is not good.
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 expanded the explanation and pushed it in 0322a74
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 also saw some issues with reporting Analytics API and opened a Jira: https://issues.redhat.com/browse/THREESCALE-11812
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.
Wow, good catch!
Adding a document that describes the keys stored in Backend Redis (storage, not queues, because the latter is managed by resque).