Add metrics publisher to indexer with S3 endpoint configuration #35
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add Metrics Publisher to gProfiler Indexer
📋 Summary
This PR adds SLI (Service Level Indicator) metrics tracking to the gProfiler indexer service to enable SLO monitoring and error budget tracking. It also adds optional S3 endpoint configuration support for local development with LocalStack.
Type: Feature + Infrastructure Improvement
Impact: Low (opt-in feature, disabled by default)
Need to check Change: Environment variable rename (see Migration Notes)
🎯 Motivation
Problem
Solution
📝 Changes
1. Indexer Metrics Publisher (Go)
New Files
src/gprofiler_indexer/metrics_publisher.go(234 lines)Modified Files
src/gprofiler_indexer/args.go(+21 lines)METRICS_ENABLED(bool, default: false)METRICS_AGENT_URL(string, default: tcp://localhost:18126)METRICS_SERVICE_NAME(string, default: gprofiler-indexer)METRICS_SLI_UUID(string, required when enabled)S3_ENDPOINT→AWS_ENDPOINT_URL(see Migration Notes)src/gprofiler_indexer/main.go(+15 lines)FlushAndClose()on graceful shutdownsrc/gprofiler_indexer/worker.go(+79 lines)GetMetricsPublisher().SendSLIMetric(...)2. S3 Endpoint Configuration (Python)
Modified Files
src/gprofiler-dev/gprofiler_dev/config.py(+3 lines)S3_ENDPOINT_URLenvironment variableNone(uses standard AWS S3 in production)src/gprofiler-dev/gprofiler_dev/s3_profile_dal.py(+4 lines)endpoint_url=config.S3_ENDPOINT_URLto boto3 S3 client/resourceNone: uses default AWS S3 endpoints3. Documentation
LOCAL_TESTING_GUIDE.md(526 lines)METRICS_PUBLISHER_INDEXER_DOCUMENTATION.md(580+ lines)🧪 Testing
Test Environment
End-to-End Testing
Metrics Testing
Performance Testing
🔄 Migration Notes
Change: Environment Variable Rename
Changed:
S3_ENDPOINT→AWS_ENDPOINT_URLWho is Affected?
NOT affected: Standard AWS S3 deployments (99% of cases)
Affected: Custom S3 endpoint deployments (rare)
S3_ENDPOINTexplicitly setMigration Steps
If you have this in your deployment:
Why This Change?
AWS_ENDPOINT_URLmatches AWS SDK naming convention🔒 Security Analysis
Credentials
Metrics
Network
🎯 Rollout Plan
Phase 1: Deploy to Staging
METRICS_ENABLED=false(disabled)METRICS_ENABLED=truePhase 2: Deploy to Production
METRICS_ENABLED=false(disabled)Rollback Plan
METRICS_ENABLED=falseto disable metrics📚 Related Documentation
Testing Verification
📈 Success Metrics
Pre-Deployment
Post-Deployment