Files
TimeTracker/app/config/__init__.py
Dries Peeters e4789cc26e feat: Add telemetry and analytics infrastructure with observability stack
Implement comprehensive analytics and monitoring system with PostHog integration,
complete observability stack (Prometheus, Grafana, Loki, Promtail), and CI/CD
workflows for automated builds.

Features:
- Add PostHog telemetry integration with privacy-focused event tracking
- Implement installation flow for opt-in telemetry configuration
- Add telemetry management UI in admin panel with detailed transparency
- Track key user events across all major features (projects, tasks, timer, etc.)

Infrastructure:
- Set up Prometheus for metrics collection
- Configure Grafana for visualization dashboards
- Integrate Loki and Promtail for log aggregation
- Add separate analytics docker-compose configuration

CI/CD:
- Add GitHub Actions workflows for building and publishing Docker images
- Implement separate dev and production build pipelines
- Configure automated image publishing to registry

Documentation:
- Restructure documentation into organized docs/ directory
- Add comprehensive guides for telemetry, analytics, and local development
- Create transparency documentation for tracked events
- Add CI/CD and build configuration guides

Code improvements:
- Integrate telemetry hooks across all route handlers
- Add feature flags and configuration management
- Refactor test suite for analytics functionality
- Clean up root directory by moving docs and removing test artifacts

Breaking changes:
- Requires new environment variables for PostHog configuration
- Docker compose setup now supports analytics stack

Changes: 73 files changed, 955 insertions(+), 14126 deletions(-)
2025-10-20 14:38:57 +02:00

53 lines
1.8 KiB
Python

"""
Configuration module for TimeTracker.
This module contains:
- Flask application configuration (Config, ProductionConfig, etc.)
- Analytics configuration for telemetry
"""
# Import Flask configuration classes from parent config.py
# We need to import from the parent app module to avoid circular imports
import sys
import os
# Import analytics configuration
from app.config.analytics_defaults import get_analytics_config, has_analytics_configured
# Import Flask Config classes from the config.py file in parent directory
# The config.py was shadowed when we created this config/ package
# So we need to import it properly
try:
# Try to import from a renamed file if it exists
from app.flask_config import Config, ProductionConfig, DevelopmentConfig, TestingConfig
except ImportError:
# If the file wasn't renamed, we need to import it differently
# Add parent to path temporarily to import the shadowed config.py
import importlib.util
config_py_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'config.py')
if os.path.exists(config_py_path):
spec = importlib.util.spec_from_file_location("flask_config_module", config_py_path)
flask_config = importlib.util.module_from_spec(spec)
spec.loader.exec_module(flask_config)
Config = flask_config.Config
ProductionConfig = flask_config.ProductionConfig
DevelopmentConfig = flask_config.DevelopmentConfig
TestingConfig = flask_config.TestingConfig
else:
# Fallback - create minimal config
class Config:
pass
ProductionConfig = Config
DevelopmentConfig = Config
TestingConfig = Config
__all__ = [
'get_analytics_config',
'has_analytics_configured',
'Config',
'ProductionConfig',
'DevelopmentConfig',
'TestingConfig'
]