opensearch-project / opensearch-py

Python Client for OpenSearch
https://opensearch.org/docs/latest/clients/python/
Apache License 2.0
338 stars 170 forks source link

Introduced service time metrics to OpenSearch-Py client. #689

Closed saimedhi closed 5 months ago

saimedhi commented 6 months ago

Description

Introduced service time metrics to OpenSearch-Py client.

Issues Resolved

678

Guide and Tests need to be added for this change.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.

codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 65.21739% with 24 lines in your changes are missing coverage. Please review.

Project coverage is 72.06%. Comparing base (4b69c09) to head (5ea57d3). Report is 2 commits behind head on main.

Files Patch % Lines
opensearchpy/metrics.py 60.00% 16 Missing :warning:
opensearchpy/connection/http_requests.py 66.66% 3 Missing :warning:
opensearchpy/connection/http_urllib3.py 66.66% 3 Missing :warning:
opensearchpy/transport.py 77.77% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #689 +/- ## ========================================== - Coverage 72.14% 72.06% -0.08% ========================================== Files 89 90 +1 Lines 7945 8009 +64 ========================================== + Hits 5732 5772 +40 - Misses 2213 2237 +24 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

saimedhi commented 6 months ago

I'm unsure about my changes to async connections. I've tested them, but I'm uncertain if I've covered all cases. Let's start by applying these changes for requests and urllib3 connections first. For async connections, I'll need to review whether a similar approach to sync connections is suitable or if we should utilize something like aiohttptraceconfig.

I've created a copy of my tested and functional changes, which include async connections. However, I'm streamlining this PR to concentrate solely on sync connections.