-
Notifications
You must be signed in to change notification settings - Fork 62
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
[Core] [Logging] | Integration logs not being ingested #1120
[Core] [Logging] | Integration logs not being ingested #1120
Conversation
…xception on exit. 3.Sirealize exception.
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.
Great to have you contributing to ocean 🌊 and diving straight to a painful bug 🤩
Left a few comments, also make sure you update the version in the pyproject.toml as well :)
async def ingest_integration_logs(self, logs: list[dict[str, Any]]) -> None: | ||
logger.debug("Ingesting logs") | ||
sirealized_logs=self.sirealize_logs(logs) |
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.
sirealized_logs=self.sirealize_logs(logs) | |
serialized_logs=self.serialize_logs(logs) |
@@ -99,15 +100,24 @@ async def patch_integration( | |||
handle_status_code(response) | |||
return response.json()["integration"] | |||
|
|||
def sirealize_logs(self,logs: list[dict[str, Any]]): |
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 seems like a pretty isolated method, lets add a test for it
port_ocean/log/handlers.py
Outdated
clear_thread_pool() | ||
thread=threading.Thread(target=_wrap_event_loop, args=(self.ocean, logs)) | ||
thread.start() | ||
self._thread_pool.append(thread) |
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.
are we supporting multiple threads flushing logs concurrently?
lets test long running, scheduled resync to verify we didn't break anything.
# Description What - bump fastapi version to 0.115.3 to upgrade starlette Why - https://github.com/port-labs/ocean/security/dependabot/433 How - bump fastapi version ## Type of change Please leave one option from the following and delete the rest: - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] 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) - [X] 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 - [x] Integration able to create all default resources from scratch - [x] Resync finishes successfully - [x] Resync able to create entities - [x] Resync able to update entities - [x] Resync able to detect and delete entities - [x] Scheduled resync able to abort existing resync and start a new one - [x] Tested with at least 2 integrations from scratch - [x] Tested with Kafka and Polling event listeners - [x] 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. --------- Co-authored-by: Shalev Avhar <[email protected]> Co-authored-by: Tom Tankilevitch <[email protected]>
This PR was automatically created by a GitHub Action. ## What does this PR do? Apply Ocean version 0.12.8 to all integrations ## How should this be manually tested? ./scripts/bump-all.sh ^0.12.8 --------- Co-authored-by: GitHub Action <[email protected]> Co-authored-by: Shalev Avhar <[email protected]>
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.
Be sure to rebase to fix your conflict
The commit messages themselves are a bit long, put the main change list you added there to the commit body
Besides that 3 small NITs
Approving in the meanwhile to save you a hop, be sure to validate the testing Q @Tankilevitch asked
|
||
|
||
def assert_extra(extra: dict): | ||
assert "exc_info" in extra |
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.
assert "exc_info" in extra | |
exc_info = extra.get("exc_info", None) | |
assert type(exec_info) is str | |
return exec_info |
return exc_info | ||
|
||
|
||
def log_record(cb: Callable[[None], None]) -> "loguru.Record": |
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.
Why a string based type?
integrations/gitlab/CHANGELOG.md
Outdated
|
||
- Await logger writing exception on exit (Integration logs not being ingested) | ||
- Await logger thread on exit (Integration logs not being ingested) | ||
- Sirealize exception (Integration logs not being ingested) |
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.
git grep -i sirealize
…xception on exit. 3.Sirealize exception.
1.Extend method "_serialize_record" to stringify exceptions in "exc_info". 2.Await logger on thread exit. 3.Await logger writing exception on exit.
1.Extend method "_serialize_record" to stringify exceptions in "exc_info". 2.Await logger on thread exit. 3.Await logger writing exception on exit.
1.Extend method "_serialize_record" to stringify exceptions in "exc_info". 2.Await logger on thread exit. 3.Await logger writing exception on exit.
Description
What:
Why:
How:
'wait_for_lingering_threads' is invoked via the 'SignalHandler' upon exit.
Type of change
Please leave one option from the following and delete the rest:
All tests should be run against the port production environment(using a testing org).
Core testing checklist
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.