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-sdk

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.1.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.1-py3-none-any.whl (23.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ekaros_sdk-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 70101d9513319f705af3de8a53b52c1adaadc6ee2879cea79dfb7761e0d2cebf
MD5 7be45342f4b2224bc2652c7c6f090a55
BLAKE2b-256 e0ea972c4328ae5dbdd586f55d4960d6188692bab11dd1c0affd34b6df7bd632

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ekaros_sdk-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5dc91678d39cb8533633a378d4829c54678a66a356c0a0b5a2a4fbdde384d8ef
MD5 037f295c0c8ccfbeebf5aba7f9c50e73
BLAKE2b-256 8659a25b1c71f91f4b696fe4d3e1cd612ab23508514af7851b96bcf125b22521

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