forked from aws-powertools/powertools-lambda-python
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(docs): Extract tracer code examples
Changes: - Extract code examples - Run isort and black - Update line highlights - Open external links in new tab - Add make task Related to: - aws-powertools#1064
- Loading branch information
1 parent
b577366
commit e7f1dc1
Showing
20 changed files
with
262 additions
and
195 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import asyncio | ||
|
||
import aiohttp | ||
|
||
from aws_lambda_powertools import Tracer | ||
from aws_lambda_powertools.tracing import aiohttp_trace_config | ||
|
||
tracer = Tracer() | ||
|
||
|
||
async def aiohttp_task(): | ||
async with aiohttp.ClientSession(trace_configs=[aiohttp_trace_config()]) as session: | ||
async with session.get("https://httpbin.org/json") as resp: | ||
resp = await resp.json() | ||
return resp |
Oops, something went wrong.