You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enterprise-grade Python SDK for TelemetryFlow - the observability platform that provides unified metrics, logs, and traces collection following OpenTelemetry standards.
Features
Feature
Description
100% OTLP Compliant
Full OpenTelemetry Protocol support
DDD Architecture
Domain-Driven Design with clean layers
CQRS Pattern
Command Query Responsibility Segregation
Three Signals
Metrics, Logs, and Traces
Multiple Protocols
gRPC (default) and HTTP
Type Safety
Full type hints with mypy support
Framework Integrations
Flask, FastAPI middleware
CLI Generator
Project scaffolding tool
Architecture
graph TB
subgraph "Interface Layer"
A[TelemetryFlowClient]
B[TelemetryFlowBuilder]
end
subgraph "Application Layer"
C[Commands]
D[Queries]
end
subgraph "Domain Layer"
E[TelemetryConfig]
F[Credentials]
end
subgraph "Infrastructure Layer"
G[CommandHandler]
H[OTLPExporterFactory]
I[OpenTelemetry SDK]
end
A --> C
B --> E
C --> G
G --> H
H --> I
E --> F
style A fill:#4CAF50
style E fill:#2196F3
style G fill:#FF9800
Loading
Installation
pip install telemetryflow-python-sdk
With optional dependencies:
# HTTP framework support (Flask, FastAPI)
pip install telemetryflow-python-sdk[http]
# gRPC support
pip install telemetryflow-python-sdk[grpc]
# Development tools
pip install telemetryflow-python-sdk[dev]
# All extras
pip install telemetryflow-python-sdk[dev,http,grpc]
# Initialize in current directory
telemetryflow-gen init
# Generate example code
telemetryflow-gen example --type basic
telemetryflow-gen example --type http-server
# Show version
telemetryflow-gen version
Data Flow
sequenceDiagram
participant App as Application
participant SDK as TelemetryFlow SDK
participant OTEL as OpenTelemetry
participant TF as TelemetryFlow Backend
App->>SDK: client.increment_counter()
SDK->>SDK: Create Command
SDK->>OTEL: Record Metric
Note over OTEL: Batch & Export
OTEL->>TF: OTLP Export (gRPC/HTTP)
TF-->>OTEL: Ack
# Run tests
make test# Run with coverage
make test-coverage
# Lint code
make lint
# Format code
make format
# Type check
make typecheck
# Run all checks
make check
# Build package
make build
Testing
# All tests
pytest
# Unit tests only
pytest tests/unit/ -v
# Integration tests
pytest tests/integration/ -v -m integration
# With coverage
pytest --cov=telemetryflow --cov-report=html
Testing Strategy
Layer
Target Coverage
Focus
Domain
90%+
Value objects, validation
Application
85%+
Commands, queries
Infrastructure
80%+
Handlers, exporters
Client
85%+
Public API
Best Practices
1. Initialize Once
# Good: Single initialization at startupclient=TelemetryFlowBuilder().with_auto_configuration().build()
client.initialize()
# Bad: Creating client per requestforrequestinrequests:
client=TelemetryFlowBuilder()... # Don't do this!
2. Use Context Managers
# Good: Automatic cleanupwithclient.span("operation") asspan_id:
# work...# Avoid: Manual management (error-prone)span_id=client.start_span("operation")
# if exception, span may not endclient.end_span(span_id)
Enterprise-grade Python SDK for TelemetryFlow - the observability platform that provides unified metrics, logs, and traces collection following OpenTelemetry standards.