Skip to content

Conversation

@DDDFiish
Copy link
Contributor

@DDDFiish DDDFiish commented Jan 15, 2026

添加了三个指标 cdnStatusCount cdnBackSourceStatusCount cdnHitTotal
分别表示 cdn状态码数量cdn回源状态码数量cdn缓存命中次数

revert #14 里面的更改,exporter暴露的命中率采用官方的计算方式

Copilot AI review requested due to automatic review settings January 15, 2026 02:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds three new CDN metrics to the upyun-exporter: cdnStatusCount, cdnBackSourceStatusCount, and cdnHitTotal. The changes include upgrading dependencies (Go version from 1.18 to 1.23.0, Prometheus client from v1.13.0 to v1.23.2), adding new metric descriptors and collection logic, improving terminology in metric descriptions, and modifying the CDN hit rate calculation logic.

Changes:

  • Added three new Prometheus metrics for CDN status code counts and cache hit totals
  • Updated Go version and Prometheus client library dependencies
  • Modified CDN hit rate calculation to exclude 403 status codes
  • Improved metric description terminology from "概率" (probability) to "比例" (proportion)

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 6 comments.

File Description
main.go Reorganized imports to separate standard library from third-party packages
go.mod Updated Go version to 1.23.0 and upgraded Prometheus client_golang to v1.23.2, includes incorrect module path for yaml/v2
go.sum Updated dependency checksums for new versions, includes incorrect module path for yaml/v2
exporter/exporter.go Added three new metric descriptors, implemented collection logic for status counts and hit totals, modified hit rate calculation, improved metric descriptions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@DDDFiish
Copy link
Contributor Author

@LeoQuote 有空帮忙看一下

@LeoQuote
Copy link
Collaborator

@DDDFiish lint 要再修一下, golang 的版本看看有没有遗漏的地方

@LeoQuote LeoQuote merged commit 42901da into douban:main Jan 15, 2026
2 checks passed
@DDDFiish DDDFiish deleted the add-cdn-counts-patch branch January 15, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants