Repository navigation
refactor+fix: 全矩阵审查收敛三单——#110 装配尾段去重 / #111 recordSpanError 改 errors.Is / #112 无 scheme 带路径显式报错 - #116
Merged
Merged
Conversation
…Provider(#110)——reader+mp+runtime.Start+失败回滚两处逐字复制抽为单点,runtime.Start 必须显式指定 provider 的关键注释随实现单点维护;另抽 applyCommonGrpcOpts 泛型帮助函数收编 grpc 分支 trace/metric 两组逐字复制的连接选项构建 fix(gormotel): recordSpanError 哨兵判定改 errors.Is(#111)——switch == 是相等比较,经 fmt.Errorf("%w") 包装后的 gorm.ErrRecordNotFound(业务未命中,最高频被包装哨兵)此前不匹配、span 被 RecordError+SetStatus(Error),APM 上未命中查询全量报红;补 wrapped 哨兵回归测试(多级包装全命中)+ 真错误正向对照 + First 未命中全链路契约钉 fix(init): parseOTLPHTTPEndpoint 无 scheme 分支显式拒绝带路径段(#112)——"collector:4318/api/otel" 此前被整串当 host:port 收下、basePath 恒空、导出打到根路径,/api/otel 段无声丢失(Init 成功、导出 404 循环),与 validateGRPCEndpoint「不合规输入报错,不静默断供」纪律相悖;报错提示补 scheme、不回显端点原值,补 parse 回归测试
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 issue:#110、#111、#112(backlog 索引:#109)
逐单变更
#110 装配尾段收敛(refactor)
assembleMeterProvider(metricExp, res, tp)(init.go):周期读取器 → MeterProvider → runtime.Start + 失败回滚,gRPC(init.go)与 HTTP(otlphttp.go)两分支各剩一行调用;「runtime.Start 必须显式指定 provider」关键注释随实现单点维护applyCommonGrpcOpts泛型帮助函数:grpc 分支 trace/metric 两组逐字复制的 WithEndpoint/WithInsecure/WithHeaders 选项构建收编(Go 1.26 泛型,Option 构造器由调用方注入)#111 recordSpanError 改 errors.Is(fix,gormotel)
switch err { case nil, gorm.ErrRecordNotFound, ... }相等比较 →errors.Is链:包装后的 ErrRecordNotFound 不再被误标 span 失败(此前 APM 上未命中查询全量报红)TestRecordSpanError_WrappedSentinelsStayUnset(nil/裸哨兵/一层包装/多层包装 × 4 哨兵)+TestRecordSpanError_RealErrorStillMarked真错误正向对照(防把报错面一起抹掉)+TestOtelPlugin_FirstMissSpanUnset真实 gorm First 未命中全链路契约钉#112 无 scheme 带路径显式报错(fix,init)
parseOTLPHTTPEndpoint无 scheme 分支遇 "/" 直接报错并提示补 scheme(此前 "collector:4318/api/otel" 被整串当 host:port、basePath 恒空、导出 404 循环——违反本包「不静默断供」纪律)TestParseOTLPHTTPEndpoint_SchemelessPathRejected(基址路径/无端口带路径/尾斜杠三形态)验证
GOWORK=off go test -race ./...全绿;gofmt -l .干净;golangci-lint 2.15.00 issuesgo 1.26.0、ci.yml 已是go-version: '1.26'(job 名不变),无需改动