This commit is contained in:
withchao 2025-02-13 17:34:05 +08:00
parent 16e324ff3d
commit de3f3d0f9b
4 changed files with 6 additions and 7 deletions

5
go.mod
View File

@ -13,7 +13,7 @@ require (
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/mitchellh/mapstructure v1.5.0
github.com/openimsdk/protocol v0.0.72-alpha.71
github.com/openimsdk/tools v0.0.50-alpha.70
github.com/openimsdk/tools v0.0.50-alpha.73
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.18.0
github.com/stretchr/testify v1.9.0
@ -220,5 +220,4 @@ require (
gopkg.in/ini.v1 v1.67.0 // indirect
)
//replace github.com/openimsdk/tools => github.com/withchao/tools v0.0.50-alpha.38.0.20250207092500-cc9b95a0cdcc
replace github.com/openimsdk/tools => /Users/chao/Desktop/code/tools
//replace github.com/openimsdk/tools => /Users/chao/Desktop/code/tools

4
go.sum
View File

@ -349,6 +349,8 @@ github.com/openimsdk/gomake v0.0.15-alpha.2 h1:5Q8yl8ezy2yx+q8/ucU/t4kJnDfCzNOrk
github.com/openimsdk/gomake v0.0.15-alpha.2/go.mod h1:PndCozNc2IsQIciyn9mvEblYWZwJmAI+06z94EY+csI=
github.com/openimsdk/protocol v0.0.72-alpha.71 h1:R3utzOlqepaJWTAmnfJi4ccUM/XIoFasSyjQMOipM70=
github.com/openimsdk/protocol v0.0.72-alpha.71/go.mod h1:WF7EuE55vQvpyUAzDXcqg+B+446xQyEba0X35lTINmw=
github.com/openimsdk/tools v0.0.50-alpha.73 h1:zZg5mj41oYm2auk7gh1bXVfkB+kkLu7jMylikE/bIJw=
github.com/openimsdk/tools v0.0.50-alpha.73/go.mod h1:n2poR3asX1e1XZce4O+MOWAp+X02QJRFvhcLCXZdzRo=
github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM=
github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs=
github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ=
@ -434,8 +436,6 @@ github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE=
github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
github.com/withchao/tools v0.0.50-alpha.38.0.20250207092500-cc9b95a0cdcc h1:kdDl/Jz6j3E0wsh30xD0BGAj8SgiEBtDE7FS0FaZk0c=
github.com/withchao/tools v0.0.50-alpha.38.0.20250207092500-cc9b95a0cdcc/go.mod h1:n2poR3asX1e1XZce4O+MOWAp+X02QJRFvhcLCXZdzRo=
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=

View File

@ -34,7 +34,7 @@ func NewPrometheusDiscoveryApi(config *Config, client discovery.Conn) *Prometheu
func (p *PrometheusDiscoveryApi) discovery(c *gin.Context, key string) {
value, err := p.kv.GetKey(c, prommetrics.BuildDiscoveryKey(key))
if err != nil {
if errors.Is(err, discovery.ErrNotSupported) {
if errors.Is(err, discovery.ErrNotSupportedKeyValue) {
c.JSON(http.StatusOK, []struct{}{})
return
}

View File

@ -124,7 +124,7 @@ func Start[T any](ctx context.Context, disc *conf.Discovery, prometheusConfig *c
return err
}
if err := client.SetKey(ctx, prommetrics.BuildDiscoveryKey(prommetrics.APIKeyName), target); err != nil {
if !errors.Is(err, discovery.ErrNotSupported) {
if !errors.Is(err, discovery.ErrNotSupportedKeyValue) {
return err
}
}