feat: add HTTP transport layer with logging and OpenTelemetry support#16
Merged
Conversation
- Added logging functions for HTTP requests and responses, ensuring sensitive information is masked. - Implemented OpenTelemetry spans for request and response tracking. - Introduced tests for logging and telemetry functionalities to ensure reliability. - Updated authentication module to include new AuthPolicy. - Enhanced transport layer to handle retries for HTTP errors and specific status codes. - Added new dependencies for HTTP/2 support and updated project configuration.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a comprehensive HTTP transport layer to the GavaConnect SDK with support for async HTTP requests, authentication, telemetry, logging, and retry logic. The implementation is fully tested and includes proper error handling and OpenTelemetry integration.
- Introduces a new
gavaconnect.httppackage with async HTTP transport, logging, and telemetry utilities - Adds comprehensive test coverage for all HTTP functionality including edge cases and error scenarios
- Updates project dependencies to support OpenTelemetry and HTTP/2 features
Reviewed Changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| gavaconnect/http/init.py | Package initialization exporting logging, telemetry, and transport components |
| gavaconnect/http/logging.py | HTTP request/response logging with header sanitization and timing |
| gavaconnect/http/telemetry.py | OpenTelemetry span creation and completion for HTTP requests |
| gavaconnect/http/transport.py | Async HTTP transport with retry logic, authentication, and error handling |
| tests/test_http_*.py | Comprehensive test suites covering all HTTP functionality |
| gavaconnect/auth/init.py | Updated to export AuthPolicy base class |
| pyproject.toml | Added OpenTelemetry and HTTP/2 development dependencies |
| coverage.xml | Updated coverage metrics reflecting new HTTP package |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…y; update type hints and ensure proper handling of keyword arguments.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new HTTP transport layer to the GavaConnect SDK, providing robust support for HTTP requests, logging, telemetry, and error handling. It adds new modules for logging HTTP requests and responses, OpenTelemetry tracing, and an asynchronous transport implementation with retry and authentication logic. The changes are fully covered by new tests and update the SDK's dependencies accordingly.
New HTTP Transport Layer
gavaconnect.httppackage with the following components: logging utilities (logging.py), OpenTelemetry tracing utilities (telemetry.py), and an asynchronous HTTP transport class with retry and error handling (transport.py). All are exported via the package's__init__.py. [1] [2] [3] [4]Testing and Coverage
coverage.xmlto reflect the addition of the new HTTP package and its complete test coverage. [1] [2]Dependency Updates
pyproject.toml.Auth Module Export Update
gavaconnect.authmodule to export theAuthPolicybase class, and adjusted corresponding tests. [1] [2]