-
Notifications
You must be signed in to change notification settings - Fork 182
send application event analytics beacon for custom reports #13723
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
base: Venus-22.10.0
Are you sure you want to change the base?
Conversation
|
@github-copilot suggest |
use requestUtils::sendAnalyticsBeacon
|
@github-copilot suggest |
| } | ||
|
|
||
| protected static function getCustomReportAnalyticsEventContent($id, $params, $partner_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.
Consider adding sanitization and size limits to $params
| { | ||
| $stats_host = explode(':', kConf::get(self::INTERNAL_ANALYTICS_HOST)); | ||
| $customReportEventContent = self::getCustomReportAnalyticsEventContent($id, $params, $partner_id); | ||
| requestUtils::sendAnalyticsBeacon( |
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.
Can sendAnalyticsBeacon throw exception? if so please wrap it with try/catch and proper handler
| $api_info = ''; | ||
| foreach ($params as $key => $value) | ||
| { | ||
| if ($key != 'partner_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.
use const for partner_id
|
|
||
| if (kConf::hasParam(self::INTERNAL_ANALYTICS_HOST)) | ||
| { | ||
| $stats_host = explode(':', kConf::get(self::INTERNAL_ANALYTICS_HOST)); |
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.
lets validate that $stats_host array length is 2 to avoid exception
| requestUtils::sendAnalyticsBeacon( | ||
| $customReportEventContent, | ||
| $stats_host[0], | ||
| isset($stats_host[1]) ? $stats_host[1] : 80 |
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.
use const for default http port 80
|
@github-copilot suggest |
Pull Request Checklist
Please complete the following before submitting:
General notes -
New Kaltura Types
New Kaltura Services / Actions
Questions
What is the purpose of this PR?
Does this change affect production code or infrastructure?
If yes, what is the rollback plan?