{"id":30593404,"url":"https://github.com/techwithty/telemetry-utils","last_synced_at":"2025-08-29T18:13:55.907Z","repository":{"id":291049150,"uuid":"976414721","full_name":"TechWithTy/telemetry-utils","owner":"TechWithTy","description":"Application telemetry and monitoring utilities","archived":false,"fork":false,"pushed_at":"2025-08-04T16:38:30.000Z","size":175,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-04T20:00:45.263Z","etag":null,"topics":["logging","metrics","monitoring","telemetry"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TechWithTy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-02T04:24:14.000Z","updated_at":"2025-08-04T16:38:34.000Z","dependencies_parsed_at":"2025-08-04T18:28:19.723Z","dependency_job_id":null,"html_url":"https://github.com/TechWithTy/telemetry-utils","commit_stats":null,"previous_names":["techwithty/telemetry-utils"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TechWithTy/telemetry-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechWithTy%2Ftelemetry-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechWithTy%2Ftelemetry-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechWithTy%2Ftelemetry-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechWithTy%2Ftelemetry-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TechWithTy","download_url":"https://codeload.github.com/TechWithTy/telemetry-utils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechWithTy%2Ftelemetry-utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272735334,"owners_count":24984285,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-29T02:00:10.610Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["logging","metrics","monitoring","telemetry"],"created_at":"2025-08-29T18:13:55.175Z","updated_at":"2025-08-29T18:13:55.894Z","avatar_url":"https://github.com/TechWithTy.png","language":"Python","readme":"# Production Telemetry Module\n\n**Production-ready Python/FastAPI Telemetry, Tracing, and Metrics Suite**\n\nThis module provides distributed tracing, metrics, and health monitoring for Python microservices using OpenTelemetry and best-in-class async patterns.\n\n---\n\n## 📁 Folder Structure \u0026 Conventions\n\n```\ntelemetry/\n├── _docs/           # Markdown docs, best practices, diagrams, usage\n├── _tests/          # Unit/integration tests for all core logic\n├── config.py        # Singleton config (class-based, imports from global settings)\n├── docker/          # Dockerfile, docker-compose, telemetry configs, .env.example\n├── models/          # Pydantic models or telemetry schemas\n├── exceptions/      # Custom exceptions for telemetry\n├── \u003ccore\u003e.py        # Main implementation (client.py, decorators.py, health_check.py, telemetry.py, etc.)\n├── README.md        # Main readme (this file)\n```\n\n- **_docs/**: All documentation, diagrams, and best practices for this module.\n- **_tests/**: All tests for this module, including integration, async, and health checks.\n- **config.py**: Singleton config pattern, imports from global settings, exposes all constants for this module.\n- **docker/**: Containerization assets (Dockerfile, docker-compose, telemetry configs, .env.example, etc).\n- **models/**: Pydantic models or schemas for telemetry/tracing payloads.\n- **exceptions/**: Custom exception classes for robust error handling.\n- **\u003ccore\u003e.py**: Main implementation modules (e.g., client.py, decorators.py, health_check.py, telemetry.py).\n\n---\n\n## 🏗️ Singleton \u0026 Config Pattern\n- Use a single class (e.g., `TelemetryConfig`) in `config.py` to centralize all env, exporter, and integration settings.\n- Import from global settings to avoid duplication and ensure DRY config.\n- Document all config keys in `_docs/usage.md` and in this README.\n\n---\n\n## Features\n- **Distributed Tracing**: End-to-end request tracking\n- **Metrics Collection**: Performance and error metrics\n- **Health Monitoring**: `/health/telemetry` endpoint\n- **Circuit Breaking**: Automatic fallback during outages\n- **Async Support**: Non-blocking operations\n\n## Usage\n```python\nfrom fastapi import FastAPI\nfrom .telemetry import setup_telemetry\n\napp = FastAPI()\nsetup_telemetry(app)  # Initializes all telemetry systems\n```\n\n## Configuration\nSet these environment variables:\n- `OTEL_EXPORTER_OTLP_ENDPOINT`: Collector endpoint\n- `SERVICE_NAME`: Service identifier\n- `SERVICE_VERSION`: Service version\n\n## Monitoring\nKey metrics:\n- `app.request.count`: Total requests\n- `app.request.latency.ms`: Response times\n- `app.error.count`: Error rates\n\n## Health Checks\nEndpoint: `GET /health/telemetry`\n\nReturns:\n```json\n{\n  \"status\": \"healthy | degraded | unhealthy\",\n  \"details\": {\n    \"circuit_breaker\": \"open | closed\"\n  }\n}\n```\n\n## Decorators\n- `@trace_function`: Request tracing\n- `@track_errors`: Error logging\n- `@measure_performance`: Performance metrics\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechwithty%2Ftelemetry-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechwithty%2Ftelemetry-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechwithty%2Ftelemetry-utils/lists"}