Conversation
| @@ -1 +1 @@ | |||
| export const VERSION = '3.0.1'; | |||
| export const VERSION = '3.0.2'; | |||
There was a problem hiding this comment.
please revert this, version change can be raised separately once all cahnges are merged, and we do npm version patch to do it not this way
| .join('&'); | ||
|
|
||
| return queryParams ? `?${queryParams}` : ''; | ||
| const search = new URLSearchParams(); |
There was a problem hiding this comment.
Yes, the query params aren't being encoded with the existing implementation and all the analytics APIs are failing due to invalid query params parsing. I've taken the python SDK implementation as reference and implemented it here as well.
There was a problem hiding this comment.
do not change the implementation here, please update the new api endpoint methods to pass the query params in the same way as existing invocations
There was a problem hiding this comment.
The previous toQueryParams isn't encoding timestamps correctly. We need to send time_of_generation_min or time_of_generation_max for almost all of the analytics APIs as query params. For example, 2026-04-05T15:13:57+05:30 won't be serialized and the + part will be sent as it is and is interpreted as a space, which fails with the following error:
URL: https://api.portkeydev.com/v1/analytics/summary/cache?time_of_generation_min=2026-04-05T15:13:57+05:30&time_of_generation_max=2026-04-07T18:56:59+05:30 {
"success": false,
"data": {
"message": "Validation failed: undefined: Invalid value, undefined: Invalid value",
"errorCode": "AB01",
"request_id": "f52f7c4c-67fd-4f44-bb0e-dac4902489ed",
"error_details": [
{
"value": "2026-04-05T15:13:57 05:30",
"msg": "Invalid value",
"param": "time_of_generation_min",
"location": "query"
},
{
"value": "2026-04-07T18:56:59 05:30",
"msg": "Invalid value",
"param": "time_of_generation_max",
"location": "query"
}
]
}
}
Title
Add analytics and MCP APIs
Related Issues
Related to ENG-1185