Skip to content

Commit c8ba099

Browse files
committed
refactor(metrics): 简化HTTP时延指标名称并更新健康检查脚本
更新HTTP时延指标名称使其更简洁,同时改进健康检查脚本以支持批量检查多个端口
1 parent d5dc444 commit c8ba099

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

mock/s3/DEPLOYMENT.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,12 @@ sudo supervisorctl start zeroops_*
5555
ps aux | grep zeroops_
5656

5757
# 健康检查
58-
curl http://localhost:8181/health # metadata-service
59-
curl http://localhost:8191/health # storage-service
60-
curl http://localhost:8201/health # queue-service
61-
curl http://localhost:8211/health # third-party-service
62-
curl http://localhost:8221/health # mock-error-service
58+
```
59+
for port in 8182 8183 8191 8192 8201 8202 8211 8221; do
60+
echo "Checking port $port:"
61+
curl -s -o /dev/null -w "HTTP Status: %{http_code}\n" http://localhost:$port/metrics ||echo "Failed"
62+
done
63+
```
6364

6465
# 查看日志
6566
tail -f /home/qboxserver/zeroops_metadata_1/logs/service.log

mock/s3/shared/observability/metrics.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,9 @@ func (c *MetricCollector) initMetrics() error {
153153
return err
154154
}
155155

156-
// HTTP 请求时延 (使用 Prometheus 兼容的命名)
156+
// HTTP 请求时延
157157
if c.httpRequestDuration, err = c.meter.Float64Histogram(
158-
"http.server.request.duration_seconds",
158+
"http_latency",
159159
metric.WithDescription("HTTP server request duration in seconds"),
160160
metric.WithUnit("s"),
161161
metric.WithExplicitBucketBoundaries(

0 commit comments

Comments
 (0)