Enterprise-grade Python SDK for TelemetryFlow - the observability platform that provides unified metrics, logs, and traces collection following OpenTelemetry standards.
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Dependabot Configuration: Added
.github/dependabot.ymlfor automated dependency updates (pip, docker, github-actions ecosystems)
- OpenTelemetry SDK Dependency: Upgraded minimum OTEL SDK from
>=1.28.0to>=1.42.1inpyproject.toml - OpenTelemetry Instrumentation: Upgraded minimum instrumentation from
>=0.49b0to>=0.63b1inpyproject.toml - GitHub Actions CI/CD: Upgraded all workflow action versions
actions/checkoutv4 → v6actions/upload-artifactv4 → v7actions/download-artifactv4 → v8docker/metadata-actionv5 → v6docker/setup-qemu-actionv3 → v4docker/setup-buildx-actionv3 → v4docker/login-actionv3 → v4docker/build-push-actionv6 → v7softprops/action-gh-releasev2 → v3
- TFO-Collector Version: Updated CI reference from v1.1.2 to v1.2.1
- Docker Compose: Removed Grafana and Jaeger services; added TFO Platform services (tfo-backend, tfo-viz, postgres, clickhouse, redis, nats) under
platformprofile - File Headers: Refactored all 66 Python source files to standard Apache 2.0 license header format
-
Build Package in Dev Dependencies: Added
build>=1.0.0to dev dependencies for local package building -
gRPC Header Lowercase Support: Added
_get_grpc_headers()method inOTLPExporterFactoryto ensure gRPC metadata keys are lowercase (required by gRPC specification) -
Comprehensive Unit Tests: Added
TestGetGrpcHeaderstest class for gRPC header handling -
TFO v2 API Configuration Alignment: Updated SDK configuration to align with TFO-Collector v1.2.1
- Added
v2_apiconfiguration section withenabledandv2_onlyoptions - Added custom endpoint paths support (
traces_endpoint,metrics_endpoint,logs_endpoint) - Aligned with
tfoexportercomponent for consistent API versioning
- Added
-
Collector Identity Support: Added collector identity configuration aligned with
tfoidentityextension- Collector ID, name, description, hostname, and datacenter settings
- Custom tags support for collector identification
- Resource attribute enrichment toggle
-
SDK Configuration Files: Added default configuration files for different use cases
configs/sdk-default.yaml- Full SDK configuration with all optionsconfigs/sdk-v2-only.yaml- Production-optimized v2-only modeconfigs/sdk-minimal.yaml- Quick-start minimal configuration
-
Enhanced Environment Variables: Updated
.env.examplewith TFO v2 API settingsTELEMETRYFLOW_USE_V2_API- Enable/disable v2 API endpointsTELEMETRYFLOW_V2_ONLY- Enable v2-only modeTELEMETRYFLOW_COLLECTOR_NAME- Human-readable collector nameTELEMETRYFLOW_DATACENTER- Datacenter/region identifierTELEMETRYFLOW_ENRICH_RESOURCES- Resource attribute enrichment
-
Command Generator Updates: Updated
telemetryflow-genCLI with TFO v2 API support- Added
--use-v2-api,--v2-only,--collector-name,--datacenter,--protocolCLI options - Updated
TemplateDataclass with TFO v2 API fields - Updated all templates (
env.tpl,init.py.tpl,example_basic.py.tpl,README.md.tpl) for v2 API - Added
init_v2_only()convenience function in generated code - Templates now include SDK version and TFO-Collector version metadata
- Added
-
Unit Tests: Added comprehensive unit tests for TFO v2 API features
- Tests for
TemplateDatav2 API fields and serialization - Tests for CLI v2 API options (
--v2-only,--collector-name, etc.) - Tests for template rendering with v2 API variables
- Tests for
-
Examples: Updated examples with TFO v2 API documentation
- Updated
examples/basic/main.pywith v2 API usage
- Updated
- CI Python Version Matrix: Updated CI workflow to test on Python 3.12 and 3.13 only (aligned with
requires-python = ">=3.12") - Updated version to 1.2.0 to align with TFO-Collector v1.2.1 release
- Default endpoint changed from
api.telemetryflow.id:4317tolocalhost:4317for development - Added
TELEMETRYFLOW_PROTOCOLandTELEMETRYFLOW_TIMEOUTenvironment variables
- gRPC Header Case Sensitivity: Fixed gRPC exporter to use lowercase header keys (gRPC metadata specification requires lowercase keys)
- Security - Credentials Exposure: Removed partial API key secret leak in
Credentials.__str__()— now masks secret completely with***instead of exposing first 8 characters - Security - Plaintext Secret Header: Removed
X-TelemetryFlow-Key-Secretfromauth_headers()— API key secret is now only transmitted via theAuthorizationheader - Security - Endpoint SSRF Validation: Added regex-based
host:portvalidation inTelemetryConfig._validate()to prevent Server-Side Request Forgery via malformed endpoints - Security - Insecure TLS Warning: Added
logging.warning()whenwith_insecure(True)is called to alert developers that TLS is disabled - Security - Hardcoded Secrets: Removed all hardcoded default passwords from
docker-compose.yml— PostgreSQL, ClickHouse, JWT, and session secrets now require explicit configuration via${VAR:?msg}pattern - Security - CORS Wildcard: Changed default
CORS_ORIGINfrom*tohttp://localhost:8080indocker-compose.ymland.env.example - Security - Weak Defaults: Removed weak default secrets (
change-me-in-production,telemetryflow123) from.env.example— all secret fields now empty by default - Security - Insecure Default: Changed
TELEMETRYFLOW_INSECUREdefault fromtruetofalsein.env.examplewith security warning - Security - Docker Root User: Added non-root
telemetryflowuser (UID 10001) toDockerfile.devwithUSERdirective - Security - Docker CVE Hardening: Updated
Dockerfile,Dockerfile.dev, anddocker.ymlworkflow to patch Trivy-detected CVEs:apt-get upgrade -yto patch ncurses, glibc, util-linux, xz, zlib, tar, systemd, sqlite vulnerabilities- Removed
perlpackage to eliminate Archive::Tar, IO::Compress, IO::Uncompress::Unzip CVEs - Upgraded
pipto latest version to fix arbitrary code execution, path traversal, and improper archive handling
- Version Alignment (CVS): Fixed
version.pyfrom stale1.1.1to1.2.0matchingpyproject.tomlandCHANGELOG.md - Version Alignment (CVS): Updated
DockerfileARG VERSIONand OCI labels from1.1.1to1.2.0 - Version Alignment (CVS): Updated
Dockerfilebuild comments from1.1.1to1.2.0 - Docker Build Fix - .dockerignore: Fixed
.dockerignoreexcludingLICENSEfile from Docker build context — changed fromLICENSEto!LICENSEso the multi-stageDockerfilecan successfullyCOPY LICENSE - Docker Build Fix - Shell Compatibility: Fixed
Dockerfilebuilder stage using bash process substitution<()which is unsupported in/bin/sh— replaced with POSIX-compliantprintf > /tmp/reqs.txtapproach for pip wheel requirements - Security - Trivy Vulnerability Scan: Verified zero vulnerabilities (CRITICAL/HIGH/MEDIUM) across all targets using Trivy v0.70.0:
- Source code filesystem scan: 0 vulnerabilities
- Production Docker image (
python:3.14-slim/ Debian 13.5): 0 vulnerabilities - Development Docker image (
python:3.14-slim/ Debian 13.5): 0 vulnerabilities
# TFO v2 API Configuration
v2_api:
enabled: true
v2_only: false
traces_endpoint: "/v2/traces"
metrics_endpoint: "/v2/metrics"
logs_endpoint: "/v2/logs"
# Collector Identity
collector:
id: "${TELEMETRYFLOW_COLLECTOR_ID:}"
name: "TelemetryFlow Python SDK"
datacenter: "default"
enrich_resources: true
tags:
sdk_version: "1.2.0"
sdk_language: "python"- Dual Endpoint Ingestion Support: Updated docker-compose and OTEL collector configs for TFO-Collector dual ingestion
- v1 endpoints: Standard OTEL community format (
/v1/traces,/v1/metrics,/v1/logs) - v2 endpoints: TelemetryFlow enhanced format (
/v2/traces,/v2/metrics,/v2/logs) - gRPC endpoint: Same port (4317) for both v1 and v2
- v1 endpoints: Standard OTEL community format (
- TFO-Collector as Default: Docker-compose now uses
telemetryflow/telemetryflow-collectoras default image- Commented alternatives for TFO-Collector-OCB and OTEL Collector Contrib
- Separate volume mounts for each collector type
- Enhanced Port Configuration: Added additional ports for observability
- zPages (55679) for debugging
- pprof (1777) for profiling
- Prometheus exporter (8889)
- Connectors for Exemplars: Added spanmetrics and servicegraph connectors
- Metrics-to-traces correlation with exemplars enabled
- Service dependency graph generation
- Template-based code generation for
telemetryflow-genCLI - Template-based code generation for
telemetryflow-restapiCLI - External
.tpltemplate files for all generated code --template-dirCLI option for custom templates- Comprehensive unit tests for CLI generators
- Refactored
generator.pyto use external template files (reduced inline code by ~70%) - Refactored
generator_restapi.pyto use external template files (reduced from 2326 to 843 lines) - Templates now loaded via
importlib.resourcesfor package portability - Improved template organization with subdirectories (project, infrastructure, domain, application, entity)
templates/
├── native/ # telemetryflow-gen templates
│ ├── env.tpl
│ ├── init.py.tpl
│ ├── metrics.py.tpl
│ ├── logs.py.tpl
│ ├── traces.py.tpl
│ ├── README.md.tpl
│ └── example_*.py.tpl
└── restapi/ # telemetryflow-restapi templates
├── project/ # Project scaffolding
├── infrastructure/ # Infrastructure layer
├── domain/ # Domain layer (DDD)
├── application/ # Application layer (CQRS)
└── entity/ # Entity CRUD generation
- Initial release of TelemetryFlow Python SDK
- Full OpenTelemetry support with OTLP export
- Metrics support (counter, gauge, histogram)
- Logs support with severity levels
- Traces support with span management
- gRPC and HTTP protocol support
- Builder pattern for client configuration
- Environment variable configuration
- Flask middleware integration
- FastAPI middleware integration
- CLI generator for project scaffolding
- Comprehensive test suite
- Type hints with mypy support
- DDD architecture with CQRS pattern
TelemetryFlowClient- Main SDK clientTelemetryFlowBuilder- Fluent configuration builderCredentials- Immutable API key value objectTelemetryConfig- Configuration aggregate root- Framework middleware for Flask and FastAPI
- Context manager support for spans
- Exemplars support for metrics-to-traces correlation
- Collector ID and service namespace support
- Custom resource attributes
- Comprehensive README with examples
- API reference documentation
- Integration guides
- Example applications (basic, HTTP server, worker, gRPC)
- AsyncIO support
- Django middleware
- Batch log emission
- More framework integrations