Skip to content

Conversation

@rindhuja-johnson
Copy link
Contributor

@rindhuja-johnson rindhuja-johnson commented Sep 20, 2025

Summary

  • Removed unnecessary MockTracer and MockSpan classes from the telemetry system
  • Fixed "name 'MockTracer' is not defined" error that was preventing builds
  • Replaced mock classes with cleaner NoOpSpan for disabled telemetry
  • Simplified type annotations and error handling

Changes Made

  • Removed MockTracer/MockSpan classes - These were causing import errors and added unnecessary complexity
  • Added NoOpSpan class - Simple no-operation span for when telemetry is disabled
  • Updated type annotations - Changed from Union["trace.Tracer", MockTracer] to Optional["trace.Tracer"]
  • Cleaned up error handling - Removed mock object assignments in exception blocks
  • Improved graceful degradation - Telemetry now properly disables when OpenTelemetry is unavailable

Test plan

  • Verify import of zen.telemetry.embedded_credentials works without errors
  • Confirm build script passes credential verification step
  • Test that telemetry gracefully disables when OpenTelemetry is not available
  • Run full test suite to ensure no regressions

🤖 Generated with Claude Code

claude-ai-netra and others added 20 commits September 19, 2025 20:04
This implementation provides anonymous public telemetry for the Zen orchestrator, enabling community-driven analytics that differentiate Zen from Apex's commercial approach.

Key features:
- Anonymous usage tracking with no authentication required
- Community insights visible to all users
- Embedded credentials for seamless operation
- Public telemetry dashboard capabilities

Files added:
- TELEMETRY_SETUP_GUIDE.md: Complete setup and capabilities guide
- COMMUNITY_ANALYTICS_DEMO.md: Live demo examples
- COMMUNITY_ANALYTICS_SUMMARY.md: Summary of analytics features
- demo_community_analytics.py: Working demo script
- scripts/setup_netra_telemetry_public.sh: Automated setup script

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This implementation provides a bulletproof secret management system for the Zen-Apex integration with enterprise-grade security features.

Key components:
- Google Secret Manager integration with automatic rotation
- Kubernetes secret management with RBAC controls
- Multi-environment secret deployment (dev/staging/prod)
- Comprehensive monitoring and alerting
- Secure credential embedding system

Files added:
- zen_secrets/: Complete secret management module
  - core.py: Core secret management classes
  - gsm.py: Google Secret Manager integration
  - kubernetes.py: Kubernetes secret management
  - rotation.py: Automated secret rotation engine
  - monitoring.py: Monitoring and alerting system
  - config.py: Configuration management
- ZEN_APEX_SECRET_MANAGEMENT_IMPLEMENTATION_GUIDE.md: Implementation guide
- zen_secret_management_architecture.md: Architecture documentation
- scripts/embed_credentials.py: Secure credential embedding

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit includes production deployment setup, core system updates, and integration improvements for the Zen-Apex ecosystem.

Key components:
- Production deployment guides and automation scripts
- Core system updates including orchestrator enhancements
- Telemetry module integration
- Build and verification automation
- Package configuration updates with updated .gitignore

Files added/modified:
- PRODUCTION_SETUP_GUIDE.md: Comprehensive production deployment guide
- DEMO_SUMMARY.md: Demo summary and usage examples
- scripts/build_production.sh: Production build automation
- scripts/verify_production.sh: Production verification script
- zen/telemetry/: Complete telemetry module implementation
- zen_orchestrator.py: Enhanced orchestrator with new capabilities
- pyproject.toml, requirements.txt: Updated dependencies and configuration
- .gitignore: Updated to exclude sensitive files like embedded credentials
- MANIFEST.in: Updated project configuration

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Removed unnecessary MockTracer and MockSpan classes that were causing import errors
- Replaced with cleaner NoOpSpan for disabled telemetry cases
- Updated type annotations to use Optional["trace.Tracer"] instead of Union types
- Simplified error handling by removing mock object assignments
- Telemetry now gracefully disables when OpenTelemetry is unavailable

This fixes the "name 'MockTracer' is not defined" error during build and
makes the codebase cleaner without fake implementations.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Fix .gitignore formatting and add .config entry
- Update community_auth.py to use embedded_credentials module
- Simplify credential loading to use embedded implementation
- Add GitHub workflows directory
- Include system files for completeness

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Implements comprehensive cache token tracking for individual tools in the Tool Usage Details table,
matching the command-level metrics display. Cache tokens (cache_read and cache_creation) are now
properly tracked, attributed, and displayed for each tool.

Key changes:
- Changed tool_tokens from Dict[str, int] to Dict[str, Dict[str, int]] for structured breakdown
- Added cache_read and cache_creation tracking alongside input/output/total tokens
- Implemented proportional cache attribution based on tool usage frequency
- Added Cache Cr and Cache Rd columns to Tool Usage Details table
- Ensured tool cache totals match overall cache metrics
- Added comprehensive regression tests in tests/test_tool_cache_tokens.py

The cache attribution uses proportional distribution since Claude's API reports cache at the
message level rather than per-tool. Tools that are used more frequently receive proportionally
more cache attribution.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@rindhuja-johnson rindhuja-johnson changed the title Remove MockTracer classes and fix telemetry import errors Add tool cache token tracking and fix telemetry issues Oct 2, 2025
@rindhuja-johnson rindhuja-johnson changed the title Add tool cache token tracking and fix telemetry issues Remove MockTracer classes and fix telemetry import errors Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants