feat(monitoring): add Redis exporter + Sentry docs to deployment guide
Some checks failed
Some checks failed
- Add redis-exporter container to docker-compose (oliver006/redis_exporter, 32MB) - Add Redis scrape target to Prometheus config - Add 4 Redis alert rules: RedisDown, HighMemory, HighConnections, RejectedConnections - Document Step 19b (Sentry Error Tracking) in Hetzner deployment guide - Document Step 19c (Redis Monitoring) in Hetzner deployment guide - Update resource budget and port reference tables Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -213,13 +213,13 @@ For complex changes that require data transformation:
|
||||
def upgrade() -> None:
|
||||
# Create new column
|
||||
op.add_column('products', sa.Column('normalized_price', sa.Numeric(10, 2)))
|
||||
|
||||
|
||||
# Migrate data
|
||||
connection = op.get_bind()
|
||||
connection.execute(
|
||||
text("UPDATE products SET normalized_price = CAST(price AS NUMERIC) WHERE price ~ '^[0-9.]+$'")
|
||||
)
|
||||
|
||||
|
||||
# Make column non-nullable after data migration
|
||||
op.alter_column('products', 'normalized_price', nullable=False)
|
||||
|
||||
@@ -329,7 +329,7 @@ def upgrade() -> None:
|
||||
if context.get_x_argument(as_dictionary=True).get('dev_data', False):
|
||||
# Add development sample data
|
||||
pass
|
||||
|
||||
|
||||
# Always apply schema changes
|
||||
op.create_table(...)
|
||||
```
|
||||
@@ -345,20 +345,20 @@ For large data transformations, use batch processing:
|
||||
```python
|
||||
def upgrade() -> None:
|
||||
connection = op.get_bind()
|
||||
|
||||
|
||||
# Process in batches to avoid memory issues
|
||||
batch_size = 1000
|
||||
offset = 0
|
||||
|
||||
|
||||
while True:
|
||||
result = connection.execute(
|
||||
text(f"SELECT id, old_field FROM products LIMIT {batch_size} OFFSET {offset}")
|
||||
)
|
||||
rows = result.fetchall()
|
||||
|
||||
|
||||
if not rows:
|
||||
break
|
||||
|
||||
|
||||
for row in rows:
|
||||
# Transform data
|
||||
new_value = transform_function(row.old_field)
|
||||
@@ -366,7 +366,7 @@ def upgrade() -> None:
|
||||
text("UPDATE products SET new_field = :new_val WHERE id = :id"),
|
||||
{"new_val": new_value, "id": row.id}
|
||||
)
|
||||
|
||||
|
||||
offset += batch_size
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user