Skip to main content

Tyke Python Agent

Project description

Tyke Python Agent

Tyke Python agent provides instrumentation for collecting traces 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.7+

Library Description Supported Library Versions
flask A micro web framework written in Python. >= 1.0, < 3.0
django Python web framework 2.0+
fastapi Python web framework ~= 0.58
grpc Python GRPC library. 1.27+
mysql-connector Python MySQL database client library. 8.*
mysqlclient Python MySQLClient library. < 3
pymyql Python MySQL database PyMysql library. 2+
psycopg2/psycopg2-binary/postgresql Python Postgresql database client library. 2.7.3.1+
requests Python HTTP client library. 2.*
aiohttp Python async HTTP client library. 3.*
pymongo Python mongodb pymongo library. >= 3.1, < 5.0
redis Python Redis library. 3.0.0+
cassandra Python Cassandra driver. ~= 3.25
scylla Python Scylla driver. ~= 3.25

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


# Set config file location in environment variables 
os.environ.setdefault("TYKE_CONFIG_FILE", "config.yaml")

agent = Agent() # initialize the agent

# Instrument a flask app + any other applicable libraries
agent.instrument(app)

# Instrument a django app
agent.instrument()
...

Project details


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.2.1.tar.gz (42.2 kB view hashes)

Uploaded Source

Built Distribution

tyke_agent-0.2.1-py3-none-any.whl (57.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page