Skip to content

Commit

Permalink
fix(cloudmon): huawei metric pull (#19235)
Browse files Browse the repository at this point in the history
  • Loading branch information
ioito authored Jan 12, 2024
1 parent 43b0609 commit d1ce2c0
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cmd/climc/shell/compute/cloudregions.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func init() {

Usable *bool `help:"List regions where networks are usable"`
UsableVpc *bool `help:"List regions where VPC are usable"`
Service string `help:"List regions which service has available skus" choices:"dbinstances|servers"`
Service string `help:"List regions which service has available skus" choices:"dbinstances|servers|elasticcaches"`

City string `help:"List regions in the specified city"`

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ require (
k8s.io/client-go v0.19.3
k8s.io/cluster-bootstrap v0.19.3
moul.io/http2curl/v2 v2.3.0
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240111104534-3f329f216a63
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240111122137-2ef550eb6d75
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32
yunion.io/x/jsonutils v1.0.1-0.20230613121553-0f3b41e2ef19
yunion.io/x/log v1.0.1-0.20230411060016-feb3f46ab361
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1201,8 +1201,8 @@ sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240111104534-3f329f216a63 h1:uom1eatMyrMV9eZLmM8enao2vW4zbrt+rrmmpZHajKo=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240111104534-3f329f216a63/go.mod h1:aj1gR9PPb6eqqKOwvANe26CoZFY8ydmXy0fuvgKYXH0=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240111122137-2ef550eb6d75 h1:H1UvouO37Ld/FKNMmDIrxgJkFhAKW1XP0DlGcFKNnfM=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240111122137-2ef550eb6d75/go.mod h1:aj1gR9PPb6eqqKOwvANe26CoZFY8ydmXy0fuvgKYXH0=
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32 h1:v7POYkQwo1XzOxBoIoRVr/k0V9Y5JyjpshlIFa9raug=
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws=
yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634=
Expand Down
2 changes: 2 additions & 0 deletions pkg/cloudmon/providerdriver/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ func (self *SCollectByResourceIdDriver) CollectDBInstanceMetrics(ctx context.Con
EndTime: end,
}
opts.ResourceId = rds.ExternalId
opts.RegionExtId = rds.RegionExtId
opts.Engine = rds.Engine

tags := []influxdb.SKeyValue{}
Expand Down Expand Up @@ -601,6 +602,7 @@ func (self *SCollectByResourceIdDriver) CollectLoadbalancerMetrics(ctx context.C
EndTime: end,
}
opts.ResourceId = lb.ExternalId
opts.RegionExtId = lb.RegionExtId

tags := []influxdb.SKeyValue{}
for k, v := range lb.GetMetricTags() {
Expand Down
1 change: 1 addition & 0 deletions pkg/cloudmon/providerdriver/huawei.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ func (self *HuaweiCollect) CollectModelartsPoolMetrics(ctx context.Context, mana
EndTime: end,
}
opts.ResourceId = pool.ExternalId
opts.RegionExtId = pool.RegionExtId

tags := []influxdb.SKeyValue{}
for k, v := range pool.GetMetricTags() {
Expand Down
1 change: 1 addition & 0 deletions pkg/compute/tasks/dbinstance_account_create_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ func (self *DBInstanceAccountCreateTask) CreateDBInstanceAccount(ctx context.Con
DBInstanceaccountId: account.Id,
DBInstancedatabaseId: privilege.DBInstancedatabaseId,
}
_privilege.ExternalId = fmt.Sprintf("%s/%s/%s", account.Name, privilege.Database, privilege.Privilege)
models.DBInstancePrivilegeManager.TableSpec().Insert(ctx, &_privilege)
logclient.AddActionLogWithStartable(self, account, logclient.ACT_GRANT_PRIVILEGE, privilege, self.UserCred, true)
}
Expand Down
2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1465,7 +1465,7 @@ sigs.k8s.io/structured-merge-diff/v4/value
# sigs.k8s.io/yaml v1.2.0
## explicit; go 1.12
sigs.k8s.io/yaml
# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240111104534-3f329f216a63
# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240111122137-2ef550eb6d75
## explicit; go 1.18
yunion.io/x/cloudmux/pkg/apis
yunion.io/x/cloudmux/pkg/apis/billing
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d1ce2c0

Please sign in to comment.