Files
ivatar/run_tests_with_ot.sh
Oliver Falk 7258d911c8 Add OpenTelemetry integration
- Add OpenTelemetry dependencies to requirements.txt
- Implement OpenTelemetry configuration with feature flag support
- Add OpenTelemetry middleware for custom metrics and tracing
- Update Django settings to conditionally enable OpenTelemetry
- Add comprehensive test suite for OpenTelemetry functionality
- Create test scripts for running with/without OpenTelemetry
- Add pytest markers for OpenTelemetry test categorization
- Update documentation with OpenTelemetry setup and infrastructure details

Features:
- Feature flag controlled (ENABLE_OPENTELEMETRY) for F/LOSS deployments
- Localhost-only security model
- Custom avatar metrics and tracing
- Graceful fallback when OpenTelemetry is disabled
- Comprehensive test coverage for both enabled/disabled states
2025-10-16 14:19:24 +02:00

24 lines
582 B
Bash
Executable File

#!/bin/bash
# Run tests with OpenTelemetry enabled
# This is used in CI to test OpenTelemetry functionality
set -e
echo "Running tests with OpenTelemetry enabled..."
# Enable OpenTelemetry
export ENABLE_OPENTELEMETRY=true
export OTEL_ENABLED=true
export OTEL_SERVICE_NAME=ivatar-test
export OTEL_ENVIRONMENT=test
export DJANGO_SETTINGS_MODULE=ivatar.settings
# Run tests including OpenTelemetry-specific tests
python3 -m pytest \
-m "opentelemetry or no_opentelemetry" \
--verbose \
--tb=short \
"$@"
echo "Tests completed successfully (OpenTelemetry enabled)"