Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Update the Aliyun Metrics Exporter functionality #15238

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions plugins/inputs/aliyuncms/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
"github.com/aliyun/alibaba-cloud-sdk-go/services/polardb"
"github.com/aliyun/alibaba-cloud-sdk-go/services/rds"
"github.com/aliyun/alibaba-cloud-sdk-go/services/slb"
"github.com/aliyun/alibaba-cloud-sdk-go/services/vpc"
Expand Down Expand Up @@ -122,6 +123,7 @@ func newDiscoveryTool(
responseRootKey = "Instances"
responseObjectIDKey = "InstanceId"
case "acs_rds_dashboard":
//rds.CreateDescribeDBInstancePerformanceRequest()
dscReq[region] = rds.CreateDescribeDBInstancesRequest()
responseRootKey = "Items"
responseObjectIDKey = "DBInstanceId"
Expand All @@ -142,13 +144,15 @@ func newDiscoveryTool(
responseObjectIDKey = "AllocationId"
case "acs_kvstore":
return nil, noDiscoverySupportErr
case "acs_mns_new":
case "acsgit new":
return nil, noDiscoverySupportErr
case "acs_cdn":
//API replies are in its own format.
return nil, noDiscoverySupportErr
case "acs_polardb":
return nil, noDiscoverySupportErr
dscReq[region] = polardb.CreateDescribeDBNodePerformanceRequest()
responseRootKey = "Items"
responseObjectIDKey = "DBInstanceId"
case "acs_gdb":
return nil, noDiscoverySupportErr
case "acs_ads":
Expand Down Expand Up @@ -384,6 +388,9 @@ func (dt *discoveryTool) getDiscoveryDataAcrossRegions(lmtr chan bool) (map[stri

//Get discovery data using common request
data, err = dt.getDiscoveryData(cli, commonRequest, lmtr)

dt.lg.Infof("RESULT: %+v | ERROR: %+v", data, err)
//DBInstanceDescription
if err != nil {
return nil, err
}
Expand All @@ -392,6 +399,8 @@ func (dt *discoveryTool) getDiscoveryDataAcrossRegions(lmtr chan bool) (map[stri
resultData[k] = v
}
}
dt.lg.Infof("RESULT 1: %+v", resultData)

return resultData, nil
}

Expand Down
1 change: 1 addition & 0 deletions plugins/inputs/aliyuncms/sample.conf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
## - acs_rds_dashboard
## - acs_slb_dashboard
## - acs_vpc_eip
## - acs_polardb
regions = ["cn-hongkong"]

## Requested AliyunCMS aggregation Period (required)
Expand Down
Loading