Skip to main content

Ekaros SDK for API performance monitoring, A/B testing, and experimentation

Project description

Ekaros SDK

Ekaros is a Python SDK for API performance monitoring, A/B testing, and experimentation of Python applications.

Features

  • Performance Monitoring: Track API latency, memory usage, and response metrics
  • A/B Testing: Run experiments with multiple variations
  • Dynamic Routing: Modify URL patterns at runtime
  • Comprehensive Metrics: Capture request/response data, headers, and custom parameters
  • Asynchronous Tracking: Non-blocking metrics collection

Supports

  • Django

Installation

pip install ekaros

Quick Start

1. Initialize Ekaros in your Django project

In your Django urls.py:

from django.urls import path, include
from ekaros import Ekaros

# Initialize Ekaros with your SDK key
ekaros_instance = Ekaros(
    framework="django",
    sdk_key="your-sdk-key-here"
)

urlpatterns = [
    path('admin/', admin.site.urls),
    path('api/', include('your_app.urls')),
    # Include Ekaros URLs
    path('ekaros/', include(('ekaros.backends.django.urls', 'ekaros'), namespace='ekaros')),
]

# Load URL patterns into Ekaros
ekaros_instance.load_url_patterns(urlpatterns)

# Override with Ekaros-enhanced patterns
urlpatterns = ekaros_instance.get_urlpatterns()

2. Register Views for A/B Testing

All your existsing views in the urls will be automatically registered. If you want to register new Views, you can use:

@ekaros.register(name="my_app:checkout_view")
def checkout_view_v1(request):
    return render(request, 'checkout_v1.html')

@ekaros.register(name="my_app:checkout_view")
def checkout_view_v2(request):
    return render(request, 'checkout_v2.html')

@ekaros.register(name="ab_apis:simple_view")
class SimpleButtonView(View):
   def get(self, request):
       return JsonResponse({"response_data": "GET API from Simple View"})


   def post(self, request):
       return JsonResponse({"response_data": "POST API from Simple View"})

Configuration Options

When initializing Ekaros, you can pass the following options:

ekaros = Ekaros(
    framework="django",
    sdk_key="your-sdk-key",
    instance_name="default",  # For multiple instances
    # Additional backend-specific options
)

Advanced Features

Client Token Generation

Generate tokens for client-side tracking:

token = ekaros.create_client_token(
    custom_parameters={"user_id": "123"},
    timeout=86400  # 24 hours
)

Metrics Collected

The SDK automatically tracks:

  • Performance: Latency, memory allocation, peak memory
  • Request Data: Headers, body, query parameters, method, path
  • Response Data: Headers, body, status code, content type
  • Experiment Data: A/B test variants, journey paths
  • Error Tracking: Exception messages and stack traces

Requirements

  • Python >= 3.8
  • Django >= 5.0
  • requests >= 2.25.0

Development

Install Development Dependencies

pip install -e ".[dev]"

Run Tests

pytest

Code Formatting

black ekaros/
flake8 ekaros/

Support

For issues, questions, or contributions:

License

MIT License - see LICENSE file for details

Changelog

0.1.0 (2025-01-01)

  • Initial release
  • Django backend support
  • Performance tracking
  • A/B testing capabilities
  • Dynamic routing

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

ekaros_sdk-0.1.0.tar.gz (21.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ekaros_sdk-0.1.0-py3-none-any.whl (23.7 kB view details)

Uploaded Python 3

File details

Details for the file ekaros_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: ekaros_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 21.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for ekaros_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cbcdb9865dd7d8b75249d4e88e58afa1b584ebe9d0d379737a2978e203e6cd9c
MD5 c2e4ae4154d13bad0de69138d4b64b2d
BLAKE2b-256 7900a7af494e434e03711b0ac73e3ca97e6da8f47fc130b4c1aaa567fe74b6f2

See more details on using hashes here.

File details

Details for the file ekaros_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ekaros_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 23.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for ekaros_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 45e194c67616c6ad09e6943220c777cdf4836e1be2a8a9f3c49cb4849d5d03d6
MD5 038ac29ab44dfe47657961cccb4683e9
BLAKE2b-256 07a0bc6d31ccec65ba51025223f4bd9ba479dc471231b4181b6ff037cce150e1

See more details on using hashes here.

Supported by

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