Skip to content

Commit

Permalink
add warning log in aws and googlecloud module for API cost (elastic#2…
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiyan-sheng authored Aug 11, 2020
1 parent e7c0b1d commit 0243f28
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions x-pack/metricbeat/module/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ func NewMetricSet(base mb.BaseMetricSet) (*MetricSet, error) {

base.Logger().Debug("Metricset level config for period: ", metricSet.Period)
base.Logger().Debug("Metricset level config for tags filter: ", metricSet.TagsFilter)
base.Logger().Warn("extra charges on AWS API requests will be generated by this metricset")

// Get IAM account name, set region by aws_partition, default is aws global partition
// refer https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
Expand Down
5 changes: 4 additions & 1 deletion x-pack/metricbeat/module/googlecloud/metrics/metricset.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
"fmt"
"time"

"github.com/elastic/beats/v7/libbeat/logp"

monitoring "cloud.google.com/go/monitoring/apiv3"
"github.com/golang/protobuf/ptypes/duration"
"github.com/pkg/errors"
Expand Down Expand Up @@ -115,8 +117,9 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) {
m.requester = &metricsRequester{
config: m.config,
client: client,
logger: m.Logger(),
logger: logp.NewLogger(MetricsetName),
}
m.Logger().Warn("extra charges on Google Cloud API requests will be generated by this metricset")
return m, nil
}

Expand Down

0 comments on commit 0243f28

Please sign in to comment.