Skip to content

Commit

Permalink
go runtime report
Browse files Browse the repository at this point in the history
Signed-off-by: bufferflies <[email protected]>
  • Loading branch information
bufferflies committed Dec 17, 2024
1 parent 590b723 commit 44e91e4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ go 1.23
// After the PR to kvproto is merged, remember to comment this out and run `go mod tidy`.
// replace github.com/pingcap/kvproto => github.com/$YourPrivateRepo $YourPrivateBranch

replace (
go.etcd.io/etcd/api/v3 v3.5.15 => github.com/bufferflies/etcd/api/v3 v3.0.0-20241212081845-8abaa0f3653c
go.etcd.io/etcd/client/pkg/v3 v3.5.15 => github.com/bufferflies/etcd/client/pkg/v3 v3.0.0-20241212081845-8abaa0f3653c
go.etcd.io/etcd/client/v3 v3.5.15 => github.com/bufferflies/etcd/client/v3 v3.0.0-20241212081845-8abaa0f3653c
go.etcd.io/etcd/server/v3 v3.5.15 => github.com/bufferflies/etcd/server/v3 v3.0.0-20241212081845-8abaa0f3653c
)
// replace (
// go.etcd.io/etcd/api/v3 v3.5.15 => github.com/bufferflies/etcd/api/v3 v3.0.0-20241212081845-8abaa0f3653c
// go.etcd.io/etcd/client/pkg/v3 v3.5.15 => github.com/bufferflies/etcd/client/pkg/v3 v3.0.0-20241212081845-8abaa0f3653c
// go.etcd.io/etcd/client/v3 v3.5.15 => github.com/bufferflies/etcd/client/v3 v3.0.0-20241212081845-8abaa0f3653c
// go.etcd.io/etcd/server/v3 v3.5.15 => github.com/bufferflies/etcd/server/v3 v3.0.0-20241212081845-8abaa0f3653c
// )

require (
github.com/AlekSi/gocov-xml v1.0.0
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,6 @@ github.com/breeswish/gin-jwt/v2 v2.6.4-jwt-patch h1:KLE/YeX+9FNaGVW5MtImRVPhjDpf
github.com/breeswish/gin-jwt/v2 v2.6.4-jwt-patch/go.mod h1:KjBLriHXe7L6fGceqWzTod8HUB/TP1WWDtfuSYtYXaI=
github.com/brianvoe/gofakeit/v6 v6.26.3 h1:3ljYrjPwsUNAUFdUIr2jVg5EhKdcke/ZLop7uVg1Er8=
github.com/brianvoe/gofakeit/v6 v6.26.3/go.mod h1:Xj58BMSnFqcn/fAQeSK+/PLtC5kSb7FJIq4JyGa8vEs=
github.com/bufferflies/etcd/api/v3 v3.0.0-20241212081845-8abaa0f3653c h1:+HZIYqZIDwW35R6OpCFfcGw+AQ1EftPSHGlblcJ//6o=
github.com/bufferflies/etcd/api/v3 v3.0.0-20241212081845-8abaa0f3653c/go.mod h1:N9EhGzXq58WuMllgH9ZvnEr7SI9pS0k0+DHZezGp7jM=
github.com/bufferflies/etcd/client/pkg/v3 v3.0.0-20241212081845-8abaa0f3653c h1:v72FYOeZyQa0iTFnxCi/+Rrby4ywUeZ51CWQ1RKBsNE=
github.com/bufferflies/etcd/client/pkg/v3 v3.0.0-20241212081845-8abaa0f3653c/go.mod h1:mXDI4NAOwEiszrHCb0aqfAYNCrZP4e9hRca3d1YK8EU=
github.com/bufferflies/etcd/client/v3 v3.0.0-20241212081845-8abaa0f3653c h1:VG2BEUEYmvrLg+uxFvSI0hQQYmYhjgedrtQno7EbgM4=
github.com/bufferflies/etcd/client/v3 v3.0.0-20241212081845-8abaa0f3653c/go.mod h1:AsFkAsmF41bC+AWhu3gb6gfjmH71Xs1vFeczgmmNIEw=
github.com/bufferflies/etcd/server/v3 v3.0.0-20241212081845-8abaa0f3653c h1:9HEcX/0OiBips5eTvfLWNW7ZpUqV4KE+YMhd0HT6bV4=
github.com/bufferflies/etcd/server/v3 v3.0.0-20241212081845-8abaa0f3653c/go.mod h1:Sc2Dd/qhh47CkMpXhGEwDqpa6w4Vg68tVV9kJDGP5WQ=
github.com/bytedance/sonic v1.11.6 h1:oUp34TzMlL+OY1OUWxHqsdkgC/Zfc85zGqw9siXjrc0=
github.com/bytedance/sonic v1.11.6/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4=
github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM=
Expand Down Expand Up @@ -553,12 +545,20 @@ github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPR
github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
go.etcd.io/bbolt v1.3.10 h1:+BqfJTcCzTItrop8mq/lbzL8wSGtj94UO/3U31shqG0=
go.etcd.io/bbolt v1.3.10/go.mod h1:bK3UQLPJZly7IlNmV7uVHJDxfe5aK9Ll93e/74Y9oEQ=
go.etcd.io/etcd/api/v3 v3.5.15 h1:3KpLJir1ZEBrYuV2v+Twaa/e2MdDCEZ/70H+lzEiwsk=
go.etcd.io/etcd/api/v3 v3.5.15/go.mod h1:N9EhGzXq58WuMllgH9ZvnEr7SI9pS0k0+DHZezGp7jM=
go.etcd.io/etcd/client/pkg/v3 v3.5.15 h1:fo0HpWz/KlHGMCC+YejpiCmyWDEuIpnTDzpJLB5fWlA=
go.etcd.io/etcd/client/pkg/v3 v3.5.15/go.mod h1:mXDI4NAOwEiszrHCb0aqfAYNCrZP4e9hRca3d1YK8EU=
go.etcd.io/etcd/client/v2 v2.305.15 h1:VG2xbf8Vz1KJh65Ar2V5eDmfkp1bpzkSEHlhJM3usp8=
go.etcd.io/etcd/client/v2 v2.305.15/go.mod h1:Ad5dRjPVb/n5yXgAWQ/hXzuXXkBk0Y658ocuXYaUU48=
go.etcd.io/etcd/client/v3 v3.5.15 h1:23M0eY4Fd/inNv1ZfU3AxrbbOdW79r9V9Rl62Nm6ip4=
go.etcd.io/etcd/client/v3 v3.5.15/go.mod h1:CLSJxrYjvLtHsrPKsy7LmZEE+DK2ktfd2bN4RhBMwlU=
go.etcd.io/etcd/pkg/v3 v3.5.15 h1:/Iu6Sr3iYaAjy++8sIDoZW9/EfhcwLZwd4FOZX2mMOU=
go.etcd.io/etcd/pkg/v3 v3.5.15/go.mod h1:e3Acf298sPFmTCGTrnGvkClEw9RYIyPtNzi1XM8rets=
go.etcd.io/etcd/raft/v3 v3.5.15 h1:jOA2HJF7zb3wy8H/pL13e8geWqkEa/kUs0waUggZC0I=
go.etcd.io/etcd/raft/v3 v3.5.15/go.mod h1:k3r7P4seEiUcgxOPLp+mloJWV3Q4QLPGNvy/OgC8OtM=
go.etcd.io/etcd/server/v3 v3.5.15 h1:x35jrWnZgsRwMsFsUJIUdT1bvzIz1B+29HjMfRYVN/E=
go.etcd.io/etcd/server/v3 v3.5.15/go.mod h1:l9jX9oa/iuArjqz0RNX/TDbc70dLXxRZo/nmPucrpFo=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 h1:PzIubN4/sjByhDRHLviCjJuweBXWFZWhghjg7cS28+M=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0/go.mod h1:Ct6zzQEuGK3WpJs2n4dn+wfJYzd/+hNnxMRTWjGn30M=
go.opentelemetry.io/otel v1.20.0 h1:vsb/ggIY+hUjD/zCAQHpzTmndPqv/ml2ArbsbfBYTAc=
Expand Down
8 changes: 7 additions & 1 deletion pkg/basicserver/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@

package server

import "github.com/prometheus/client_golang/prometheus"
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/collectors"
)

var (
// ServerMaxProcsGauge records the maxprocs.
Expand Down Expand Up @@ -46,6 +49,9 @@ var (
)

func init() {
prometheus.DefaultRegisterer.Unregister(collectors.NewGoCollector())
prometheus.MustRegister(collectors.NewGoCollector(collectors.WithGoCollectorRuntimeMetrics(collectors.MetricsGC, collectors.MetricsMemory, collectors.MetricsScheduler)))

prometheus.MustRegister(ServerMaxProcsGauge)
prometheus.MustRegister(ServerMemoryLimit)
prometheus.MustRegister(ServerInfoGauge)
Expand Down

0 comments on commit 44e91e4

Please sign in to comment.