-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from juexiaolin/master
v2.1版本发布
- Loading branch information
Showing
28 changed files
with
197 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
credential: | ||
access_key: "access_key" | ||
secret_key: "secret_key" | ||
region: "region" | ||
|
||
rate_limit: 15 #云监控拉数据接口最大限制, 20/秒, 1200/分钟, https://cloud.tencent.com/document/product/248/31014 | ||
|
||
products: | ||
- namespace: QCE/LOADBALANCE #指标详情: https://cloud.tencent.com/document/product/248/45045 | ||
all_metrics: true | ||
all_instances: true | ||
#only_include_metrics: [] | ||
#only_include_instances: [lb-xxxxxxxx] | ||
#extra_labels: [InstanceName] | ||
#statistics_types: [last] | ||
#period_seconds: 60 | ||
#metric_name_type: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package collector | ||
|
||
import ( | ||
"github.com/go-kit/kit/log" | ||
"github.com/tencentyun/tencentcloud-exporter/pkg/metric" | ||
"github.com/tencentyun/tencentcloud-exporter/pkg/util" | ||
"strings" | ||
) | ||
|
||
const ( | ||
Clb7Namespace = "QCE/LOADBALANCE" | ||
Clb7InstanceidKey = "vip" | ||
) | ||
|
||
var ( | ||
Clb7ExcludeMetrics = []string{ | ||
"outpkgratio", | ||
"intrafficratio", | ||
"inpkgratio", | ||
"qpsratio", | ||
"activeconnratio", | ||
"newactiveconnratio", | ||
"outtrafficratio", | ||
} | ||
) | ||
|
||
func init() { | ||
registerHandler(Clb7Namespace, defaultHandlerEnabled, NewClb7Handler) | ||
} | ||
|
||
type clb7Handler struct { | ||
baseProductHandler | ||
} | ||
|
||
func (h *clb7Handler) CheckMetricMeta(meta *metric.TcmMeta) bool { | ||
meta.SupportDimensions = append(meta.SupportDimensions, "vip") | ||
return true | ||
} | ||
|
||
func (h *clb7Handler) GetNamespace() string { | ||
return Clb7Namespace | ||
} | ||
|
||
func (h *clb7Handler) IsIncludeMetric(m *metric.TcmMetric) bool { | ||
if util.IsStrInList(Clb7ExcludeMetrics, strings.ToLower(m.Meta.MetricName)) { | ||
return false | ||
} | ||
return true | ||
} | ||
|
||
func NewClb7Handler(c *TcProductCollector, logger log.Logger) (handler productHandler, err error) { | ||
handler = &clb7Handler{ | ||
baseProductHandler{ | ||
monitorQueryKey: Clb7InstanceidKey, | ||
collector: c, | ||
logger: logger, | ||
}, | ||
} | ||
return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.