Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Add telemetry counter for Redis pub/sub reconnection attempts

Đang mở Phù hợp với người mới
#11,943 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
75/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
php, redis
Lĩnh vực
backend, observability

Hướng nghiên cứu

Bắt đầu trong app/realtime.php, đọc các đăng ký telemetry quanh dòng 398-400 và khối catch của pub/sub connection-error quanh dòng 616. Làm theo các mẫu đăng ký và sử dụng counter hiện có; công việc hoàn tất khi pubsub.reconnection được đăng ký trong onWorkerStart và được tăng một lần cho mỗi lần thử kết nối lại được xử lý.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

api / realtime product / auth product / functions product / storage
🔖 Enhancement description

Add a telemetry counter telemetry.pubsubReconnectionCounter in app/realtime.php to track Redis pub/sub connection reconnection attempts. The counter will be incremented in the catch block that handles pub/sub connection errors (around line 616).

🎤 Pitch

Realtime functionality depends entirely on Redis pub/sub for message distribution. When pub/sub connections fail, the system automatically retries, but there's currently no metric to monitor the frequency or pattern of these reconnections.

This enhancement provides:

  • Infrastructure visibility: Operators can detect Redis instability before it impacts users
  • Alerting capability: Spikes in reconnection attempts can trigger infrastructure alerts
  • Low overhead: Single counter increment per failed connection attempt
  • Consistent pattern: Follows existing telemetry patterns already in the file (lines 398-400 show telemetry.connectionCounter, telemetry.connectionCreatedCounter, and telemetry.messageSentCounter)
    Implementation follows existing patterns:

The file already uses this telemetry pattern:

  1. Registration (around line 400):
php
$register->set('telemetry.connectionCounter', fn () => $telemetry->createUpDownCounter('realtime.server.open_connections'));
$register->set('telemetry.connectionCreatedCounter', fn () => $telemetry->createCounter('realtime.server.connection.created'));
$register->set('telemetry.messageSentCounter', fn () => $telemetry->createCounter('realtime.server.message.sent'));

Usage throughout the file:

php
$register->get('telemetry.connectionCounter')->add(1);
$register->get('telemetry.connectionCreatedCounter')->add(1);
$register->get('telemetry.messageSentCounter')->add($total);
The proposed change follows this exact pattern:
  • Register the counter in onWorkerStart: $register->set('telemetry.pubsubReconnectionCounter', fn () => $telemetry->createCounter('realtime.server.pubsub.reconnection'));
  • Increment it in the catch block: $register->get('telemetry.pubsubReconnectionCounter')->add(1);
👀 Have you spent some time to check if this issue has been raised before?
  • I checked and didn't find similar issue
🏢 Have you read the Code of Conduct?
Ngôn ngữ chính
PHP
Star
57.5k
Fork
5.8k
Merge trung bình
18 giờ 45 phút
Pull request đã merge (30 ngày)
384

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của appwrite/appwrite

Tất cả issue của appwrite/appwrite

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.