-
Notifications
You must be signed in to change notification settings - Fork 250
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
Added aiohttp integration #1031
base: master
Are you sure you want to change the base?
Added aiohttp integration #1031
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
@googlebot I fixed it. |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
3b3df7c
to
c439511
Compare
@aabmass @hectorhdzg @lzchen @songy23 What I should do to make this PR approved? Is there any flow I need to follow? |
@lzchen What should I do to make this PR to be added to project and to have package released? |
- Added attributes following specs listed [here](https://github.com/census-instrumentation/opencensus-specs/blob/master/trace/HTTP.md#attributes) | ||
([#746](https://github.com/census-instrumentation/opencensus-python/pull/746)) | ||
- Support exporter changes in `opencensus>=0.7.0` | ||
- Initial version |
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.
Please consolidate changes into one bullet point and hyperlink this PR.
@@ -0,0 +1,53 @@ | |||
OpenCensus requests Integration |
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.
OpenCensus requests Integration | |
OpenCensus aiohttp client Integration |
|
||
:: | ||
|
||
pip install opencensus-ext-requests |
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.
pip install opencensus-ext-requests | |
pip install opencensus-ext-aiohttp |
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.
Thanks for the PR, and sorry for the slow response 😄 Since this won't work on 2.7 and potentially 3.{4,6}, you'll have to update tox.ini similar to what I did here https://github.com/census-instrumentation/opencensus-python/pull/1056/files#diff-ef2cef9f88b4fe09ca3082140e67f5ad34fb65fb6e228f119d3812261ae51449
|
||
You can enable aiohttp integration by specifying ``'aiohttp'`` to ``trace_integrations``. | ||
|
||
It's possible to configure a list of URL you don't want traced, anf it's configurable by giving an array of |
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.
typo
@@ -0,0 +1,17 @@ | |||
# Copyright 2017, OpenCensus Authors |
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.
Can you update copyright years to 2021?
excludelist_hostnames = execution_context.get_opencensus_attr( | ||
"excludelist_hostnames" | ||
) | ||
url_host_with_port = url.host + (f":{url.port}" if url.port else "") |
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.
Since f-strings are only since python3.6, this is probably breaking tests (we support back to 2.7)
"License :: OSI Approved :: Apache Software License", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.6", |
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.
Does aiohttp not support 3.5 and 3.4?
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
], | ||
description="OpenCensus Requests Integration", |
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.
typo "requests"
async def test_wrap_session_request(self): | ||
mock_tracer = MockTracer() | ||
patch_tracer = mock.patch( | ||
"opencensus.ext.requests.trace.execution_context." "get_opencensus_tracer", |
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.
typo "requests" in a few places in here
.. |pypi| image:: https://badge.fury.io/py/opencensus-ext-aiohttp.svg | ||
:target: https://pypi.org/project/opencensus-ext-aiohttp/ | ||
|
||
OpenCensus can trace asynchronous HTTP requests made with the `aiohttp package`_. The request URL, |
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.
Please mention somewhere explicitly that only Python versions 3.6+ are supported.
Thanks for the contribution and sorry for the long wait in reviewing. In terms of integration contributions, we expect contributors to maintain this part of the codebase in the future. OpenCensus maintainers will assist when needed by the responsibility for maintaining, reviewing issues/PRs and releasing related to this integration falls on the contributor. Is this alright with you? |
Can I please ask if this is abandoned? |
@maciejmoskala |
Aiohttp integration to track async requests. Library way build based on opencensus-ext-requests and it was tested on real life environment.