Add support for aiohttp client and server#659
Merged
beniwohli merged 21 commits intoelastic:masterfrom Dec 16, 2019
Merged
Conversation
6 tasks
basepi
approved these changes
Dec 3, 2019
Contributor
basepi
left a comment
There was a problem hiding this comment.
This is excellent work! And will be incredibly useful to me as I dive into Tornado. 👍
(One small note that you can ignore or take, but this is approved either way.)
| app = aioeapm.app | ||
| client = await aiohttp_client(app) | ||
| elasticapm_client = aioeapm.client | ||
| resp = await client.get( |
Contributor
There was a problem hiding this comment.
Unused variable
(I happened to open this in my editor and pylint was complaining)
Suggested change
| resp = await client.get( | |
| await client.get( |
basepi
approved these changes
Dec 6, 2019
Comment on lines
+79
to
+85
| def _set_disttracing_headers(self, headers, trace_parent, transaction): | ||
| trace_parent_str = trace_parent.to_string() | ||
| headers[constants.TRACEPARENT_HEADER_NAME] = trace_parent_str | ||
| if transaction.tracer.config.use_elastic_traceparent_header: | ||
| headers[constants.TRACEPARENT_LEGACY_HEADER_NAME] = trace_parent_str | ||
| if trace_parent.tracestate: | ||
| headers[constants.TRACESTATE_HEADER_NAME] = trace_parent.tracestate |
Contributor
There was a problem hiding this comment.
We'll probably want to keep an eye on these types of functions as we go along. Has potential to become a maintenance problem if this behavior changes over time. Though I guess searching for the constants.TRACEPARENT will probably be sufficient for any number of uses.
basepi
reviewed
Dec 9, 2019
basepi
approved these changes
Dec 11, 2019
Contributor
basepi
left a comment
There was a problem hiding this comment.
One small copy-pasta in the docs. Look excellent.
docs/aiohttp-server.asciidoc
Outdated
| ==== Usage | ||
|
|
||
| Once you have configured the agent, | ||
| it will automatically track transactions and capture uncaught exceptions within Flask. |
# Conflicts: # .ci/.jenkins_exclude.yml # .ci/.jenkins_framework.yml # .ci/.jenkins_framework_full.yml # elasticapm/instrumentation/register.py # setup.cfg
3 tasks
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.
What does this pull request do?
This PR adds integration for the aiohttp web framework, as well as the aiohttp
HTTP client library.
Why is it important?
Adding support for more asyncio frameworks and libraries is part of the roadmap.BECAUSE ASYNC ALL THE THINGS! (edited for excitement by @basepi)