Tyke Python Agent
Project description
Tyke Python Agent
Python agent provides instrumentation for collecting relevant data to be processed by Tyke.
This agent supports these frameworks and adds following capabilities:
- capture request and response headers
- capture request and response bodies
- capture SQL queries
- tracing context propagation
Tyke python agent supports Python 3.6+
Library | Description | Supported Library Versions |
---|---|---|
flask | A micro web framework written in Python. | 1.*, 2.* |
django | Python web framework | 1.10+ |
grpc | Python GRPC library. | 1.27+ |
mysql-connector | Python MySQL database client library. | 8.* |
psycopg2/postgresql | Python Postgresql database client library. | 2.7.3.1+ |
requests | Python HTTP client library. | 2.* |
aiohttp | Python async HTTP client library. | 3.* |
Getting started
Instrumentation
Instrumentation requires editing your code to initialize an agent, and registering any applicable modules to be instrumented.
- Install the tyke python agent:
pip install tyke-agent
- Create a YAML file with the name config.yaml in the application root directory and add below content
service_name: "Service Name"
resource_attributes:
app.name: "Application Name"
service.identifier: Service unique identifier
reporting:
endpoint: http://localhost:4317
- Add the following to your app's entrypoint python file:
from tyke.agent import Agent
agent = Agent() # initialize the agent
# Instrument a specific flask app + any other applicable libraries
agent.instrument(app)
# Instrument a flask app, additional libraries, except for mysql
# the second argument tells the agent to skip these specific libraries from being instrumented
agent.instrument(app, ['mysql'])
# if you aren't using flask, you can pass None
# and still provide skip libraries if needed
agent.instrument(None, ['flask', 'mysql'])
# Set config file location in environment variables
os.environ.setdefault("TYKE_CONFIG_FILE", "config.yaml")
...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tyke-agent-0.1.6.tar.gz
(36.6 kB
view hashes)
Built Distribution
tyke_agent-0.1.6-py3-none-any.whl
(46.7 kB
view hashes)
Close
Hashes for tyke_agent-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e7f9632bba65fa3ccc754c16d3e677b1861523cfda457cd71abaa0271780f5b |
|
MD5 | 5dd49d42c3c5b4783de8f3e06d7ee49a |
|
BLAKE2b-256 | cb1c73e6279fa8cc435094ec436db3adeb12918beb3f49cb5c07371b78d26bac |