Skip to content

Commit 6d51830

Browse files
author
yangyile
committed
Bump from go1.22.8 to go1.23.0
1 parent 9c76617 commit 6d51830

File tree

5 files changed

+62
-54
lines changed

5 files changed

+62
-54
lines changed

apm.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ import (
99
"go.uber.org/zap"
1010
)
1111

12-
// Initialize 初始化全局的APM,需要校验 agentVersion 是因为有可能系统里是 2.0.0 而新项目用的是 2.0.1 的,或者总之就是出现版本不匹配的情况
12+
// Initialize 初始化全局的APM,使用的是 "go.elastic.co/apm/v2" 而非旧版的 ""go.elastic.co/apm" 依赖
1313
func Initialize(cfg *Config) error {
1414
if err := InitializeWithOptions(cfg, NewEnvOption()); err != nil {
1515
return erero.Wro(err)
1616
}
1717
zaplog.LOG.Debug("Initialize apm success")
1818
//设置日志
19-
apm.DefaultTracer().SetLogger(apmzaplog.NewLog(zaplog.ZAPS.Skip1.SUG))
19+
apm.DefaultTracer().SetLogger(apmzaplog.NewLog())
2020
return nil
2121
}
2222

apmzaplog/apmzaplog.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
package apmzaplog
22

3-
import "go.uber.org/zap"
3+
import (
4+
"github.com/yyle88/zaplog"
5+
)
46

5-
type Log struct {
6-
sugaredLogger *zap.SugaredLogger
7-
}
7+
type Log struct{}
88

9-
func NewLog(sugaredLogger *zap.SugaredLogger) *Log {
10-
return &Log{sugaredLogger: sugaredLogger}
9+
func NewLog() *Log {
10+
return &Log{}
1111
}
1212

1313
func (o *Log) Debugf(format string, args ...interface{}) {
14-
o.sugaredLogger.Debugf(format, args...)
14+
zaplog.ZAPS.Skip(1).SUG.Debugf(format, args...)
1515
}
1616

1717
func (o *Log) Errorf(format string, args ...interface{}) {
18-
o.sugaredLogger.Errorf(format, args...)
18+
zaplog.ZAPS.Skip(1).SUG.Errorf(format, args...)
1919
}
2020

2121
func (o *Log) Warningf(format string, args ...interface{}) {
22-
o.sugaredLogger.Warnf(format, args...)
22+
zaplog.ZAPS.Skip(1).SUG.Warnf(format, args...)
2323
}

apmzaplog/apmzaplog_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,11 @@ import (
77
func TestMain(m *testing.M) {
88
m.Run()
99
}
10+
11+
func TestNewLog(t *testing.T) {
12+
log := NewLog()
13+
a, b, c := 100, 200, 300
14+
log.Debugf("message a=%v b=%v c=%v", a, b, c)
15+
log.Errorf("message a=%v b=%v c=%v", a, b, c)
16+
log.Warningf("message a=%v b=%v c=%v", a, b, c)
17+
}

go.mod

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
module github.com/go-xlan/elasticapm
22

3-
go 1.22.8
3+
go 1.23.0
44

55
require (
66
github.com/stretchr/testify v1.10.0
7-
github.com/yyle88/erero v1.0.20
8-
github.com/yyle88/must v0.0.22
7+
github.com/yyle88/erero v1.0.23
8+
github.com/yyle88/must v0.0.25
99
github.com/yyle88/neatjson v0.0.12
10-
github.com/yyle88/zaplog v0.0.22
11-
go.elastic.co/apm/module/apmhttp/v2 v2.6.3
12-
go.elastic.co/apm/v2 v2.6.3
10+
github.com/yyle88/zaplog v0.0.25
11+
go.elastic.co/apm/module/apmhttp/v2 v2.7.1
12+
go.elastic.co/apm/v2 v2.7.1
1313
go.uber.org/zap v1.27.0
14-
google.golang.org/grpc v1.71.1
14+
google.golang.org/grpc v1.73.0
1515
)
1616

1717
require (
1818
github.com/armon/go-radix v1.0.0 // indirect
1919
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
20-
github.com/elastic/go-sysinfo v1.15.0 // indirect
20+
github.com/elastic/go-sysinfo v1.15.3 // indirect
2121
github.com/elastic/go-windows v1.0.2 // indirect
2222
github.com/pkg/errors v0.9.1 // indirect
2323
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
24-
github.com/prometheus/procfs v0.15.1 // indirect
25-
github.com/yyle88/done v1.0.25 // indirect
24+
github.com/prometheus/procfs v0.16.1 // indirect
25+
github.com/yyle88/done v1.0.26 // indirect
2626
github.com/yyle88/mutexmap v1.0.13 // indirect
2727
github.com/yyle88/sure v0.0.38 // indirect
28-
github.com/yyle88/syntaxgo v0.0.48 // indirect
28+
github.com/yyle88/syntaxgo v0.0.53 // indirect
2929
github.com/yyle88/tern v0.0.8 // indirect
30-
go.elastic.co/fastjson v1.4.0 // indirect
30+
go.elastic.co/fastjson v1.5.1 // indirect
3131
go.uber.org/multierr v1.11.0 // indirect
32-
golang.org/x/sys v0.30.0 // indirect
32+
golang.org/x/sys v0.33.0 // indirect
3333
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
3434
gopkg.in/yaml.v3 v3.0.1 // indirect
3535
howett.net/plist v1.0.1 // indirect

go.sum

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI=
22
github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
33
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
44
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
5-
github.com/elastic/go-sysinfo v1.15.0 h1:54pRFlAYUlVNQ2HbXzLVZlV+fxS7Eax49stzg95M4Xw=
6-
github.com/elastic/go-sysinfo v1.15.0/go.mod h1:jPSuTgXG+dhhh0GKIyI2Cso+w5lPJ5PvVqKlL8LV/Hk=
5+
github.com/elastic/go-sysinfo v1.15.3 h1:W+RnmhKFkqPTCRoFq2VCTmsT4p/fwpo+3gKNQsn1XU0=
6+
github.com/elastic/go-sysinfo v1.15.3/go.mod h1:K/cNrqYTDrSoMh2oDkYEMS2+a72GRxMvNP+GC+vRIlo=
77
github.com/elastic/go-windows v1.0.2 h1:yoLLsAsV5cfg9FLhZ9EXZ2n2sQFKeDYrHenkcivY4vI=
88
github.com/elastic/go-windows v1.0.2/go.mod h1:bGcDpBzXgYSqM0Gx3DM4+UxFj300SZLixie9u9ixLM8=
9-
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
10-
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
9+
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
10+
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
1111
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
1212
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
1313
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
@@ -17,44 +17,44 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
1717
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
1818
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
1919
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
20-
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
21-
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
20+
github.com/prometheus/procfs v0.16.1 h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzMyRg=
21+
github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is=
2222
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
2323
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
2424
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
2525
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
26-
github.com/yyle88/done v1.0.25 h1:zBOFbByEybPited1OZcF+VMaZF5lSTueBgGeTCLH6XA=
27-
github.com/yyle88/done v1.0.25/go.mod h1:ATFPtqXx5TgRuk0abvGQivAA1yupqKAq6gogUNBYb4s=
28-
github.com/yyle88/erero v1.0.20 h1:S561vG3urdQ1pM6Se2/x8OQicrmVxnlWe9J7rC+WPvU=
29-
github.com/yyle88/erero v1.0.20/go.mod h1:nbNNXS09v4YZop/nYswXuxvnga874h6tjYOcDGYKKuA=
26+
github.com/yyle88/done v1.0.26 h1:lncTfGVFZWDV+ni9kgJWXjwl9qryVrX5xBYKW1Os1yg=
27+
github.com/yyle88/done v1.0.26/go.mod h1:Y/QHJS7guYtGMnbar4SHXGUtwUqckomTmRBaCcwW/y4=
28+
github.com/yyle88/erero v1.0.23 h1:AY5grHGm+CgwCzPjn60LT7APCLSCuaHhWu2uOle6Nk0=
29+
github.com/yyle88/erero v1.0.23/go.mod h1:ZbUp//iNppPtn4yxilmlJHbpZ5U2ycipje6/SkMYHo4=
3030
github.com/yyle88/formatgo v1.0.23 h1:RrLxVGbv2aLbkfjpm97YYOpxD8fdTC1CwkggdNlRCFU=
3131
github.com/yyle88/formatgo v1.0.23/go.mod h1:I0yhAaSqWiIjBe98wL+rzgepj3F8GWYF8He+VWneQ2Q=
32-
github.com/yyle88/must v0.0.22 h1:Ay5TkDOWWsPmvTy8HpzNs0YoymsBgGuljivEMB4lrdE=
33-
github.com/yyle88/must v0.0.22/go.mod h1:grBswgDZIpUOjs4ujCj0WXMGVOU/fL9xjMS3D50pfaU=
32+
github.com/yyle88/must v0.0.25 h1:SF1wAYNTfupFNfnXJcnizLZAJtCUCJf2dUVY/9nvtUQ=
33+
github.com/yyle88/must v0.0.25/go.mod h1:SE9pZwrZLt8+wnWJJEAve5QKOm8rz3lSxokUxGGgemo=
3434
github.com/yyle88/mutexmap v1.0.13 h1:wp/6mv/gsC2DSqNbhMYiil4gtnb0sDCIhHHIHK2h0cQ=
3535
github.com/yyle88/mutexmap v1.0.13/go.mod h1:QUYDuARLPlGj414kHewQ5tt8jkDxQXoai8H3C4Gg+yc=
3636
github.com/yyle88/neatjson v0.0.12 h1:M6y4IsHbe2/3drF/kDl3zBpaN29lmfW4MetEQcoG04A=
3737
github.com/yyle88/neatjson v0.0.12/go.mod h1:LT3nIhKyB3lkD3INiIXCN3FejNu+g+qvzCJ+fZSZaRc=
3838
github.com/yyle88/printgo v1.0.5 h1:gmaJKzEkrH6adbgfOfS6xq02CdvsE8QF+uKXXOdVLN8=
3939
github.com/yyle88/printgo v1.0.5/go.mod h1:QZZD92Orn8ddmxF5IOEFvLPPW66UIQtgoLixPdpXuQc=
40-
github.com/yyle88/rese v0.0.8 h1:IdLs2VCnMuIraZvOHrJwCfbAr/BRqkQWNIM4/mMQ/ao=
41-
github.com/yyle88/rese v0.0.8/go.mod h1:DQ4kEu01G51q6McosiptvlC66JSQFAbMXau/+xg3dIc=
40+
github.com/yyle88/rese v0.0.10 h1:rMEcybaIe/CNVMmilgor3nMQWB4TcJgXRttvDjKtvLg=
41+
github.com/yyle88/rese v0.0.10/go.mod h1:2jCdwu7qpJDdZqVulM4+zz/qiSxJWbOK/ndzQhg+5G0=
4242
github.com/yyle88/runpath v1.0.23 h1:VEdeaMXfvFY7CuF9Nceuxb6HSNDcmiSSGEf+zT7O900=
4343
github.com/yyle88/runpath v1.0.23/go.mod h1:JRGxn/0Ytg6CvGoE2VrO74oX8Lu4jbOPZDKxr8tzPEg=
4444
github.com/yyle88/sure v0.0.38 h1:+yw3++UKizkh7JsBtoZKH6jC2K1Jr4Z2U088zYBLJ/w=
4545
github.com/yyle88/sure v0.0.38/go.mod h1:zkSgOlFeW4xETRZNoR0GZ2v/q7wxnlHl3dxI4f4tftI=
46-
github.com/yyle88/syntaxgo v0.0.48 h1:JbyUnpq1pnf/hXgkfQ65bGMzJh/EVOvkXR7TtqjcpgQ=
47-
github.com/yyle88/syntaxgo v0.0.48/go.mod h1:Zx2vsDL+025u78thQwDqM6z33t7/czEuRAOzRvVsGxk=
46+
github.com/yyle88/syntaxgo v0.0.53 h1:3W4S5ncRdq3hUp3Qjw4GqB+mAxypJCycMo/mMJP+1vc=
47+
github.com/yyle88/syntaxgo v0.0.53/go.mod h1:68EidTlDxVi/iaCJeg0menpA4v/xbq+ITxa1aKdmjLo=
4848
github.com/yyle88/tern v0.0.8 h1:Qn6dpYNbYA8bhPX/SjQHnML0MIoKScGNRgGH+VFox1U=
4949
github.com/yyle88/tern v0.0.8/go.mod h1:g9weyOMLtXYyt37EAshZPUTTHdH7WFauuxDi4oPr7/8=
50-
github.com/yyle88/zaplog v0.0.22 h1:hozMmQ0bhXLS6bkR3yHwW5cH8YelK09Df3lhy1k3iMM=
51-
github.com/yyle88/zaplog v0.0.22/go.mod h1:lOdA2Ju4Alify777G8AvdZVqfCPUEpkWjsLgEOkVfS4=
52-
go.elastic.co/apm/module/apmhttp/v2 v2.6.3 h1:jwFovJZkccySKCyy2oE9ZKvUry/a4gdQHF/MtZUQVtE=
53-
go.elastic.co/apm/module/apmhttp/v2 v2.6.3/go.mod h1:w94Gkk6uzI/K+eJYKDLB66tvWC5uK0fSHyWcyX2jPlQ=
54-
go.elastic.co/apm/v2 v2.6.3 h1:yVKFPLnmHOxpzLMGd3aexcik20ziXmRHqgcn9NZn/VU=
55-
go.elastic.co/apm/v2 v2.6.3/go.mod h1:33rOXgtHwbgZcDgi6I/GtCSMZQqgxkHC0IQT3gudKvo=
56-
go.elastic.co/fastjson v1.4.0 h1:a4BXUKXZHAzjVOPrqtEx2FDsIRBCMek01vCnrtyutWs=
57-
go.elastic.co/fastjson v1.4.0/go.mod h1:ZD5um63l0/8TIdddZbL2znD83FAr2IckYa3KR7VcdNA=
50+
github.com/yyle88/zaplog v0.0.25 h1:9cXJUQ4/EVyk0PjTYoe3SXjW5LS7gPNwGemHjujyGcE=
51+
github.com/yyle88/zaplog v0.0.25/go.mod h1:3eaCIi66BgCHh5IIbHlvuRWJPXz89m/EDPfqLe7p6Us=
52+
go.elastic.co/apm/module/apmhttp/v2 v2.7.1 h1:1uPHesdm9nKytQ/N0bPmlS7F69oXvkzW+IlvzQuDUs8=
53+
go.elastic.co/apm/module/apmhttp/v2 v2.7.1/go.mod h1:DlBnNivf+eArsEI1QtUx7fygo/JDbdMIcU9+i/Wid1U=
54+
go.elastic.co/apm/v2 v2.7.1 h1:OFjARuESjBsxw7wHrEAnfSVNCHGBATXSI/kPvBARY/A=
55+
go.elastic.co/apm/v2 v2.7.1/go.mod h1:tQhBAjwh93b2leuAdzGwta/sP7Yc7QoKTSjeIHHDuog=
56+
go.elastic.co/fastjson v1.5.1 h1:zeh1xHrFH79aQ6Xsw7YxixvnOdAl3OSv0xch/jRDzko=
57+
go.elastic.co/fastjson v1.5.1/go.mod h1:WtvH5wz8z9pDOPqNYSYKoLLv/9zCWZLeejHWuvdL/EM=
5858
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
5959
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
6060
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
@@ -65,14 +65,14 @@ golang.org/x/exp v0.0.0-20250210185358-939b2ce775ac h1:l5+whBCLH3iH2ZNHYLbAe58bo
6565
golang.org/x/exp v0.0.0-20250210185358-939b2ce775ac/go.mod h1:hH+7mtFmImwwcMvScyxUhjuVHR3HGaDPMn9rMSUUbxo=
6666
golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM=
6767
golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
68-
golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
69-
golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
70-
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
71-
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
68+
golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610=
69+
golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
70+
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
71+
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
7272
golang.org/x/tools v0.30.0 h1:BgcpHewrV5AUp2G9MebG4XPFI1E2W41zU1SaqVA9vJY=
7373
golang.org/x/tools v0.30.0/go.mod h1:c347cR/OJfw5TI+GfX7RUPNMdDRRbjvYTS0jPyvsVtY=
74-
google.golang.org/grpc v1.71.1 h1:ffsFWr7ygTUscGPI0KKK6TLrGz0476KUvvsbqWK0rPI=
75-
google.golang.org/grpc v1.71.1/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec=
74+
google.golang.org/grpc v1.73.0 h1:VIWSmpI2MegBtTuFt5/JWy2oXxtjJ/e89Z70ImfD2ok=
75+
google.golang.org/grpc v1.73.0/go.mod h1:50sbHOUqWoCQGI8V2HQLJM0B+LMlIUjNSZmow7EVBQc=
7676
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
7777
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
7878
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=

0 commit comments

Comments
 (0)