fix(metrics): 补齐媒体结果存储读取与兼容响应指标

增加对象存储 GET、结果 URL 签名和同步 Base64 限流指标,使生产轮询可直接验证零对象下载,并区分签名失败、容量等待超时和 20MiB 超限。\n\n验证:API 全量 go test、go vet、gofmt 与 git diff --check。
This commit is contained in:
2026-08-05 18:55:41 +08:00
parent b13392ef50
commit 03c0873649
7 changed files with 113 additions and 7 deletions
@@ -57,10 +57,17 @@ func TestMetricsExposeBoundedOutcomesAndState(t *testing.T) {
metrics.ObserveObjectStorage("retry", "s3", 0, 0)
metrics.ObserveObjectStorage("failover", "s3", 0, 0)
metrics.ObserveObjectStorage("all_failed", "", 0, 0)
metrics.ObserveObjectStorage("read_success", "aliyun_oss", 256, 15*time.Millisecond)
metrics.ObserveObjectStorage("read_failure", "aliyun_oss", 0, 5*time.Millisecond)
metrics.ObserveResultStorage("upstream_url")
metrics.ObserveResultStorage("uploaded")
metrics.ObserveResultDelivery("poll_success", 512)
metrics.ObserveResultDelivery("poll_oversized", 70<<10)
metrics.ObserveResultURLSigning("success")
metrics.ObserveResultURLSigning("failure")
metrics.ObserveSynchronousBase64("success")
metrics.ObserveSynchronousBase64("capacity_timeout")
metrics.ObserveSynchronousBase64("too_large")
metrics.ObserveAsyncWorkerResize("success")
metrics.ObserveConcurrencyLeaseRenewal("success")
metrics.ObserveConcurrencyLeaseRenewal("lost")
@@ -121,11 +128,19 @@ func TestMetricsExposeBoundedOutcomesAndState(t *testing.T) {
`easyai_gateway_storage_channel_failovers_total 1`,
`easyai_gateway_storage_all_channels_failed_total 1`,
`easyai_gateway_storage_objectified_bytes_total 128`,
`easyai_gateway_storage_object_get_attempts_total 2`,
`easyai_gateway_storage_object_get_failures_total 1`,
`easyai_gateway_storage_object_get_bytes_total 256`,
`easyai_gateway_result_storage_total{outcome="upstream_url"} 1`,
`easyai_gateway_result_storage_total{outcome="uploaded"} 1`,
`easyai_gateway_result_poll_responses_total 1`,
`easyai_gateway_result_poll_response_bytes_total 512`,
`easyai_gateway_result_poll_oversized_total 1`,
`easyai_gateway_result_url_signing_total{outcome="success"} 1`,
`easyai_gateway_result_url_signing_total{outcome="failure"} 1`,
`easyai_gateway_sync_base64_responses_total{outcome="success"} 1`,
`easyai_gateway_sync_base64_responses_total{outcome="capacity_timeout"} 1`,
`easyai_gateway_sync_base64_responses_total{outcome="too_large"} 1`,
`easyai_gateway_platform_model_rate_limit_utilization{platform_model_id="platform-model-1",metric="concurrent"} 0.750000`,
`easyai_gateway_async_worker_resizes_total{outcome="success"} 1`,
`easyai_gateway_concurrency_lease_renewals_total{outcome="success"} 1`,