Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
mtanda committed Feb 10, 2018
1 parent c03f3bf commit bec9209
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
14 changes: 0 additions & 14 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,6 @@ import (
"golang.org/x/sync/errgroup"
)

var (
cloudwatchApiCalls = prometheus.NewCounterVec(
prometheus.CounterOpts{
Name: "cloudwatch_read_adapter_cloudwatch_api_calls_total",
Help: "The total number of CloudWatch API calls",
},
[]string{"api", "status"},
)
)

func init() {
prometheus.MustRegister(cloudwatchApiCalls)
}

type config struct {
listenAddr string
configFile string
Expand Down
15 changes: 15 additions & 0 deletions query.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,24 @@ import (

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/cloudwatch"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/prometheus/prompb"
)

var (
cloudwatchApiCalls = prometheus.NewCounterVec(
prometheus.CounterOpts{
Name: "cloudwatch_read_adapter_cloudwatch_api_calls_total",
Help: "The total number of CloudWatch API calls",
},
[]string{"api", "status"},
)
)

func init() {
prometheus.MustRegister(cloudwatchApiCalls)
}

func getQueryWithoutIndex(q *prompb.Query, indexer *Indexer) (string, []*cloudwatch.GetMetricStatisticsInput, error) {
region := ""
queries := make([]*cloudwatch.GetMetricStatisticsInput, 0)
Expand Down

0 comments on commit bec9209

Please sign in to comment.