You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### **User description**
# Description
What -
Add log for third party response size
Why -
Know the size of data returned from third parties.
How -
Add log in retry transport
## Type of change
Please leave one option from the following and delete the rest:
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] New Integration (non-breaking change which adds a new integration)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] Non-breaking change (fix of existing functionality that will not
change current behavior)
- [ ] Documentation (added/updated documentation)
<h4> All tests should be run against the port production
environment(using a testing org). </h4>
### Core testing checklist
- [ ] Integration able to create all default resources from scratch
- [ ] Resync finishes successfully
- [ ] Resync able to create entities
- [ ] Resync able to update entities
- [ ] Resync able to detect and delete entities
- [ ] Scheduled resync able to abort existing resync and start a new one
- [ ] Tested with at least 2 integrations from scratch
- [ ] Tested with Kafka and Polling event listeners
- [ ] Tested deletion of entities that don't pass the selector
### Integration testing checklist
- [ ] Integration able to create all default resources from scratch
- [ ] Resync able to create entities
- [ ] Resync able to update entities
- [ ] Resync able to detect and delete entities
- [ ] Resync finishes successfully
- [ ] If new resource kind is added or updated in the integration, add
example raw data, mapping and expected result to the `examples` folder
in the integration directory.
- [ ] If resource kind is updated, run the integration with the example
data and check if the expected result is achieved
- [ ] If new resource kind is added or updated, validate that
live-events for that resource are working as expected
- [ ] Docs PR link [here](#)
### Preflight checklist
- [ ] Handled rate limiting
- [ ] Handled pagination
- [ ] Implemented the code in async
- [ ] Support Multi account
## Screenshots
Include screenshots from your environment showing how the resources of
the integration will look.
## API Documentation
Provide links to the API documentation used for this integration.
___
### **PR Type**
Enhancement
___
### **Description**
- Add response size logging for third-party API calls
- Exclude Port's own API from size logging
- Support both sync and async HTTP transports
- Handle content-length headers and actual content reading
___
### **Changes diagram**
```mermaid
flowchart LR
A["HTTP Request"] --> B["Retry Transport"]
B --> C["Execute Request"]
C --> D["Get Response"]
D --> E["Log Response Size"]
E --> F["Return Response"]
G["Content-Length Header"] --> E
H["Actual Content Size"] --> E
```
___
### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>retry.py</strong><dd><code>Add third-party response
size logging functionality</code>
</dd></summary>
<hr>
port_ocean/helpers/retry.py
<li>Add response size logging methods for sync and async operations<br>
<li> Filter out Port's own API calls from logging<br> <li> Handle
content-length headers and fallback to actual content reading<br> <li>
Integrate logging calls into existing request handling flow
</details>
</td>
<td><a
href="https://github.com/port-labs/ocean/pull/1902/files#diff-a02bcfe3ab769cf2d3d6ef3f313947e35886fbe56e5c55f7a9799043014aff1a">+68/-1</a>
</td>
</tr>
</table></td></tr><tr><td><strong>Documentation</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>CHANGELOG.md</strong><dd><code>Update changelog with
response size logging</code>
</dd></summary>
<hr>
CHANGELOG.md
<li>Add changelog entry for version 0.25.3<br> <li> Document new
response body size logging feature
</details>
</td>
<td><a
href="https://github.com/port-labs/ocean/pull/1902/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed">+6/-0</a>
</td>
</tr>
</table></td></tr><tr><td><strong>Configuration
changes</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>pyproject.toml</strong><dd><code>Version bump to
0.25.4</code>
</dd></summary>
<hr>
pyproject.toml
- Bump version from 0.25.3 to 0.25.4
</details>
</td>
<td><a
href="https://github.com/port-labs/ocean/pull/1902/files#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711">+1/-1</a>
</td>
</tr>
</table></td></tr></tr></tbody></table>
___
> <details> <summary> Need help?</summary><li>Type <code>/help how to
...</code> in the comments thread for any questions about Qodo Merge
usage.</li><li>Check out the <a
href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
for more information.</li></details>
---------
Co-authored-by: Ivan Kalinovski <ivankalinovski@ivan.k-laptop>
0 commit comments