Skip to content

Commit

Permalink
add dsa support
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoQuote committed Sep 18, 2023
1 parent 15300d6 commit 13e66e8
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 21 deletions.
5 changes: 3 additions & 2 deletions cmd/qcloud-exporter/qcloud_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"fmt"
"github.com/prometheus/client_golang/prometheus/collectors"
"net/http"
"os"
"time"
Expand All @@ -28,8 +29,8 @@ func newHandler(cred common.CredentialIface, c *config.TencentConfig,
exporterMetricsRegistry := prometheus.NewRegistry()
if includeExporterMetrics {
exporterMetricsRegistry.MustRegister(
prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{}),
prometheus.NewGoCollector(),
collectors.NewProcessCollector(collectors.ProcessCollectorOpts{}),
collectors.NewGoCollector(),
)
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require (
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka v1.0.334
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.334
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cmq v1.0.334
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.634
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.750
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.334
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cynosdb v1.0.413
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dc v1.0.334
Expand Down
20 changes: 4 additions & 16 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,6 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/tencentcloud/tencentcloud-sdk-go v1.0.485 h1:l1xeZUO2ddcouOpxO7dhkXcmcYembuCG5EZ6O+Cox/o=
github.com/tencentcloud/tencentcloud-sdk-go v1.0.528 h1:6HidDboNfqxPVD6/hSgK4vcw3B/sNLHi8ysAAj70Bsc=
github.com/tencentcloud/tencentcloud-sdk-go v1.0.532 h1:8AmaxcmnFwH5HTcmE9suGsI2CROtiVkNQvot64Y+gv0=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cbs v1.0.334 h1:GijOjoDBcWXtra6hmzpj4IXOahWmsTE3bwpOcp5VBDw=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cbs v1.0.334/go.mod h1:PTp058qpOV//RukBVdYQT962rZg71lIt6eHLK1zdvEc=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdb v1.0.413 h1:6cQPfHc3I1pKUj23csRd9P/xxUPcnGRLRK2e5NGqtzc=
Expand All @@ -231,20 +228,13 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cmq v1.0.334/go.mod h1:
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.194/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.413/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.430/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.437 h1:Qa0q6mhOkQ/0RoAqOheJAzPFksAf3jsjOZVt4FGcvyQ=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.437/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.479 h1:3kwDb6p1J3LxmwnNgSSEheemPffo+vMewoDzKysYdig=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.479/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.528 h1:ECUVFkluily8Cr0VHzcKmC0M7PLNqEOkoKoS5DukSmA=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.528/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.531 h1:E8vq0WQBjB3jjtCK3u5DPrWGqlgyQUvQ19EkgBob1A8=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.531/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.534 h1:ZsJCXIZO2KfmEsrVN6a75VncTuaSkD4PNd1iXZ1I8BU=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.534/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.576 h1:6L4MeAnCk1NkuKoSfJvNPxqOrXq/HG9FqV3jl6i5t+w=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.576/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.634 h1:xSW5zhVEl+Lp7gJ9Bah1XUAzpGdLB1JrcFmJ+r16RJw=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.634/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.750 h1:zATJQLrw+i0NRosWvoAZ4FM+GbloqovVJGxLCdcjr/w=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.750/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.334 h1:ulfSODMy8rpKa8MfnTIPbe5HyOArnlB4RJ1qmpj09to=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.334/go.mod h1:AqyM/ZZMD7q5mHBqNY9YImbSpEpoEe7E/vrTbUWX+po=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cynosdb v1.0.413 h1:MomwSkFrSLB16s51Yu1h4JO+p3Pzc1yesIj+oNwAVM0=
Expand All @@ -253,16 +243,14 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dc v1.0.334 h1:inkOmQwx
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dc v1.0.334/go.mod h1:5WGSrlIZJOhwIqPjjafb6vzrPEZieSHPhPMjjGPXOSU=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dcdb v1.0.334 h1:Xxe889sr1FVhUPPFdZC4Z5IyJObgnGh0ELe+MJH17Mo=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dcdb v1.0.334/go.mod h1:uvcrduqH3pPyyZoZyEX0WXlXIR554ys3ctSsKoeJp64=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dts v1.0.479 h1:Tuo8zLhHaO+AxHlk7WOYGs6j/3bfD3FMNB3fWAgIxWM=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dts v1.0.479/go.mod h1:CNPxkXeOC/vOmu9a/yaxp+2immIjDL/WsGC/H2rcWQA=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dts v1.0.531 h1:U0diLtuiEK8RDjfEh7X/BKetd+OppXWvoCW3CFJCMKE=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dts v1.0.531/go.mod h1:Mwk3VuBuWg6d2JtT5pKXKfNKxYRH1mrWquMcTVZQ7gc=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ecdn v1.0.750 h1:yzja0ZT7+yciVCEgmy7Zsx8lEjTWXtU6KZL+uHuVUXE=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ecdn v1.0.750/go.mod h1:S6u2ljeAetJAa/lFQVQZAvVJWJSNK7V5e6QPqj4LqA0=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/es v1.0.334 h1:oXOMQ2EmNjqMfpShQeCrWS5QH2MwrAhJfd0rLJOxccE=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/es v1.0.334/go.mod h1:UegCt4vv9jAlzpgDu31ZJTuRP5T2BTV8w+jZBTsZIzg=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/gaap v1.0.528 h1:CS8HIQNpfYQogrPR/WEFdVNJX6GIOwDyBzn1IHMb46g=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/gaap v1.0.528/go.mod h1:J+xFyeGmSCp0x4tXPu5mlAhg2BAYQPIy3fQ4afy26tI=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/gaap v1.0.534 h1:E/ccMQB7Il/U6Da5jrS4YUxpEZhVatageVdny+xAoMk=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/gaap v1.0.534/go.mod h1:MNvt4sQeoetKfp8y3Y1iKv4aR+P7Z5khZX5QXG31ULA=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/kms v1.0.194/go.mod h1:yrBKWhChnDqNz1xuXdSbWXG56XawEq0G5j1lg4VwBD4=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/lighthouse v1.0.334 h1:druwbDkTAvVwEGW4nHVuTuOX0bjk1CtLUDiC3r4gmgY=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/lighthouse v1.0.334/go.mod h1:r8txjlw4DjLDZFOpnPC/hOFHr1VckZc0jjBK6XIFLP0=
Expand Down
9 changes: 9 additions & 0 deletions pkg/collector/handler_dsa.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package collector

const (
DsaNamespace = "QCE/DSA"
)

func init() {
registerHandler(DsaNamespace, defaultHandlerEnabled, NewCdnHandler)
}
4 changes: 2 additions & 2 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package config

import (
"fmt"
"io/ioutil"
"os"
"strings"

Expand Down Expand Up @@ -70,6 +69,7 @@ var (
"lb_private": "QCE/LB_PRIVATE",
"waf": "QCE/WAF",
"cfs": "QCE/CFS",
"dsa": "QCE/DSA",
}

SupportStatisticsTypes = map[string]bool{
Expand Down Expand Up @@ -157,7 +157,7 @@ func NewConfig() *TencentConfig {

func (c *TencentConfig) LoadFile(filename string) error {
c.Filename = filename
content, err := ioutil.ReadFile(c.Filename)
content, err := os.ReadFile(c.Filename)
if err != nil {
return err
}
Expand Down
5 changes: 5 additions & 0 deletions pkg/instance/repository_dsa.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package instance

func init() {
registerRepository("QCE/DSA", NewCdnTcInstanceRepository)
}

0 comments on commit 13e66e8

Please sign in to comment.