Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Asyncio Examples

This directory includes an example asyncio application and client with aiohttp and aio-pika used for testing.

Requirements

  • Python 3.8 or greater
  • instana, aiohttp and aio-pika Python packages installed
  • A RabbitMQ server with it's location specified in the RABBITMQ_HOST environment variable

Run

  • Make sure the Instana Python package is installed or you have this git repository checked out.

  • Set the environment variable AUTOWRAPT_BOOTSTRAP=instana for immediate instrumentation.

  • Boot the aiohttpserver.py file as follows. It will launch an aiohttp server that listens on port localhost:5102. See the source code for published endpoints.

python aiohttpserver.py
  • Boot the aiohttpclient.py file to generate a request (every 1 second) to the aiohttp server.
python aiohttpclient.py

From here, you can modify the aiohttpclient.py file as needed to change requested paths and so on.

Results

Some example traces from local tests.

aiohttp client calling aiohttp server: screen shot 2019-02-25 at 19 12 28

aiohttp server making multiple aio-pika calls (publish & consume)

screen shot 2019-02-26 at 10 21 50