From efe5a1982372c63c82ee9d6708a843802a7acc08 Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Tue, 14 Apr 2020 19:59:32 -0600 Subject: [PATCH 01/15] Collect one metric per collection period --- x-pack/metricbeat/module/googlecloud/constants.go | 10 +++++++++- .../googlecloud/stackdriver/metrics_requester.go | 4 ++-- .../module/googlecloud/stackdriver/metricset.go | 4 ++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/x-pack/metricbeat/module/googlecloud/constants.go b/x-pack/metricbeat/module/googlecloud/constants.go index b5ded8bf9bc..b8ee1e8cb69 100644 --- a/x-pack/metricbeat/module/googlecloud/constants.go +++ b/x-pack/metricbeat/module/googlecloud/constants.go @@ -10,10 +10,18 @@ const ( // MinTimeIntervalDataWindowMinutes is the minimum time in minutes that we allow the user to specify when requesting past metrics. Less than 5 minutes // usually return no results. - MinTimeIntervalDataWindowMinutes = 5 + MinTimeIntervalDataWindowMinutes = 1 // MaxTimeIntervalDataWindowMinutes is the max time in minutes that we allow the user to specify when requesting past metrics. MaxTimeIntervalDataWindowMinutes = 60 + + // MonitoringMetricsLatency (in minute) refers to how long it takes before a new metric data point is available in Monitoring after it is written. + // Monitoring collects one measurement each minute (the sampling rate), but it can take up to 4 minutes before you can retrieve the data (latency). + // So, the time stamp recording the collection time might be up to 4 minutes old. + MonitoringMetricsLatency = 4 + + // MonitoringMetricsSamplingRate (in second) refers to how frequent monitoring collects measurement in GCP. + MonitoringMetricsSamplingRate = 60 ) // Metricsets / GCP services names diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester.go b/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester.go index 8d2147d285c..5761beadaf3 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester.go +++ b/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester.go @@ -149,8 +149,8 @@ func getTimeInterval(windowTime time.Duration) (*monitoringpb.TimeInterval, erro var startTime, endTime time.Time if windowTime > 0 { - endTime = time.Now().UTC() - startTime = time.Now().UTC().Add(-windowTime) + endTime = time.Now().UTC().Add(-googlecloud.MonitoringMetricsLatency * time.Minute) + startTime = endTime.Add(-googlecloud.MonitoringMetricsSamplingRate * time.Second) } if windowTime.Minutes() < googlecloud.MinTimeIntervalDataWindowMinutes { diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/metricset.go b/x-pack/metricbeat/module/googlecloud/stackdriver/metricset.go index 69ac38ca101..9c311fc8a30 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/metricset.go +++ b/x-pack/metricbeat/module/googlecloud/stackdriver/metricset.go @@ -140,8 +140,8 @@ func (m *MetricSet) eventMapping(ctx context.Context, tss []*monitoringpb.TimeSe // validatePeriodForGCP returns nil if the Period in the module config is in the accepted threshold func validatePeriodForGCP(d time.Duration) (err error) { - if d.Seconds() < 300 { - return errors.New("period in Google Cloud config file cannot be set to less than 300 seconds") + if d.Seconds() < googlecloud.MonitoringMetricsSamplingRate { + return errors.Errorf("period in Google Cloud config file cannot be set to less than %s seconds", googlecloud.MonitoringMetricsSamplingRate) } return nil From 99c8b05e1c9b32ec0ce115b73ca21e62b88a8b65 Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Wed, 15 Apr 2020 19:30:12 -0600 Subject: [PATCH 02/15] Add metricDescriptor to get sample period and ingest delay time --- .../module/googlecloud/constants.go | 12 ---- .../stackdriver/metrics_requester.go | 61 +++++------------- .../googlecloud/stackdriver/metricset.go | 64 ++++++++++++++++--- 3 files changed, 73 insertions(+), 64 deletions(-) diff --git a/x-pack/metricbeat/module/googlecloud/constants.go b/x-pack/metricbeat/module/googlecloud/constants.go index b8ee1e8cb69..2806d52b496 100644 --- a/x-pack/metricbeat/module/googlecloud/constants.go +++ b/x-pack/metricbeat/module/googlecloud/constants.go @@ -8,18 +8,6 @@ const ( // ModuleName in Metricbeat ModuleName = "googlecloud" - // MinTimeIntervalDataWindowMinutes is the minimum time in minutes that we allow the user to specify when requesting past metrics. Less than 5 minutes - // usually return no results. - MinTimeIntervalDataWindowMinutes = 1 - - // MaxTimeIntervalDataWindowMinutes is the max time in minutes that we allow the user to specify when requesting past metrics. - MaxTimeIntervalDataWindowMinutes = 60 - - // MonitoringMetricsLatency (in minute) refers to how long it takes before a new metric data point is available in Monitoring after it is written. - // Monitoring collects one measurement each minute (the sampling rate), but it can take up to 4 minutes before you can retrieve the data (latency). - // So, the time stamp recording the collection time might be up to 4 minutes old. - MonitoringMetricsLatency = 4 - // MonitoringMetricsSamplingRate (in second) refers to how frequent monitoring collects measurement in GCP. MonitoringMetricsSamplingRate = 60 ) diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester.go b/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester.go index 5761beadaf3..d1cb6a3128c 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester.go +++ b/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester.go @@ -13,7 +13,6 @@ import ( monitoring "cloud.google.com/go/monitoring/apiv3" "github.com/golang/protobuf/ptypes/timestamp" - "github.com/pkg/errors" "google.golang.org/api/iterator" monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3" @@ -21,40 +20,20 @@ import ( "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud" ) -func newStackdriverMetricsRequester(ctx context.Context, c config, window time.Duration, logger *logp.Logger) (*stackdriverMetricsRequester, error) { - interval, err := getTimeInterval(window) - if err != nil { - return nil, errors.Wrap(err, "error trying to get time window") - } - - client, err := monitoring.NewMetricClient(ctx, c.opt...) - if err != nil { - return nil, errors.Wrap(err, "error creating Stackdriver client") - } - - return &stackdriverMetricsRequester{ - config: c, - client: client, - logger: logger, - interval: interval, - }, nil -} - type stackdriverMetricsRequester struct { config config - client *monitoring.MetricClient - interval *monitoringpb.TimeInterval + client *monitoring.MetricClient logger *logp.Logger } -func (r *stackdriverMetricsRequester) Metric(ctx context.Context, m string) (out []*monitoringpb.TimeSeries) { +func (r *stackdriverMetricsRequester) Metric(ctx context.Context, m string, timeInterval *monitoringpb.TimeInterval) (out []*monitoringpb.TimeSeries) { out = make([]*monitoringpb.TimeSeries, 0) req := &monitoringpb.ListTimeSeriesRequest{ Name: "projects/" + r.config.ProjectID, - Interval: r.interval, + Interval: timeInterval, View: monitoringpb.ListTimeSeriesRequest_FULL, Filter: r.getFilterForMetric(m), } @@ -89,23 +68,27 @@ func constructFilter(m string, region string, zone string) string { return filter } -func (r *stackdriverMetricsRequester) Metrics(ctx context.Context, ms []string) ([]*monitoringpb.TimeSeries, error) { +func (r *stackdriverMetricsRequester) Metrics(ctx context.Context, metricTypes []string, metricsMeta map[string]metricMeta) ([]*monitoringpb.TimeSeries, error) { var lock sync.Mutex var wg sync.WaitGroup results := make([]*monitoringpb.TimeSeries, 0) - for _, metric := range ms { + for _, mt := range metricTypes { + metricType := mt wg.Add(1) - go func(m string) { + go func(metricType string) { defer wg.Done() - ts := r.Metric(ctx, m) + metricMeta := metricsMeta[metricType] + interval := getTimeInterval(metricMeta.ingestDelay, metricMeta.samplePeriod) + + ts := r.Metric(ctx, metricType, interval) lock.Lock() defer lock.Unlock() results = append(results, ts...) - }(metric) + }(metricType) } wg.Wait() @@ -144,22 +127,12 @@ func (r *stackdriverMetricsRequester) getFilterForMetric(m string) (f string) { return } -// Returns a GCP TimeInterval based on the provided config -func getTimeInterval(windowTime time.Duration) (*monitoringpb.TimeInterval, error) { +// Returns a GCP TimeInterval based on the ingestDelay and samplePeriod from ListMetricDescriptor +func getTimeInterval(ingestDelay time.Duration, samplePeriod time.Duration) *monitoringpb.TimeInterval { var startTime, endTime time.Time - if windowTime > 0 { - endTime = time.Now().UTC().Add(-googlecloud.MonitoringMetricsLatency * time.Minute) - startTime = endTime.Add(-googlecloud.MonitoringMetricsSamplingRate * time.Second) - } - - if windowTime.Minutes() < googlecloud.MinTimeIntervalDataWindowMinutes { - return nil, errors.Errorf("the provided window time is too small. No less than %d minutes can be fetched", googlecloud.MinTimeIntervalDataWindowMinutes) - } - - if windowTime.Minutes() >= googlecloud.MaxTimeIntervalDataWindowMinutes { - return nil, errors.Errorf("the provided window time is too big. No more than %d minutes can be fetched", googlecloud.MaxTimeIntervalDataWindowMinutes) - } + endTime = time.Now().UTC().Add(-ingestDelay * time.Second) + startTime = endTime.Add(-samplePeriod * time.Second) interval := &monitoringpb.TimeInterval{ StartTime: ×tamp.Timestamp{ @@ -170,5 +143,5 @@ func getTimeInterval(windowTime time.Duration) (*monitoringpb.TimeInterval, erro }, } - return interval, nil + return interval } diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/metricset.go b/x-pack/metricbeat/module/googlecloud/stackdriver/metricset.go index 9c311fc8a30..0430626e6dd 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/metricset.go +++ b/x-pack/metricbeat/module/googlecloud/stackdriver/metricset.go @@ -6,8 +6,11 @@ package stackdriver import ( "context" + "fmt" "time" + monitoring "cloud.google.com/go/monitoring/apiv3" + "github.com/pkg/errors" "google.golang.org/api/option" @@ -38,7 +41,14 @@ func init() { // interface methods except for Fetch. type MetricSet struct { mb.BaseMetricSet - config config + config config + metricsMeta map[string]metricMeta + requester *stackdriverMetricsRequester +} + +type metricMeta struct { + samplePeriod time.Duration + ingestDelay time.Duration } type config struct { @@ -70,6 +80,23 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { return nil, err } + // Get ingest delay and sample period for each metric type + ctx := context.Background() + client, err := monitoring.NewMetricClient(ctx, m.config.opt...) + if err != nil { + return nil, errors.Wrap(err, "error creating Stackdriver client") + } + + m.metricsMeta, err = metricDescriptor(ctx, client, m.config.ProjectID, m.config.Metrics) + if err != nil { + return nil, errors.Wrap(err, "error calling metricDescriptor function") + } + + m.requester = &stackdriverMetricsRequester{ + config: m.config, + client: client, + logger: m.Logger(), + } return m, nil } @@ -77,12 +104,7 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { // format. It publishes the event which is then forwarded to the output. In case // of an error set the Error field of mb.Event or simply call report.Error(). func (m *MetricSet) Fetch(ctx context.Context, reporter mb.ReporterV2) (err error) { - reqs, err := newStackdriverMetricsRequester(ctx, m.config, m.Module().Config().Period, m.Logger()) - if err != nil { - return errors.Wrapf(err, "error trying to do create a request client to GCP project '%s' in zone '%s' or region '%s'", m.config.ProjectID, m.config.Zone, m.config.Region) - } - - responses, err := reqs.Metrics(ctx, m.config.Metrics) + responses, err := m.requester.Metrics(ctx, m.config.Metrics, m.metricsMeta) if err != nil { return errors.Wrapf(err, "error trying to get metrics for project '%s' and zone '%s' or region '%s'", m.config.ProjectID, m.config.Zone, m.config.Region) } @@ -141,7 +163,7 @@ func (m *MetricSet) eventMapping(ctx context.Context, tss []*monitoringpb.TimeSe // validatePeriodForGCP returns nil if the Period in the module config is in the accepted threshold func validatePeriodForGCP(d time.Duration) (err error) { if d.Seconds() < googlecloud.MonitoringMetricsSamplingRate { - return errors.Errorf("period in Google Cloud config file cannot be set to less than %s seconds", googlecloud.MonitoringMetricsSamplingRate) + return errors.Errorf("period in Google Cloud config file cannot be set to less than %d seconds", googlecloud.MonitoringMetricsSamplingRate) } return nil @@ -158,3 +180,29 @@ func (c *config) Validate() error { } return nil } + +// metricDescriptor calls ListMetricDescriptorsRequest API to get metric metadata +// (sample period and ingest delay) of each given metric type +func metricDescriptor(ctx context.Context, client *monitoring.MetricClient, projectID string, metricTypes []string) (map[string]metricMeta, error) { + metricsWithMeta := make(map[string]metricMeta, 0) + + for _, mt := range metricTypes { + req := &monitoringpb.ListMetricDescriptorsRequest{ + Name: "projects/" + projectID, + Filter: fmt.Sprintf(`metric.type = "%s"`, mt), + } + + it := client.ListMetricDescriptors(ctx, req) + out, err := it.Next() + if err != nil { + return metricsWithMeta, errors.Errorf("Could not make ListMetricDescriptors request: %s: %v", mt, err) + } + + metricsWithMeta[mt] = metricMeta{ + samplePeriod: time.Duration(out.Metadata.SamplePeriod.Seconds), + ingestDelay: time.Duration(out.Metadata.IngestDelay.Seconds), + } + } + + return metricsWithMeta, nil +} From f7609c69664b285d2c28a3e68ea7c796a550c2f5 Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Thu, 16 Apr 2020 14:33:02 -0600 Subject: [PATCH 03/15] add aggregation for ListTimeSeriesRequest --- .../module/googlecloud/constants.go | 25 +++++ .../stackdriver/metrics_requester.go | 62 ++++++++++--- .../stackdriver/metrics_requester_test.go | 92 +++++++++++++++++++ .../googlecloud/stackdriver/metricset.go | 25 ++++- 4 files changed, 187 insertions(+), 17 deletions(-) diff --git a/x-pack/metricbeat/module/googlecloud/constants.go b/x-pack/metricbeat/module/googlecloud/constants.go index 2806d52b496..4c7743ffbf8 100644 --- a/x-pack/metricbeat/module/googlecloud/constants.go +++ b/x-pack/metricbeat/module/googlecloud/constants.go @@ -4,6 +4,8 @@ package googlecloud +import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3" + const ( // ModuleName in Metricbeat ModuleName = "googlecloud" @@ -69,3 +71,26 @@ const ( LabelUser = "user" LabelMetadata = "metadata" ) + +// Available perSeriesAligner map +var AlignersMapToGCP = map[string]monitoringpb.Aggregation_Aligner{ + "ALIGN_NONE": monitoringpb.Aggregation_ALIGN_NONE, + "ALIGN_DELTA": monitoringpb.Aggregation_ALIGN_DELTA, + "ALIGN_RATE": monitoringpb.Aggregation_ALIGN_RATE, + "ALIGN_INTERPOLATE": monitoringpb.Aggregation_ALIGN_INTERPOLATE, + "ALIGN_NEXT_OLDER": monitoringpb.Aggregation_ALIGN_NEXT_OLDER, + "ALIGN_MIN": monitoringpb.Aggregation_ALIGN_MIN, + "ALIGN_MAX": monitoringpb.Aggregation_ALIGN_MAX, + "ALIGN_MEAN": monitoringpb.Aggregation_ALIGN_MEAN, + "ALIGN_COUNT": monitoringpb.Aggregation_ALIGN_COUNT, + "ALIGN_SUM": monitoringpb.Aggregation_ALIGN_SUM, + "ALIGN_STDDEV": monitoringpb.Aggregation_ALIGN_STDDEV, + "ALIGN_COUNT_TRUE": monitoringpb.Aggregation_ALIGN_COUNT_TRUE, + "ALIGN_COUNT_FALSE": monitoringpb.Aggregation_ALIGN_COUNT_FALSE, + "ALIGN_FRACTION_TRUE": monitoringpb.Aggregation_ALIGN_FRACTION_TRUE, + "ALIGN_PERCENTILE_99": monitoringpb.Aggregation_ALIGN_PERCENTILE_99, + "ALIGN_PERCENTILE_95": monitoringpb.Aggregation_ALIGN_PERCENTILE_95, + "ALIGN_PERCENTILE_50": monitoringpb.Aggregation_ALIGN_PERCENTILE_50, + "ALIGN_PERCENTILE_05": monitoringpb.Aggregation_ALIGN_PERCENTILE_05, + "ALIGN_PERCENT_CHANGE": monitoringpb.Aggregation_ALIGN_PERCENT_CHANGE, +} diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester.go b/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester.go index d1cb6a3128c..2249349971e 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester.go +++ b/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester.go @@ -11,6 +11,8 @@ import ( "sync" "time" + "github.com/golang/protobuf/ptypes/duration" + monitoring "cloud.google.com/go/monitoring/apiv3" "github.com/golang/protobuf/ptypes/timestamp" "google.golang.org/api/iterator" @@ -28,14 +30,15 @@ type stackdriverMetricsRequester struct { logger *logp.Logger } -func (r *stackdriverMetricsRequester) Metric(ctx context.Context, m string, timeInterval *monitoringpb.TimeInterval) (out []*monitoringpb.TimeSeries) { +func (r *stackdriverMetricsRequester) Metric(ctx context.Context, m string, timeInterval *monitoringpb.TimeInterval, needsAggregation bool) (out []*monitoringpb.TimeSeries) { out = make([]*monitoringpb.TimeSeries, 0) req := &monitoringpb.ListTimeSeriesRequest{ - Name: "projects/" + r.config.ProjectID, - Interval: timeInterval, - View: monitoringpb.ListTimeSeriesRequest_FULL, - Filter: r.getFilterForMetric(m), + Name: "projects/" + r.config.ProjectID, + Interval: timeInterval, + View: monitoringpb.ListTimeSeriesRequest_FULL, + Filter: r.getFilterForMetric(m), + Aggregation: constructAggregation(r.config.period, r.config.PerSeriesAligner, needsAggregation), } it := r.client.ListTimeSeries(ctx, req) @@ -81,9 +84,8 @@ func (r *stackdriverMetricsRequester) Metrics(ctx context.Context, metricTypes [ defer wg.Done() metricMeta := metricsMeta[metricType] - interval := getTimeInterval(metricMeta.ingestDelay, metricMeta.samplePeriod) - - ts := r.Metric(ctx, metricType, interval) + interval, needsAggregation := getTimeInterval(metricMeta.ingestDelay, metricMeta.samplePeriod, r.config.period) + ts := r.Metric(ctx, metricType, interval, needsAggregation) lock.Lock() defer lock.Unlock() @@ -128,11 +130,28 @@ func (r *stackdriverMetricsRequester) getFilterForMetric(m string) (f string) { } // Returns a GCP TimeInterval based on the ingestDelay and samplePeriod from ListMetricDescriptor -func getTimeInterval(ingestDelay time.Duration, samplePeriod time.Duration) *monitoringpb.TimeInterval { - var startTime, endTime time.Time +func getTimeInterval(ingestDelay time.Duration, samplePeriod time.Duration, collectionPeriod duration.Duration) (*monitoringpb.TimeInterval, bool) { + var startTime, endTime, currentTime time.Time + var needsAggregation bool + currentTime = time.Now().UTC() + + // When samplePeriod < collectionPeriod, aggregation will be done in ListTimeSeriesRequest. + // For example, samplePeriod = 60s, collectionPeriod = 300s, if perSeriesAligner is not given, + // ALIGN_MEAN will be used by default. + if int64(samplePeriod.Seconds()) < collectionPeriod.Seconds { + endTime = currentTime.Add(-ingestDelay) + startTime = endTime.Add(-time.Duration(collectionPeriod.Seconds) * time.Second) + needsAggregation = true + } - endTime = time.Now().UTC().Add(-ingestDelay * time.Second) - startTime = endTime.Add(-samplePeriod * time.Second) + // When samplePeriod == collectionPeriod, aggregation is not needed + // When samplePeriod > collectionPeriod, aggregation is not needed, use sample period + // to determine startTime and endTime to make sure there will be data point in this time range. + if int64(samplePeriod.Seconds()) >= collectionPeriod.Seconds { + endTime = time.Now().UTC().Add(-ingestDelay) + startTime = endTime.Add(-samplePeriod) + needsAggregation = false + } interval := &monitoringpb.TimeInterval{ StartTime: ×tamp.Timestamp{ @@ -143,5 +162,22 @@ func getTimeInterval(ingestDelay time.Duration, samplePeriod time.Duration) *mon }, } - return interval + return interval, needsAggregation +} + +func constructAggregation(period duration.Duration, perSeriesAligner string, needsAggregation bool) *monitoringpb.Aggregation { + aligner := "ALIGN_NONE" + if needsAggregation { + aligner = perSeriesAligner + if perSeriesAligner == "" { + // set to default aggregation ALIGN_MEAN + aligner = "ALIGN_MEAN" + } + } + + aggregation := &monitoringpb.Aggregation{ + PerSeriesAligner: googlecloud.AlignersMapToGCP[aligner], + AlignmentPeriod: &period, + } + return aggregation } diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester_test.go b/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester_test.go index be7b824d224..156f58c84a5 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester_test.go +++ b/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester_test.go @@ -6,7 +6,9 @@ package stackdriver import ( "testing" + "time" + "github.com/golang/protobuf/ptypes/duration" "github.com/stretchr/testify/assert" "github.com/elastic/beats/v7/libbeat/logp" @@ -103,3 +105,93 @@ func TestGetFilterForMetric(t *testing.T) { }) } } + +func TestConstructAggregation(t *testing.T) { + cases := []struct { + title string + period duration.Duration + perSeriesAligner string + needsAggregation bool + expectedPerSeriesAligner string + }{ + { + "test no aggregation", + duration.Duration{ + Seconds: int64(60), + }, + "", + false, + "ALIGN_NONE", + }, + { + "test needs aggregation with no perSeriesAligner config parameter", + duration.Duration{ + Seconds: int64(60), + }, + "", + true, + "ALIGN_MEAN", + }, + { + "test needs aggregation with perSeriesAligner configured", + duration.Duration{ + Seconds: int64(60), + }, + "ALIGN_MAX", + true, + "ALIGN_MAX", + }, + } + + for _, c := range cases { + t.Run(c.title, func(t *testing.T) { + aggregation := constructAggregation(c.period, c.perSeriesAligner, c.needsAggregation) + assert.Equal(t, c.expectedPerSeriesAligner, aggregation.PerSeriesAligner.String()) + }) + } +} + +func TestGetTimeInterval(t *testing.T) { + cases := []struct { + title string + ingestDelay time.Duration + samplePeriod time.Duration + collectionPeriod duration.Duration + expectedNeedsAggregation bool + }{ + { + "test collectionPeriod equals to samplePeriod", + time.Duration(240) * time.Second, + time.Duration(60) * time.Second, + duration.Duration{ + Seconds: int64(60), + }, + false, + }, + { + "test collectionPeriod larger than samplePeriod", + time.Duration(240) * time.Second, + time.Duration(60) * time.Second, + duration.Duration{ + Seconds: int64(300), + }, + true, + }, + { + "test collectionPeriod smaller than samplePeriod", + time.Duration(240) * time.Second, + time.Duration(60) * time.Second, + duration.Duration{ + Seconds: int64(30), + }, + false, + }, + } + + for _, c := range cases { + t.Run(c.title, func(t *testing.T) { + _, needsAggregation := getTimeInterval(c.ingestDelay, c.samplePeriod, c.collectionPeriod) + assert.Equal(t, c.expectedNeedsAggregation, needsAggregation) + }) + } +} diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/metricset.go b/x-pack/metricbeat/module/googlecloud/stackdriver/metricset.go index 0430626e6dd..1db9bbc4487 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/metricset.go +++ b/x-pack/metricbeat/module/googlecloud/stackdriver/metricset.go @@ -9,6 +9,8 @@ import ( "fmt" "time" + "github.com/golang/protobuf/ptypes/duration" + monitoring "cloud.google.com/go/monitoring/apiv3" "github.com/pkg/errors" @@ -59,8 +61,10 @@ type config struct { ExcludeLabels bool `config:"exclude_labels"` ServiceName string `config:"stackdriver.service" validate:"required"` CredentialsFilePath string `config:"credentials_file_path"` + PerSeriesAligner string `config:"perSeriesAligner"` - opt []option.ClientOption + opt []option.ClientOption + period duration.Duration } // New creates a new instance of the MetricSet. New is responsible for unpacking @@ -75,6 +79,7 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { } m.config.opt = []option.ClientOption{option.WithCredentialsFile(m.config.CredentialsFilePath)} + m.config.period.Seconds = int64(m.Module().Config().Period.Seconds()) if err := validatePeriodForGCP(m.Module().Config().Period); err != nil { return nil, err @@ -121,7 +126,7 @@ func (m *MetricSet) Fetch(ctx context.Context, reporter mb.ReporterV2) (err erro return nil } -func (m *MetricSet) eventMapping(ctx context.Context, tss []*monitoringpb.TimeSeries) ([]mb.Event, error) { +func (m *MetricSet) eventMapping(ctx context.Context, tss []OutputWithAligner) ([]mb.Event, error) { e := newIncomingFieldExtractor(m.Logger()) var gcpService = googlecloud.NewStackdriverMetadataServiceForTimeSeries(nil) @@ -178,6 +183,18 @@ func (c *config) Validate() error { if c.Region == "" && c.Zone == "" { return errors.New("region and zone in Google Cloud config file cannot both be empty") } + + gcpAlignerNames := make([]string, 0) + for k := range googlecloud.AlignersMapToGCP { + gcpAlignerNames = append(gcpAlignerNames, k) + } + + if c.PerSeriesAligner != "" { + if _, ok := googlecloud.AlignersMapToGCP[c.PerSeriesAligner]; !ok { + return errors.Errorf("the given perSeriesAligner is not supported, please specify one of %s as perSeriesAligner", gcpAlignerNames) + } + } + return nil } @@ -199,8 +216,8 @@ func metricDescriptor(ctx context.Context, client *monitoring.MetricClient, proj } metricsWithMeta[mt] = metricMeta{ - samplePeriod: time.Duration(out.Metadata.SamplePeriod.Seconds), - ingestDelay: time.Duration(out.Metadata.IngestDelay.Seconds), + samplePeriod: time.Duration(out.Metadata.SamplePeriod.Seconds) * time.Second, + ingestDelay: time.Duration(out.Metadata.IngestDelay.Seconds) * time.Second, } } From c9b34c0c32a7965629b269758f96bb3403512e33 Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Thu, 16 Apr 2020 16:39:15 -0600 Subject: [PATCH 04/15] update documentation change --- metricbeat/docs/modules/googlecloud.asciidoc | 15 ++++++++++++++- .../module/googlecloud/_meta/docs.asciidoc | 15 ++++++++++++++- .../module/googlecloud/stackdriver/metricset.go | 2 +- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/metricbeat/docs/modules/googlecloud.asciidoc b/metricbeat/docs/modules/googlecloud.asciidoc index 19a741eb5d0..203f91ca044 100644 --- a/metricbeat/docs/modules/googlecloud.asciidoc +++ b/metricbeat/docs/modules/googlecloud.asciidoc @@ -17,11 +17,22 @@ Note: extra GCP charges on Stackdriver Monitoring API requests will be generated This is a list of the possible module parameters you can tune: * *zone*: A single string with the zone you want to monitor like "us-central1-a". If you need to fetch from multiple regions, you have to setup a different configuration for each (but you don't need a new instance of Metricbeat running) + * *region*: A single string with the region you want to monitor like "us-central1". This will enable monitoring for all zones under this region. + * *project_id*: A single string with your GCP Project ID + * *credentials_file_path*: A single string pointing to the JSON file path reachable by Metricbeat that you have created using IAM. + * *exclude_labels*: (`true`/`false` default `false`) Do not extract extra labels and metadata information from Metricsets and fetch metrics onlly. At the moment, *labels and metadata extraction is only supported* in Compute Metricset. +* *period*: A single time duration specified for this module collection frequency. + +* *perSeriesAligner*: A single string with which operation need to be applied onto time series data for aggregation. +If it's not given and sample period of a specific metric type is larger or equal than module collection period, default perSeriesAligner is set to be `ALIGN_NONE`. +If it's not given and sample period of a specific metric type is smaller than module collection period, default perSeriesAligner is set to be `ALIGN_MEAN`. +Sample period of each metric type is obtained from making https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors/list [ListMetricDescriptors API] call. + [float] == Authentication, authorization and permissions. Authentication and authorization in Google Cloud Platform can be achieved in many ways. For the current version of the Google Cloud Platform module for Metricbeat, the only supported method is using Service Account JSON files. A typical JSON with a private key looks like this: @@ -62,7 +73,9 @@ Google Cloud Platform offers the https://cloud.google.com/monitoring/api/metrics If you also want to *extract service labels* (by setting `exclude_labels` to false, which is the default state). You also make a new API check on the corresponding service. Service labels requires a new API call to extract those metrics. In the worst case the number of API calls will be doubled. In the best case, all metrics come from the same GCP entity and 100% of the required information is included in the first API call (which is cached for subsequent calls). -A recommended `period` value between fetches is between 5 and 10 minutes, depending on how granular you want your metrics. GCP restricts information for less than 5 minutes. +If `period` value is set to 5-minute and sample period of the metric type is 60-second, then this module will collect data from this metric type once every 5 minutes with aggregation. +GCP monitoring data has a up to 240 seconds latency, which means latest monitoring data will be up to 4 minutes old. Please see https://cloud.google.com/monitoring/api/v3/latency-n-retention[Latency of GCP Monitoring Metric Data] for more details. +In googlecloud module, metrics are collected based on this ingest delay, which is also obtained from ListMetricDescriptors API. [float] === Rough estimation of the number of API Calls diff --git a/x-pack/metricbeat/module/googlecloud/_meta/docs.asciidoc b/x-pack/metricbeat/module/googlecloud/_meta/docs.asciidoc index ff4b03cb023..682a2b60fac 100644 --- a/x-pack/metricbeat/module/googlecloud/_meta/docs.asciidoc +++ b/x-pack/metricbeat/module/googlecloud/_meta/docs.asciidoc @@ -7,11 +7,22 @@ Note: extra GCP charges on Stackdriver Monitoring API requests will be generated This is a list of the possible module parameters you can tune: * *zone*: A single string with the zone you want to monitor like "us-central1-a". If you need to fetch from multiple regions, you have to setup a different configuration for each (but you don't need a new instance of Metricbeat running) + * *region*: A single string with the region you want to monitor like "us-central1". This will enable monitoring for all zones under this region. + * *project_id*: A single string with your GCP Project ID + * *credentials_file_path*: A single string pointing to the JSON file path reachable by Metricbeat that you have created using IAM. + * *exclude_labels*: (`true`/`false` default `false`) Do not extract extra labels and metadata information from Metricsets and fetch metrics onlly. At the moment, *labels and metadata extraction is only supported* in Compute Metricset. +* *period*: A single time duration specified for this module collection frequency. + +* *perSeriesAligner*: A single string with which operation need to be applied onto time series data for aggregation. +If it's not given and sample period of a specific metric type is larger or equal than module collection period, default perSeriesAligner is set to be `ALIGN_NONE`. +If it's not given and sample period of a specific metric type is smaller than module collection period, default perSeriesAligner is set to be `ALIGN_MEAN`. +Sample period of each metric type is obtained from making https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors/list [ListMetricDescriptors API] call. + [float] == Authentication, authorization and permissions. Authentication and authorization in Google Cloud Platform can be achieved in many ways. For the current version of the Google Cloud Platform module for Metricbeat, the only supported method is using Service Account JSON files. A typical JSON with a private key looks like this: @@ -52,7 +63,9 @@ Google Cloud Platform offers the https://cloud.google.com/monitoring/api/metrics If you also want to *extract service labels* (by setting `exclude_labels` to false, which is the default state). You also make a new API check on the corresponding service. Service labels requires a new API call to extract those metrics. In the worst case the number of API calls will be doubled. In the best case, all metrics come from the same GCP entity and 100% of the required information is included in the first API call (which is cached for subsequent calls). -A recommended `period` value between fetches is between 5 and 10 minutes, depending on how granular you want your metrics. GCP restricts information for less than 5 minutes. +If `period` value is set to 5-minute and sample period of the metric type is 60-second, then this module will collect data from this metric type once every 5 minutes with aggregation. +GCP monitoring data has a up to 240 seconds latency, which means latest monitoring data will be up to 4 minutes old. Please see https://cloud.google.com/monitoring/api/v3/latency-n-retention[Latency of GCP Monitoring Metric Data] for more details. +In googlecloud module, metrics are collected based on this ingest delay, which is also obtained from ListMetricDescriptors API. [float] === Rough estimation of the number of API Calls diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/metricset.go b/x-pack/metricbeat/module/googlecloud/stackdriver/metricset.go index 1db9bbc4487..982a3275f5a 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/metricset.go +++ b/x-pack/metricbeat/module/googlecloud/stackdriver/metricset.go @@ -126,7 +126,7 @@ func (m *MetricSet) Fetch(ctx context.Context, reporter mb.ReporterV2) (err erro return nil } -func (m *MetricSet) eventMapping(ctx context.Context, tss []OutputWithAligner) ([]mb.Event, error) { +func (m *MetricSet) eventMapping(ctx context.Context, tss []*monitoringpb.TimeSeries) ([]mb.Event, error) { e := newIncomingFieldExtractor(m.Logger()) var gcpService = googlecloud.NewStackdriverMetadataServiceForTimeSeries(nil) From 5d42e046a06f19bb19b9de0cad64afb3140f54ae Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Fri, 17 Apr 2020 09:57:00 -0600 Subject: [PATCH 05/15] add googlecloud configuration example in doc --- .../module/googlecloud/_meta/config.yml | 11 +++- .../module/googlecloud/_meta/docs.asciidoc | 65 ++++++++++++++++++- 2 files changed, 74 insertions(+), 2 deletions(-) diff --git a/x-pack/metricbeat/module/googlecloud/_meta/config.yml b/x-pack/metricbeat/module/googlecloud/_meta/config.yml index 5df057bba18..e819b3c2916 100644 --- a/x-pack/metricbeat/module/googlecloud/_meta/config.yml +++ b/x-pack/metricbeat/module/googlecloud/_meta/config.yml @@ -1,13 +1,22 @@ - module: googlecloud metricsets: - compute + region: "us-central1" + project_id: "your project id" + credentials_file_path: "your JSON credentials file path" + exclude_labels: false + perSeriesAligner: ALIGN_MAX + period: 300s + +- module: googlecloud + metricsets: - pubsub - loadbalancing zone: "us-central1-a" project_id: "your project id" credentials_file_path: "your JSON credentials file path" exclude_labels: false - period: 300s + period: 60s - module: googlecloud metricsets: diff --git a/x-pack/metricbeat/module/googlecloud/_meta/docs.asciidoc b/x-pack/metricbeat/module/googlecloud/_meta/docs.asciidoc index 682a2b60fac..1cd9a26f269 100644 --- a/x-pack/metricbeat/module/googlecloud/_meta/docs.asciidoc +++ b/x-pack/metricbeat/module/googlecloud/_meta/docs.asciidoc @@ -23,12 +23,75 @@ If it's not given and sample period of a specific metric type is larger or equal If it's not given and sample period of a specific metric type is smaller than module collection period, default perSeriesAligner is set to be `ALIGN_MEAN`. Sample period of each metric type is obtained from making https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors/list [ListMetricDescriptors API] call. +[float] +=== Example Configuration +* `compute` metricset is enabled to collect metrics from all zones under +`us-central1` region in `test-project`. Metric types +collected by `compute` metricset usually have 240 seconds ingest delay time and +60 seconds sample period. With `period` specified as `60s` in the config below, +Metricbeat will collect compute metrics from googlecloud every minute with no +aggregation(because `period` matches the metric type's sample period). ++ +[source,yaml] +---- +metricbeat.modules: +- module: googlecloud + metricsets: + - compute + region: "us-central1" + project_id: "test-project" + credentials_file_path: "your JSON credentials file path" + exclude_labels: false + period: 60s +---- + +* `compute` metricset is enabled to collect metrics from a specific zone +`us-central1a` in `test-project`. Metric types collected by `compute` metricset +usually have 240 seconds ingest delay time and 60 seconds sample period. With +`period` specified as `300s` in the config below and no `perSeriesAligner` +specified, Metricbeat will collect compute metrics from googlecloud every +5-minute with default `perSeriesAligner = ALIGN_MEAN` aggregation. ++ +[source,yaml] +---- +metricbeat.modules: +- module: googlecloud + metricsets: + - compute + zone: "us-central1a" + project_id: "test-project" + credentials_file_path: "your JSON credentials file path" + exclude_labels: false + period: 300s +---- + +* `compute` metricset is enabled to collect metrics from a specific zone +`us-central1a` in `test-project`. Metric types collected by `compute` metricset +usually have 240 seconds ingest delay time and 60 seconds sample period. With +`period` specified as `10m` in the config below and given `perSeriesAligner: ALIGN_MAX` +specified, Metricbeat will collect compute metrics from googlecloud every +10-minute with default `perSeriesAligner = ALIGN_MAX` aggregation. ++ +[source,yaml] +---- +metricbeat.modules: +- module: googlecloud + metricsets: + - compute + zone: "us-central1a" + project_id: "test-project" + credentials_file_path: "your JSON credentials file path" + exclude_labels: false + perSeriesAligner: ALIGN_MAX + period: 10m +---- + [float] == Authentication, authorization and permissions. Authentication and authorization in Google Cloud Platform can be achieved in many ways. For the current version of the Google Cloud Platform module for Metricbeat, the only supported method is using Service Account JSON files. A typical JSON with a private key looks like this: [float] -==== Example Credentials +=== Example Credentials [source,json] ---- { From 96b49fd58f2cf2524bd874ca6ecfd42974a235ca Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Fri, 17 Apr 2020 11:11:42 -0600 Subject: [PATCH 06/15] add perSeriesAligner into config example --- metricbeat/docs/modules/googlecloud.asciidoc | 99 ++++++++++++++++++- x-pack/metricbeat/metricbeat.reference.yml | 11 ++- .../module/googlecloud/_meta/docs.asciidoc | 23 +++++ .../modules.d/googlecloud.yml.disabled | 11 ++- 4 files changed, 140 insertions(+), 4 deletions(-) diff --git a/metricbeat/docs/modules/googlecloud.asciidoc b/metricbeat/docs/modules/googlecloud.asciidoc index 203f91ca044..06e7427e3a9 100644 --- a/metricbeat/docs/modules/googlecloud.asciidoc +++ b/metricbeat/docs/modules/googlecloud.asciidoc @@ -33,12 +33,98 @@ If it's not given and sample period of a specific metric type is larger or equal If it's not given and sample period of a specific metric type is smaller than module collection period, default perSeriesAligner is set to be `ALIGN_MEAN`. Sample period of each metric type is obtained from making https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors/list [ListMetricDescriptors API] call. +[float] +=== Example Configuration +* `compute` metricset is enabled to collect metrics from all zones under +`us-central1` region in `test-project`. Metric types +collected by `compute` metricset usually have 240 seconds ingest delay time and +60 seconds sample period. With `period` specified as `60s` in the config below, +Metricbeat will collect compute metrics from googlecloud every minute with no +aggregation(because `period` matches the metric type's sample period). ++ +[source,yaml] +---- +metricbeat.modules: +- module: googlecloud + metricsets: + - compute + region: "us-central1" + project_id: "test-project" + credentials_file_path: "your JSON credentials file path" + exclude_labels: false + period: 60s +---- + +* `compute` metricset is enabled to collect metrics from a specific zone +`us-central1a` in `test-project`. Metric types collected by `compute` metricset +usually have 240 seconds ingest delay time and 60 seconds sample period. With +`period` specified as `300s` in the config below and no `perSeriesAligner` +specified, Metricbeat will collect compute metrics from googlecloud every +5-minute with default `perSeriesAligner = ALIGN_MEAN` aggregation. ++ +[source,yaml] +---- +metricbeat.modules: +- module: googlecloud + metricsets: + - compute + zone: "us-central1a" + project_id: "test-project" + credentials_file_path: "your JSON credentials file path" + exclude_labels: false + period: 300s +---- + +* `compute` metricset is enabled to collect metrics from a specific zone +`us-central1a` in `test-project`. Metric types collected by `compute` metricset +usually have 240 seconds ingest delay time and 60 seconds sample period. With +`period` specified as `10m` in the config below and given `perSeriesAligner: ALIGN_MAX` +specified, Metricbeat will collect compute metrics from googlecloud every +10-minute with default `perSeriesAligner = ALIGN_MAX` aggregation. ++ +[source,yaml] +---- +metricbeat.modules: +- module: googlecloud + metricsets: + - compute + zone: "us-central1a" + project_id: "test-project" + credentials_file_path: "your JSON credentials file path" + exclude_labels: false + perSeriesAligner: ALIGN_MAX + period: 10m +---- + +* `compute` metricset is enabled to collect metrics from a specific zone +`us-central1a` in `test-project`. Metric types collected by `compute` metricset +usually have 240 seconds ingest delay time and 60 seconds sample period. With +`period` specified as `5m` in the config below and given `perSeriesAligner: ALIGN_NONE` +specified, Metricbeat will collect compute metrics from googlecloud every +5-minute with `perSeriesAligner = ALIGN_NONE` aggregation, which means no aligner +is applied. This way, Metricbeat will collect `compute` metrics every 5-minute and +each collection will return 5 data points(one per sample period). ++ +[source,yaml] +---- +metricbeat.modules: +- module: googlecloud + metricsets: + - compute + zone: "us-central1a" + project_id: "test-project" + credentials_file_path: "your JSON credentials file path" + exclude_labels: false + perSeriesAligner: ALIGN_NONE + period: 5m +---- + [float] == Authentication, authorization and permissions. Authentication and authorization in Google Cloud Platform can be achieved in many ways. For the current version of the Google Cloud Platform module for Metricbeat, the only supported method is using Service Account JSON files. A typical JSON with a private key looks like this: [float] -==== Example Credentials +=== Example Credentials [source,json] ---- { @@ -114,13 +200,22 @@ metricbeat.modules: - module: googlecloud metricsets: - compute + region: "us-central1" + project_id: "your project id" + credentials_file_path: "your JSON credentials file path" + exclude_labels: false + perSeriesAligner: ALIGN_MAX + period: 300s + +- module: googlecloud + metricsets: - pubsub - loadbalancing zone: "us-central1-a" project_id: "your project id" credentials_file_path: "your JSON credentials file path" exclude_labels: false - period: 300s + period: 60s - module: googlecloud metricsets: diff --git a/x-pack/metricbeat/metricbeat.reference.yml b/x-pack/metricbeat/metricbeat.reference.yml index 704cc820a65..c96b545905f 100644 --- a/x-pack/metricbeat/metricbeat.reference.yml +++ b/x-pack/metricbeat/metricbeat.reference.yml @@ -498,13 +498,22 @@ metricbeat.modules: - module: googlecloud metricsets: - compute + region: "us-central1" + project_id: "your project id" + credentials_file_path: "your JSON credentials file path" + exclude_labels: false + perSeriesAligner: ALIGN_MAX + period: 300s + +- module: googlecloud + metricsets: - pubsub - loadbalancing zone: "us-central1-a" project_id: "your project id" credentials_file_path: "your JSON credentials file path" exclude_labels: false - period: 300s + period: 60s - module: googlecloud metricsets: diff --git a/x-pack/metricbeat/module/googlecloud/_meta/docs.asciidoc b/x-pack/metricbeat/module/googlecloud/_meta/docs.asciidoc index 1cd9a26f269..b512d1a0c72 100644 --- a/x-pack/metricbeat/module/googlecloud/_meta/docs.asciidoc +++ b/x-pack/metricbeat/module/googlecloud/_meta/docs.asciidoc @@ -86,6 +86,29 @@ metricbeat.modules: period: 10m ---- +* `compute` metricset is enabled to collect metrics from a specific zone +`us-central1a` in `test-project`. Metric types collected by `compute` metricset +usually have 240 seconds ingest delay time and 60 seconds sample period. With +`period` specified as `5m` in the config below and given `perSeriesAligner: ALIGN_NONE` +specified, Metricbeat will collect compute metrics from googlecloud every +5-minute with `perSeriesAligner = ALIGN_NONE` aggregation, which means no aligner +is applied. This way, Metricbeat will collect `compute` metrics every 5-minute and +each collection will return 5 data points(one per sample period). ++ +[source,yaml] +---- +metricbeat.modules: +- module: googlecloud + metricsets: + - compute + zone: "us-central1a" + project_id: "test-project" + credentials_file_path: "your JSON credentials file path" + exclude_labels: false + perSeriesAligner: ALIGN_NONE + period: 5m +---- + [float] == Authentication, authorization and permissions. Authentication and authorization in Google Cloud Platform can be achieved in many ways. For the current version of the Google Cloud Platform module for Metricbeat, the only supported method is using Service Account JSON files. A typical JSON with a private key looks like this: diff --git a/x-pack/metricbeat/modules.d/googlecloud.yml.disabled b/x-pack/metricbeat/modules.d/googlecloud.yml.disabled index fc7d792dadf..52bb91f8358 100644 --- a/x-pack/metricbeat/modules.d/googlecloud.yml.disabled +++ b/x-pack/metricbeat/modules.d/googlecloud.yml.disabled @@ -4,13 +4,22 @@ - module: googlecloud metricsets: - compute + region: "us-central1" + project_id: "your project id" + credentials_file_path: "your JSON credentials file path" + exclude_labels: false + perSeriesAligner: ALIGN_MAX + period: 300s + +- module: googlecloud + metricsets: - pubsub - loadbalancing zone: "us-central1-a" project_id: "your project id" credentials_file_path: "your JSON credentials file path" exclude_labels: false - period: 300s + period: 60s - module: googlecloud metricsets: From c0a44bf2d295cd769e801e1c23f7f42cf27cfd5e Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Fri, 17 Apr 2020 15:12:46 -0600 Subject: [PATCH 07/15] add aligner as a metadata label --- metricbeat/docs/modules/googlecloud.asciidoc | 2 +- .../module/googlecloud/_meta/docs.asciidoc | 2 +- .../module/googlecloud/_meta/fields.yml | 3 + .../metricbeat/module/googlecloud/fields.go | 2 +- .../stackdriver/metrics_requester.go | 20 ++++-- .../googlecloud/stackdriver/metricset.go | 2 +- .../googlecloud/stackdriver/timeseries.go | 66 ++++++++++--------- 7 files changed, 56 insertions(+), 41 deletions(-) diff --git a/metricbeat/docs/modules/googlecloud.asciidoc b/metricbeat/docs/modules/googlecloud.asciidoc index 06e7427e3a9..d2958c9fef7 100644 --- a/metricbeat/docs/modules/googlecloud.asciidoc +++ b/metricbeat/docs/modules/googlecloud.asciidoc @@ -28,7 +28,7 @@ This is a list of the possible module parameters you can tune: * *period*: A single time duration specified for this module collection frequency. -* *perSeriesAligner*: A single string with which operation need to be applied onto time series data for aggregation. +* *perSeriesAligner*: A single string with which aggregation operation need to be applied onto time series data for ListTimeSeries API . If it's not given and sample period of a specific metric type is larger or equal than module collection period, default perSeriesAligner is set to be `ALIGN_NONE`. If it's not given and sample period of a specific metric type is smaller than module collection period, default perSeriesAligner is set to be `ALIGN_MEAN`. Sample period of each metric type is obtained from making https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors/list [ListMetricDescriptors API] call. diff --git a/x-pack/metricbeat/module/googlecloud/_meta/docs.asciidoc b/x-pack/metricbeat/module/googlecloud/_meta/docs.asciidoc index b512d1a0c72..f16907d3222 100644 --- a/x-pack/metricbeat/module/googlecloud/_meta/docs.asciidoc +++ b/x-pack/metricbeat/module/googlecloud/_meta/docs.asciidoc @@ -18,7 +18,7 @@ This is a list of the possible module parameters you can tune: * *period*: A single time duration specified for this module collection frequency. -* *perSeriesAligner*: A single string with which operation need to be applied onto time series data for aggregation. +* *perSeriesAligner*: A single string with which aggregation operation need to be applied onto time series data for ListTimeSeries API . If it's not given and sample period of a specific metric type is larger or equal than module collection period, default perSeriesAligner is set to be `ALIGN_NONE`. If it's not given and sample period of a specific metric type is smaller than module collection period, default perSeriesAligner is set to be `ALIGN_MEAN`. Sample period of each metric type is obtained from making https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors/list [ListMetricDescriptors API] call. diff --git a/x-pack/metricbeat/module/googlecloud/_meta/fields.yml b/x-pack/metricbeat/module/googlecloud/_meta/fields.yml index 8bbae3bf4fe..9827d8dcdda 100644 --- a/x-pack/metricbeat/module/googlecloud/_meta/fields.yml +++ b/x-pack/metricbeat/module/googlecloud/_meta/fields.yml @@ -15,3 +15,6 @@ type: object - name: system.* type: object + - name: aggregation_aligner + type: keyword + description: Aggregation perSeriesAligner used for ListTimeSeries API. diff --git a/x-pack/metricbeat/module/googlecloud/fields.go b/x-pack/metricbeat/module/googlecloud/fields.go index 8fac4947787..d0b2992705d 100644 --- a/x-pack/metricbeat/module/googlecloud/fields.go +++ b/x-pack/metricbeat/module/googlecloud/fields.go @@ -19,5 +19,5 @@ func init() { // AssetGooglecloud returns asset data. // This is the base64 encoded gzipped contents of module/googlecloud. func AssetGooglecloud() string { - return "eJzsXUuT2zYSvvtX9M321nh82JtrK1WTyW7iWnsztTPJVQWCLQk7IMDgMYry67cAkBQp8QFSpPwo3WYkEv11A/i+bgCk3sEz7j/ARsoNR8qlTV8BGGY4foDXP/tP4d59DA+cmLVU2etXAAo5Eo0fIEFDXgGkqKliuWFSfIAfXgEA/Hz/AJlMLcdXAGuGPNUf/BfvQJAMGyZvOUmQa/81gNnn+AFk8j+kpviofn+9DatR3f6t+rj13sPVGRqSEkNG3aEY1fE36L02mMVfT2WWW4O1y49D22xmo6TNa582At/orvvQculC7Z7jYNbxMKENERQbX3YZ72qs3uCaKdwRzk8u6Gu0r+F646mSeY7pKtkb1CsqrTCt15e2uBSbjgsagfwoqMyY2IBvuDQDyR7MFvtcOoWWE/qMZhFwRdPR8Koxl9tFekOhRvWC6YpKhbrX11TahB8PslZv/2OzBBXINfhWKyMghfd2K7Vx37q/OwZvE6U1jLO/iGt9JohPLuiKUPdfCYVwLikxmML9w29gtsQA00CtUigM3wMTjrtKJ+KAa7LBlWFZF6ixuH9zDcJaKoe2CC8ToJFKkZ72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kHj1zy+sbLJQ0iuyCi76+RPpmV0fm/WTKUISWSem/mmS4LIm/uyz4HL++zmTyHI9m0vfzRL0h5146vcgPrOh/OWX/XjR86pCp6VWQQm/kYbRjD66UT58p4SW7XGgdpGepoHRllAMvzn3DeE+liaVP2fTVyaNhbiFbdkaNYDwxtMLmix37mRrMJpaZYhmN6sTwfTta8K733KH/wQt/5jxT7KXjBxeW+F2DfUEkVZtC5zoe+Rhanng+khQsWl2GX3IcLgNi30X7Cbkh+6Fw9/ARKPFnJhrd7+jBXcnRbGTm7VdjILytTWWG3ZJKrNn8dabHzROdPEmJxiwJv++REEpRzzEvDuJQrzr508NhrPsJLcpfFoEUXd27VkQ4qQ84QEuOfAeZRZcAlnfe3X8ayPacS/vEcgZPwpf9XV/ef2qkrIf8M7w3VoZXF0jZitHEocytmas0P4h2tbCUk6wZuMp6RwT3x8e7PrF9+gCL/Mj6yZ4efGL98IPc5846ODxgs6gbnd8Un4s4jon7vJ4tR/QMn+7w6VPjCL9vWEOBqnzfpxWC0g+gnOiqSHwh3KIrFffv3gqKvoWM7G58iFzo6vsUFuHVBWLKlVeSF9wRkH/x/oXw6o0BaY1/NCMDLzWEL4P44rjvFw2+jTG+d2SOtL3Khgnnda+y8JWTr6xj/x8AAP//ykexBg==" } diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester.go b/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester.go index 2249349971e..9c59e47638f 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester.go +++ b/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester.go @@ -30,9 +30,15 @@ type stackdriverMetricsRequester struct { logger *logp.Logger } -func (r *stackdriverMetricsRequester) Metric(ctx context.Context, m string, timeInterval *monitoringpb.TimeInterval, needsAggregation bool) (out []*monitoringpb.TimeSeries) { - out = make([]*monitoringpb.TimeSeries, 0) +type timeSeriesWithAligner struct { + timeSeries []*monitoringpb.TimeSeries + aligner string +} + +func (r *stackdriverMetricsRequester) Metric(ctx context.Context, m string, timeInterval *monitoringpb.TimeInterval, needsAggregation bool) (out timeSeriesWithAligner) { + timeSeries := make([]*monitoringpb.TimeSeries, 0) + aggregation := constructAggregation(r.config.period, r.config.PerSeriesAligner, needsAggregation) req := &monitoringpb.ListTimeSeriesRequest{ Name: "projects/" + r.config.ProjectID, Interval: timeInterval, @@ -53,9 +59,11 @@ func (r *stackdriverMetricsRequester) Metric(ctx context.Context, m string, time break } - out = append(out, resp) + timeSeries = append(timeSeries, resp) } + out.aligner = aggregation.PerSeriesAligner.String() + out.timeSeries = timeSeries return } @@ -71,10 +79,10 @@ func constructFilter(m string, region string, zone string) string { return filter } -func (r *stackdriverMetricsRequester) Metrics(ctx context.Context, metricTypes []string, metricsMeta map[string]metricMeta) ([]*monitoringpb.TimeSeries, error) { +func (r *stackdriverMetricsRequester) Metrics(ctx context.Context, metricTypes []string, metricsMeta map[string]metricMeta) ([]timeSeriesWithAligner, error) { var lock sync.Mutex var wg sync.WaitGroup - results := make([]*monitoringpb.TimeSeries, 0) + results := make([]timeSeriesWithAligner, 0) for _, mt := range metricTypes { metricType := mt @@ -89,7 +97,7 @@ func (r *stackdriverMetricsRequester) Metrics(ctx context.Context, metricTypes [ lock.Lock() defer lock.Unlock() - results = append(results, ts...) + results = append(results, ts) }(metricType) } diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/metricset.go b/x-pack/metricbeat/module/googlecloud/stackdriver/metricset.go index 982a3275f5a..107d229eb9e 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/metricset.go +++ b/x-pack/metricbeat/module/googlecloud/stackdriver/metricset.go @@ -126,7 +126,7 @@ func (m *MetricSet) Fetch(ctx context.Context, reporter mb.ReporterV2) (err erro return nil } -func (m *MetricSet) eventMapping(ctx context.Context, tss []*monitoringpb.TimeSeries) ([]mb.Event, error) { +func (m *MetricSet) eventMapping(ctx context.Context, tss []timeSeriesWithAligner) ([]mb.Event, error) { e := newIncomingFieldExtractor(m.Logger()) var gcpService = googlecloud.NewStackdriverMetadataServiceForTimeSeries(nil) diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/timeseries.go b/x-pack/metricbeat/module/googlecloud/stackdriver/timeseries.go index fcf3184717c..1cb9997a5f8 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/timeseries.go +++ b/x-pack/metricbeat/module/googlecloud/stackdriver/timeseries.go @@ -7,53 +7,57 @@ package stackdriver import ( "context" - monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3" - "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud" ) //timeSeriesGrouped groups TimeSeries responses into common Elasticsearch friendly events. This is to avoid sending // events with a single metric that shares info (like timestamp) with another event with a single metric too -func (m *MetricSet) timeSeriesGrouped(ctx context.Context, gcpService googlecloud.MetadataService, tss []*monitoringpb.TimeSeries, e *incomingFieldExtractor) (map[string][]KeyValuePoint, error) { +func (m *MetricSet) timeSeriesGrouped(ctx context.Context, gcpService googlecloud.MetadataService, tsas []timeSeriesWithAligner, e *incomingFieldExtractor) (map[string][]KeyValuePoint, error) { eventGroups := make(map[string][]KeyValuePoint) metadataService := gcpService - for _, ts := range tss { - keyValues, err := e.extractTimeSeriesMetricValues(ts) - if err != nil { - return nil, err - } - - sdCollectorInputData := googlecloud.NewStackdriverCollectorInputData(ts, m.config.ProjectID, m.config.Zone, m.config.Region) - if gcpService == nil { - metadataService = googlecloud.NewStackdriverMetadataServiceForTimeSeries(ts) - } - - for i := range keyValues { - sdCollectorInputData.Timestamp = &keyValues[i].Timestamp - - id, err := metadataService.ID(ctx, sdCollectorInputData) + for _, tsa := range tsas { + aligner := tsa.aligner + for _, ts := range tsa.timeSeries { + keyValues, err := e.extractTimeSeriesMetricValues(ts) if err != nil { - m.Logger().Errorf("error trying to retrieve ID from metric event '%v'", err) - continue + return nil, err } - metadataCollectorData, err := metadataService.Metadata(ctx, sdCollectorInputData.TimeSeries) - if err != nil { - m.Logger().Error("error trying to retrieve labels from metric event") - continue + sdCollectorInputData := googlecloud.NewStackdriverCollectorInputData(ts, m.config.ProjectID, m.config.Zone, m.config.Region) + if gcpService == nil { + metadataService = googlecloud.NewStackdriverMetadataServiceForTimeSeries(ts) } - if _, ok := eventGroups[id]; !ok { - eventGroups[id] = make([]KeyValuePoint, 0) - } + for i := range keyValues { + sdCollectorInputData.Timestamp = &keyValues[i].Timestamp + + id, err := metadataService.ID(ctx, sdCollectorInputData) + if err != nil { + m.Logger().Errorf("error trying to retrieve ID from metric event '%v'", err) + continue + } + + metadataCollectorData, err := metadataService.Metadata(ctx, sdCollectorInputData.TimeSeries) + if err != nil { + m.Logger().Error("error trying to retrieve labels from metric event") + continue + } - keyValues[i].ECS = metadataCollectorData.ECS - keyValues[i].Labels = metadataCollectorData.Labels + if _, ok := eventGroups[id]; !ok { + eventGroups[id] = make([]KeyValuePoint, 0) + } - // Group the data into common events - eventGroups[id] = append(eventGroups[id], keyValues[i]) + // Add aggregation aligner as a label into metadata + metadataCollectorData.Labels.Put("aggregation_aligner", aligner) + + keyValues[i].ECS = metadataCollectorData.ECS + keyValues[i].Labels = metadataCollectorData.Labels + + // Group the data into common events + eventGroups[id] = append(eventGroups[id], keyValues[i]) + } } } From 19647da0d7d7225277ae40e4e51ba95f8a027439 Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Fri, 17 Apr 2020 15:50:41 -0600 Subject: [PATCH 08/15] add changelog --- CHANGELOG.next.asciidoc | 1 + x-pack/metricbeat/module/googlecloud/constants.go | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 8e6611da1dd..930fbcdd79d 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -331,6 +331,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - Add final tests and move label to GA for the azure module in metricbeat. {pull}17319[17319] - Reference kubernetes manifests mount data directory from the host when running metricbeat as daemonset, so data persist between executions in the same node. {pull}17429[17429] - Stack Monitoring modules now auto-configure required metricsets when `xpack.enabled: true` is set. {issue}16471[[16471] {pull}17609[17609] +- Add aggregation into ListTimeSeries for googlecloud module to collect one metric per period. {issue}17141[[17141] {pull}17719[17719] *Packetbeat* diff --git a/x-pack/metricbeat/module/googlecloud/constants.go b/x-pack/metricbeat/module/googlecloud/constants.go index 4c7743ffbf8..54d0b360a56 100644 --- a/x-pack/metricbeat/module/googlecloud/constants.go +++ b/x-pack/metricbeat/module/googlecloud/constants.go @@ -73,6 +73,7 @@ const ( ) // Available perSeriesAligner map +// https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.alertPolicies#Aligner var AlignersMapToGCP = map[string]monitoringpb.Aggregation_Aligner{ "ALIGN_NONE": monitoringpb.Aggregation_ALIGN_NONE, "ALIGN_DELTA": monitoringpb.Aggregation_ALIGN_DELTA, From 839fdf50aff68569da14778cf6829e8644e058b0 Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Mon, 20 Apr 2020 20:50:46 -0600 Subject: [PATCH 09/15] add metric_types and aligner config params under metrics for stackdriver --- .../module/googlecloud/_meta/docs.asciidoc | 20 ++-- .../module/googlecloud/compute/manifest.yml | 30 +++--- .../module/googlecloud/constants.go | 4 + .../googlecloud/loadbalancing/manifest.yml | 51 +++++----- .../module/googlecloud/pubsub/manifest.yml | 95 ++++++++++--------- .../stackdriver/metrics_requester.go | 69 ++++++-------- .../stackdriver/metrics_requester_test.go | 71 +++----------- .../googlecloud/stackdriver/metricset.go | 86 ++++++++++------- .../googlecloud/stackdriver/timeseries.go | 4 +- .../module/googlecloud/storage/manifest.yml | 19 ++-- 10 files changed, 216 insertions(+), 233 deletions(-) diff --git a/x-pack/metricbeat/module/googlecloud/_meta/docs.asciidoc b/x-pack/metricbeat/module/googlecloud/_meta/docs.asciidoc index f16907d3222..19b951af4a5 100644 --- a/x-pack/metricbeat/module/googlecloud/_meta/docs.asciidoc +++ b/x-pack/metricbeat/module/googlecloud/_meta/docs.asciidoc @@ -18,10 +18,10 @@ This is a list of the possible module parameters you can tune: * *period*: A single time duration specified for this module collection frequency. -* *perSeriesAligner*: A single string with which aggregation operation need to be applied onto time series data for ListTimeSeries API . -If it's not given and sample period of a specific metric type is larger or equal than module collection period, default perSeriesAligner is set to be `ALIGN_NONE`. -If it's not given and sample period of a specific metric type is smaller than module collection period, default perSeriesAligner is set to be `ALIGN_MEAN`. -Sample period of each metric type is obtained from making https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors/list [ListMetricDescriptors API] call. +* *aligner*: A single string with which aggregation operation need to be applied +onto time series data for ListTimeSeries API. If it's not given, default aligner +is set to be `ALIGN_NONE`. Sample period of each metric type is obtained from +making https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors/list [ListMetricDescriptors API] call. [float] === Example Configuration @@ -48,9 +48,9 @@ metricbeat.modules: * `compute` metricset is enabled to collect metrics from a specific zone `us-central1a` in `test-project`. Metric types collected by `compute` metricset usually have 240 seconds ingest delay time and 60 seconds sample period. With -`period` specified as `300s` in the config below and no `perSeriesAligner` +`period` specified as `300s` in the config below and no `aligner` specified, Metricbeat will collect compute metrics from googlecloud every -5-minute with default `perSeriesAligner = ALIGN_MEAN` aggregation. +5-minute with default `aligner = ALIGN_MEAN` aggregation. + [source,yaml] ---- @@ -68,9 +68,9 @@ metricbeat.modules: * `compute` metricset is enabled to collect metrics from a specific zone `us-central1a` in `test-project`. Metric types collected by `compute` metricset usually have 240 seconds ingest delay time and 60 seconds sample period. With -`period` specified as `10m` in the config below and given `perSeriesAligner: ALIGN_MAX` +`period` specified as `10m` in the config below and given `aligner: ALIGN_MAX` specified, Metricbeat will collect compute metrics from googlecloud every -10-minute with default `perSeriesAligner = ALIGN_MAX` aggregation. +10-minute with default `aligner = ALIGN_MAX` aggregation. + [source,yaml] ---- @@ -89,9 +89,9 @@ metricbeat.modules: * `compute` metricset is enabled to collect metrics from a specific zone `us-central1a` in `test-project`. Metric types collected by `compute` metricset usually have 240 seconds ingest delay time and 60 seconds sample period. With -`period` specified as `5m` in the config below and given `perSeriesAligner: ALIGN_NONE` +`period` specified as `5m` in the config below and given `aligner: ALIGN_NONE` specified, Metricbeat will collect compute metrics from googlecloud every -5-minute with `perSeriesAligner = ALIGN_NONE` aggregation, which means no aligner +5-minute with `aligner = ALIGN_NONE` aggregation, which means no aligner is applied. This way, Metricbeat will collect `compute` metrics every 5-minute and each collection will return 5 data points(one per sample period). + diff --git a/x-pack/metricbeat/module/googlecloud/compute/manifest.yml b/x-pack/metricbeat/module/googlecloud/compute/manifest.yml index 03b16dcd440..54607999d60 100644 --- a/x-pack/metricbeat/module/googlecloud/compute/manifest.yml +++ b/x-pack/metricbeat/module/googlecloud/compute/manifest.yml @@ -6,16 +6,20 @@ input: stackdriver: service: compute metrics: - - "compute.googleapis.com/firewall/dropped_bytes_count" - - "compute.googleapis.com/firewall/dropped_packets_count" - - "compute.googleapis.com/instance/cpu/reserved_cores" - - "compute.googleapis.com/instance/cpu/usage_time" - - "compute.googleapis.com/instance/cpu/utilization" - - "compute.googleapis.com/instance/disk/read_bytes_count" - - "compute.googleapis.com/instance/disk/read_ops_count" - - "compute.googleapis.com/instance/disk/write_bytes_count" - - "compute.googleapis.com/instance/disk/write_ops_count" - - "compute.googleapis.com/instance/network/received_bytes_count" - - "compute.googleapis.com/instance/network/received_packets_count" - - "compute.googleapis.com/instance/network/sent_bytes_count" - - "compute.googleapis.com/instance/uptime" + - metric_types: + - "compute.googleapis.com/instance/cpu/usage_time" + - "compute.googleapis.com/instance/cpu/utilization" + - "compute.googleapis.com/instance/uptime" + - "compute.googleapis.com/firewall/dropped_bytes_count" + - "compute.googleapis.com/firewall/dropped_packets_count" + - "compute.googleapis.com/instance/cpu/reserved_cores" + - "compute.googleapis.com/instance/cpu/usage_time" + - "compute.googleapis.com/instance/cpu/utilization" + - "compute.googleapis.com/instance/disk/read_bytes_count" + - "compute.googleapis.com/instance/disk/read_ops_count" + - "compute.googleapis.com/instance/disk/write_bytes_count" + - "compute.googleapis.com/instance/disk/write_ops_count" + - "compute.googleapis.com/instance/network/received_bytes_count" + - "compute.googleapis.com/instance/network/received_packets_count" + - "compute.googleapis.com/instance/network/sent_bytes_count" + - "compute.googleapis.com/instance/uptime" diff --git a/x-pack/metricbeat/module/googlecloud/constants.go b/x-pack/metricbeat/module/googlecloud/constants.go index 54d0b360a56..429a668cb86 100644 --- a/x-pack/metricbeat/module/googlecloud/constants.go +++ b/x-pack/metricbeat/module/googlecloud/constants.go @@ -95,3 +95,7 @@ var AlignersMapToGCP = map[string]monitoringpb.Aggregation_Aligner{ "ALIGN_PERCENTILE_05": monitoringpb.Aggregation_ALIGN_PERCENTILE_05, "ALIGN_PERCENT_CHANGE": monitoringpb.Aggregation_ALIGN_PERCENT_CHANGE, } + +const ( + DefaultAligner = "ALIGN_NONE" +) diff --git a/x-pack/metricbeat/module/googlecloud/loadbalancing/manifest.yml b/x-pack/metricbeat/module/googlecloud/loadbalancing/manifest.yml index 479f92c94d4..173b8fbd265 100644 --- a/x-pack/metricbeat/module/googlecloud/loadbalancing/manifest.yml +++ b/x-pack/metricbeat/module/googlecloud/loadbalancing/manifest.yml @@ -6,28 +6,29 @@ input: stackdriver: service: loadbalancing metrics: - - "loadbalancing.googleapis.com/https/backend_latencies" - - "loadbalancing.googleapis.com/https/backend_latencies" - - "loadbalancing.googleapis.com/https/backend_request_bytes_count" - - "loadbalancing.googleapis.com/https/backend_request_count" - - "loadbalancing.googleapis.com/https/backend_response_bytes_count" - - "loadbalancing.googleapis.com/https/frontend_tcp_rtt" - - "loadbalancing.googleapis.com/https/request_bytes_count" - - "loadbalancing.googleapis.com/https/request_bytes_count" - - "loadbalancing.googleapis.com/https/request_count" - - "loadbalancing.googleapis.com/https/request_count" - - "loadbalancing.googleapis.com/https/response_bytes_count" - - "loadbalancing.googleapis.com/https/response_bytes_count" - - "loadbalancing.googleapis.com/https/total_latencies" - - "loadbalancing.googleapis.com/https/total_latencies" - - "loadbalancing.googleapis.com/l3/internal/egress_bytes_count" - - "loadbalancing.googleapis.com/l3/internal/egress_packets_count" - - "loadbalancing.googleapis.com/l3/internal/ingress_bytes_count" - - "loadbalancing.googleapis.com/l3/internal/ingress_packets_count" - - "loadbalancing.googleapis.com/l3/internal/rtt_latencies" - - "loadbalancing.googleapis.com/tcp_ssl_proxy/closed_connections" - - "loadbalancing.googleapis.com/tcp_ssl_proxy/egress_bytes_count" - - "loadbalancing.googleapis.com/tcp_ssl_proxy/frontend_tcp_rtt" - - "loadbalancing.googleapis.com/tcp_ssl_proxy/ingress_bytes_count" - - "loadbalancing.googleapis.com/tcp_ssl_proxy/new_connections" - - "loadbalancing.googleapis.com/tcp_ssl_proxy/open_connections" + - metric_types: + - "loadbalancing.googleapis.com/https/backend_latencies" + - "loadbalancing.googleapis.com/https/backend_latencies" + - "loadbalancing.googleapis.com/https/backend_request_bytes_count" + - "loadbalancing.googleapis.com/https/backend_request_count" + - "loadbalancing.googleapis.com/https/backend_response_bytes_count" + - "loadbalancing.googleapis.com/https/frontend_tcp_rtt" + - "loadbalancing.googleapis.com/https/request_bytes_count" + - "loadbalancing.googleapis.com/https/request_bytes_count" + - "loadbalancing.googleapis.com/https/request_count" + - "loadbalancing.googleapis.com/https/request_count" + - "loadbalancing.googleapis.com/https/response_bytes_count" + - "loadbalancing.googleapis.com/https/response_bytes_count" + - "loadbalancing.googleapis.com/https/total_latencies" + - "loadbalancing.googleapis.com/https/total_latencies" + - "loadbalancing.googleapis.com/l3/internal/egress_bytes_count" + - "loadbalancing.googleapis.com/l3/internal/egress_packets_count" + - "loadbalancing.googleapis.com/l3/internal/ingress_bytes_count" + - "loadbalancing.googleapis.com/l3/internal/ingress_packets_count" + - "loadbalancing.googleapis.com/l3/internal/rtt_latencies" + - "loadbalancing.googleapis.com/tcp_ssl_proxy/closed_connections" + - "loadbalancing.googleapis.com/tcp_ssl_proxy/egress_bytes_count" + - "loadbalancing.googleapis.com/tcp_ssl_proxy/frontend_tcp_rtt" + - "loadbalancing.googleapis.com/tcp_ssl_proxy/ingress_bytes_count" + - "loadbalancing.googleapis.com/tcp_ssl_proxy/new_connections" + - "loadbalancing.googleapis.com/tcp_ssl_proxy/open_connections" diff --git a/x-pack/metricbeat/module/googlecloud/pubsub/manifest.yml b/x-pack/metricbeat/module/googlecloud/pubsub/manifest.yml index 3d8cdb0949c..285136f3cf8 100644 --- a/x-pack/metricbeat/module/googlecloud/pubsub/manifest.yml +++ b/x-pack/metricbeat/module/googlecloud/pubsub/manifest.yml @@ -6,50 +6,51 @@ input: stackdriver: service: pubsub metrics: - - "pubsub.googleapis.com/snapshot/backlog_bytes" - - "pubsub.googleapis.com/snapshot/backlog_bytes_by_region" - - "pubsub.googleapis.com/snapshot/config_updates_count" - - "pubsub.googleapis.com/snapshot/num_messages" - - "pubsub.googleapis.com/snapshot/num_messages_by_region" - - "pubsub.googleapis.com/snapshot/oldest_message_age" - - "pubsub.googleapis.com/snapshot/oldest_message_age_by_region" - - "pubsub.googleapis.com/subscription/ack_message_count" - - "pubsub.googleapis.com/subscription/backlog_bytes" - - "pubsub.googleapis.com/subscription/byte_cost" - - "pubsub.googleapis.com/subscription/config_updates_count" - - "pubsub.googleapis.com/subscription/dead_letter_message_count" - - "pubsub.googleapis.com/subscription/mod_ack_deadline_message_count" - - "pubsub.googleapis.com/subscription/mod_ack_deadline_message_operation_count" - - "pubsub.googleapis.com/subscription/mod_ack_deadline_request_count" - - "pubsub.googleapis.com/subscription/num_outstanding_messages" - - "pubsub.googleapis.com/subscription/num_undelivered_messages" - - "pubsub.googleapis.com/subscription/oldest_retained_acked_message_age" - - "pubsub.googleapis.com/subscription/oldest_retained_acked_message_age_by_region" - - "pubsub.googleapis.com/subscription/oldest_unacked_message_age" - - "pubsub.googleapis.com/subscription/oldest_unacked_message_age_by_region" - - "pubsub.googleapis.com/subscription/pull_ack_message_operation_count" - - "pubsub.googleapis.com/subscription/pull_ack_request_count" - - "pubsub.googleapis.com/subscription/pull_message_operation_count" - - "pubsub.googleapis.com/subscription/pull_request_count" - - "pubsub.googleapis.com/subscription/push_request_count" - - "pubsub.googleapis.com/subscription/push_request_latencies" - - "pubsub.googleapis.com/subscription/retained_acked_bytes" - - "pubsub.googleapis.com/subscription/retained_acked_bytes_by_region" - - "pubsub.googleapis.com/subscription/seek_request_count" - - "pubsub.googleapis.com/subscription/sent_message_count" - - "pubsub.googleapis.com/subscription/streaming_pull_ack_message_operation_count" - - "pubsub.googleapis.com/subscription/streaming_pull_ack_request_count" - - "pubsub.googleapis.com/subscription/streaming_pull_message_operation_count" - - "pubsub.googleapis.com/subscription/streaming_pull_mod_ack_deadline_message_operation_count" - - "pubsub.googleapis.com/subscription/streaming_pull_mod_ack_deadline_request_count" - - "pubsub.googleapis.com/subscription/streaming_pull_response_count" - - "pubsub.googleapis.com/subscription/unacked_bytes_by_region" - - "pubsub.googleapis.com/topic/byte_cost" - - "pubsub.googleapis.com/topic/config_updates_count" - - "pubsub.googleapis.com/topic/message_sizes" - - "pubsub.googleapis.com/topic/oldest_retained_acked_message_age_by_region" - - "pubsub.googleapis.com/topic/oldest_unacked_message_age_by_region" - - "pubsub.googleapis.com/topic/retained_acked_bytes_by_region" - - "pubsub.googleapis.com/topic/send_message_operation_count" - - "pubsub.googleapis.com/topic/send_request_count" - - "pubsub.googleapis.com/topic/unacked_bytes_by_region" + - metric_types: + - "pubsub.googleapis.com/snapshot/backlog_bytes" + - "pubsub.googleapis.com/snapshot/backlog_bytes_by_region" + - "pubsub.googleapis.com/snapshot/config_updates_count" + - "pubsub.googleapis.com/snapshot/num_messages" + - "pubsub.googleapis.com/snapshot/num_messages_by_region" + - "pubsub.googleapis.com/snapshot/oldest_message_age" + - "pubsub.googleapis.com/snapshot/oldest_message_age_by_region" + - "pubsub.googleapis.com/subscription/ack_message_count" + - "pubsub.googleapis.com/subscription/backlog_bytes" + - "pubsub.googleapis.com/subscription/byte_cost" + - "pubsub.googleapis.com/subscription/config_updates_count" + - "pubsub.googleapis.com/subscription/dead_letter_message_count" + - "pubsub.googleapis.com/subscription/mod_ack_deadline_message_count" + - "pubsub.googleapis.com/subscription/mod_ack_deadline_message_operation_count" + - "pubsub.googleapis.com/subscription/mod_ack_deadline_request_count" + - "pubsub.googleapis.com/subscription/num_outstanding_messages" + - "pubsub.googleapis.com/subscription/num_undelivered_messages" + - "pubsub.googleapis.com/subscription/oldest_retained_acked_message_age" + - "pubsub.googleapis.com/subscription/oldest_retained_acked_message_age_by_region" + - "pubsub.googleapis.com/subscription/oldest_unacked_message_age" + - "pubsub.googleapis.com/subscription/oldest_unacked_message_age_by_region" + - "pubsub.googleapis.com/subscription/pull_ack_message_operation_count" + - "pubsub.googleapis.com/subscription/pull_ack_request_count" + - "pubsub.googleapis.com/subscription/pull_message_operation_count" + - "pubsub.googleapis.com/subscription/pull_request_count" + - "pubsub.googleapis.com/subscription/push_request_count" + - "pubsub.googleapis.com/subscription/push_request_latencies" + - "pubsub.googleapis.com/subscription/retained_acked_bytes" + - "pubsub.googleapis.com/subscription/retained_acked_bytes_by_region" + - "pubsub.googleapis.com/subscription/seek_request_count" + - "pubsub.googleapis.com/subscription/sent_message_count" + - "pubsub.googleapis.com/subscription/streaming_pull_ack_message_operation_count" + - "pubsub.googleapis.com/subscription/streaming_pull_ack_request_count" + - "pubsub.googleapis.com/subscription/streaming_pull_message_operation_count" + - "pubsub.googleapis.com/subscription/streaming_pull_mod_ack_deadline_message_operation_count" + - "pubsub.googleapis.com/subscription/streaming_pull_mod_ack_deadline_request_count" + - "pubsub.googleapis.com/subscription/streaming_pull_response_count" + - "pubsub.googleapis.com/subscription/unacked_bytes_by_region" + - "pubsub.googleapis.com/topic/byte_cost" + - "pubsub.googleapis.com/topic/config_updates_count" + - "pubsub.googleapis.com/topic/message_sizes" + - "pubsub.googleapis.com/topic/oldest_retained_acked_message_age_by_region" + - "pubsub.googleapis.com/topic/oldest_unacked_message_age_by_region" + - "pubsub.googleapis.com/topic/retained_acked_bytes_by_region" + - "pubsub.googleapis.com/topic/send_message_operation_count" + - "pubsub.googleapis.com/topic/send_request_count" + - "pubsub.googleapis.com/topic/unacked_bytes_by_region" diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester.go b/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester.go index 9c59e47638f..8916fd176b0 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester.go +++ b/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester.go @@ -35,16 +35,18 @@ type timeSeriesWithAligner struct { aligner string } -func (r *stackdriverMetricsRequester) Metric(ctx context.Context, m string, timeInterval *monitoringpb.TimeInterval, needsAggregation bool) (out timeSeriesWithAligner) { +func (r *stackdriverMetricsRequester) Metric(ctx context.Context, metricType string, timeInterval *monitoringpb.TimeInterval, aligner string) (out timeSeriesWithAligner) { timeSeries := make([]*monitoringpb.TimeSeries, 0) - aggregation := constructAggregation(r.config.period, r.config.PerSeriesAligner, needsAggregation) req := &monitoringpb.ListTimeSeriesRequest{ - Name: "projects/" + r.config.ProjectID, - Interval: timeInterval, - View: monitoringpb.ListTimeSeriesRequest_FULL, - Filter: r.getFilterForMetric(m), - Aggregation: constructAggregation(r.config.period, r.config.PerSeriesAligner, needsAggregation), + Name: "projects/" + r.config.ProjectID, + Interval: timeInterval, + View: monitoringpb.ListTimeSeriesRequest_FULL, + Filter: r.getFilterForMetric(metricType), + Aggregation: &monitoringpb.Aggregation{ + PerSeriesAligner: googlecloud.AlignersMapToGCP[aligner], + AlignmentPeriod: &r.config.period, + }, } it := r.client.ListTimeSeries(ctx, req) @@ -55,14 +57,14 @@ func (r *stackdriverMetricsRequester) Metric(ctx context.Context, m string, time } if err != nil { - r.logger.Errorf("Could not read time series value: %s: %v", m, err) + r.logger.Errorf("Could not read time series value: %s: %v", metricType, err) break } timeSeries = append(timeSeries, resp) } - out.aligner = aggregation.PerSeriesAligner.String() + out.aligner = aligner out.timeSeries = timeSeries return } @@ -79,26 +81,28 @@ func constructFilter(m string, region string, zone string) string { return filter } -func (r *stackdriverMetricsRequester) Metrics(ctx context.Context, metricTypes []string, metricsMeta map[string]metricMeta) ([]timeSeriesWithAligner, error) { +func (r *stackdriverMetricsRequester) Metrics(ctx context.Context, stackDriverConfigs []stackDriverConfig, metricsMeta map[string]metricMeta) ([]timeSeriesWithAligner, error) { var lock sync.Mutex var wg sync.WaitGroup results := make([]timeSeriesWithAligner, 0) - for _, mt := range metricTypes { - metricType := mt - wg.Add(1) + for _, sdc := range stackDriverConfigs { + for _, mt := range sdc.MetricTypes { + metricType := mt + wg.Add(1) - go func(metricType string) { - defer wg.Done() + go func(metricType string) { + defer wg.Done() - metricMeta := metricsMeta[metricType] - interval, needsAggregation := getTimeInterval(metricMeta.ingestDelay, metricMeta.samplePeriod, r.config.period) - ts := r.Metric(ctx, metricType, interval, needsAggregation) + metricMeta := metricsMeta[metricType] + interval, aligner := getTimeIntervalAligner(metricMeta.ingestDelay, metricMeta.samplePeriod, r.config.period, sdc.Aligner) + ts := r.Metric(ctx, metricType, interval, aligner) - lock.Lock() - defer lock.Unlock() - results = append(results, ts) - }(metricType) + lock.Lock() + defer lock.Unlock() + results = append(results, ts) + }(metricType) + } } wg.Wait() @@ -138,7 +142,7 @@ func (r *stackdriverMetricsRequester) getFilterForMetric(m string) (f string) { } // Returns a GCP TimeInterval based on the ingestDelay and samplePeriod from ListMetricDescriptor -func getTimeInterval(ingestDelay time.Duration, samplePeriod time.Duration, collectionPeriod duration.Duration) (*monitoringpb.TimeInterval, bool) { +func getTimeIntervalAligner(ingestDelay time.Duration, samplePeriod time.Duration, collectionPeriod duration.Duration, inputAligner string) (*monitoringpb.TimeInterval, string) { var startTime, endTime, currentTime time.Time var needsAggregation bool currentTime = time.Now().UTC() @@ -170,22 +174,11 @@ func getTimeInterval(ingestDelay time.Duration, samplePeriod time.Duration, coll }, } - return interval, needsAggregation -} - -func constructAggregation(period duration.Duration, perSeriesAligner string, needsAggregation bool) *monitoringpb.Aggregation { - aligner := "ALIGN_NONE" + // Default aligner for aggregation is ALIGN_NONE if it's not given + updatedAligner := googlecloud.DefaultAligner if needsAggregation { - aligner = perSeriesAligner - if perSeriesAligner == "" { - // set to default aggregation ALIGN_MEAN - aligner = "ALIGN_MEAN" - } + updatedAligner = inputAligner } - aggregation := &monitoringpb.Aggregation{ - PerSeriesAligner: googlecloud.AlignersMapToGCP[aligner], - AlignmentPeriod: &period, - } - return aggregation + return interval, updatedAligner } diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester_test.go b/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester_test.go index 156f58c84a5..1699e25d53a 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester_test.go +++ b/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester_test.go @@ -106,58 +106,14 @@ func TestGetFilterForMetric(t *testing.T) { } } -func TestConstructAggregation(t *testing.T) { +func TestGetTimeIntervalAligner(t *testing.T) { cases := []struct { - title string - period duration.Duration - perSeriesAligner string - needsAggregation bool - expectedPerSeriesAligner string - }{ - { - "test no aggregation", - duration.Duration{ - Seconds: int64(60), - }, - "", - false, - "ALIGN_NONE", - }, - { - "test needs aggregation with no perSeriesAligner config parameter", - duration.Duration{ - Seconds: int64(60), - }, - "", - true, - "ALIGN_MEAN", - }, - { - "test needs aggregation with perSeriesAligner configured", - duration.Duration{ - Seconds: int64(60), - }, - "ALIGN_MAX", - true, - "ALIGN_MAX", - }, - } - - for _, c := range cases { - t.Run(c.title, func(t *testing.T) { - aggregation := constructAggregation(c.period, c.perSeriesAligner, c.needsAggregation) - assert.Equal(t, c.expectedPerSeriesAligner, aggregation.PerSeriesAligner.String()) - }) - } -} - -func TestGetTimeInterval(t *testing.T) { - cases := []struct { - title string - ingestDelay time.Duration - samplePeriod time.Duration - collectionPeriod duration.Duration - expectedNeedsAggregation bool + title string + ingestDelay time.Duration + samplePeriod time.Duration + collectionPeriod duration.Duration + inputAligner string + expectedAligner string }{ { "test collectionPeriod equals to samplePeriod", @@ -166,7 +122,8 @@ func TestGetTimeInterval(t *testing.T) { duration.Duration{ Seconds: int64(60), }, - false, + "", + "ALIGN_NONE", }, { "test collectionPeriod larger than samplePeriod", @@ -175,7 +132,8 @@ func TestGetTimeInterval(t *testing.T) { duration.Duration{ Seconds: int64(300), }, - true, + "ALIGN_MEAN", + "ALIGN_MEAN", }, { "test collectionPeriod smaller than samplePeriod", @@ -184,14 +142,15 @@ func TestGetTimeInterval(t *testing.T) { duration.Duration{ Seconds: int64(30), }, - false, + "ALIGN_MAX", + "ALIGN_NONE", }, } for _, c := range cases { t.Run(c.title, func(t *testing.T) { - _, needsAggregation := getTimeInterval(c.ingestDelay, c.samplePeriod, c.collectionPeriod) - assert.Equal(t, c.expectedNeedsAggregation, needsAggregation) + _, aligner := getTimeIntervalAligner(c.ingestDelay, c.samplePeriod, c.collectionPeriod, c.inputAligner) + assert.Equal(t, c.expectedAligner, aligner) }) } } diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/metricset.go b/x-pack/metricbeat/module/googlecloud/stackdriver/metricset.go index 107d229eb9e..286094b104b 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/metricset.go +++ b/x-pack/metricbeat/module/googlecloud/stackdriver/metricset.go @@ -43,9 +43,16 @@ func init() { // interface methods except for Fetch. type MetricSet struct { mb.BaseMetricSet - config config - metricsMeta map[string]metricMeta - requester *stackdriverMetricsRequester + config config + metricsMeta map[string]metricMeta + requester *stackdriverMetricsRequester + StackDriverConfig []stackDriverConfig `config:"metrics" validate:"nonzero,required"` +} + +//stackDriverConfig holds a configuration specific for stackdriver metricset. +type stackDriverConfig struct { + MetricTypes []string `config:"metric_types" validate:"required"` + Aligner string `config:"aligner"` } type metricMeta struct { @@ -54,14 +61,12 @@ type metricMeta struct { } type config struct { - Metrics []string `config:"stackdriver.metrics" validate:"required"` - Zone string `config:"zone"` - Region string `config:"region"` - ProjectID string `config:"project_id" validate:"required"` - ExcludeLabels bool `config:"exclude_labels"` - ServiceName string `config:"stackdriver.service" validate:"required"` - CredentialsFilePath string `config:"credentials_file_path"` - PerSeriesAligner string `config:"perSeriesAligner"` + Zone string `config:"zone"` + Region string `config:"region"` + ProjectID string `config:"project_id" validate:"required"` + ExcludeLabels bool `config:"exclude_labels"` + ServiceName string `config:"stackdriver.service" validate:"required"` + CredentialsFilePath string `config:"credentials_file_path"` opt []option.ClientOption period duration.Duration @@ -78,6 +83,15 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { return nil, err } + stackDriverConfigs := struct { + StackDriverMetrics []stackDriverConfig `config:"stackdriver.metrics" validate:"nonzero,required"` + }{} + + if err := base.Module().UnpackConfig(&stackDriverConfigs); err != nil { + return nil, err + } + + m.StackDriverConfig = stackDriverConfigs.StackDriverMetrics m.config.opt = []option.ClientOption{option.WithCredentialsFile(m.config.CredentialsFilePath)} m.config.period.Seconds = int64(m.Module().Config().Period.Seconds()) @@ -92,7 +106,7 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { return nil, errors.Wrap(err, "error creating Stackdriver client") } - m.metricsMeta, err = metricDescriptor(ctx, client, m.config.ProjectID, m.config.Metrics) + m.metricsMeta, err = metricDescriptor(ctx, client, m.config.ProjectID, m.StackDriverConfig) if err != nil { return nil, errors.Wrap(err, "error calling metricDescriptor function") } @@ -109,7 +123,7 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { // format. It publishes the event which is then forwarded to the output. In case // of an error set the Error field of mb.Event or simply call report.Error(). func (m *MetricSet) Fetch(ctx context.Context, reporter mb.ReporterV2) (err error) { - responses, err := m.requester.Metrics(ctx, m.config.Metrics, m.metricsMeta) + responses, err := m.requester.Metrics(ctx, m.StackDriverConfig, m.metricsMeta) if err != nil { return errors.Wrapf(err, "error trying to get metrics for project '%s' and zone '%s' or region '%s'", m.config.ProjectID, m.config.Zone, m.config.Region) } @@ -174,6 +188,7 @@ func validatePeriodForGCP(d time.Duration) (err error) { return nil } +// Validate googlecloud module config func (c *config) Validate() error { // storage metricset does not require region or zone config parameter. if c.ServiceName == "storage" { @@ -183,41 +198,46 @@ func (c *config) Validate() error { if c.Region == "" && c.Zone == "" { return errors.New("region and zone in Google Cloud config file cannot both be empty") } + return nil +} +// Validate stackdriver related config +func (mc *stackDriverConfig) Validate() error { gcpAlignerNames := make([]string, 0) for k := range googlecloud.AlignersMapToGCP { gcpAlignerNames = append(gcpAlignerNames, k) } - if c.PerSeriesAligner != "" { - if _, ok := googlecloud.AlignersMapToGCP[c.PerSeriesAligner]; !ok { - return errors.Errorf("the given perSeriesAligner is not supported, please specify one of %s as perSeriesAligner", gcpAlignerNames) + if mc.Aligner != "" { + if _, ok := googlecloud.AlignersMapToGCP[mc.Aligner]; !ok { + return errors.Errorf("the given aligner is not supported, please specify one of %s as aligner", gcpAlignerNames) } } - return nil } // metricDescriptor calls ListMetricDescriptorsRequest API to get metric metadata // (sample period and ingest delay) of each given metric type -func metricDescriptor(ctx context.Context, client *monitoring.MetricClient, projectID string, metricTypes []string) (map[string]metricMeta, error) { +func metricDescriptor(ctx context.Context, client *monitoring.MetricClient, projectID string, metricsConfigs []stackDriverConfig) (map[string]metricMeta, error) { metricsWithMeta := make(map[string]metricMeta, 0) - for _, mt := range metricTypes { - req := &monitoringpb.ListMetricDescriptorsRequest{ - Name: "projects/" + projectID, - Filter: fmt.Sprintf(`metric.type = "%s"`, mt), - } - - it := client.ListMetricDescriptors(ctx, req) - out, err := it.Next() - if err != nil { - return metricsWithMeta, errors.Errorf("Could not make ListMetricDescriptors request: %s: %v", mt, err) - } - - metricsWithMeta[mt] = metricMeta{ - samplePeriod: time.Duration(out.Metadata.SamplePeriod.Seconds) * time.Second, - ingestDelay: time.Duration(out.Metadata.IngestDelay.Seconds) * time.Second, + for _, metricsC := range metricsConfigs { + for _, mt := range metricsC.MetricTypes { + req := &monitoringpb.ListMetricDescriptorsRequest{ + Name: "projects/" + projectID, + Filter: fmt.Sprintf(`metric.type = "%s"`, mt), + } + + it := client.ListMetricDescriptors(ctx, req) + out, err := it.Next() + if err != nil { + return metricsWithMeta, errors.Errorf("Could not make ListMetricDescriptors request: %s: %v", mt, err) + } + + metricsWithMeta[mt] = metricMeta{ + samplePeriod: time.Duration(out.Metadata.SamplePeriod.Seconds) * time.Second, + ingestDelay: time.Duration(out.Metadata.IngestDelay.Seconds) * time.Second, + } } } diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/timeseries.go b/x-pack/metricbeat/module/googlecloud/stackdriver/timeseries.go index 1cb9997a5f8..74f24ffe825 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/timeseries.go +++ b/x-pack/metricbeat/module/googlecloud/stackdriver/timeseries.go @@ -18,7 +18,7 @@ func (m *MetricSet) timeSeriesGrouped(ctx context.Context, gcpService googleclou metadataService := gcpService for _, tsa := range tsas { - aligner := tsa.aligner + // aligner := tsa.aligner for _, ts := range tsa.timeSeries { keyValues, err := e.extractTimeSeriesMetricValues(ts) if err != nil { @@ -50,7 +50,7 @@ func (m *MetricSet) timeSeriesGrouped(ctx context.Context, gcpService googleclou } // Add aggregation aligner as a label into metadata - metadataCollectorData.Labels.Put("aggregation_aligner", aligner) + // metadataCollectorData.Labels.Put("aggregation_aligner", aligner) keyValues[i].ECS = metadataCollectorData.ECS keyValues[i].Labels = metadataCollectorData.Labels diff --git a/x-pack/metricbeat/module/googlecloud/storage/manifest.yml b/x-pack/metricbeat/module/googlecloud/storage/manifest.yml index f462867dcb5..2a9363cf78d 100644 --- a/x-pack/metricbeat/module/googlecloud/storage/manifest.yml +++ b/x-pack/metricbeat/module/googlecloud/storage/manifest.yml @@ -6,12 +6,13 @@ input: stackdriver: service: storage metrics: - - "storage.googleapis.com/api/request_count" - - "storage.googleapis.com/authz/acl_based_object_access_count" - - "storage.googleapis.com/authz/acl_operations_count" - - "storage.googleapis.com/authz/object_specific_acl_mutation_count" - - "storage.googleapis.com/network/received_bytes_count" - - "storage.googleapis.com/network/sent_bytes_count" - - "storage.googleapis.com/storage/object_count" - - "storage.googleapis.com/storage/total_byte_seconds" - - "storage.googleapis.com/storage/total_bytes" + - metric_types: + - "storage.googleapis.com/api/request_count" + - "storage.googleapis.com/authz/acl_based_object_access_count" + - "storage.googleapis.com/authz/acl_operations_count" + - "storage.googleapis.com/authz/object_specific_acl_mutation_count" + - "storage.googleapis.com/network/received_bytes_count" + - "storage.googleapis.com/network/sent_bytes_count" + - "storage.googleapis.com/storage/object_count" + - "storage.googleapis.com/storage/total_byte_seconds" + - "storage.googleapis.com/storage/total_bytes" From b1c98a9a52d9b243c8fb6e5a2a31347be532d372 Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Mon, 20 Apr 2020 20:58:17 -0600 Subject: [PATCH 10/15] update doc --- metricbeat/docs/modules/googlecloud.asciidoc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/metricbeat/docs/modules/googlecloud.asciidoc b/metricbeat/docs/modules/googlecloud.asciidoc index d2958c9fef7..d8026bcab96 100644 --- a/metricbeat/docs/modules/googlecloud.asciidoc +++ b/metricbeat/docs/modules/googlecloud.asciidoc @@ -28,10 +28,10 @@ This is a list of the possible module parameters you can tune: * *period*: A single time duration specified for this module collection frequency. -* *perSeriesAligner*: A single string with which aggregation operation need to be applied onto time series data for ListTimeSeries API . -If it's not given and sample period of a specific metric type is larger or equal than module collection period, default perSeriesAligner is set to be `ALIGN_NONE`. -If it's not given and sample period of a specific metric type is smaller than module collection period, default perSeriesAligner is set to be `ALIGN_MEAN`. -Sample period of each metric type is obtained from making https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors/list [ListMetricDescriptors API] call. +* *aligner*: A single string with which aggregation operation need to be applied +onto time series data for ListTimeSeries API. If it's not given, default aligner +is set to be `ALIGN_NONE`. Sample period of each metric type is obtained from +making https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors/list [ListMetricDescriptors API] call. [float] === Example Configuration @@ -58,9 +58,9 @@ metricbeat.modules: * `compute` metricset is enabled to collect metrics from a specific zone `us-central1a` in `test-project`. Metric types collected by `compute` metricset usually have 240 seconds ingest delay time and 60 seconds sample period. With -`period` specified as `300s` in the config below and no `perSeriesAligner` +`period` specified as `300s` in the config below and no `aligner` specified, Metricbeat will collect compute metrics from googlecloud every -5-minute with default `perSeriesAligner = ALIGN_MEAN` aggregation. +5-minute with default `aligner = ALIGN_MEAN` aggregation. + [source,yaml] ---- @@ -78,9 +78,9 @@ metricbeat.modules: * `compute` metricset is enabled to collect metrics from a specific zone `us-central1a` in `test-project`. Metric types collected by `compute` metricset usually have 240 seconds ingest delay time and 60 seconds sample period. With -`period` specified as `10m` in the config below and given `perSeriesAligner: ALIGN_MAX` +`period` specified as `10m` in the config below and given `aligner: ALIGN_MAX` specified, Metricbeat will collect compute metrics from googlecloud every -10-minute with default `perSeriesAligner = ALIGN_MAX` aggregation. +10-minute with default `aligner = ALIGN_MAX` aggregation. + [source,yaml] ---- @@ -99,9 +99,9 @@ metricbeat.modules: * `compute` metricset is enabled to collect metrics from a specific zone `us-central1a` in `test-project`. Metric types collected by `compute` metricset usually have 240 seconds ingest delay time and 60 seconds sample period. With -`period` specified as `5m` in the config below and given `perSeriesAligner: ALIGN_NONE` +`period` specified as `5m` in the config below and given `aligner: ALIGN_NONE` specified, Metricbeat will collect compute metrics from googlecloud every -5-minute with `perSeriesAligner = ALIGN_NONE` aggregation, which means no aligner +5-minute with `aligner = ALIGN_NONE` aggregation, which means no aligner is applied. This way, Metricbeat will collect `compute` metrics every 5-minute and each collection will return 5 data points(one per sample period). + From d2370e7904b442db81e041ed4d50091c3417d4fe Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Tue, 21 Apr 2020 15:02:17 -0600 Subject: [PATCH 11/15] Add aligner into metric name suffix (eg: .avg, .sum) --- metricbeat/docs/fields.asciidoc | 1239 +++++++++++++++++ .../module/googlecloud/_meta/fields.yml | 28 +- .../googlecloud/compute/_meta/data.json | 22 +- .../googlecloud/compute/_meta/fields.yml | 28 +- .../metricbeat/module/googlecloud/fields.go | 2 +- .../googlecloud/loadbalancing/_meta/data.json | 126 +- .../loadbalancing/_meta/fields.yml | 120 +- .../module/googlecloud/pubsub/_meta/data.json | 28 +- .../googlecloud/pubsub/_meta/fields.yml | 97 +- .../googlecloud/storage/_meta/fields.yml | 18 +- 10 files changed, 1427 insertions(+), 281 deletions(-) diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index 8996357d382..33a6a9e6bdc 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -17174,6 +17174,7 @@ GCP module + *`googlecloud.labels`*:: + -- @@ -17181,6 +17182,1244 @@ type: object -- +*`googlecloud.*.*.*.*.*`*:: ++ +-- +Metrics that returned from StackDriver API query. + + +type: object + +-- + +[float] +=== compute + +Google Cloud Compute metrics + + + + +*`googlecloud.compute.instance.firewall.dropped_bytes_count.raw`*:: ++ +-- +Incoming bytes dropped by the firewall + +type: long + +-- + +*`googlecloud.compute.instance.firewall.dropped_packets_count.raw`*:: ++ +-- +Incoming packets dropped by the firewall + +type: long + +-- + + +*`googlecloud.compute.instance.cpu.reserved_cores.raw`*:: ++ +-- +Number of cores reserved on the host of the instance + +type: double + +-- + +*`googlecloud.compute.instance.cpu.utilization.raw`*:: ++ +-- +The fraction of the allocated CPU that is currently in use on the instance + +type: double + +-- + +*`googlecloud.compute.instance.cpu.usage_time.raw`*:: ++ +-- +Usage for all cores in seconds + +type: double + +-- + + +*`googlecloud.compute.instance.disk.read_bytes_count.raw`*:: ++ +-- +Count of bytes read from disk + +type: long + +-- + +*`googlecloud.compute.instance.disk.read_ops_count.raw`*:: ++ +-- +Count of disk read IO operations + +type: long + +-- + +*`googlecloud.compute.instance.disk.write_bytes_count.raw`*:: ++ +-- +Count of bytes written to disk + +type: long + +-- + +*`googlecloud.compute.instance.disk.write_ops_count.raw`*:: ++ +-- +Count of disk write IO operations + +type: long + +-- + +*`googlecloud.compute.instance.uptime.raw`*:: ++ +-- +How long the VM has been running, in seconds + +type: long + +-- + + +*`googlecloud.compute.instance.network.received_bytes_count.raw`*:: ++ +-- +Count of bytes received from the network + +type: long + +-- + +*`googlecloud.compute.instance.network.received_packets_count.raw`*:: ++ +-- +Count of packets received from the network + +type: long + +-- + +*`googlecloud.compute.instance.network.sent_bytes_count.raw`*:: ++ +-- +Count of bytes sent over the network + +type: long + +-- + +*`googlecloud.compute.instance.network.sent_packets_count.raw`*:: ++ +-- +Count of packets sent over the network + +type: long + +-- + +[float] +=== loadbalancing + +Google Cloud Load Balancing metrics + + +[float] +=== https + +Google Cloud Load Balancing metrics + + +[float] +=== backend_latencies + +A distribution of the latency calculated from when the request was sent by the proxy to the backend until the proxy received from the backend the last byte of response. + + +*`googlecloud.loadbalancing.https.backend_latencies.count.raw`*:: ++ +-- +type: long + +-- + +*`googlecloud.loadbalancing.https.backend_latencies.mean.raw`*:: ++ +-- +type: long + +-- + +*`googlecloud.loadbalancing.https.backend_latencies.bucket_counts.raw`*:: ++ +-- +type: long + +-- + + + + +*`googlecloud.loadbalancing.https.backend_latencies.bucket_options.Options.ExponentialBuckets.growth_factor.raw`*:: ++ +-- +type: double + +-- + +*`googlecloud.loadbalancing.https.backend_latencies.bucket_options.Options.ExponentialBuckets.scale.raw`*:: ++ +-- +type: long + +-- + +*`googlecloud.loadbalancing.https.backend_latencies.bucket_options.Options.ExponentialBuckets.num_finite_buckets.raw`*:: ++ +-- +type: long + +-- + +*`googlecloud.loadbalancing.https.backend_request_bytes_count.raw`*:: ++ +-- +The number of bytes sent as requests from HTTP/S load balancer to backends. + +type: long + +-- + +*`googlecloud.loadbalancing.https.backend_request_count.raw`*:: ++ +-- +The number of requests served by backends of HTTP/S load balancer. + +type: long + +-- + +*`googlecloud.loadbalancing.https.backend_response_bytes_count.raw`*:: ++ +-- +The number of bytes sent as responses from backends (or cache) to HTTP/S load balancer. + +type: long + +-- + +[float] +=== frontend_tcp_rtt + +A distribution of the RTT measured for each connection between client and proxy. + + +*`googlecloud.loadbalancing.https.frontend_tcp_rtt.count.raw`*:: ++ +-- +type: long + +-- + +*`googlecloud.loadbalancing.https.frontend_tcp_rtt.mean.raw`*:: ++ +-- +type: long + +-- + +*`googlecloud.loadbalancing.https.frontend_tcp_rtt.bucket_counts.raw`*:: ++ +-- +type: long + +-- + + + + +*`googlecloud.loadbalancing.https.frontend_tcp_rtt.bucket_options.Options.ExponentialBuckets.growth_factor.raw`*:: ++ +-- +type: double + +-- + +*`googlecloud.loadbalancing.https.frontend_tcp_rtt.bucket_options.Options.ExponentialBuckets.scale.raw`*:: ++ +-- +type: long + +-- + +*`googlecloud.loadbalancing.https.frontend_tcp_rtt.bucket_options.Options.ExponentialBuckets.num_finite_buckets.raw`*:: ++ +-- +type: long + +-- + + +[float] +=== backend_latencies + +A distribution of the latency calculated from when the request was sent by the proxy to the backend until the proxy received from the backend the last byte of response. + + +*`googlecloud.loadbalancing.https.internal.backend_latencies.count.raw`*:: ++ +-- +type: long + +-- + +*`googlecloud.loadbalancing.https.internal.backend_latencies.mean.raw`*:: ++ +-- +type: long + +-- + +*`googlecloud.loadbalancing.https.internal.backend_latencies.bucket_counts.raw`*:: ++ +-- +type: long + +-- + + + + +*`googlecloud.loadbalancing.https.internal.backend_latencies.bucket_options.Options.ExponentialBuckets.growth_factor.raw`*:: ++ +-- +type: double + +-- + +*`googlecloud.loadbalancing.https.internal.backend_latencies.bucket_options.Options.ExponentialBuckets.scale.raw`*:: ++ +-- +type: long + +-- + +*`googlecloud.loadbalancing.https.internal.backend_latencies.bucket_options.Options.ExponentialBuckets.num_finite_buckets.raw`*:: ++ +-- +type: long + +-- + +*`googlecloud.loadbalancing.https.internal.request_bytes_count.raw`*:: ++ +-- +The number of bytes sent as requests from clients to HTTP/S load balancer. + +type: long + +-- + +*`googlecloud.loadbalancing.https.internal.request_count.raw`*:: ++ +-- +The number of requests served by HTTP/S load balancer. + +type: long + +-- + +*`googlecloud.loadbalancing.https.internal.response_bytes_count.raw`*:: ++ +-- +The number of bytes sent as responses from HTTP/S load balancer to clients. + +type: long + +-- + +[float] +=== total_latencies + +A distribution of the latency calculated from when the request was received by the proxy until the proxy got ACK from client on last response byte. + + +*`googlecloud.loadbalancing.https.internal.total_latencies.count.raw`*:: ++ +-- +type: long + +-- + +*`googlecloud.loadbalancing.https.internal.total_latencies.mean.raw`*:: ++ +-- +type: long + +-- + +*`googlecloud.loadbalancing.https.internal.total_latencies.bucket_counts.raw`*:: ++ +-- +type: long + +-- + + + + +*`googlecloud.loadbalancing.https.internal.total_latencies.bucket_options.Options.ExponentialBuckets.growth_factor.raw`*:: ++ +-- +type: double + +-- + +*`googlecloud.loadbalancing.https.internal.total_latencies.bucket_options.Options.ExponentialBuckets.scale.raw`*:: ++ +-- +type: long + +-- + +*`googlecloud.loadbalancing.https.internal.total_latencies.bucket_options.Options.ExponentialBuckets.num_finite_buckets.raw`*:: ++ +-- +type: long + +-- + +*`googlecloud.loadbalancing.https.request_bytes_count.raw`*:: ++ +-- +The number of bytes sent as requests from clients to HTTP/S load balancer. + +type: long + +-- + +*`googlecloud.loadbalancing.https.request_count.raw`*:: ++ +-- +The number of requests served by HTTP/S load balancer. + +type: long + +-- + +*`googlecloud.loadbalancing.https.response_bytes_count.raw`*:: ++ +-- +The number of bytes sent as responses from HTTP/S load balancer to clients. + +type: long + +-- + +[float] +=== total_latencies + +A distribution of the latency calculated from when the request was received by the proxy until the proxy got ACK from client on last response byte. + + +*`googlecloud.loadbalancing.https.total_latencies.count.raw`*:: ++ +-- +type: long + +-- + +*`googlecloud.loadbalancing.https.total_latencies.mean.raw`*:: ++ +-- +type: long + +-- + +*`googlecloud.loadbalancing.https.total_latencies.bucket_counts.raw`*:: ++ +-- +type: long + +-- + + + + +*`googlecloud.loadbalancing.https.total_latencies.bucket_options.Options.ExponentialBuckets.growth_factor.raw`*:: ++ +-- +type: double + +-- + +*`googlecloud.loadbalancing.https.total_latencies.bucket_options.Options.ExponentialBuckets.scale.raw`*:: ++ +-- +type: long + +-- + +*`googlecloud.loadbalancing.https.total_latencies.bucket_options.Options.ExponentialBuckets.num_finite_buckets.raw`*:: ++ +-- +type: long + +-- + +[float] +=== l3.internal + +Google Cloud Load Balancing metrics + + +*`googlecloud.loadbalancing.l3.internal.egress_bytes_count.raw`*:: ++ +-- +The number of bytes sent from ILB backend to client (for TCP flows it's counting bytes on application stream only). + +type: long + +-- + +*`googlecloud.loadbalancing.l3.internal.egress_packets_count.raw`*:: ++ +-- +The number of packets sent from ILB backend to client of the flow. + +type: long + +-- + +*`googlecloud.loadbalancing.l3.internal.ingress_bytes_count.raw`*:: ++ +-- +The number of bytes sent from client to ILB backend (for TCP flows it's counting bytes on application stream only). + +type: long + +-- + +*`googlecloud.loadbalancing.l3.internal.ingress_packets_count.raw`*:: ++ +-- +The number of packets sent from client to ILB backend. + +type: long + +-- + +[float] +=== rtt_latencies + +A distribution of RTT measured over TCP connections for ILB flows. + + +*`googlecloud.loadbalancing.l3.internal.rtt_latencies.count.raw`*:: ++ +-- +type: long + +-- + +*`googlecloud.loadbalancing.l3.internal.rtt_latencies.mean.raw`*:: ++ +-- +type: long + +-- + +*`googlecloud.loadbalancing.l3.internal.rtt_latencies.bucket_counts.raw`*:: ++ +-- +type: long + +-- + + + + +*`googlecloud.loadbalancing.l3.internal.rtt_latencies.bucket_options.Options.ExponentialBuckets.growth_factor.raw`*:: ++ +-- +type: double + +-- + +*`googlecloud.loadbalancing.l3.internal.rtt_latencies.bucket_options.Options.ExponentialBuckets.scale.raw`*:: ++ +-- +type: long + +-- + +*`googlecloud.loadbalancing.l3.internal.rtt_latencies.bucket_options.Options.ExponentialBuckets.num_finite_buckets.raw`*:: ++ +-- +type: long + +-- + +[float] +=== tcp_ssl_proxy + +Google Cloud Load Balancing metrics + + +*`googlecloud.loadbalancing.tcp_ssl_proxy.closed_connections.raw`*:: ++ +-- +Number of connections that were terminated over TCP/SSL proxy. + +type: long + +-- + +*`googlecloud.loadbalancing.tcp_ssl_proxy.egress_bytes_count.raw`*:: ++ +-- +Number of bytes sent from VM to client using proxy. + +type: long + +-- + +[float] +=== frontend_tcp_rtt + +A distribution of the smoothed RTT (in ms) measured by the proxy's TCP stack, each minute application layer bytes pass from proxy to client. + + +*`googlecloud.loadbalancing.tcp_ssl_proxy.frontend_tcp_rtt.count.raw`*:: ++ +-- +type: long + +-- + +*`googlecloud.loadbalancing.tcp_ssl_proxy.frontend_tcp_rtt.mean.raw`*:: ++ +-- +type: long + +-- + +*`googlecloud.loadbalancing.tcp_ssl_proxy.frontend_tcp_rtt.bucket_counts.raw`*:: ++ +-- +type: long + +-- + + + + +*`googlecloud.loadbalancing.tcp_ssl_proxy.frontend_tcp_rtt.bucket_options.Options.ExponentialBuckets.growth_factor.raw`*:: ++ +-- +type: double + +-- + +*`googlecloud.loadbalancing.tcp_ssl_proxy.frontend_tcp_rtt.bucket_options.Options.ExponentialBuckets.scale.raw`*:: ++ +-- +type: long + +-- + +*`googlecloud.loadbalancing.tcp_ssl_proxy.frontend_tcp_rtt.bucket_options.Options.ExponentialBuckets.num_finite_buckets.raw`*:: ++ +-- +type: long + +-- + +*`googlecloud.loadbalancing.tcp_ssl_proxy.ingress_bytes_count.raw`*:: ++ +-- +Number of bytes sent from client to VM using proxy. + +type: long + +-- + +*`googlecloud.loadbalancing.tcp_ssl_proxy.new_connections.raw`*:: ++ +-- +Number of connections that were created over TCP/SSL proxy. + +type: long + +-- + +*`googlecloud.loadbalancing.tcp_ssl_proxy.open_connections.raw`*:: ++ +-- +Current number of outstanding connections through the TCP/SSL proxy. + +type: long + +-- + +[float] +=== pubsub + +Google Cloud PubSub metrics + + +[float] +=== subscription + +Suscription related metrics + + +*`googlecloud.pubsub.subscription.ack_message_count.raw`*:: ++ +-- +Cumulative count of messages acknowledged by Acknowledge requests, grouped by delivery type. + +type: long + +-- + +*`googlecloud.pubsub.subscription.backlog_bytes.raw`*:: ++ +-- +Total byte size of the unacknowledged messages (a.k.a. backlog messages) in a subscription. + +type: long + +-- + +*`googlecloud.pubsub.subscription.num_outstanding_messages.raw`*:: ++ +-- +Number of messages delivered to a subscription's push endpoint, but not yet acknowledged. + +type: long + +-- + +*`googlecloud.pubsub.subscription.num_undelivered_messages.raw`*:: ++ +-- +Number of unacknowledged messages (a.k.a. backlog messages) in a subscription. + +type: long + +-- + +*`googlecloud.pubsub.subscription.oldest_unacked_message_age.raw`*:: ++ +-- +Age (in seconds) of the oldest unacknowledged message (a.k.a. backlog message) in a subscription. + +type: long + +-- + +*`googlecloud.pubsub.subscription.pull_ack_message_operation_count.raw`*:: ++ +-- +Cumulative count of acknowledge message operations, grouped by result. For a definition of message operations, see Cloud Pub/Sub metric subscription/mod_ack_deadline_message_operation_count. + +type: long + +-- + +*`googlecloud.pubsub.subscription.pull_ack_request_count.raw`*:: ++ +-- +Cumulative count of acknowledge requests, grouped by result. + +type: long + +-- + +*`googlecloud.pubsub.subscription.pull_message_operation_count.raw`*:: ++ +-- +Cumulative count of pull message operations, grouped by result. For a definition of message operations, see Cloud Pub/Sub metric subscription/mod_ack_deadline_message_operation_count. + +type: long + +-- + +*`googlecloud.pubsub.subscription.pull_request_count.raw`*:: ++ +-- +Cumulative count of pull requests, grouped by result. + +type: long + +-- + +*`googlecloud.pubsub.subscription.push_request_count.raw`*:: ++ +-- +Cumulative count of push attempts, grouped by result. Unlike pulls, the push server implementation does not batch user messages. So each request only contains one user message. The push server retries on errors, so a given user message can appear multiple times. + +type: long + +-- + +*`googlecloud.pubsub.subscription.push_request_latencies.raw`*:: ++ +-- +Distribution of push request latencies (in microseconds), grouped by result. + +type: long + +-- + +*`googlecloud.pubsub.subscription.sent_message_count.raw`*:: ++ +-- +Cumulative count of messages sent by Cloud Pub/Sub to subscriber clients, grouped by delivery type. + +type: long + +-- + +*`googlecloud.pubsub.subscription.streaming_pull_ack_message_operation_count.raw`*:: ++ +-- +Cumulative count of StreamingPull acknowledge message operations, grouped by result. For a definition of message operations, see Cloud Pub/Sub metric subscription/mod_ack_deadline_message_operation_count. + +type: long + +-- + +*`googlecloud.pubsub.subscription.streaming_pull_ack_request_count.raw`*:: ++ +-- +Cumulative count of streaming pull requests with non-empty acknowledge ids, grouped by result. + +type: long + +-- + +*`googlecloud.pubsub.subscription.streaming_pull_message_operation_count.raw`*:: ++ +-- +Cumulative count of streaming pull message operations, grouped by result. For a definition of message operations, see Cloud Pub/Sub metric subscription/mod_ack_deadline_message_operation_count + +type: long + +-- + +*`googlecloud.pubsub.subscription.streaming_pull_response_count.raw`*:: ++ +-- +Cumulative count of streaming pull responses, grouped by result. + +type: long + +-- + +*`googlecloud.pubsub.subscription.dead_letter_message_count.raw`*:: ++ +-- +Cumulative count of messages published to dead letter topic, grouped by result. + +type: long + +-- + +*`googlecloud.pubsub.subscription.mod_ack_deadline_message_count.raw`*:: ++ +-- +Cumulative count of messages whose deadline was updated by ModifyAckDeadline requests, grouped by delivery type. + +type: long + +-- + +*`googlecloud.pubsub.subscription.mod_ack_deadline_message_operation_count.raw`*:: ++ +-- +Cumulative count of ModifyAckDeadline message operations, grouped by result. + +type: long + +-- + +*`googlecloud.pubsub.subscription.mod_ack_deadline_request_count.raw`*:: ++ +-- +Cumulative count of ModifyAckDeadline requests, grouped by result. + +type: long + +-- + +*`googlecloud.pubsub.subscription.oldest_retained_acked_message_age.raw`*:: ++ +-- +Age (in seconds) of the oldest acknowledged message retained in a subscription. + +type: long + +-- + +*`googlecloud.pubsub.subscription.oldest_retained_acked_message_age_by_region.raw`*:: ++ +-- +Age (in seconds) of the oldest acknowledged message retained in a subscription, broken down by Cloud region. + +type: long + +-- + +*`googlecloud.pubsub.subscription.oldest_unacked_message_age_by_region.raw`*:: ++ +-- +Age (in seconds) of the oldest unacknowledged message in a subscription, broken down by Cloud region. + +type: long + +-- + +*`googlecloud.pubsub.subscription.retained_acked_bytes.raw`*:: ++ +-- +Total byte size of the acknowledged messages retained in a subscription. + +type: long + +-- + +*`googlecloud.pubsub.subscription.retained_acked_bytes_by_region.raw`*:: ++ +-- +Total byte size of the acknowledged messages retained in a subscription, broken down by Cloud region. + +type: long + +-- + +*`googlecloud.pubsub.subscription.seek_request_count.raw`*:: ++ +-- +Cumulative count of seek attempts, grouped by result. + +type: long + +-- + +*`googlecloud.pubsub.subscription.streaming_pull_mod_ack_deadline_message_operation_count.raw`*:: ++ +-- +Cumulative count of StreamingPull ModifyAckDeadline operations, grouped by result. + +type: long + +-- + +*`googlecloud.pubsub.subscription.streaming_pull_mod_ack_deadline_request_count.raw`*:: ++ +-- +Cumulative count of streaming pull requests with non-empty ModifyAckDeadline fields, grouped by result. + +type: long + +-- + +*`googlecloud.pubsub.subscription.byte_cost.raw`*:: ++ +-- +Cumulative cost of operations, measured in bytes. This is used to measure quota utilization. + +type: long + +-- + +*`googlecloud.pubsub.subscription.config_updates_count.raw`*:: ++ +-- +Cumulative count of configuration changes for each subscription, grouped by operation type and result. + +type: long + +-- + +*`googlecloud.pubsub.subscription.unacked_bytes_by_region.raw`*:: ++ +-- +Total byte size of the unacknowledged messages in a subscription, broken down by Cloud region. + +type: long + +-- + +[float] +=== topic + +Topic related metrics + + +*`googlecloud.pubsub.topic.streaming_pull_response_count.raw`*:: ++ +-- +Cumulative count of streaming pull responses, grouped by result. + +type: long + +-- + +*`googlecloud.pubsub.topic.send_message_operation_count.raw`*:: ++ +-- +Cumulative count of publish message operations, grouped by result. For a definition of message operations, see Cloud Pub/Sub metric subscription/mod_ack_deadline_message_operation_count. + +type: long + +-- + +*`googlecloud.pubsub.topic.send_request_count.raw`*:: ++ +-- +Cumulative count of publish requests, grouped by result. + +type: long + +-- + +*`googlecloud.pubsub.topic.oldest_retained_acked_message_age_by_region.raw`*:: ++ +-- +Age (in seconds) of the oldest acknowledged message retained in a topic, broken down by Cloud region. + +type: long + +-- + +*`googlecloud.pubsub.topic.oldest_unacked_message_age_by_region.raw`*:: ++ +-- +Age (in seconds) of the oldest unacknowledged message in a topic, broken down by Cloud region. + +type: long + +-- + +*`googlecloud.pubsub.topic.retained_acked_bytes_by_region.raw`*:: ++ +-- +Total byte size of the acknowledged messages retained in a topic, broken down by Cloud region. + +type: long + +-- + +*`googlecloud.pubsub.topic.byte_cost.raw`*:: ++ +-- +Cost of operations, measured in bytes. This is used to measure utilization for quotas. + +type: long + +-- + +*`googlecloud.pubsub.topic.config_updates_count.raw`*:: ++ +-- +Cumulative count of configuration changes, grouped by operation type and result. + +type: long + +-- + +*`googlecloud.pubsub.topic.message_sizes.raw`*:: ++ +-- +Distribution of publish message sizes (in bytes) + +type: long + +-- + +*`googlecloud.pubsub.topic.unacked_bytes_by_region.raw`*:: ++ +-- +Total byte size of the unacknowledged messages in a topic, broken down by Cloud region. + +type: long + +-- + +[float] +=== snapshot + +Snapshot related metrics + + +*`googlecloud.pubsub.snapshot.oldest_message_age.raw`*:: ++ +-- +Age (in seconds) of the oldest message retained in a snapshot. + +type: long + +-- + +*`googlecloud.pubsub.snapshot.oldest_message_age_by_region.raw`*:: ++ +-- +Age (in seconds) of the oldest message retained in a snapshot, broken down by Cloud region. + +type: long + +-- + +*`googlecloud.pubsub.snapshot.backlog_bytes.raw`*:: ++ +-- +Total byte size of the messages retained in a snapshot. + +type: long + +-- + +*`googlecloud.pubsub.snapshot.backlog_bytes_by_region.raw`*:: ++ +-- +Total byte size of the messages retained in a snapshot, broken down by Cloud region. + +type: long + +-- + +*`googlecloud.pubsub.snapshot.num_messages.raw`*:: ++ +-- +Number of messages retained in a snapshot. + +type: long + +-- + +*`googlecloud.pubsub.snapshot.num_messages_by_region.raw`*:: ++ +-- +Number of messages retained in a snapshot, broken down by Cloud region. + +type: long + +-- + +*`googlecloud.pubsub.snapshot.config_updates_count.raw`*:: ++ +-- +Cumulative count of configuration changes, grouped by operation type and result. + +type: long + +-- + +[float] +=== storage + +Google Cloud Storage metrics + + + +*`googlecloud.storage.api.request_count.raw`*:: ++ +-- +Delta count of API calls, grouped by the API method name and response code. + +type: long + +-- + + +*`googlecloud.storage.authz.acl_based_object_access_count.raw`*:: ++ +-- +Delta count of requests that result in an object being granted access solely due to object ACLs. + +type: long + +-- + +*`googlecloud.storage.authz.acl_operations_count.raw`*:: ++ +-- +Usage of ACL operations broken down by type. + +type: long + +-- + +*`googlecloud.storage.authz.object_specific_acl_mutation_count.raw`*:: ++ +-- +Delta count of changes made to object specific ACLs. + +type: long + +-- + + +*`googlecloud.storage.network.received_bytes_count.raw`*:: ++ +-- +Delta count of bytes received over the network, grouped by the API method name and response code. + +type: long + +-- + +*`googlecloud.storage.network.sent_bytes_count.raw`*:: ++ +-- +Delta count of bytes sent over the network, grouped by the API method name and response code. + +type: long + +-- + + +*`googlecloud.storage.storage.object_count.raw`*:: ++ +-- +Total number of objects per bucket, grouped by storage class. This value is measured once per day, and the value is repeated at each sampling interval throughout the day. + +type: long + +-- + +*`googlecloud.storage.storage.total_byte_seconds.raw`*:: ++ +-- +Delta count of bytes received over the network, grouped by the API method name and response code. + +type: long + +-- + +*`googlecloud.storage.storage.total_bytes.raw`*:: ++ +-- +Total size of all objects in the bucket, grouped by storage class. This value is measured once per day, and the value is repeated at each sampling interval throughout the day. + +type: long + +-- + [[exported-fields-graphite]] == Graphite fields diff --git a/x-pack/metricbeat/module/googlecloud/_meta/fields.yml b/x-pack/metricbeat/module/googlecloud/_meta/fields.yml index 9827d8dcdda..1fe7d88d3e3 100644 --- a/x-pack/metricbeat/module/googlecloud/_meta/fields.yml +++ b/x-pack/metricbeat/module/googlecloud/_meta/fields.yml @@ -4,17 +4,23 @@ description: > GCP module fields: - - name: googlecloud.labels - type: object + - name: googlecloud + type: group fields: - - name: user.* + - name: labels type: object - - name: metadata.* + fields: + - name: user.* + type: object + - name: metadata.* + type: object + - name: metrics.* + type: object + - name: system.* + type: object + - name: "*.*.*.*.*" type: object - - name: metrics.* - type: object - - name: system.* - type: object - - name: aggregation_aligner - type: keyword - description: Aggregation perSeriesAligner used for ListTimeSeries API. + object_type: double + object_type_mapping_type: "*" + description: > + Metrics that returned from StackDriver API query. diff --git a/x-pack/metricbeat/module/googlecloud/compute/_meta/data.json b/x-pack/metricbeat/module/googlecloud/compute/_meta/data.json index cd37490aa90..8c20535e94b 100644 --- a/x-pack/metricbeat/module/googlecloud/compute/_meta/data.json +++ b/x-pack/metricbeat/module/googlecloud/compute/_meta/data.json @@ -5,8 +5,8 @@ "id": "elastic-observability" }, "instance": { - "id": "9077240380975650630", - "name": "gke-observability-8--observability-8--bc1afd95-cwh3" + "id": "8390997210852978465", + "name": "gke-observability-7--observability-7--3dd3e39b-0jm5" }, "machine": { "type": "n1-standard-4" @@ -23,16 +23,24 @@ "compute": { "instance": { "disk": { - "read_bytes_count": 0, - "read_ops_count": 0, - "write_bytes_count": 0, - "write_ops_count": 0 + "read_bytes_count": { + "raw": 0 + }, + "read_ops_count": { + "raw": 0 + }, + "write_bytes_count": { + "raw": 11951536 + }, + "write_ops_count": { + "raw": 264 + } } } }, "labels": { "metrics": { - "device_name": "gke-observability-8-0--pvc-ad47fe58-7bcf-11e9-a839-42010a8401a4", + "device_name": "gke-observability-7-1--pvc-4193b085-82e1-11ea-8cd9-42010af0011c", "device_type": "permanent", "storage_type": "pd-standard" }, diff --git a/x-pack/metricbeat/module/googlecloud/compute/_meta/fields.yml b/x-pack/metricbeat/module/googlecloud/compute/_meta/fields.yml index 01be5ebf386..4827165653b 100644 --- a/x-pack/metricbeat/module/googlecloud/compute/_meta/fields.yml +++ b/x-pack/metricbeat/module/googlecloud/compute/_meta/fields.yml @@ -9,54 +9,54 @@ - name: firewall type: group fields: - - name: dropped_bytes_count + - name: dropped_bytes_count.raw type: long description: Incoming bytes dropped by the firewall - - name: dropped_packets_count + - name: dropped_packets_count.raw type: long description: Incoming packets dropped by the firewall - name: cpu type: group fields: - - name: reserved_cores + - name: reserved_cores.raw type: double description: Number of cores reserved on the host of the instance - - name: utilization + - name: utilization.raw type: double description: The fraction of the allocated CPU that is currently in use on the instance - - name: usage_time + - name: usage_time.raw type: double description: Usage for all cores in seconds - name: disk type: group fields: - - name: read_bytes_count + - name: read_bytes_count.raw type: long description: Count of bytes read from disk - - name: read_ops_count + - name: read_ops_count.raw type: long description: Count of disk read IO operations - - name: write_bytes_count + - name: write_bytes_count.raw type: long description: Count of bytes written to disk - - name: write_ops_count + - name: write_ops_count.raw type: long description: Count of disk write IO operations - - name: uptime + - name: uptime.raw type: long description: How long the VM has been running, in seconds - name: network type: group fields: - - name: received_bytes_count + - name: received_bytes_count.raw type: long description: Count of bytes received from the network - - name: received_packets_count + - name: received_packets_count.raw type: long description: Count of packets received from the network - - name: sent_bytes_count + - name: sent_bytes_count.raw type: long description: Count of bytes sent over the network - - name: sent_packets_count + - name: sent_packets_count.raw type: long description: Count of packets sent over the network diff --git a/x-pack/metricbeat/module/googlecloud/fields.go b/x-pack/metricbeat/module/googlecloud/fields.go index d0b2992705d..09f1b44af9d 100644 --- a/x-pack/metricbeat/module/googlecloud/fields.go +++ b/x-pack/metricbeat/module/googlecloud/fields.go @@ -19,5 +19,5 @@ func init() { // AssetGooglecloud returns asset data. // This is the base64 encoded gzipped contents of module/googlecloud. func AssetGooglecloud() string { - return "eJzsXUuT2zYSvvtX9M321nh82JtrK1WTyW7iWnsztTPJlQWCLQk7IMDgMYry67cAkBQp8QFKpPwo3ewhif66AXxfNwBS7+AZdx9gLeWaI+XSZq8ADDMcP8Drn/1f4d79GR44MSup8tevABRyJBo/QIqGvALIUFPFCsOk+AA/vAIA+Pn+AXKZWY6vAFYMeaY/+AvvQJAcWyZvOUmRa38ZwOwK/AAy/R9SU/6p+XyzDatR3f6t/nPns/u7czQkI4ZMekIxquMf0DttMI+/n6zXCtfEBS4hnK0FqqNHn3G3lSpr/L0V7rt9E1CgekTFUN+FtlyAMlhJBZ+YNk8sx3AZ7h4+3h6BoTIvrMGGocN+bgNbK2mLPlitsXMfWq7i2XjmsGebeJjQhgiKrYt9xvsaaza4Ygq3hPOjG4YaHWq42XimZFFglqQ7gzqh0grTeX9li0ux7rmhFciPgsqciTX4hiszkO7AbHDIpWNoBaHPaBYBVzYdDa8ec4VdpDcUalQvmCVUKtSDvmbSpvxwkHV6+x+bp6hArsC3WhsBKby3G6mNu+r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UTIR/5JRoxEUyRcTH1iK0dwL4nIGmXjWcUvbIcNOl4jeTyJ9qHLYfBmnrPD2iUk+sSXhDYHUGyiMCTITNuhU8bJkGpsHqkNzll8DvVhpSe2tgI3wqxZptopBJTbWreG5OgiAb1AG6JcIRQPnahPrar9i/NIGX71+i0DUlRcxZiNqamvuXcNrh4YKM0XGbbg/u1gu3215ooaVRJAs3ln2J9WK7LdO/iqbNSvOUAt9UAp2X1n/JzPkS3b7d5PMSrSbMAS4L/JWQ70OrTwRadhCeN/pfGueLleGmeo5tjzqneyl+zfhJuHoR6cdQry4jgiCZ3srjFmzf8z753RdmHzkRLtjuaeiG5Op0UvazUHU75rGMtsQBpaY2QKe5a+jmX2EdOEeaWNh01lNTQ41axTOhTXsjG2nGlxXC3jce5fQ/A+OP+if+1zjeHOOe4yc1DnWeVGQzx8973IeRBx45JRnrHXnan0Xtrmr6Pib4CbkhB3e4ufsMlPgjJhUXcHThvknRbGXiMRR+EB64pzLB8yGXWLP980KtqwdleRQTjUmU/34MoRT1VOvjyBZlgy3/gRnn835xi/zXayBGV9JvFBEuHQhYQEuOfA+JRZfD5lfe3H5pSVidWofceCJtwo9JuDm9/VLJvI/5qH3LMDezzpCyNaORQ5paM2Xn4cjqRQ8tJUnVgAWCM5Y8nNQ/9+b28c424D3+o7U9eov/8XveL12FcHw2aXZVzr6ufioyOSX0y2Y49+6J3sri06zKExN+cA0Zqvyxq5oZcl2AcqKL2veJcIuuAj48Li0o+hESsr/2ZnLmK69TmIWnRYjJG84kzbgjJf/uhCfCiwc0pDX+1oS0PEcSXvri6/48LX/B/n5QZqpUv8ieCefl7LLwIptvbIL/FwAA//8QA7g+" } diff --git a/x-pack/metricbeat/module/googlecloud/loadbalancing/_meta/data.json b/x-pack/metricbeat/module/googlecloud/loadbalancing/_meta/data.json index 2106cb1e277..3882e804356 100644 --- a/x-pack/metricbeat/module/googlecloud/loadbalancing/_meta/data.json +++ b/x-pack/metricbeat/module/googlecloud/loadbalancing/_meta/data.json @@ -14,120 +14,30 @@ "googlecloud": { "labels": { "metrics": { - "cache_result": "DISABLED", - "proxy_continent": "Europe", - "response_code": "502", - "response_code_class": "500" + "client_network": "UNKNOWN", + "client_subnetwork": "REMOTE_IS_EXTERNAL", + "client_zone": "UNKNOWN" }, "resource": { - "backend_name": "INVALID_BACKEND", - "backend_scope": "INVALID_BACKEND", - "backend_scope_type": "INVALID_BACKEND", - "backend_target_name": "test1-backend-ks", + "backend_name": "ocp-be-c5kjr-master-us-central1-a", + "backend_scope": "us-central1-a", + "backend_scope_type": "ZONE", + "backend_subnetwork_name": "ocp-be-c5kjr-master-subnet", + "backend_target_name": "ocp-be-c5kjr-api-internal", "backend_target_type": "BACKEND_SERVICE", - "backend_type": "INVALID_BACKEND", - "forwarding_rule_name": "test-lb-ks-forwarding-rule", - "matched_url_path_rule": "UNMATCHED", - "region": "global", - "target_proxy_name": "test-lb-ks-target-proxy", - "url_map_name": "test-lb-ks" + "backend_type": "INSTANCE_GROUP", + "forwarding_rule_name": "ocp-be-c5kjr-api-internal", + "load_balancer_name": "ocp-be-c5kjr-api-internal", + "network_name": "ocp-be-c5kjr-network", + "region": "us-central1" } }, "loadbalancing": { - "https": { - "backend_latencies": { - "count": 4, - "mean": 97.927, - "bucket_options": { - "Options": { - "ExponentialBuckets": { - "num_finite_buckets": 66, - "growth_factor": 1.4, - "scale": 1 - } - } - }, - "bucket_counts": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 4 - ] - }, - "backend_request_bytes_count": 736, - "backend_request_count": 4, - "backend_response_bytes_count": 1952, - "frontend_tcp_rtt": { - "count": 4, - "mean": 50, - "bucket_options": { - "Options": { - "ExponentialBuckets": { - "num_finite_buckets": 66, - "growth_factor": 1.4, - "scale": 1 - } - } - }, - "bucket_counts": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 4 - ] - }, - "request_bytes_count": 736, - "request_count": 4, - "response_bytes_count": 1952, - "total_latencies": { - "count": 4, - "mean": 98.423, - "bucket_options": { - "Options": { - "ExponentialBuckets": { - "num_finite_buckets": 66, - "growth_factor": 1.4, - "scale": 1 - } - } - }, - "bucket_counts": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 4 - ] + "l3": { + "internal": { + "ingress_packets_count": { + "raw": 482 + } } } } diff --git a/x-pack/metricbeat/module/googlecloud/loadbalancing/_meta/fields.yml b/x-pack/metricbeat/module/googlecloud/loadbalancing/_meta/fields.yml index 57761c8ea1b..3f5cdc9a1db 100644 --- a/x-pack/metricbeat/module/googlecloud/loadbalancing/_meta/fields.yml +++ b/x-pack/metricbeat/module/googlecloud/loadbalancing/_meta/fields.yml @@ -11,11 +11,11 @@ description: A distribution of the latency calculated from when the request was sent by the proxy to the backend until the proxy received from the backend the last byte of response. type: group fields: - - name: count + - name: count.raw type: long - - name: mean + - name: mean.raw type: long - - name: bucket_counts + - name: bucket_counts.raw type: long - name: bucket_options type: group @@ -26,30 +26,30 @@ - name: ExponentialBuckets type: group fields: - - name: growth_factor + - name: growth_factor.raw type: double - - name: scale + - name: scale.raw type: long - - name: num_finite_buckets + - name: num_finite_buckets.raw type: long - - name: backend_request_bytes_count + - name: backend_request_bytes_count.raw type: long description: The number of bytes sent as requests from HTTP/S load balancer to backends. - - name: backend_request_count + - name: backend_request_count.raw type: long description: The number of requests served by backends of HTTP/S load balancer. - - name: backend_response_bytes_count + - name: backend_response_bytes_count.raw type: long description: The number of bytes sent as responses from backends (or cache) to HTTP/S load balancer. - name: frontend_tcp_rtt description: A distribution of the RTT measured for each connection between client and proxy. type: group fields: - - name: count + - name: count.raw type: long - - name: mean + - name: mean.raw type: long - - name: bucket_counts + - name: bucket_counts.raw type: long - name: bucket_options type: group @@ -60,11 +60,11 @@ - name: ExponentialBuckets type: group fields: - - name: growth_factor + - name: growth_factor.raw type: double - - name: scale + - name: scale.raw type: long - - name: num_finite_buckets + - name: num_finite_buckets.raw type: long - name: internal type: group @@ -73,11 +73,11 @@ description: A distribution of the latency calculated from when the request was sent by the proxy to the backend until the proxy received from the backend the last byte of response. type: group fields: - - name: count + - name: count.raw type: long - - name: mean + - name: mean.raw type: long - - name: bucket_counts + - name: bucket_counts.raw type: long - name: bucket_options type: group @@ -88,30 +88,30 @@ - name: ExponentialBuckets type: group fields: - - name: growth_factor + - name: growth_factor.raw type: double - - name: scale + - name: scale.raw type: long - - name: num_finite_buckets + - name: num_finite_buckets.raw type: long - - name: request_bytes_count + - name: request_bytes_count.raw type: long description: The number of bytes sent as requests from clients to HTTP/S load balancer. - - name: request_count + - name: request_count.raw type: long description: The number of requests served by HTTP/S load balancer. - - name: response_bytes_count + - name: response_bytes_count.raw type: long description: The number of bytes sent as responses from HTTP/S load balancer to clients. - name: total_latencies description: A distribution of the latency calculated from when the request was received by the proxy until the proxy got ACK from client on last response byte. type: group fields: - - name: count + - name: count.raw type: long - - name: mean + - name: mean.raw type: long - - name: bucket_counts + - name: bucket_counts.raw type: long - name: bucket_options type: group @@ -122,30 +122,30 @@ - name: ExponentialBuckets type: group fields: - - name: growth_factor + - name: growth_factor.raw type: double - - name: scale + - name: scale.raw type: long - - name: num_finite_buckets + - name: num_finite_buckets.raw type: long - - name: request_bytes_count + - name: request_bytes_count.raw type: long description: The number of bytes sent as requests from clients to HTTP/S load balancer. - - name: request_count + - name: request_count.raw type: long description: The number of requests served by HTTP/S load balancer. - - name: response_bytes_count + - name: response_bytes_count.raw type: long description: The number of bytes sent as responses from HTTP/S load balancer to clients. - name: total_latencies description: A distribution of the latency calculated from when the request was received by the proxy until the proxy got ACK from client on last response byte. type: group fields: - - name: count + - name: count.raw type: long - - name: mean + - name: mean.raw type: long - - name: bucket_counts + - name: bucket_counts.raw type: long - name: bucket_options type: group @@ -156,37 +156,37 @@ - name: ExponentialBuckets type: group fields: - - name: growth_factor + - name: growth_factor.raw type: double - - name: scale + - name: scale.raw type: long - - name: num_finite_buckets + - name: num_finite_buckets.raw type: long - name: l3.internal type: group description: Google Cloud Load Balancing metrics fields: - - name: egress_bytes_count + - name: egress_bytes_count.raw type: long description: The number of bytes sent from ILB backend to client (for TCP flows it's counting bytes on application stream only). - - name: egress_packets_count + - name: egress_packets_count.raw type: long description: The number of packets sent from ILB backend to client of the flow. - - name: ingress_bytes_count + - name: ingress_bytes_count.raw type: long description: The number of bytes sent from client to ILB backend (for TCP flows it's counting bytes on application stream only). - - name: ingress_packets_count + - name: ingress_packets_count.raw type: long description: The number of packets sent from client to ILB backend. - name: rtt_latencies description: A distribution of RTT measured over TCP connections for ILB flows. type: group fields: - - name: count + - name: count.raw type: long - - name: mean + - name: mean.raw type: long - - name: bucket_counts + - name: bucket_counts.raw type: long - name: bucket_options type: group @@ -197,31 +197,31 @@ - name: ExponentialBuckets type: group fields: - - name: growth_factor + - name: growth_factor.raw type: double - - name: scale + - name: scale.raw type: long - - name: num_finite_buckets + - name: num_finite_buckets.raw type: long - name: tcp_ssl_proxy type: group description: Google Cloud Load Balancing metrics fields: - - name: closed_connections + - name: closed_connections.raw type: long description: Number of connections that were terminated over TCP/SSL proxy. - - name: egress_bytes_count + - name: egress_bytes_count.raw type: long description: Number of bytes sent from VM to client using proxy. - name: frontend_tcp_rtt description: A distribution of the smoothed RTT (in ms) measured by the proxy's TCP stack, each minute application layer bytes pass from proxy to client. type: group fields: - - name: count + - name: count.raw type: long - - name: mean + - name: mean.raw type: long - - name: bucket_counts + - name: bucket_counts.raw type: long - name: bucket_options type: group @@ -232,18 +232,18 @@ - name: ExponentialBuckets type: group fields: - - name: growth_factor + - name: growth_factor.raw type: double - - name: scale + - name: scale.raw type: long - - name: num_finite_buckets + - name: num_finite_buckets.raw type: long - - name: ingress_bytes_count + - name: ingress_bytes_count.raw type: long description: Number of bytes sent from client to VM using proxy. - - name: new_connections + - name: new_connections.raw type: long description: Number of connections that were created over TCP/SSL proxy. - - name: open_connections + - name: open_connections.raw type: long description: Current number of outstanding connections through the TCP/SSL proxy. diff --git a/x-pack/metricbeat/module/googlecloud/pubsub/_meta/data.json b/x-pack/metricbeat/module/googlecloud/pubsub/_meta/data.json index 86da8d924e5..60b9b98dba5 100644 --- a/x-pack/metricbeat/module/googlecloud/pubsub/_meta/data.json +++ b/x-pack/metricbeat/module/googlecloud/pubsub/_meta/data.json @@ -14,34 +14,14 @@ "googlecloud": { "labels": { "resource": { - "subscription_id": "test-ks" + "subscription_id": "test-subscription-1" } }, "pubsub": { - "snapshot": { - "backlog_bytes": 19, - "backlog_bytes_by_region": 19, - "num_messages": 4, - "num_messages_by_region": 4, - "oldest_message_age": 69319, - "oldest_message_age_by_region": 69319 - }, "subscription": { - "backlog_bytes": 0, - "num_undelivered_messages": 0, - "oldest_retained_acked_message_age": 0, - "oldest_retained_acked_message_age_by_region": 0, - "oldest_unacked_message_age": 0, - "oldest_unacked_message_age_by_region": 69277, - "retained_acked_bytes": 0, - "retained_acked_bytes_by_region": 0, - "unacked_bytes_by_region": 19 - }, - "topic": { - "oldest_retained_acked_message_age_by_region": 0, - "oldest_unacked_message_age_by_region": 69319, - "retained_acked_bytes_by_region": 0, - "unacked_bytes_by_region": 76 + "retained_acked_bytes": { + "raw": 0 + } } } }, diff --git a/x-pack/metricbeat/module/googlecloud/pubsub/_meta/fields.yml b/x-pack/metricbeat/module/googlecloud/pubsub/_meta/fields.yml index 32e4acbb521..4fecca10fbd 100644 --- a/x-pack/metricbeat/module/googlecloud/pubsub/_meta/fields.yml +++ b/x-pack/metricbeat/module/googlecloud/pubsub/_meta/fields.yml @@ -7,152 +7,155 @@ type: group description: Suscription related metrics fields: - - name: ack_message_count + - name: ack_message_count.raw type: long description: Cumulative count of messages acknowledged by Acknowledge requests, grouped by delivery type. - - name: backlog_bytes + - name: backlog_bytes.raw type: long description: Total byte size of the unacknowledged messages (a.k.a. backlog messages) in a subscription. - - name: num_outstanding_messages + - name: num_outstanding_messages.raw type: long description: Number of messages delivered to a subscription's push endpoint, but not yet acknowledged. - - name: num_undelivered_messages + - name: num_undelivered_messages.raw type: long description: Number of unacknowledged messages (a.k.a. backlog messages) in a subscription. - - name: oldest_unacked_message_age + - name: oldest_unacked_message_age.raw type: long description: Age (in seconds) of the oldest unacknowledged message (a.k.a. backlog message) in a subscription. - - name: pull_ack_message_operation_count + - name: pull_ack_message_operation_count.raw type: long description: Cumulative count of acknowledge message operations, grouped by result. For a definition of message operations, see Cloud Pub/Sub metric subscription/mod_ack_deadline_message_operation_count. - - name: pull_ack_request_count + - name: pull_ack_request_count.raw type: long description: Cumulative count of acknowledge requests, grouped by result. - - name: pull_message_operation_count + - name: pull_message_operation_count.raw type: long description: Cumulative count of pull message operations, grouped by result. For a definition of message operations, see Cloud Pub/Sub metric subscription/mod_ack_deadline_message_operation_count. - - name: pull_request_count + - name: pull_request_count.raw type: long description: Cumulative count of pull requests, grouped by result. - - name: push_request_count + - name: push_request_count.raw type: long description: Cumulative count of push attempts, grouped by result. Unlike pulls, the push server implementation does not batch user messages. So each request only contains one user message. The push server retries on errors, so a given user message can appear multiple times. - - name: push_request_latencies + - name: push_request_latencies.raw type: long description: Distribution of push request latencies (in microseconds), grouped by result. - - name: sent_message_count + - name: sent_message_count.raw type: long description: Cumulative count of messages sent by Cloud Pub/Sub to subscriber clients, grouped by delivery type. - - name: streaming_pull_ack_message_operation_count + - name: streaming_pull_ack_message_operation_count.raw type: long description: Cumulative count of StreamingPull acknowledge message operations, grouped by result. For a definition of message operations, see Cloud Pub/Sub metric subscription/mod_ack_deadline_message_operation_count. - - name: streaming_pull_ack_request_count + - name: streaming_pull_ack_request_count.raw type: long description: Cumulative count of streaming pull requests with non-empty acknowledge ids, grouped by result. - - name: streaming_pull_message_operation_count + - name: streaming_pull_message_operation_count.raw type: long description: Cumulative count of streaming pull message operations, grouped by result. For a definition of message operations, see Cloud Pub/Sub metric subscription/mod_ack_deadline_message_operation_count - - name: streaming_pull_response_count + - name: streaming_pull_response_count.raw type: long description: Cumulative count of streaming pull responses, grouped by result. - - name: dead_letter_message_count + - name: dead_letter_message_count.raw type: long description: Cumulative count of messages published to dead letter topic, grouped by result. - - name: mod_ack_deadline_message_count + - name: mod_ack_deadline_message_count.raw type: long description: Cumulative count of messages whose deadline was updated by ModifyAckDeadline requests, grouped by delivery type. - - name: mod_ack_deadline_message_operation_count + - name: mod_ack_deadline_message_operation_count.raw type: long description: Cumulative count of ModifyAckDeadline message operations, grouped by result. - - name: mod_ack_deadline_request_count + - name: mod_ack_deadline_request_count.raw type: long description: Cumulative count of ModifyAckDeadline requests, grouped by result. - - name: oldest_retained_acked_message_age + - name: oldest_retained_acked_message_age.raw type: long description: Age (in seconds) of the oldest acknowledged message retained in a subscription. - - name: oldest_retained_acked_message_age_by_region + - name: oldest_retained_acked_message_age_by_region.raw type: long description: Age (in seconds) of the oldest acknowledged message retained in a subscription, broken down by Cloud region. - - name: oldest_unacked_message_age_by_region + - name: oldest_unacked_message_age_by_region.raw type: long description: Age (in seconds) of the oldest unacknowledged message in a subscription, broken down by Cloud region. - - name: retained_acked_bytes + - name: retained_acked_bytes.raw type: long description: Total byte size of the acknowledged messages retained in a subscription. - - name: retained_acked_bytes_by_region + - name: retained_acked_bytes_by_region.raw type: long description: Total byte size of the acknowledged messages retained in a subscription, broken down by Cloud region. - - name: seek_request_count + - name: seek_request_count.raw type: long description: Cumulative count of seek attempts, grouped by result. - - name: streaming_pull_mod_ack_deadline_message_operation_count + - name: streaming_pull_mod_ack_deadline_message_operation_count.raw type: long description: Cumulative count of StreamingPull ModifyAckDeadline operations, grouped by result. - - name: streaming_pull_mod_ack_deadline_request_count + - name: streaming_pull_mod_ack_deadline_request_count.raw type: long description: Cumulative count of streaming pull requests with non-empty ModifyAckDeadline fields, grouped by result. - - name: byte_cost + - name: byte_cost.raw type: long description: Cumulative cost of operations, measured in bytes. This is used to measure quota utilization. - - name: config_updates_count + - name: config_updates_count.raw type: long description: Cumulative count of configuration changes for each subscription, grouped by operation type and result. - - name: unacked_bytes_by_region + - name: unacked_bytes_by_region.raw type: long description: Total byte size of the unacknowledged messages in a subscription, broken down by Cloud region. - name: topic type: group description: Topic related metrics fields: - - name: streaming_pull_response_count + - name: streaming_pull_response_count.raw type: long description: Cumulative count of streaming pull responses, grouped by result. - - name: send_message_operation_count + - name: send_message_operation_count.raw type: long description: Cumulative count of publish message operations, grouped by result. For a definition of message operations, see Cloud Pub/Sub metric subscription/mod_ack_deadline_message_operation_count. - - name: send_request_count + - name: send_request_count.raw type: long description: Cumulative count of publish requests, grouped by result. - - name: oldest_retained_acked_message_age_by_region + - name: oldest_retained_acked_message_age_by_region.raw type: long description: Age (in seconds) of the oldest acknowledged message retained in a topic, broken down by Cloud region. - - name: oldest_unacked_message_age_by_region + - name: oldest_unacked_message_age_by_region.raw type: long description: Age (in seconds) of the oldest unacknowledged message in a topic, broken down by Cloud region. - - name: retained_acked_bytes_by_region + - name: retained_acked_bytes_by_region.raw type: long description: Total byte size of the acknowledged messages retained in a topic, broken down by Cloud region. - - name: byte_cost + - name: byte_cost.raw type: long description: Cost of operations, measured in bytes. This is used to measure utilization for quotas. - - name: config_updates_count + - name: config_updates_count.raw type: long description: Cumulative count of configuration changes, grouped by operation type and result. - - name: unacked_bytes_by_region + - name: message_sizes.raw + type: long + description: Distribution of publish message sizes (in bytes) + - name: unacked_bytes_by_region.raw type: long description: Total byte size of the unacknowledged messages in a topic, broken down by Cloud region. - name: snapshot type: group description: Snapshot related metrics fields: - - name: oldest_message_age + - name: oldest_message_age.raw type: long description: Age (in seconds) of the oldest message retained in a snapshot. - - name: oldest_message_age_by_region + - name: oldest_message_age_by_region.raw type: long description: Age (in seconds) of the oldest message retained in a snapshot, broken down by Cloud region. - - name: backlog_bytes + - name: backlog_bytes.raw type: long description: Total byte size of the messages retained in a snapshot. - - name: backlog_bytes_by_region + - name: backlog_bytes_by_region.raw type: long description: Total byte size of the messages retained in a snapshot, broken down by Cloud region. - - name: num_messages + - name: num_messages.raw type: long description: Number of messages retained in a snapshot. - - name: num_messages_by_region + - name: num_messages_by_region.raw type: long description: Number of messages retained in a snapshot, broken down by Cloud region. - - name: config_updates_count + - name: config_updates_count.raw type: long description: Cumulative count of configuration changes, grouped by operation type and result. diff --git a/x-pack/metricbeat/module/googlecloud/storage/_meta/fields.yml b/x-pack/metricbeat/module/googlecloud/storage/_meta/fields.yml index 71fcb2bdbeb..17ea1d5b377 100644 --- a/x-pack/metricbeat/module/googlecloud/storage/_meta/fields.yml +++ b/x-pack/metricbeat/module/googlecloud/storage/_meta/fields.yml @@ -6,39 +6,39 @@ - name: api type: group fields: - - name: request_count + - name: request_count.raw type: long description: Delta count of API calls, grouped by the API method name and response code. - name: authz type: group fields: - - name: acl_based_object_access_count + - name: acl_based_object_access_count.raw type: long description: Delta count of requests that result in an object being granted access solely due to object ACLs. - - name: acl_operations_count + - name: acl_operations_count.raw type: long description: Usage of ACL operations broken down by type. - - name: object_specific_acl_mutation_count + - name: object_specific_acl_mutation_count.raw type: long description: Delta count of changes made to object specific ACLs. - name: network type: group fields: - - name: received_bytes_count + - name: received_bytes_count.raw type: long description: Delta count of bytes received over the network, grouped by the API method name and response code. - - name: sent_bytes_count + - name: sent_bytes_count.raw type: long description: Delta count of bytes sent over the network, grouped by the API method name and response code. - name: storage type: group fields: - - name: object_count + - name: object_count.raw type: long description: Total number of objects per bucket, grouped by storage class. This value is measured once per day, and the value is repeated at each sampling interval throughout the day. - - name: total_byte_seconds + - name: total_byte_seconds.raw type: long description: Delta count of bytes received over the network, grouped by the API method name and response code. - - name: total_bytes + - name: total_bytes.raw type: long description: Total size of all objects in the bucket, grouped by storage class. This value is measured once per day, and the value is repeated at each sampling interval throughout the day. From 418aea0c79e41ee02e4cf81dc0c101d164b08109 Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Tue, 21 Apr 2020 16:42:50 -0600 Subject: [PATCH 12/15] add documentation for stackdriver metricset --- CHANGELOG.next.asciidoc | 2 +- metricbeat/docs/fields.asciidoc | 2 +- metricbeat/docs/modules/googlecloud.asciidoc | 96 +------------------ .../modules/googlecloud/stackdriver.asciidoc | 23 +++++ metricbeat/docs/modules_list.asciidoc | 3 +- x-pack/metricbeat/metricbeat.reference.yml | 1 - .../module/googlecloud/_meta/config.yml | 1 - .../module/googlecloud/_meta/docs.asciidoc | 91 ------------------ .../module/googlecloud/_meta/fields.yml | 2 +- .../module/googlecloud/compute/manifest.yml | 3 - .../module/googlecloud/constants.go | 22 +++++ .../metricbeat/module/googlecloud/fields.go | 2 +- .../stackdriver/_meta/docs.asciidoc | 82 ++++++++++++++++ .../stackdriver/compute/identity.go | 2 +- .../stackdriver/metrics_requester.go | 5 +- .../stackdriver/metrics_requester_test.go | 10 ++ .../stackdriver/response_parser.go | 16 ++-- .../stackdriver/response_parser_test.go | 32 +++++++ .../googlecloud/stackdriver/timeseries.go | 7 +- .../modules.d/googlecloud.yml.disabled | 1 - 20 files changed, 194 insertions(+), 209 deletions(-) create mode 100644 metricbeat/docs/modules/googlecloud/stackdriver.asciidoc create mode 100644 x-pack/metricbeat/module/googlecloud/stackdriver/_meta/docs.asciidoc diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index a9370d569e8..9ef03121e20 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -333,7 +333,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - Add final tests and move label to GA for the azure module in metricbeat. {pull}17319[17319] - Reference kubernetes manifests mount data directory from the host when running metricbeat as daemonset, so data persist between executions in the same node. {pull}17429[17429] - Stack Monitoring modules now auto-configure required metricsets when `xpack.enabled: true` is set. {issue}16471[[16471] {pull}17609[17609] -- Add aggregation into ListTimeSeries for googlecloud module to collect one metric per period. {issue}17141[[17141] {pull}17719[17719] +- Add aggregation aligner as a config parameter for googlecloud stackdriver metricset. {issue}17141[[17141] {pull}17719[17719] *Packetbeat* diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index 33a6a9e6bdc..ab9a1ec8998 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -17182,7 +17182,7 @@ type: object -- -*`googlecloud.*.*.*.*.*`*:: +*`googlecloud.stackdriver.*.*.*.*`*:: + -- Metrics that returned from StackDriver API query. diff --git a/metricbeat/docs/modules/googlecloud.asciidoc b/metricbeat/docs/modules/googlecloud.asciidoc index d8026bcab96..6e3d7e881d5 100644 --- a/metricbeat/docs/modules/googlecloud.asciidoc +++ b/metricbeat/docs/modules/googlecloud.asciidoc @@ -28,97 +28,6 @@ This is a list of the possible module parameters you can tune: * *period*: A single time duration specified for this module collection frequency. -* *aligner*: A single string with which aggregation operation need to be applied -onto time series data for ListTimeSeries API. If it's not given, default aligner -is set to be `ALIGN_NONE`. Sample period of each metric type is obtained from -making https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors/list [ListMetricDescriptors API] call. - -[float] -=== Example Configuration -* `compute` metricset is enabled to collect metrics from all zones under -`us-central1` region in `test-project`. Metric types -collected by `compute` metricset usually have 240 seconds ingest delay time and -60 seconds sample period. With `period` specified as `60s` in the config below, -Metricbeat will collect compute metrics from googlecloud every minute with no -aggregation(because `period` matches the metric type's sample period). -+ -[source,yaml] ----- -metricbeat.modules: -- module: googlecloud - metricsets: - - compute - region: "us-central1" - project_id: "test-project" - credentials_file_path: "your JSON credentials file path" - exclude_labels: false - period: 60s ----- - -* `compute` metricset is enabled to collect metrics from a specific zone -`us-central1a` in `test-project`. Metric types collected by `compute` metricset -usually have 240 seconds ingest delay time and 60 seconds sample period. With -`period` specified as `300s` in the config below and no `aligner` -specified, Metricbeat will collect compute metrics from googlecloud every -5-minute with default `aligner = ALIGN_MEAN` aggregation. -+ -[source,yaml] ----- -metricbeat.modules: -- module: googlecloud - metricsets: - - compute - zone: "us-central1a" - project_id: "test-project" - credentials_file_path: "your JSON credentials file path" - exclude_labels: false - period: 300s ----- - -* `compute` metricset is enabled to collect metrics from a specific zone -`us-central1a` in `test-project`. Metric types collected by `compute` metricset -usually have 240 seconds ingest delay time and 60 seconds sample period. With -`period` specified as `10m` in the config below and given `aligner: ALIGN_MAX` -specified, Metricbeat will collect compute metrics from googlecloud every -10-minute with default `aligner = ALIGN_MAX` aggregation. -+ -[source,yaml] ----- -metricbeat.modules: -- module: googlecloud - metricsets: - - compute - zone: "us-central1a" - project_id: "test-project" - credentials_file_path: "your JSON credentials file path" - exclude_labels: false - perSeriesAligner: ALIGN_MAX - period: 10m ----- - -* `compute` metricset is enabled to collect metrics from a specific zone -`us-central1a` in `test-project`. Metric types collected by `compute` metricset -usually have 240 seconds ingest delay time and 60 seconds sample period. With -`period` specified as `5m` in the config below and given `aligner: ALIGN_NONE` -specified, Metricbeat will collect compute metrics from googlecloud every -5-minute with `aligner = ALIGN_NONE` aggregation, which means no aligner -is applied. This way, Metricbeat will collect `compute` metrics every 5-minute and -each collection will return 5 data points(one per sample period). -+ -[source,yaml] ----- -metricbeat.modules: -- module: googlecloud - metricsets: - - compute - zone: "us-central1a" - project_id: "test-project" - credentials_file_path: "your JSON credentials file path" - exclude_labels: false - perSeriesAligner: ALIGN_NONE - period: 5m ----- - [float] == Authentication, authorization and permissions. Authentication and authorization in Google Cloud Platform can be achieved in many ways. For the current version of the Google Cloud Platform module for Metricbeat, the only supported method is using Service Account JSON files. A typical JSON with a private key looks like this: @@ -204,7 +113,6 @@ metricbeat.modules: project_id: "your project id" credentials_file_path: "your JSON credentials file path" exclude_labels: false - perSeriesAligner: ALIGN_MAX period: 300s - module: googlecloud @@ -238,6 +146,8 @@ The following metricsets are available: * <> +* <> + * <> include::googlecloud/compute.asciidoc[] @@ -246,5 +156,7 @@ include::googlecloud/loadbalancing.asciidoc[] include::googlecloud/pubsub.asciidoc[] +include::googlecloud/stackdriver.asciidoc[] + include::googlecloud/storage.asciidoc[] diff --git a/metricbeat/docs/modules/googlecloud/stackdriver.asciidoc b/metricbeat/docs/modules/googlecloud/stackdriver.asciidoc new file mode 100644 index 00000000000..16609f7b01e --- /dev/null +++ b/metricbeat/docs/modules/googlecloud/stackdriver.asciidoc @@ -0,0 +1,23 @@ +//// +This file is generated! See scripts/mage/docs_collector.go +//// + +[[metricbeat-metricset-googlecloud-stackdriver]] +=== Google Cloud Platform stackdriver metricset + +beta[] + +include::../../../../x-pack/metricbeat/module/googlecloud/stackdriver/_meta/docs.asciidoc[] + + +==== Fields + +For a description of each field in the metricset, see the +<> section. + +Here is an example document generated by this metricset: + +[source,json] +---- +include::../../../../x-pack/metricbeat/module/googlecloud/stackdriver/_meta/data.json[] +---- diff --git a/metricbeat/docs/modules_list.asciidoc b/metricbeat/docs/modules_list.asciidoc index b324627d173..7f21121c7c9 100644 --- a/metricbeat/docs/modules_list.asciidoc +++ b/metricbeat/docs/modules_list.asciidoc @@ -109,9 +109,10 @@ This file is generated! See scripts/mage/docs_collector.go .2+| .2+| |<> |<> |<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | -.4+| .4+| |<> beta[] +.5+| .5+| |<> beta[] |<> beta[] |<> beta[] +|<> beta[] |<> beta[] |<> |image:./images/icon-no.png[No prebuilt dashboards] | .1+| .1+| |<> diff --git a/x-pack/metricbeat/metricbeat.reference.yml b/x-pack/metricbeat/metricbeat.reference.yml index c96b545905f..f5c2f331307 100644 --- a/x-pack/metricbeat/metricbeat.reference.yml +++ b/x-pack/metricbeat/metricbeat.reference.yml @@ -502,7 +502,6 @@ metricbeat.modules: project_id: "your project id" credentials_file_path: "your JSON credentials file path" exclude_labels: false - perSeriesAligner: ALIGN_MAX period: 300s - module: googlecloud diff --git a/x-pack/metricbeat/module/googlecloud/_meta/config.yml b/x-pack/metricbeat/module/googlecloud/_meta/config.yml index e819b3c2916..e717a98ee6d 100644 --- a/x-pack/metricbeat/module/googlecloud/_meta/config.yml +++ b/x-pack/metricbeat/module/googlecloud/_meta/config.yml @@ -5,7 +5,6 @@ project_id: "your project id" credentials_file_path: "your JSON credentials file path" exclude_labels: false - perSeriesAligner: ALIGN_MAX period: 300s - module: googlecloud diff --git a/x-pack/metricbeat/module/googlecloud/_meta/docs.asciidoc b/x-pack/metricbeat/module/googlecloud/_meta/docs.asciidoc index 19b951af4a5..a02a1b80979 100644 --- a/x-pack/metricbeat/module/googlecloud/_meta/docs.asciidoc +++ b/x-pack/metricbeat/module/googlecloud/_meta/docs.asciidoc @@ -18,97 +18,6 @@ This is a list of the possible module parameters you can tune: * *period*: A single time duration specified for this module collection frequency. -* *aligner*: A single string with which aggregation operation need to be applied -onto time series data for ListTimeSeries API. If it's not given, default aligner -is set to be `ALIGN_NONE`. Sample period of each metric type is obtained from -making https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors/list [ListMetricDescriptors API] call. - -[float] -=== Example Configuration -* `compute` metricset is enabled to collect metrics from all zones under -`us-central1` region in `test-project`. Metric types -collected by `compute` metricset usually have 240 seconds ingest delay time and -60 seconds sample period. With `period` specified as `60s` in the config below, -Metricbeat will collect compute metrics from googlecloud every minute with no -aggregation(because `period` matches the metric type's sample period). -+ -[source,yaml] ----- -metricbeat.modules: -- module: googlecloud - metricsets: - - compute - region: "us-central1" - project_id: "test-project" - credentials_file_path: "your JSON credentials file path" - exclude_labels: false - period: 60s ----- - -* `compute` metricset is enabled to collect metrics from a specific zone -`us-central1a` in `test-project`. Metric types collected by `compute` metricset -usually have 240 seconds ingest delay time and 60 seconds sample period. With -`period` specified as `300s` in the config below and no `aligner` -specified, Metricbeat will collect compute metrics from googlecloud every -5-minute with default `aligner = ALIGN_MEAN` aggregation. -+ -[source,yaml] ----- -metricbeat.modules: -- module: googlecloud - metricsets: - - compute - zone: "us-central1a" - project_id: "test-project" - credentials_file_path: "your JSON credentials file path" - exclude_labels: false - period: 300s ----- - -* `compute` metricset is enabled to collect metrics from a specific zone -`us-central1a` in `test-project`. Metric types collected by `compute` metricset -usually have 240 seconds ingest delay time and 60 seconds sample period. With -`period` specified as `10m` in the config below and given `aligner: ALIGN_MAX` -specified, Metricbeat will collect compute metrics from googlecloud every -10-minute with default `aligner = ALIGN_MAX` aggregation. -+ -[source,yaml] ----- -metricbeat.modules: -- module: googlecloud - metricsets: - - compute - zone: "us-central1a" - project_id: "test-project" - credentials_file_path: "your JSON credentials file path" - exclude_labels: false - perSeriesAligner: ALIGN_MAX - period: 10m ----- - -* `compute` metricset is enabled to collect metrics from a specific zone -`us-central1a` in `test-project`. Metric types collected by `compute` metricset -usually have 240 seconds ingest delay time and 60 seconds sample period. With -`period` specified as `5m` in the config below and given `aligner: ALIGN_NONE` -specified, Metricbeat will collect compute metrics from googlecloud every -5-minute with `aligner = ALIGN_NONE` aggregation, which means no aligner -is applied. This way, Metricbeat will collect `compute` metrics every 5-minute and -each collection will return 5 data points(one per sample period). -+ -[source,yaml] ----- -metricbeat.modules: -- module: googlecloud - metricsets: - - compute - zone: "us-central1a" - project_id: "test-project" - credentials_file_path: "your JSON credentials file path" - exclude_labels: false - perSeriesAligner: ALIGN_NONE - period: 5m ----- - [float] == Authentication, authorization and permissions. Authentication and authorization in Google Cloud Platform can be achieved in many ways. For the current version of the Google Cloud Platform module for Metricbeat, the only supported method is using Service Account JSON files. A typical JSON with a private key looks like this: diff --git a/x-pack/metricbeat/module/googlecloud/_meta/fields.yml b/x-pack/metricbeat/module/googlecloud/_meta/fields.yml index 1fe7d88d3e3..41c1c09fad9 100644 --- a/x-pack/metricbeat/module/googlecloud/_meta/fields.yml +++ b/x-pack/metricbeat/module/googlecloud/_meta/fields.yml @@ -18,7 +18,7 @@ type: object - name: system.* type: object - - name: "*.*.*.*.*" + - name: "stackdriver.*.*.*.*" type: object object_type: double object_type_mapping_type: "*" diff --git a/x-pack/metricbeat/module/googlecloud/compute/manifest.yml b/x-pack/metricbeat/module/googlecloud/compute/manifest.yml index 54607999d60..34210db8c0e 100644 --- a/x-pack/metricbeat/module/googlecloud/compute/manifest.yml +++ b/x-pack/metricbeat/module/googlecloud/compute/manifest.yml @@ -7,9 +7,6 @@ input: service: compute metrics: - metric_types: - - "compute.googleapis.com/instance/cpu/usage_time" - - "compute.googleapis.com/instance/cpu/utilization" - - "compute.googleapis.com/instance/uptime" - "compute.googleapis.com/firewall/dropped_bytes_count" - "compute.googleapis.com/firewall/dropped_packets_count" - "compute.googleapis.com/instance/cpu/reserved_cores" diff --git a/x-pack/metricbeat/module/googlecloud/constants.go b/x-pack/metricbeat/module/googlecloud/constants.go index 429a668cb86..594b577b00d 100644 --- a/x-pack/metricbeat/module/googlecloud/constants.go +++ b/x-pack/metricbeat/module/googlecloud/constants.go @@ -99,3 +99,25 @@ var AlignersMapToGCP = map[string]monitoringpb.Aggregation_Aligner{ const ( DefaultAligner = "ALIGN_NONE" ) + +var AlignersMapToSuffix = map[string]string{ + "ALIGN_NONE": ".raw", + "ALIGN_DELTA": ".delta", + "ALIGN_RATE": ".rate", + "ALIGN_INTERPOLATE": ".interpolate", + "ALIGN_NEXT_OLDER": ".next_older", + "ALIGN_MIN": ".min", + "ALIGN_MAX": ".max", + "ALIGN_MEAN": ".avg", + "ALIGN_COUNT": ".count", + "ALIGN_SUM": ".sum", + "ALIGN_STDDEV": ".stddev", + "ALIGN_COUNT_TRUE": ".count_true", + "ALIGN_COUNT_FALSE": ".count_false", + "ALIGN_FRACTION_TRUE": ".fraction_true", + "ALIGN_PERCENTILE_99": ".percentile_99", + "ALIGN_PERCENTILE_95": ".percentile_95", + "ALIGN_PERCENTILE_50": ".percentile_50", + "ALIGN_PERCENTILE_05": ".percentile_05", + "ALIGN_PERCENT_CHANGE": ".percent_change", +} diff --git a/x-pack/metricbeat/module/googlecloud/fields.go b/x-pack/metricbeat/module/googlecloud/fields.go index 09f1b44af9d..99366c55683 100644 --- a/x-pack/metricbeat/module/googlecloud/fields.go +++ b/x-pack/metricbeat/module/googlecloud/fields.go @@ -19,5 +19,5 @@ func init() { // AssetGooglecloud returns asset data. // This is the base64 encoded gzipped contents of module/googlecloud. func AssetGooglecloud() string { - return "eJzsXUtz4zYSvs+v6MplximP5rC3qa1UOZ7dZGpnNq61kysLBFsS1iDA4GFF+fVbAEiKlMSnSHqc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8Ot/efgRJ/xKQyBRxduG9SNBuZeAzFPAgX7qlM8LTLJdZs/jpT6+pBWR7FRGMS5b8fQyhFPdX6OLBFWWDLf2DGzXm/uEX+6zUQo0vp14oIFw4ELKAlR76DxKKLYfMnb+++tASsTq19bDyRNuHHJNyY3n2pRN6HfNS+ZZibWWdI2YrRyCFNrZmy8nBg9aKGlpKkasACwQlL7k/qn3pz+/jJNuA9/qO1PXiL/+F73s9dhXB4Nml2VU6+rn4qMjkm9PNGOJ/dE72VxYdZlRsTvnMNGar82lXNDLkuQDnRRe77TLhFlwHvr0sLir6HhOyuvZmc+crnFGbhtggxecGZpBl3pOTfnfBMeHFBQ1rjmyak5R5JeOmLz/vzsPwVz/e9MlOF+kX0TDgvR5eFF9l8YwP83wAAAP//F2u8tg==" } diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/_meta/docs.asciidoc b/x-pack/metricbeat/module/googlecloud/stackdriver/_meta/docs.asciidoc new file mode 100644 index 00000000000..00cce58cac8 --- /dev/null +++ b/x-pack/metricbeat/module/googlecloud/stackdriver/_meta/docs.asciidoc @@ -0,0 +1,82 @@ +Stackdriver provides visibility into the performance, uptime, and overall health +of cloud-powered applications. It collects metrics, events, and metadata from +different services from Google Cloud. This metricset is to collect monitoring +metrics from Google Cloud using `ListTimeSeries` API. + +[float] +== Metricset config and parameters + +* *metric_types*: Required, a list of metric type strings. Each call of the +`ListTimeSeries` API can return any number of time series from a single metric +type. Metric type is to used for identifying a specific time series. + +* *aligner*: A single string with which aggregation operation need to be applied +onto time series data for ListTimeSeries API. If it's not given, default aligner +is set to be `ALIGN_NONE`. Sample period of each metric type is obtained from +making https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors/list [ListMetricDescriptors API] call. + +[float] +=== Example Configuration +* `stackdriver` metricset is enabled to collect metrics from all zones under +`europe-west1-c` region in `elastic-observability` project. Two sets of metrics +are specified: first one is to collect CPU usage time and utilization with +aggregation aligner ALIGN_MEAN; second one is to collect uptime with aggregation +aligner ALIGN_SUM. These metric types all have 240 seconds ingest delay time and +60 seconds sample period. With `period` specified as `300s` in the config below, +Metricbeat will collect compute metrics from googlecloud every 5-minute with +given aggregation aligner applied for each metric type. ++ +[source,yaml] +---- +- module: googlecloud + metricsets: + - stackdriver + zone: "europe-west1-c" + project_id: elastic-observability + credentials_file_path: "your JSON credentials file path" + exclude_labels: false + period: 300s + stackdriver: + service: compute + metrics: + - aligner: ALIGN_MEAN + metric_types: + - "compute.googleapis.com/instance/cpu/usage_time" + - "compute.googleapis.com/instance/cpu/utilization" + - aligner: ALIGN_SUM + metric_types: + - "compute.googleapis.com/instance/uptime" + +---- + +* `stackdriver` metricset is enabled to collect metrics from all zones under +`europe-west1-c` region in `elastic-observability` project. Two sets of metrics +are specified: first one is to collect CPU usage time and utilization with +aggregation aligner ALIGN_MEAN; second one is to collect uptime with aggregation +aligner ALIGN_SUM. These metric types all have 240 seconds ingest delay time and +60 seconds sample period. With `period` specified as `60s` in the config below, +Metricbeat will collect compute metrics from googlecloud every minute with no +aggregation. This case, the aligners specified in the configuration will be +ignored. ++ +[source,yaml] +---- +- module: googlecloud + metricsets: + - stackdriver + zone: "europe-west1-c" + project_id: elastic-observability + credentials_file_path: "your JSON credentials file path" + exclude_labels: false + period: 60s + stackdriver: + service: compute + metrics: + - aligner: ALIGN_MEAN + metric_types: + - "compute.googleapis.com/instance/cpu/usage_time" + - "compute.googleapis.com/instance/cpu/utilization" + - aligner: ALIGN_SUM + metric_types: + - "compute.googleapis.com/instance/uptime" +---- diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/compute/identity.go b/x-pack/metricbeat/module/googlecloud/stackdriver/compute/identity.go index 9367862e6c7..19e434e8df7 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/compute/identity.go +++ b/x-pack/metricbeat/module/googlecloud/stackdriver/compute/identity.go @@ -23,7 +23,7 @@ func (s *metadataCollector) ID(ctx context.Context, in *googlecloud.MetadataColl if in.Timestamp != nil { metadata.ECS.Put("timestamp", in.Timestamp) } else if in.Point != nil { - metadata.ECS.Put("timestamp", in.Point.Interval.StartTime) + metadata.ECS.Put("timestamp", in.Point.Interval.EndTime) } else { return "", errors.New("no timestamp information found") } diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester.go b/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester.go index 8916fd176b0..edfd52a64e3 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester.go +++ b/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester.go @@ -87,6 +87,7 @@ func (r *stackdriverMetricsRequester) Metrics(ctx context.Context, stackDriverCo results := make([]timeSeriesWithAligner, 0) for _, sdc := range stackDriverConfigs { + aligner := sdc.Aligner for _, mt := range sdc.MetricTypes { metricType := mt wg.Add(1) @@ -95,7 +96,7 @@ func (r *stackdriverMetricsRequester) Metrics(ctx context.Context, stackDriverCo defer wg.Done() metricMeta := metricsMeta[metricType] - interval, aligner := getTimeIntervalAligner(metricMeta.ingestDelay, metricMeta.samplePeriod, r.config.period, sdc.Aligner) + interval, aligner := getTimeIntervalAligner(metricMeta.ingestDelay, metricMeta.samplePeriod, r.config.period, aligner) ts := r.Metric(ctx, metricType, interval, aligner) lock.Lock() @@ -176,7 +177,7 @@ func getTimeIntervalAligner(ingestDelay time.Duration, samplePeriod time.Duratio // Default aligner for aggregation is ALIGN_NONE if it's not given updatedAligner := googlecloud.DefaultAligner - if needsAggregation { + if needsAggregation && inputAligner != "" { updatedAligner = inputAligner } diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester_test.go b/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester_test.go index 1699e25d53a..1ed10814b76 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester_test.go +++ b/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester_test.go @@ -145,6 +145,16 @@ func TestGetTimeIntervalAligner(t *testing.T) { "ALIGN_MAX", "ALIGN_NONE", }, + { + "test collectionPeriod equals to samplePeriod with given aligner", + time.Duration(240) * time.Second, + time.Duration(60) * time.Second, + duration.Duration{ + Seconds: int64(60), + }, + "ALIGN_MEAN", + "ALIGN_NONE", + }, } for _, c := range cases { diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/response_parser.go b/x-pack/metricbeat/module/googlecloud/stackdriver/response_parser.go index 474f04a244b..b6e38f4d333 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/response_parser.go +++ b/x-pack/metricbeat/module/googlecloud/stackdriver/response_parser.go @@ -9,9 +9,10 @@ import ( "strings" "time" - "github.com/pkg/errors" + "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud" "github.com/golang/protobuf/ptypes" + "github.com/pkg/errors" "google.golang.org/genproto/googleapis/monitoring/v3" "github.com/elastic/beats/v7/libbeat/common" @@ -36,7 +37,7 @@ type KeyValuePoint struct { } // extractTimeSeriesMetricValues valuable to send to Elasticsearch. This includes, for example, metric values, labels and timestamps -func (e *incomingFieldExtractor) extractTimeSeriesMetricValues(resp *monitoring.TimeSeries) (points []KeyValuePoint, err error) { +func (e *incomingFieldExtractor) extractTimeSeriesMetricValues(resp *monitoring.TimeSeries, aligner string) (points []KeyValuePoint, err error) { points = make([]KeyValuePoint, 0) for _, point := range resp.Points { @@ -48,7 +49,7 @@ func (e *incomingFieldExtractor) extractTimeSeriesMetricValues(resp *monitoring. } p := KeyValuePoint{ - Key: cleanMetricNameString(resp.Metric.Type), + Key: cleanMetricNameString(resp.Metric.Type, aligner), Value: getValueFromPoint(point), Timestamp: ts, } @@ -62,8 +63,8 @@ func (e *incomingFieldExtractor) extractTimeSeriesMetricValues(resp *monitoring. func (e *incomingFieldExtractor) getTimestamp(p *monitoring.Point) (ts time.Time, err error) { // Don't add point intervals that can't be "stated" at some timestamp. if p.Interval != nil { - if ts, err = ptypes.Timestamp(p.Interval.StartTime); err != nil { - return time.Time{}, errors.Errorf("error trying to parse timestamp '%#v' from metric\n", p.Interval.StartTime) + if ts, err = ptypes.Timestamp(p.Interval.EndTime); err != nil { + return time.Time{}, errors.Errorf("error trying to parse timestamp '%#v' from metric\n", p.Interval.EndTime) } return ts, nil } @@ -73,7 +74,7 @@ func (e *incomingFieldExtractor) getTimestamp(p *monitoring.Point) (ts time.Time var rx = regexp.MustCompile(`^[a-z_-]+\.googleapis.com\/`) -func cleanMetricNameString(s string) string { +func cleanMetricNameString(s string, aligner string) string { if s == "" { return "unknown" } @@ -83,7 +84,8 @@ func cleanMetricNameString(s string) string { removedPrefix := strings.TrimPrefix(s, prefix) replacedChars := strings.Replace(removedPrefix, "/", ".", -1) - return replacedChars + metricName := replacedChars + googlecloud.AlignersMapToSuffix[aligner] + return metricName } func getValueFromPoint(p *monitoring.Point) (out interface{}) { diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/response_parser_test.go b/x-pack/metricbeat/module/googlecloud/stackdriver/response_parser_test.go index 4f055ffc0cc..0d5b8fc7ba7 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/response_parser_test.go +++ b/x-pack/metricbeat/module/googlecloud/stackdriver/response_parser_test.go @@ -5,7 +5,10 @@ package stackdriver import ( + "testing" + "github.com/golang/protobuf/ptypes/timestamp" + "github.com/stretchr/testify/assert" "google.golang.org/genproto/googleapis/api/metric" "google.golang.org/genproto/googleapis/api/monitoredres" "google.golang.org/genproto/googleapis/monitoring/v3" @@ -65,3 +68,32 @@ var metrics = []string{ "compute.googleapis.com/instance/disk/read_bytes_count", "compute.googleapis.com/http/server/response_latencies", } + +func TestCleanMetricNameString(t *testing.T) { + cases := []struct { + title string + metricType string + aligner string + expectedMetricName string + }{ + { + "test construct metric name with ALIGN_MEAN aligner", + "compute.googleapis.com/instance/cpu/usage_time", + "ALIGN_MEAN", + "instance.cpu.usage_time.avg", + }, + { + "test construct metric name with ALIGN_NONE aligner", + "compute.googleapis.com/instance/cpu/utilization", + "ALIGN_NONE", + "instance.cpu.utilization.raw", + }, + } + + for _, c := range cases { + t.Run(c.title, func(t *testing.T) { + metricName := cleanMetricNameString(c.metricType, c.aligner) + assert.Equal(t, c.expectedMetricName, metricName) + }) + } +} diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/timeseries.go b/x-pack/metricbeat/module/googlecloud/stackdriver/timeseries.go index 74f24ffe825..c0b456f9954 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/timeseries.go +++ b/x-pack/metricbeat/module/googlecloud/stackdriver/timeseries.go @@ -18,9 +18,9 @@ func (m *MetricSet) timeSeriesGrouped(ctx context.Context, gcpService googleclou metadataService := gcpService for _, tsa := range tsas { - // aligner := tsa.aligner + aligner := tsa.aligner for _, ts := range tsa.timeSeries { - keyValues, err := e.extractTimeSeriesMetricValues(ts) + keyValues, err := e.extractTimeSeriesMetricValues(ts, aligner) if err != nil { return nil, err } @@ -49,9 +49,6 @@ func (m *MetricSet) timeSeriesGrouped(ctx context.Context, gcpService googleclou eventGroups[id] = make([]KeyValuePoint, 0) } - // Add aggregation aligner as a label into metadata - // metadataCollectorData.Labels.Put("aggregation_aligner", aligner) - keyValues[i].ECS = metadataCollectorData.ECS keyValues[i].Labels = metadataCollectorData.Labels diff --git a/x-pack/metricbeat/modules.d/googlecloud.yml.disabled b/x-pack/metricbeat/modules.d/googlecloud.yml.disabled index 52bb91f8358..392b64718d8 100644 --- a/x-pack/metricbeat/modules.d/googlecloud.yml.disabled +++ b/x-pack/metricbeat/modules.d/googlecloud.yml.disabled @@ -8,7 +8,6 @@ project_id: "your project id" credentials_file_path: "your JSON credentials file path" exclude_labels: false - perSeriesAligner: ALIGN_MAX period: 300s - module: googlecloud From c792ce9b02fb73dee573c08aa636a3a8d121b7d6 Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Wed, 22 Apr 2020 10:00:56 -0600 Subject: [PATCH 13/15] change .raw to .value suffix and regenerate data.json files --- .../googlecloud/compute/_meta/data.json | 14 ++-- .../googlecloud/compute/_meta/data_cpu.json | 69 ----------------- .../compute/_meta/data_disk_01.json | 74 ------------------ .../compute/_meta/data_disk_02.json | 77 ------------------- .../compute/_meta/data_firewall.json | 75 ------------------ .../compute/_meta/data_instance.json | 73 ------------------ .../compute/_meta/data_network_01.json | 74 ------------------ .../compute/_meta/data_network_02.json | 72 ----------------- .../compute/compute_integration_test.go | 4 +- .../module/googlecloud/constants.go | 2 +- .../googlecloud/loadbalancing/_meta/data.json | 10 +-- .../module/googlecloud/pubsub/_meta/data.json | 6 +- .../{ => stackdriver}/integration.go | 8 +- .../googlecloud/stackdriver/metricset.go | 14 ++-- .../stackdriver_integration_test.go | 3 +- .../googlecloud/storage/_meta/data.json | 15 ++-- .../storage/storage_integration_test.go | 4 +- 17 files changed, 42 insertions(+), 552 deletions(-) delete mode 100644 x-pack/metricbeat/module/googlecloud/compute/_meta/data_cpu.json delete mode 100644 x-pack/metricbeat/module/googlecloud/compute/_meta/data_disk_01.json delete mode 100644 x-pack/metricbeat/module/googlecloud/compute/_meta/data_disk_02.json delete mode 100644 x-pack/metricbeat/module/googlecloud/compute/_meta/data_firewall.json delete mode 100644 x-pack/metricbeat/module/googlecloud/compute/_meta/data_instance.json delete mode 100644 x-pack/metricbeat/module/googlecloud/compute/_meta/data_network_01.json delete mode 100644 x-pack/metricbeat/module/googlecloud/compute/_meta/data_network_02.json rename x-pack/metricbeat/module/googlecloud/{ => stackdriver}/integration.go (86%) diff --git a/x-pack/metricbeat/module/googlecloud/compute/_meta/data.json b/x-pack/metricbeat/module/googlecloud/compute/_meta/data.json index 8c20535e94b..f1f9f8f386b 100644 --- a/x-pack/metricbeat/module/googlecloud/compute/_meta/data.json +++ b/x-pack/metricbeat/module/googlecloud/compute/_meta/data.json @@ -5,8 +5,8 @@ "id": "elastic-observability" }, "instance": { - "id": "8390997210852978465", - "name": "gke-observability-7--observability-7--3dd3e39b-0jm5" + "id": "6889336735612324102", + "name": "gke-dev-oblt-dev-oblt-pool-83a8831b-kd53" }, "machine": { "type": "n1-standard-4" @@ -24,23 +24,23 @@ "instance": { "disk": { "read_bytes_count": { - "raw": 0 + "value": 0 }, "read_ops_count": { - "raw": 0 + "value": 0 }, "write_bytes_count": { - "raw": 11951536 + "value": 0 }, "write_ops_count": { - "raw": 264 + "value": 0 } } } }, "labels": { "metrics": { - "device_name": "gke-observability-7-1--pvc-4193b085-82e1-11ea-8cd9-42010af0011c", + "device_name": "disk-4", "device_type": "permanent", "storage_type": "pd-standard" }, diff --git a/x-pack/metricbeat/module/googlecloud/compute/_meta/data_cpu.json b/x-pack/metricbeat/module/googlecloud/compute/_meta/data_cpu.json deleted file mode 100644 index 8496bfd79b1..00000000000 --- a/x-pack/metricbeat/module/googlecloud/compute/_meta/data_cpu.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "@timestamp": "2020-01-08T16:06:00.000Z", - "@metadata": { - "beat": "metricbeat", - "type": "_doc", - "version": "8.0.0" - }, - "host": { - "name": "mcastro", - "id": "54f70115bae545cbac2b150f254472a0", - "containerized": false, - "hostname": "mcastro", - "architecture": "x86_64", - "os": { - "version": "", - "family": "", - "name": "Antergos Linux", - "kernel": "5.4.3-arch1-1", - "platform": "antergos" - } - }, - "agent": { - "ephemeral_id": "8b802033-b611-414b-bcaf-1aa19e5f5901", - "hostname": "mcastro", - "id": "7e36a073-1a32-4a94-b65b-4c7f971fb228", - "version": "8.0.0", - "type": "metricbeat" - }, - "cloud": { - "account": { - "id": "elastic-metricbeat" - }, - "provider": "googlecloud", - "instance": { - "name": "instance-1", - "id": "4503798379141677974" - }, - "machine": { - "type": "f1-micro" - }, - "availability_zone": "us-central1-a" - }, - "event": { - "duration": 1398412653, - "dataset": "googlecloud.compute", - "module": "googlecloud" - }, - "metricset": { - "name": "compute", - "period": 300000 - }, - "googlecloud": { - "compute": { - "instance": { - "cpu": { - "reserved_cores": 0.2, - "utilization": 0.005524845140497596 - } - } - }, - "labels": {} - }, - "service": { - "type": "googlecloud" - }, - "ecs": { - "version": "1.2.0" - } -} diff --git a/x-pack/metricbeat/module/googlecloud/compute/_meta/data_disk_01.json b/x-pack/metricbeat/module/googlecloud/compute/_meta/data_disk_01.json deleted file mode 100644 index 038c451d934..00000000000 --- a/x-pack/metricbeat/module/googlecloud/compute/_meta/data_disk_01.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "@timestamp": "2020-01-08T16:05:00.000Z", - "@metadata": { - "beat": "metricbeat", - "type": "_doc", - "version": "8.0.0" - }, - "agent": { - "hostname": "mcastro", - "id": "7e36a073-1a32-4a94-b65b-4c7f971fb228", - "version": "8.0.0", - "type": "metricbeat", - "ephemeral_id": "8b802033-b611-414b-bcaf-1aa19e5f5901" - }, - "ecs": { - "version": "1.2.0" - }, - "googlecloud": { - "labels": { - "metrics": { - "device_type": "permanent", - "storage_type": "pd-standard", - "device_name": "instance-1" - } - }, - "compute": { - "instance": { - "disk": { - "write_bytes_count": 945853 - } - } - } - }, - "service": { - "type": "googlecloud" - }, - "cloud": { - "account": { - "id": "elastic-metricbeat" - }, - "provider": "googlecloud", - "instance": { - "name": "instance-1", - "id": "4503798379141677974" - }, - "machine": { - "type": "f1-micro" - }, - "availability_zone": "us-central1-a" - }, - "metricset": { - "name": "compute", - "period": 300000 - }, - "event": { - "module": "googlecloud", - "duration": 1398637364, - "dataset": "googlecloud.compute" - }, - "host": { - "containerized": false, - "hostname": "mcastro", - "architecture": "x86_64", - "os": { - "platform": "antergos", - "version": "", - "family": "", - "name": "Antergos Linux", - "kernel": "5.4.3-arch1-1" - }, - "name": "mcastro", - "id": "54f70115bae545cbac2b150f254472a0" - } -} diff --git a/x-pack/metricbeat/module/googlecloud/compute/_meta/data_disk_02.json b/x-pack/metricbeat/module/googlecloud/compute/_meta/data_disk_02.json deleted file mode 100644 index d3d0bc9c5ba..00000000000 --- a/x-pack/metricbeat/module/googlecloud/compute/_meta/data_disk_02.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "@timestamp": "2020-01-08T16:04:00.000Z", - "@metadata": { - "beat": "metricbeat", - "type": "_doc", - "version": "8.0.0" - }, - "service": { - "type": "googlecloud" - }, - "ecs": { - "version": "1.2.0" - }, - "host": { - "os": { - "name": "Antergos Linux", - "kernel": "5.4.3-arch1-1", - "platform": "antergos", - "version": "", - "family": "" - }, - "id": "54f70115bae545cbac2b150f254472a0", - "containerized": false, - "name": "mcastro", - "hostname": "mcastro", - "architecture": "x86_64" - }, - "agent": { - "ephemeral_id": "8b802033-b611-414b-bcaf-1aa19e5f5901", - "hostname": "mcastro", - "id": "7e36a073-1a32-4a94-b65b-4c7f971fb228", - "version": "8.0.0", - "type": "metricbeat" - }, - "cloud": { - "availability_zone": "us-central1-a", - "account": { - "id": "elastic-metricbeat" - }, - "provider": "googlecloud", - "instance": { - "id": "4503798379141677974", - "name": "instance-1" - }, - "machine": { - "type": "f1-micro" - } - }, - "metricset": { - "name": "compute", - "period": 300000 - }, - "event": { - "dataset": "googlecloud.compute", - "module": "googlecloud", - "duration": 1398743696 - }, - "googlecloud": { - "labels": { - "metrics": { - "device_name": "instance-1", - "device_type": "permanent", - "storage_type": "pd-standard" - } - }, - "compute": { - "instance": { - "disk": { - "write_ops_count": 140, - "read_ops_count": 2897, - "read_bytes_count": 71574649, - "write_bytes_count": 2557677 - } - } - } - } -} diff --git a/x-pack/metricbeat/module/googlecloud/compute/_meta/data_firewall.json b/x-pack/metricbeat/module/googlecloud/compute/_meta/data_firewall.json deleted file mode 100644 index ee219ec74e0..00000000000 --- a/x-pack/metricbeat/module/googlecloud/compute/_meta/data_firewall.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "@timestamp": "2020-01-08T16:05:00.000Z", - "@metadata": { - "beat": "metricbeat", - "type": "_doc", - "version": "8.0.0" - }, - "ecs": { - "version": "1.2.0" - }, - "host": { - "containerized": false, - "name": "mcastro", - "hostname": "mcastro", - "architecture": "x86_64", - "os": { - "version": "", - "family": "", - "name": "Antergos Linux", - "kernel": "5.4.3-arch1-1", - "platform": "antergos" - }, - "id": "54f70115bae545cbac2b150f254472a0" - }, - "agent": { - "type": "metricbeat", - "ephemeral_id": "8b802033-b611-414b-bcaf-1aa19e5f5901", - "hostname": "mcastro", - "id": "7e36a073-1a32-4a94-b65b-4c7f971fb228", - "version": "8.0.0" - }, - "cloud": { - "availability_zone": "us-central1-a", - "account": { - "id": "elastic-metricbeat" - }, - "provider": "googlecloud", - "instance": { - "id": "4503798379141677974", - "name": "instance-1" - }, - "machine": { - "type": "f1-micro" - } - }, - "event": { - "dataset": "googlecloud.compute", - "module": "googlecloud", - "duration": 1397755844 - }, - "metricset": { - "name": "compute", - "period": 300000 - }, - "googlecloud": { - "labels": {}, - "compute": { - "instance": { - "uptime": 60.00000000000001, - "cpu": { - "reserved_cores": 0.2, - "utilization": 0.38202685489490784, - "usage_time": 0.06629814168597115 - } - }, - "firewall": { - "dropped_packets_count": 3 - } - } - }, - "service": { - "type": "googlecloud" - } -} - diff --git a/x-pack/metricbeat/module/googlecloud/compute/_meta/data_instance.json b/x-pack/metricbeat/module/googlecloud/compute/_meta/data_instance.json deleted file mode 100644 index 4306273f73c..00000000000 --- a/x-pack/metricbeat/module/googlecloud/compute/_meta/data_instance.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "@timestamp": "2020-01-08T16:04:00.000Z", - "@metadata": { - "beat": "metricbeat", - "type": "_doc", - "version": "8.0.0" - }, - "ecs": { - "version": "1.2.0" - }, - "host": { - "os": { - "platform": "antergos", - "version": "", - "family": "", - "name": "Antergos Linux", - "kernel": "5.4.3-arch1-1" - }, - "id": "54f70115bae545cbac2b150f254472a0", - "containerized": false, - "hostname": "mcastro", - "name": "mcastro", - "architecture": "x86_64" - }, - "agent": { - "ephemeral_id": "8b802033-b611-414b-bcaf-1aa19e5f5901", - "hostname": "mcastro", - "id": "7e36a073-1a32-4a94-b65b-4c7f971fb228", - "version": "8.0.0", - "type": "metricbeat" - }, - "cloud": { - "provider": "googlecloud", - "instance": { - "id": "4503798379141677974", - "name": "instance-1" - }, - "machine": { - "type": "f1-micro" - }, - "availability_zone": "us-central1-a", - "account": { - "id": "elastic-metricbeat" - } - }, - "event": { - "module": "googlecloud", - "duration": 1397750508, - "dataset": "googlecloud.compute" - }, - "metricset": { - "period": 300000, - "name": "compute" - }, - "googlecloud": { - "labels": {}, - "compute": { - "firewall": { - "dropped_bytes_count": 0, - "dropped_packets_count": 0 - }, - "instance": { - "uptime": 46.181442, - "cpu": { - "usage_time": 4.5843222587388945 - } - } - } - }, - "service": { - "type": "googlecloud" - } -} diff --git a/x-pack/metricbeat/module/googlecloud/compute/_meta/data_network_01.json b/x-pack/metricbeat/module/googlecloud/compute/_meta/data_network_01.json deleted file mode 100644 index 26c21d62295..00000000000 --- a/x-pack/metricbeat/module/googlecloud/compute/_meta/data_network_01.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "@timestamp": "2020-01-08T16:04:00.000Z", - "@metadata": { - "beat": "metricbeat", - "type": "_doc", - "version": "8.0.0" - }, - "cloud": { - "machine": { - "type": "f1-micro" - }, - "availability_zone": "us-central1-a", - "account": { - "id": "elastic-metricbeat" - }, - "provider": "googlecloud", - "instance": { - "id": "4503798379141677974", - "name": "instance-1" - } - }, - "ecs": { - "version": "1.2.0" - }, - "host": { - "name": "mcastro", - "hostname": "mcastro", - "architecture": "x86_64", - "os": { - "kernel": "5.4.3-arch1-1", - "platform": "antergos", - "version": "", - "family": "", - "name": "Antergos Linux" - }, - "id": "54f70115bae545cbac2b150f254472a0", - "containerized": false - }, - "agent": { - "hostname": "mcastro", - "id": "7e36a073-1a32-4a94-b65b-4c7f971fb228", - "version": "8.0.0", - "type": "metricbeat", - "ephemeral_id": "8b802033-b611-414b-bcaf-1aa19e5f5901" - }, - "event": { - "duration": 1397728251, - "dataset": "googlecloud.compute", - "module": "googlecloud" - }, - "metricset": { - "name": "compute", - "period": 300000 - }, - "googlecloud": { - "labels": { - "metrics": { - "loadbalanced": "false" - } - }, - "compute": { - "instance": { - "network": { - "received_bytes_count": 3846, - "sent_bytes_count": 1750, - "received_packets_count": 17 - } - } - } - }, - "service": { - "type": "googlecloud" - } -} diff --git a/x-pack/metricbeat/module/googlecloud/compute/_meta/data_network_02.json b/x-pack/metricbeat/module/googlecloud/compute/_meta/data_network_02.json deleted file mode 100644 index cc71eda5683..00000000000 --- a/x-pack/metricbeat/module/googlecloud/compute/_meta/data_network_02.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "@timestamp": "2020-01-08T16:05:00.000Z", - "@metadata": { - "beat": "metricbeat", - "type": "_doc", - "version": "8.0.0" - }, - "event": { - "dataset": "googlecloud.compute", - "module": "googlecloud", - "duration": 1398297740 - }, - "metricset": { - "name": "compute", - "period": 300000 - }, - "googlecloud": { - "labels": { - "metrics": { - "loadbalanced": "false" - } - }, - "compute": { - "instance": { - "network": { - "sent_bytes_count": 3977 - } - } - } - }, - "service": { - "type": "googlecloud" - }, - "ecs": { - "version": "1.2.0" - }, - "host": { - "containerized": false, - "name": "mcastro", - "hostname": "mcastro", - "architecture": "x86_64", - "os": { - "family": "", - "name": "Antergos Linux", - "kernel": "5.4.3-arch1-1", - "platform": "antergos", - "version": "" - }, - "id": "54f70115bae545cbac2b150f254472a0" - }, - "agent": { - "id": "7e36a073-1a32-4a94-b65b-4c7f971fb228", - "version": "8.0.0", - "type": "metricbeat", - "ephemeral_id": "8b802033-b611-414b-bcaf-1aa19e5f5901", - "hostname": "mcastro" - }, - "cloud": { - "account": { - "id": "elastic-metricbeat" - }, - "provider": "googlecloud", - "instance": { - "id": "4503798379141677974", - "name": "instance-1" - }, - "machine": { - "type": "f1-micro" - }, - "availability_zone": "us-central1-a" - } -} diff --git a/x-pack/metricbeat/module/googlecloud/compute/compute_integration_test.go b/x-pack/metricbeat/module/googlecloud/compute/compute_integration_test.go index ae9400fdeb3..a4d47d95dd6 100644 --- a/x-pack/metricbeat/module/googlecloud/compute/compute_integration_test.go +++ b/x-pack/metricbeat/module/googlecloud/compute/compute_integration_test.go @@ -11,11 +11,11 @@ import ( "testing" mbtest "github.com/elastic/beats/v7/metricbeat/mb/testing" - "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud" + "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud/stackdriver" ) func TestData(t *testing.T) { - config := googlecloud.GetConfigForTest(t, "compute") + config := stackdriver.GetConfigForTest(t, "compute") metricSet := mbtest.NewFetcher(t, config) metricSet.WriteEvents(t, "/") } diff --git a/x-pack/metricbeat/module/googlecloud/constants.go b/x-pack/metricbeat/module/googlecloud/constants.go index 594b577b00d..19b7e27c53d 100644 --- a/x-pack/metricbeat/module/googlecloud/constants.go +++ b/x-pack/metricbeat/module/googlecloud/constants.go @@ -101,7 +101,7 @@ const ( ) var AlignersMapToSuffix = map[string]string{ - "ALIGN_NONE": ".raw", + "ALIGN_NONE": ".value", "ALIGN_DELTA": ".delta", "ALIGN_RATE": ".rate", "ALIGN_INTERPOLATE": ".interpolate", diff --git a/x-pack/metricbeat/module/googlecloud/loadbalancing/_meta/data.json b/x-pack/metricbeat/module/googlecloud/loadbalancing/_meta/data.json index 3882e804356..f9335292924 100644 --- a/x-pack/metricbeat/module/googlecloud/loadbalancing/_meta/data.json +++ b/x-pack/metricbeat/module/googlecloud/loadbalancing/_meta/data.json @@ -14,9 +14,9 @@ "googlecloud": { "labels": { "metrics": { - "client_network": "UNKNOWN", - "client_subnetwork": "REMOTE_IS_EXTERNAL", - "client_zone": "UNKNOWN" + "client_network": "ocp-be-c5kjr-network", + "client_subnetwork": "ocp-be-c5kjr-worker-subnet", + "client_zone": "us-central1-a" }, "resource": { "backend_name": "ocp-be-c5kjr-master-us-central1-a", @@ -35,8 +35,8 @@ "loadbalancing": { "l3": { "internal": { - "ingress_packets_count": { - "raw": 482 + "egress_packets_count": { + "value": 0 } } } diff --git a/x-pack/metricbeat/module/googlecloud/pubsub/_meta/data.json b/x-pack/metricbeat/module/googlecloud/pubsub/_meta/data.json index 60b9b98dba5..fd0dd71838a 100644 --- a/x-pack/metricbeat/module/googlecloud/pubsub/_meta/data.json +++ b/x-pack/metricbeat/module/googlecloud/pubsub/_meta/data.json @@ -14,13 +14,13 @@ "googlecloud": { "labels": { "resource": { - "subscription_id": "test-subscription-1" + "subscription_id": "test-ks" } }, "pubsub": { "subscription": { - "retained_acked_bytes": { - "raw": 0 + "oldest_unacked_message_age": { + "value": 0 } } } diff --git a/x-pack/metricbeat/module/googlecloud/integration.go b/x-pack/metricbeat/module/googlecloud/stackdriver/integration.go similarity index 86% rename from x-pack/metricbeat/module/googlecloud/integration.go rename to x-pack/metricbeat/module/googlecloud/stackdriver/integration.go index 0e7ac055bc7..68e3750d5a5 100644 --- a/x-pack/metricbeat/module/googlecloud/integration.go +++ b/x-pack/metricbeat/module/googlecloud/stackdriver/integration.go @@ -2,7 +2,7 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. -package googlecloud +package stackdriver import ( "os" @@ -36,7 +36,11 @@ func GetConfigForTest(t *testing.T, metricSetName string) map[string]interface{} if metricSetName == "stackdriver" { config["stackdriver.service"] = "compute" - config["stackdriver.metrics"] = []string{"compute.googleapis.com/instance/uptime"} + stackDriverConfig := stackDriverConfig{ + Aligner: "ALIGN_NONE", + MetricTypes: []string{"compute.googleapis.com/instance/uptime"}, + } + config["stackdriver.metrics"] = stackDriverConfig } } return config diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/metricset.go b/x-pack/metricbeat/module/googlecloud/stackdriver/metricset.go index 286094b104b..81fa98751aa 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/metricset.go +++ b/x-pack/metricbeat/module/googlecloud/stackdriver/metricset.go @@ -46,7 +46,7 @@ type MetricSet struct { config config metricsMeta map[string]metricMeta requester *stackdriverMetricsRequester - StackDriverConfig []stackDriverConfig `config:"metrics" validate:"nonzero,required"` + stackDriverConfig []stackDriverConfig `config:"metrics" validate:"nonzero,required"` } //stackDriverConfig holds a configuration specific for stackdriver metricset. @@ -91,7 +91,7 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { return nil, err } - m.StackDriverConfig = stackDriverConfigs.StackDriverMetrics + m.stackDriverConfig = stackDriverConfigs.StackDriverMetrics m.config.opt = []option.ClientOption{option.WithCredentialsFile(m.config.CredentialsFilePath)} m.config.period.Seconds = int64(m.Module().Config().Period.Seconds()) @@ -106,7 +106,7 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { return nil, errors.Wrap(err, "error creating Stackdriver client") } - m.metricsMeta, err = metricDescriptor(ctx, client, m.config.ProjectID, m.StackDriverConfig) + m.metricsMeta, err = metricDescriptor(ctx, client, m.config.ProjectID, m.stackDriverConfig) if err != nil { return nil, errors.Wrap(err, "error calling metricDescriptor function") } @@ -123,7 +123,7 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { // format. It publishes the event which is then forwarded to the output. In case // of an error set the Error field of mb.Event or simply call report.Error(). func (m *MetricSet) Fetch(ctx context.Context, reporter mb.ReporterV2) (err error) { - responses, err := m.requester.Metrics(ctx, m.StackDriverConfig, m.metricsMeta) + responses, err := m.requester.Metrics(ctx, m.stackDriverConfig, m.metricsMeta) if err != nil { return errors.Wrapf(err, "error trying to get metrics for project '%s' and zone '%s' or region '%s'", m.config.ProjectID, m.config.Zone, m.config.Region) } @@ -218,11 +218,11 @@ func (mc *stackDriverConfig) Validate() error { // metricDescriptor calls ListMetricDescriptorsRequest API to get metric metadata // (sample period and ingest delay) of each given metric type -func metricDescriptor(ctx context.Context, client *monitoring.MetricClient, projectID string, metricsConfigs []stackDriverConfig) (map[string]metricMeta, error) { +func metricDescriptor(ctx context.Context, client *monitoring.MetricClient, projectID string, stackDriverConfigs []stackDriverConfig) (map[string]metricMeta, error) { metricsWithMeta := make(map[string]metricMeta, 0) - for _, metricsC := range metricsConfigs { - for _, mt := range metricsC.MetricTypes { + for _, sdc := range stackDriverConfigs { + for _, mt := range sdc.MetricTypes { req := &monitoringpb.ListMetricDescriptorsRequest{ Name: "projects/" + projectID, Filter: fmt.Sprintf(`metric.type = "%s"`, mt), diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/stackdriver_integration_test.go b/x-pack/metricbeat/module/googlecloud/stackdriver/stackdriver_integration_test.go index 8fe568ebe95..fd11a50c6e9 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/stackdriver_integration_test.go +++ b/x-pack/metricbeat/module/googlecloud/stackdriver/stackdriver_integration_test.go @@ -11,11 +11,10 @@ import ( "testing" mbtest "github.com/elastic/beats/v7/metricbeat/mb/testing" - "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud" ) func TestData(t *testing.T) { - config := googlecloud.GetConfigForTest(t, "stackdriver") + config := GetConfigForTest(t, "stackdriver") metricSet := mbtest.NewFetcher(t, config) metricSet.WriteEvents(t, "/") } diff --git a/x-pack/metricbeat/module/googlecloud/storage/_meta/data.json b/x-pack/metricbeat/module/googlecloud/storage/_meta/data.json index f94a1375997..02541f8a1e7 100644 --- a/x-pack/metricbeat/module/googlecloud/storage/_meta/data.json +++ b/x-pack/metricbeat/module/googlecloud/storage/_meta/data.json @@ -14,18 +14,19 @@ "googlecloud": { "labels": { "metrics": { - "storage_class": "REGIONAL" + "method": "GetBucketMetadata", + "response_code": "OK" }, "resource": { - "bucket_name": "elastic-vsphere-images", - "location": "us-east1" + "bucket_name": "ocp-be-c5kjr-image-registry-us-central1-dsoafnbgctvfimpavswkgn", + "location": "us-central1" } }, "storage": { - "storage": { - "object_count": 3, - "total_byte_seconds": 58816542441472, - "total_bytes": 680747019 + "network": { + "sent_bytes_count": { + "value": 2637 + } } } }, diff --git a/x-pack/metricbeat/module/googlecloud/storage/storage_integration_test.go b/x-pack/metricbeat/module/googlecloud/storage/storage_integration_test.go index f669a7c46e9..0f2b010f5f2 100644 --- a/x-pack/metricbeat/module/googlecloud/storage/storage_integration_test.go +++ b/x-pack/metricbeat/module/googlecloud/storage/storage_integration_test.go @@ -11,11 +11,11 @@ import ( "testing" mbtest "github.com/elastic/beats/v7/metricbeat/mb/testing" - "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud" + "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud/stackdriver" ) func TestData(t *testing.T) { - config := googlecloud.GetConfigForTest(t, "storage") + config := stackdriver.GetConfigForTest(t, "storage") metricSet := mbtest.NewFetcher(t, config) metricSet.WriteEvents(t, "/") } From 78a3ad55eb8a75065e4e8369d3c7039f5dbb38ea Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Wed, 22 Apr 2020 10:48:52 -0600 Subject: [PATCH 14/15] fix unit test for .value suffix --- .../module/googlecloud/stackdriver/response_parser_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/response_parser_test.go b/x-pack/metricbeat/module/googlecloud/stackdriver/response_parser_test.go index 0d5b8fc7ba7..84f689d042b 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/response_parser_test.go +++ b/x-pack/metricbeat/module/googlecloud/stackdriver/response_parser_test.go @@ -86,7 +86,7 @@ func TestCleanMetricNameString(t *testing.T) { "test construct metric name with ALIGN_NONE aligner", "compute.googleapis.com/instance/cpu/utilization", "ALIGN_NONE", - "instance.cpu.utilization.raw", + "instance.cpu.utilization.value", }, } From 26c46524791943f1b3127d7c4dceabc9abb50c7d Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Wed, 22 Apr 2020 14:16:11 -0600 Subject: [PATCH 15/15] change .raw to .value in fields.yml --- metricbeat/docs/fields.asciidoc | 262 +++++++++--------- .../googlecloud/compute/_meta/data_cpu.json | 69 +++++ .../compute/_meta/data_disk_01.json | 74 +++++ .../compute/_meta/data_disk_02.json | 77 +++++ .../compute/_meta/data_firewall.json | 75 +++++ .../compute/_meta/data_instance.json | 73 +++++ .../googlecloud/compute/_meta/fields.yml | 28 +- .../metricbeat/module/googlecloud/fields.go | 2 +- .../loadbalancing/_meta/fields.yml | 120 ++++---- .../googlecloud/pubsub/_meta/fields.yml | 96 +++---- .../googlecloud/storage/_meta/fields.yml | 18 +- 11 files changed, 631 insertions(+), 263 deletions(-) create mode 100644 x-pack/metricbeat/module/googlecloud/compute/_meta/data_cpu.json create mode 100644 x-pack/metricbeat/module/googlecloud/compute/_meta/data_disk_01.json create mode 100644 x-pack/metricbeat/module/googlecloud/compute/_meta/data_disk_02.json create mode 100644 x-pack/metricbeat/module/googlecloud/compute/_meta/data_firewall.json create mode 100644 x-pack/metricbeat/module/googlecloud/compute/_meta/data_instance.json diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index ab9a1ec8998..f0f8919cc51 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -17200,7 +17200,7 @@ Google Cloud Compute metrics -*`googlecloud.compute.instance.firewall.dropped_bytes_count.raw`*:: +*`googlecloud.compute.instance.firewall.dropped_bytes_count.value`*:: + -- Incoming bytes dropped by the firewall @@ -17209,7 +17209,7 @@ type: long -- -*`googlecloud.compute.instance.firewall.dropped_packets_count.raw`*:: +*`googlecloud.compute.instance.firewall.dropped_packets_count.value`*:: + -- Incoming packets dropped by the firewall @@ -17219,7 +17219,7 @@ type: long -- -*`googlecloud.compute.instance.cpu.reserved_cores.raw`*:: +*`googlecloud.compute.instance.cpu.reserved_cores.value`*:: + -- Number of cores reserved on the host of the instance @@ -17228,7 +17228,7 @@ type: double -- -*`googlecloud.compute.instance.cpu.utilization.raw`*:: +*`googlecloud.compute.instance.cpu.utilization.value`*:: + -- The fraction of the allocated CPU that is currently in use on the instance @@ -17237,7 +17237,7 @@ type: double -- -*`googlecloud.compute.instance.cpu.usage_time.raw`*:: +*`googlecloud.compute.instance.cpu.usage_time.value`*:: + -- Usage for all cores in seconds @@ -17247,7 +17247,7 @@ type: double -- -*`googlecloud.compute.instance.disk.read_bytes_count.raw`*:: +*`googlecloud.compute.instance.disk.read_bytes_count.value`*:: + -- Count of bytes read from disk @@ -17256,7 +17256,7 @@ type: long -- -*`googlecloud.compute.instance.disk.read_ops_count.raw`*:: +*`googlecloud.compute.instance.disk.read_ops_count.value`*:: + -- Count of disk read IO operations @@ -17265,7 +17265,7 @@ type: long -- -*`googlecloud.compute.instance.disk.write_bytes_count.raw`*:: +*`googlecloud.compute.instance.disk.write_bytes_count.value`*:: + -- Count of bytes written to disk @@ -17274,7 +17274,7 @@ type: long -- -*`googlecloud.compute.instance.disk.write_ops_count.raw`*:: +*`googlecloud.compute.instance.disk.write_ops_count.value`*:: + -- Count of disk write IO operations @@ -17283,7 +17283,7 @@ type: long -- -*`googlecloud.compute.instance.uptime.raw`*:: +*`googlecloud.compute.instance.uptime.value`*:: + -- How long the VM has been running, in seconds @@ -17293,7 +17293,7 @@ type: long -- -*`googlecloud.compute.instance.network.received_bytes_count.raw`*:: +*`googlecloud.compute.instance.network.received_bytes_count.value`*:: + -- Count of bytes received from the network @@ -17302,7 +17302,7 @@ type: long -- -*`googlecloud.compute.instance.network.received_packets_count.raw`*:: +*`googlecloud.compute.instance.network.received_packets_count.value`*:: + -- Count of packets received from the network @@ -17311,7 +17311,7 @@ type: long -- -*`googlecloud.compute.instance.network.sent_bytes_count.raw`*:: +*`googlecloud.compute.instance.network.sent_bytes_count.value`*:: + -- Count of bytes sent over the network @@ -17320,7 +17320,7 @@ type: long -- -*`googlecloud.compute.instance.network.sent_packets_count.raw`*:: +*`googlecloud.compute.instance.network.sent_packets_count.value`*:: + -- Count of packets sent over the network @@ -17347,21 +17347,21 @@ Google Cloud Load Balancing metrics A distribution of the latency calculated from when the request was sent by the proxy to the backend until the proxy received from the backend the last byte of response. -*`googlecloud.loadbalancing.https.backend_latencies.count.raw`*:: +*`googlecloud.loadbalancing.https.backend_latencies.count.value`*:: + -- type: long -- -*`googlecloud.loadbalancing.https.backend_latencies.mean.raw`*:: +*`googlecloud.loadbalancing.https.backend_latencies.mean.value`*:: + -- type: long -- -*`googlecloud.loadbalancing.https.backend_latencies.bucket_counts.raw`*:: +*`googlecloud.loadbalancing.https.backend_latencies.bucket_counts.value`*:: + -- type: long @@ -17371,28 +17371,28 @@ type: long -*`googlecloud.loadbalancing.https.backend_latencies.bucket_options.Options.ExponentialBuckets.growth_factor.raw`*:: +*`googlecloud.loadbalancing.https.backend_latencies.bucket_options.Options.ExponentialBuckets.growth_factor.value`*:: + -- type: double -- -*`googlecloud.loadbalancing.https.backend_latencies.bucket_options.Options.ExponentialBuckets.scale.raw`*:: +*`googlecloud.loadbalancing.https.backend_latencies.bucket_options.Options.ExponentialBuckets.scale.value`*:: + -- type: long -- -*`googlecloud.loadbalancing.https.backend_latencies.bucket_options.Options.ExponentialBuckets.num_finite_buckets.raw`*:: +*`googlecloud.loadbalancing.https.backend_latencies.bucket_options.Options.ExponentialBuckets.num_finite_buckets.value`*:: + -- type: long -- -*`googlecloud.loadbalancing.https.backend_request_bytes_count.raw`*:: +*`googlecloud.loadbalancing.https.backend_request_bytes_count.value`*:: + -- The number of bytes sent as requests from HTTP/S load balancer to backends. @@ -17401,7 +17401,7 @@ type: long -- -*`googlecloud.loadbalancing.https.backend_request_count.raw`*:: +*`googlecloud.loadbalancing.https.backend_request_count.value`*:: + -- The number of requests served by backends of HTTP/S load balancer. @@ -17410,7 +17410,7 @@ type: long -- -*`googlecloud.loadbalancing.https.backend_response_bytes_count.raw`*:: +*`googlecloud.loadbalancing.https.backend_response_bytes_count.value`*:: + -- The number of bytes sent as responses from backends (or cache) to HTTP/S load balancer. @@ -17425,21 +17425,21 @@ type: long A distribution of the RTT measured for each connection between client and proxy. -*`googlecloud.loadbalancing.https.frontend_tcp_rtt.count.raw`*:: +*`googlecloud.loadbalancing.https.frontend_tcp_rtt.count.value`*:: + -- type: long -- -*`googlecloud.loadbalancing.https.frontend_tcp_rtt.mean.raw`*:: +*`googlecloud.loadbalancing.https.frontend_tcp_rtt.mean.value`*:: + -- type: long -- -*`googlecloud.loadbalancing.https.frontend_tcp_rtt.bucket_counts.raw`*:: +*`googlecloud.loadbalancing.https.frontend_tcp_rtt.bucket_counts.value`*:: + -- type: long @@ -17449,21 +17449,21 @@ type: long -*`googlecloud.loadbalancing.https.frontend_tcp_rtt.bucket_options.Options.ExponentialBuckets.growth_factor.raw`*:: +*`googlecloud.loadbalancing.https.frontend_tcp_rtt.bucket_options.Options.ExponentialBuckets.growth_factor.value`*:: + -- type: double -- -*`googlecloud.loadbalancing.https.frontend_tcp_rtt.bucket_options.Options.ExponentialBuckets.scale.raw`*:: +*`googlecloud.loadbalancing.https.frontend_tcp_rtt.bucket_options.Options.ExponentialBuckets.scale.value`*:: + -- type: long -- -*`googlecloud.loadbalancing.https.frontend_tcp_rtt.bucket_options.Options.ExponentialBuckets.num_finite_buckets.raw`*:: +*`googlecloud.loadbalancing.https.frontend_tcp_rtt.bucket_options.Options.ExponentialBuckets.num_finite_buckets.value`*:: + -- type: long @@ -17477,21 +17477,21 @@ type: long A distribution of the latency calculated from when the request was sent by the proxy to the backend until the proxy received from the backend the last byte of response. -*`googlecloud.loadbalancing.https.internal.backend_latencies.count.raw`*:: +*`googlecloud.loadbalancing.https.internal.backend_latencies.count.value`*:: + -- type: long -- -*`googlecloud.loadbalancing.https.internal.backend_latencies.mean.raw`*:: +*`googlecloud.loadbalancing.https.internal.backend_latencies.mean.value`*:: + -- type: long -- -*`googlecloud.loadbalancing.https.internal.backend_latencies.bucket_counts.raw`*:: +*`googlecloud.loadbalancing.https.internal.backend_latencies.bucket_counts.value`*:: + -- type: long @@ -17501,28 +17501,28 @@ type: long -*`googlecloud.loadbalancing.https.internal.backend_latencies.bucket_options.Options.ExponentialBuckets.growth_factor.raw`*:: +*`googlecloud.loadbalancing.https.internal.backend_latencies.bucket_options.Options.ExponentialBuckets.growth_factor.value`*:: + -- type: double -- -*`googlecloud.loadbalancing.https.internal.backend_latencies.bucket_options.Options.ExponentialBuckets.scale.raw`*:: +*`googlecloud.loadbalancing.https.internal.backend_latencies.bucket_options.Options.ExponentialBuckets.scale.value`*:: + -- type: long -- -*`googlecloud.loadbalancing.https.internal.backend_latencies.bucket_options.Options.ExponentialBuckets.num_finite_buckets.raw`*:: +*`googlecloud.loadbalancing.https.internal.backend_latencies.bucket_options.Options.ExponentialBuckets.num_finite_buckets.value`*:: + -- type: long -- -*`googlecloud.loadbalancing.https.internal.request_bytes_count.raw`*:: +*`googlecloud.loadbalancing.https.internal.request_bytes_count.value`*:: + -- The number of bytes sent as requests from clients to HTTP/S load balancer. @@ -17531,7 +17531,7 @@ type: long -- -*`googlecloud.loadbalancing.https.internal.request_count.raw`*:: +*`googlecloud.loadbalancing.https.internal.request_count.value`*:: + -- The number of requests served by HTTP/S load balancer. @@ -17540,7 +17540,7 @@ type: long -- -*`googlecloud.loadbalancing.https.internal.response_bytes_count.raw`*:: +*`googlecloud.loadbalancing.https.internal.response_bytes_count.value`*:: + -- The number of bytes sent as responses from HTTP/S load balancer to clients. @@ -17555,21 +17555,21 @@ type: long A distribution of the latency calculated from when the request was received by the proxy until the proxy got ACK from client on last response byte. -*`googlecloud.loadbalancing.https.internal.total_latencies.count.raw`*:: +*`googlecloud.loadbalancing.https.internal.total_latencies.count.value`*:: + -- type: long -- -*`googlecloud.loadbalancing.https.internal.total_latencies.mean.raw`*:: +*`googlecloud.loadbalancing.https.internal.total_latencies.mean.value`*:: + -- type: long -- -*`googlecloud.loadbalancing.https.internal.total_latencies.bucket_counts.raw`*:: +*`googlecloud.loadbalancing.https.internal.total_latencies.bucket_counts.value`*:: + -- type: long @@ -17579,28 +17579,28 @@ type: long -*`googlecloud.loadbalancing.https.internal.total_latencies.bucket_options.Options.ExponentialBuckets.growth_factor.raw`*:: +*`googlecloud.loadbalancing.https.internal.total_latencies.bucket_options.Options.ExponentialBuckets.growth_factor.value`*:: + -- type: double -- -*`googlecloud.loadbalancing.https.internal.total_latencies.bucket_options.Options.ExponentialBuckets.scale.raw`*:: +*`googlecloud.loadbalancing.https.internal.total_latencies.bucket_options.Options.ExponentialBuckets.scale.value`*:: + -- type: long -- -*`googlecloud.loadbalancing.https.internal.total_latencies.bucket_options.Options.ExponentialBuckets.num_finite_buckets.raw`*:: +*`googlecloud.loadbalancing.https.internal.total_latencies.bucket_options.Options.ExponentialBuckets.num_finite_buckets.value`*:: + -- type: long -- -*`googlecloud.loadbalancing.https.request_bytes_count.raw`*:: +*`googlecloud.loadbalancing.https.request_bytes_count.value`*:: + -- The number of bytes sent as requests from clients to HTTP/S load balancer. @@ -17609,7 +17609,7 @@ type: long -- -*`googlecloud.loadbalancing.https.request_count.raw`*:: +*`googlecloud.loadbalancing.https.request_count.value`*:: + -- The number of requests served by HTTP/S load balancer. @@ -17618,7 +17618,7 @@ type: long -- -*`googlecloud.loadbalancing.https.response_bytes_count.raw`*:: +*`googlecloud.loadbalancing.https.response_bytes_count.value`*:: + -- The number of bytes sent as responses from HTTP/S load balancer to clients. @@ -17633,21 +17633,21 @@ type: long A distribution of the latency calculated from when the request was received by the proxy until the proxy got ACK from client on last response byte. -*`googlecloud.loadbalancing.https.total_latencies.count.raw`*:: +*`googlecloud.loadbalancing.https.total_latencies.count.value`*:: + -- type: long -- -*`googlecloud.loadbalancing.https.total_latencies.mean.raw`*:: +*`googlecloud.loadbalancing.https.total_latencies.mean.value`*:: + -- type: long -- -*`googlecloud.loadbalancing.https.total_latencies.bucket_counts.raw`*:: +*`googlecloud.loadbalancing.https.total_latencies.bucket_counts.value`*:: + -- type: long @@ -17657,21 +17657,21 @@ type: long -*`googlecloud.loadbalancing.https.total_latencies.bucket_options.Options.ExponentialBuckets.growth_factor.raw`*:: +*`googlecloud.loadbalancing.https.total_latencies.bucket_options.Options.ExponentialBuckets.growth_factor.value`*:: + -- type: double -- -*`googlecloud.loadbalancing.https.total_latencies.bucket_options.Options.ExponentialBuckets.scale.raw`*:: +*`googlecloud.loadbalancing.https.total_latencies.bucket_options.Options.ExponentialBuckets.scale.value`*:: + -- type: long -- -*`googlecloud.loadbalancing.https.total_latencies.bucket_options.Options.ExponentialBuckets.num_finite_buckets.raw`*:: +*`googlecloud.loadbalancing.https.total_latencies.bucket_options.Options.ExponentialBuckets.num_finite_buckets.value`*:: + -- type: long @@ -17684,7 +17684,7 @@ type: long Google Cloud Load Balancing metrics -*`googlecloud.loadbalancing.l3.internal.egress_bytes_count.raw`*:: +*`googlecloud.loadbalancing.l3.internal.egress_bytes_count.value`*:: + -- The number of bytes sent from ILB backend to client (for TCP flows it's counting bytes on application stream only). @@ -17693,7 +17693,7 @@ type: long -- -*`googlecloud.loadbalancing.l3.internal.egress_packets_count.raw`*:: +*`googlecloud.loadbalancing.l3.internal.egress_packets_count.value`*:: + -- The number of packets sent from ILB backend to client of the flow. @@ -17702,7 +17702,7 @@ type: long -- -*`googlecloud.loadbalancing.l3.internal.ingress_bytes_count.raw`*:: +*`googlecloud.loadbalancing.l3.internal.ingress_bytes_count.value`*:: + -- The number of bytes sent from client to ILB backend (for TCP flows it's counting bytes on application stream only). @@ -17711,7 +17711,7 @@ type: long -- -*`googlecloud.loadbalancing.l3.internal.ingress_packets_count.raw`*:: +*`googlecloud.loadbalancing.l3.internal.ingress_packets_count.value`*:: + -- The number of packets sent from client to ILB backend. @@ -17726,21 +17726,21 @@ type: long A distribution of RTT measured over TCP connections for ILB flows. -*`googlecloud.loadbalancing.l3.internal.rtt_latencies.count.raw`*:: +*`googlecloud.loadbalancing.l3.internal.rtt_latencies.count.value`*:: + -- type: long -- -*`googlecloud.loadbalancing.l3.internal.rtt_latencies.mean.raw`*:: +*`googlecloud.loadbalancing.l3.internal.rtt_latencies.mean.value`*:: + -- type: long -- -*`googlecloud.loadbalancing.l3.internal.rtt_latencies.bucket_counts.raw`*:: +*`googlecloud.loadbalancing.l3.internal.rtt_latencies.bucket_counts.value`*:: + -- type: long @@ -17750,21 +17750,21 @@ type: long -*`googlecloud.loadbalancing.l3.internal.rtt_latencies.bucket_options.Options.ExponentialBuckets.growth_factor.raw`*:: +*`googlecloud.loadbalancing.l3.internal.rtt_latencies.bucket_options.Options.ExponentialBuckets.growth_factor.value`*:: + -- type: double -- -*`googlecloud.loadbalancing.l3.internal.rtt_latencies.bucket_options.Options.ExponentialBuckets.scale.raw`*:: +*`googlecloud.loadbalancing.l3.internal.rtt_latencies.bucket_options.Options.ExponentialBuckets.scale.value`*:: + -- type: long -- -*`googlecloud.loadbalancing.l3.internal.rtt_latencies.bucket_options.Options.ExponentialBuckets.num_finite_buckets.raw`*:: +*`googlecloud.loadbalancing.l3.internal.rtt_latencies.bucket_options.Options.ExponentialBuckets.num_finite_buckets.value`*:: + -- type: long @@ -17777,7 +17777,7 @@ type: long Google Cloud Load Balancing metrics -*`googlecloud.loadbalancing.tcp_ssl_proxy.closed_connections.raw`*:: +*`googlecloud.loadbalancing.tcp_ssl_proxy.closed_connections.value`*:: + -- Number of connections that were terminated over TCP/SSL proxy. @@ -17786,7 +17786,7 @@ type: long -- -*`googlecloud.loadbalancing.tcp_ssl_proxy.egress_bytes_count.raw`*:: +*`googlecloud.loadbalancing.tcp_ssl_proxy.egress_bytes_count.value`*:: + -- Number of bytes sent from VM to client using proxy. @@ -17801,21 +17801,21 @@ type: long A distribution of the smoothed RTT (in ms) measured by the proxy's TCP stack, each minute application layer bytes pass from proxy to client. -*`googlecloud.loadbalancing.tcp_ssl_proxy.frontend_tcp_rtt.count.raw`*:: +*`googlecloud.loadbalancing.tcp_ssl_proxy.frontend_tcp_rtt.count.value`*:: + -- type: long -- -*`googlecloud.loadbalancing.tcp_ssl_proxy.frontend_tcp_rtt.mean.raw`*:: +*`googlecloud.loadbalancing.tcp_ssl_proxy.frontend_tcp_rtt.mean.value`*:: + -- type: long -- -*`googlecloud.loadbalancing.tcp_ssl_proxy.frontend_tcp_rtt.bucket_counts.raw`*:: +*`googlecloud.loadbalancing.tcp_ssl_proxy.frontend_tcp_rtt.bucket_counts.value`*:: + -- type: long @@ -17825,28 +17825,28 @@ type: long -*`googlecloud.loadbalancing.tcp_ssl_proxy.frontend_tcp_rtt.bucket_options.Options.ExponentialBuckets.growth_factor.raw`*:: +*`googlecloud.loadbalancing.tcp_ssl_proxy.frontend_tcp_rtt.bucket_options.Options.ExponentialBuckets.growth_factor.value`*:: + -- type: double -- -*`googlecloud.loadbalancing.tcp_ssl_proxy.frontend_tcp_rtt.bucket_options.Options.ExponentialBuckets.scale.raw`*:: +*`googlecloud.loadbalancing.tcp_ssl_proxy.frontend_tcp_rtt.bucket_options.Options.ExponentialBuckets.scale.value`*:: + -- type: long -- -*`googlecloud.loadbalancing.tcp_ssl_proxy.frontend_tcp_rtt.bucket_options.Options.ExponentialBuckets.num_finite_buckets.raw`*:: +*`googlecloud.loadbalancing.tcp_ssl_proxy.frontend_tcp_rtt.bucket_options.Options.ExponentialBuckets.num_finite_buckets.value`*:: + -- type: long -- -*`googlecloud.loadbalancing.tcp_ssl_proxy.ingress_bytes_count.raw`*:: +*`googlecloud.loadbalancing.tcp_ssl_proxy.ingress_bytes_count.value`*:: + -- Number of bytes sent from client to VM using proxy. @@ -17855,7 +17855,7 @@ type: long -- -*`googlecloud.loadbalancing.tcp_ssl_proxy.new_connections.raw`*:: +*`googlecloud.loadbalancing.tcp_ssl_proxy.new_connections.value`*:: + -- Number of connections that were created over TCP/SSL proxy. @@ -17864,7 +17864,7 @@ type: long -- -*`googlecloud.loadbalancing.tcp_ssl_proxy.open_connections.raw`*:: +*`googlecloud.loadbalancing.tcp_ssl_proxy.open_connections.value`*:: + -- Current number of outstanding connections through the TCP/SSL proxy. @@ -17885,7 +17885,7 @@ Google Cloud PubSub metrics Suscription related metrics -*`googlecloud.pubsub.subscription.ack_message_count.raw`*:: +*`googlecloud.pubsub.subscription.ack_message_count.value`*:: + -- Cumulative count of messages acknowledged by Acknowledge requests, grouped by delivery type. @@ -17894,7 +17894,7 @@ type: long -- -*`googlecloud.pubsub.subscription.backlog_bytes.raw`*:: +*`googlecloud.pubsub.subscription.backlog_bytes.value`*:: + -- Total byte size of the unacknowledged messages (a.k.a. backlog messages) in a subscription. @@ -17903,7 +17903,7 @@ type: long -- -*`googlecloud.pubsub.subscription.num_outstanding_messages.raw`*:: +*`googlecloud.pubsub.subscription.num_outstanding_messages.value`*:: + -- Number of messages delivered to a subscription's push endpoint, but not yet acknowledged. @@ -17912,7 +17912,7 @@ type: long -- -*`googlecloud.pubsub.subscription.num_undelivered_messages.raw`*:: +*`googlecloud.pubsub.subscription.num_undelivered_messages.value`*:: + -- Number of unacknowledged messages (a.k.a. backlog messages) in a subscription. @@ -17921,7 +17921,7 @@ type: long -- -*`googlecloud.pubsub.subscription.oldest_unacked_message_age.raw`*:: +*`googlecloud.pubsub.subscription.oldest_unacked_message_age.value`*:: + -- Age (in seconds) of the oldest unacknowledged message (a.k.a. backlog message) in a subscription. @@ -17930,7 +17930,7 @@ type: long -- -*`googlecloud.pubsub.subscription.pull_ack_message_operation_count.raw`*:: +*`googlecloud.pubsub.subscription.pull_ack_message_operation_count.value`*:: + -- Cumulative count of acknowledge message operations, grouped by result. For a definition of message operations, see Cloud Pub/Sub metric subscription/mod_ack_deadline_message_operation_count. @@ -17939,7 +17939,7 @@ type: long -- -*`googlecloud.pubsub.subscription.pull_ack_request_count.raw`*:: +*`googlecloud.pubsub.subscription.pull_ack_request_count.value`*:: + -- Cumulative count of acknowledge requests, grouped by result. @@ -17948,7 +17948,7 @@ type: long -- -*`googlecloud.pubsub.subscription.pull_message_operation_count.raw`*:: +*`googlecloud.pubsub.subscription.pull_message_operation_count.value`*:: + -- Cumulative count of pull message operations, grouped by result. For a definition of message operations, see Cloud Pub/Sub metric subscription/mod_ack_deadline_message_operation_count. @@ -17957,7 +17957,7 @@ type: long -- -*`googlecloud.pubsub.subscription.pull_request_count.raw`*:: +*`googlecloud.pubsub.subscription.pull_request_count.value`*:: + -- Cumulative count of pull requests, grouped by result. @@ -17966,7 +17966,7 @@ type: long -- -*`googlecloud.pubsub.subscription.push_request_count.raw`*:: +*`googlecloud.pubsub.subscription.push_request_count.value`*:: + -- Cumulative count of push attempts, grouped by result. Unlike pulls, the push server implementation does not batch user messages. So each request only contains one user message. The push server retries on errors, so a given user message can appear multiple times. @@ -17975,7 +17975,7 @@ type: long -- -*`googlecloud.pubsub.subscription.push_request_latencies.raw`*:: +*`googlecloud.pubsub.subscription.push_request_latencies.value`*:: + -- Distribution of push request latencies (in microseconds), grouped by result. @@ -17984,7 +17984,7 @@ type: long -- -*`googlecloud.pubsub.subscription.sent_message_count.raw`*:: +*`googlecloud.pubsub.subscription.sent_message_count.value`*:: + -- Cumulative count of messages sent by Cloud Pub/Sub to subscriber clients, grouped by delivery type. @@ -17993,7 +17993,7 @@ type: long -- -*`googlecloud.pubsub.subscription.streaming_pull_ack_message_operation_count.raw`*:: +*`googlecloud.pubsub.subscription.streaming_pull_ack_message_operation_count.value`*:: + -- Cumulative count of StreamingPull acknowledge message operations, grouped by result. For a definition of message operations, see Cloud Pub/Sub metric subscription/mod_ack_deadline_message_operation_count. @@ -18002,7 +18002,7 @@ type: long -- -*`googlecloud.pubsub.subscription.streaming_pull_ack_request_count.raw`*:: +*`googlecloud.pubsub.subscription.streaming_pull_ack_request_count.value`*:: + -- Cumulative count of streaming pull requests with non-empty acknowledge ids, grouped by result. @@ -18011,7 +18011,7 @@ type: long -- -*`googlecloud.pubsub.subscription.streaming_pull_message_operation_count.raw`*:: +*`googlecloud.pubsub.subscription.streaming_pull_message_operation_count.value`*:: + -- Cumulative count of streaming pull message operations, grouped by result. For a definition of message operations, see Cloud Pub/Sub metric subscription/mod_ack_deadline_message_operation_count @@ -18020,7 +18020,7 @@ type: long -- -*`googlecloud.pubsub.subscription.streaming_pull_response_count.raw`*:: +*`googlecloud.pubsub.subscription.streaming_pull_response_count.value`*:: + -- Cumulative count of streaming pull responses, grouped by result. @@ -18029,7 +18029,7 @@ type: long -- -*`googlecloud.pubsub.subscription.dead_letter_message_count.raw`*:: +*`googlecloud.pubsub.subscription.dead_letter_message_count.value`*:: + -- Cumulative count of messages published to dead letter topic, grouped by result. @@ -18038,7 +18038,7 @@ type: long -- -*`googlecloud.pubsub.subscription.mod_ack_deadline_message_count.raw`*:: +*`googlecloud.pubsub.subscription.mod_ack_deadline_message_count.value`*:: + -- Cumulative count of messages whose deadline was updated by ModifyAckDeadline requests, grouped by delivery type. @@ -18047,7 +18047,7 @@ type: long -- -*`googlecloud.pubsub.subscription.mod_ack_deadline_message_operation_count.raw`*:: +*`googlecloud.pubsub.subscription.mod_ack_deadline_message_operation_count.value`*:: + -- Cumulative count of ModifyAckDeadline message operations, grouped by result. @@ -18056,7 +18056,7 @@ type: long -- -*`googlecloud.pubsub.subscription.mod_ack_deadline_request_count.raw`*:: +*`googlecloud.pubsub.subscription.mod_ack_deadline_request_count.value`*:: + -- Cumulative count of ModifyAckDeadline requests, grouped by result. @@ -18065,7 +18065,7 @@ type: long -- -*`googlecloud.pubsub.subscription.oldest_retained_acked_message_age.raw`*:: +*`googlecloud.pubsub.subscription.oldest_retained_acked_message_age.value`*:: + -- Age (in seconds) of the oldest acknowledged message retained in a subscription. @@ -18074,7 +18074,7 @@ type: long -- -*`googlecloud.pubsub.subscription.oldest_retained_acked_message_age_by_region.raw`*:: +*`googlecloud.pubsub.subscription.oldest_retained_acked_message_age_by_region.value`*:: + -- Age (in seconds) of the oldest acknowledged message retained in a subscription, broken down by Cloud region. @@ -18083,7 +18083,7 @@ type: long -- -*`googlecloud.pubsub.subscription.oldest_unacked_message_age_by_region.raw`*:: +*`googlecloud.pubsub.subscription.oldest_unacked_message_age_by_region.value`*:: + -- Age (in seconds) of the oldest unacknowledged message in a subscription, broken down by Cloud region. @@ -18092,7 +18092,7 @@ type: long -- -*`googlecloud.pubsub.subscription.retained_acked_bytes.raw`*:: +*`googlecloud.pubsub.subscription.retained_acked_bytes.value`*:: + -- Total byte size of the acknowledged messages retained in a subscription. @@ -18101,7 +18101,7 @@ type: long -- -*`googlecloud.pubsub.subscription.retained_acked_bytes_by_region.raw`*:: +*`googlecloud.pubsub.subscription.retained_acked_bytes_by_region.value`*:: + -- Total byte size of the acknowledged messages retained in a subscription, broken down by Cloud region. @@ -18110,7 +18110,7 @@ type: long -- -*`googlecloud.pubsub.subscription.seek_request_count.raw`*:: +*`googlecloud.pubsub.subscription.seek_request_count.value`*:: + -- Cumulative count of seek attempts, grouped by result. @@ -18119,7 +18119,7 @@ type: long -- -*`googlecloud.pubsub.subscription.streaming_pull_mod_ack_deadline_message_operation_count.raw`*:: +*`googlecloud.pubsub.subscription.streaming_pull_mod_ack_deadline_message_operation_count.value`*:: + -- Cumulative count of StreamingPull ModifyAckDeadline operations, grouped by result. @@ -18128,7 +18128,7 @@ type: long -- -*`googlecloud.pubsub.subscription.streaming_pull_mod_ack_deadline_request_count.raw`*:: +*`googlecloud.pubsub.subscription.streaming_pull_mod_ack_deadline_request_count.value`*:: + -- Cumulative count of streaming pull requests with non-empty ModifyAckDeadline fields, grouped by result. @@ -18137,7 +18137,7 @@ type: long -- -*`googlecloud.pubsub.subscription.byte_cost.raw`*:: +*`googlecloud.pubsub.subscription.byte_cost.value`*:: + -- Cumulative cost of operations, measured in bytes. This is used to measure quota utilization. @@ -18146,7 +18146,7 @@ type: long -- -*`googlecloud.pubsub.subscription.config_updates_count.raw`*:: +*`googlecloud.pubsub.subscription.config_updates_count.value`*:: + -- Cumulative count of configuration changes for each subscription, grouped by operation type and result. @@ -18155,7 +18155,7 @@ type: long -- -*`googlecloud.pubsub.subscription.unacked_bytes_by_region.raw`*:: +*`googlecloud.pubsub.subscription.unacked_bytes_by_region.value`*:: + -- Total byte size of the unacknowledged messages in a subscription, broken down by Cloud region. @@ -18170,7 +18170,7 @@ type: long Topic related metrics -*`googlecloud.pubsub.topic.streaming_pull_response_count.raw`*:: +*`googlecloud.pubsub.topic.streaming_pull_response_count.value`*:: + -- Cumulative count of streaming pull responses, grouped by result. @@ -18179,7 +18179,7 @@ type: long -- -*`googlecloud.pubsub.topic.send_message_operation_count.raw`*:: +*`googlecloud.pubsub.topic.send_message_operation_count.value`*:: + -- Cumulative count of publish message operations, grouped by result. For a definition of message operations, see Cloud Pub/Sub metric subscription/mod_ack_deadline_message_operation_count. @@ -18188,7 +18188,7 @@ type: long -- -*`googlecloud.pubsub.topic.send_request_count.raw`*:: +*`googlecloud.pubsub.topic.send_request_count.value`*:: + -- Cumulative count of publish requests, grouped by result. @@ -18197,7 +18197,7 @@ type: long -- -*`googlecloud.pubsub.topic.oldest_retained_acked_message_age_by_region.raw`*:: +*`googlecloud.pubsub.topic.oldest_retained_acked_message_age_by_region.value`*:: + -- Age (in seconds) of the oldest acknowledged message retained in a topic, broken down by Cloud region. @@ -18206,7 +18206,7 @@ type: long -- -*`googlecloud.pubsub.topic.oldest_unacked_message_age_by_region.raw`*:: +*`googlecloud.pubsub.topic.oldest_unacked_message_age_by_region.value`*:: + -- Age (in seconds) of the oldest unacknowledged message in a topic, broken down by Cloud region. @@ -18215,7 +18215,7 @@ type: long -- -*`googlecloud.pubsub.topic.retained_acked_bytes_by_region.raw`*:: +*`googlecloud.pubsub.topic.retained_acked_bytes_by_region.value`*:: + -- Total byte size of the acknowledged messages retained in a topic, broken down by Cloud region. @@ -18224,7 +18224,7 @@ type: long -- -*`googlecloud.pubsub.topic.byte_cost.raw`*:: +*`googlecloud.pubsub.topic.byte_cost.value`*:: + -- Cost of operations, measured in bytes. This is used to measure utilization for quotas. @@ -18233,7 +18233,7 @@ type: long -- -*`googlecloud.pubsub.topic.config_updates_count.raw`*:: +*`googlecloud.pubsub.topic.config_updates_count.value`*:: + -- Cumulative count of configuration changes, grouped by operation type and result. @@ -18242,7 +18242,7 @@ type: long -- -*`googlecloud.pubsub.topic.message_sizes.raw`*:: +*`googlecloud.pubsub.topic.message_sizes.value`*:: + -- Distribution of publish message sizes (in bytes) @@ -18251,7 +18251,7 @@ type: long -- -*`googlecloud.pubsub.topic.unacked_bytes_by_region.raw`*:: +*`googlecloud.pubsub.topic.unacked_bytes_by_region.value`*:: + -- Total byte size of the unacknowledged messages in a topic, broken down by Cloud region. @@ -18266,7 +18266,7 @@ type: long Snapshot related metrics -*`googlecloud.pubsub.snapshot.oldest_message_age.raw`*:: +*`googlecloud.pubsub.snapshot.oldest_message_age.value`*:: + -- Age (in seconds) of the oldest message retained in a snapshot. @@ -18275,7 +18275,7 @@ type: long -- -*`googlecloud.pubsub.snapshot.oldest_message_age_by_region.raw`*:: +*`googlecloud.pubsub.snapshot.oldest_message_age_by_region.value`*:: + -- Age (in seconds) of the oldest message retained in a snapshot, broken down by Cloud region. @@ -18284,7 +18284,7 @@ type: long -- -*`googlecloud.pubsub.snapshot.backlog_bytes.raw`*:: +*`googlecloud.pubsub.snapshot.backlog_bytes.value`*:: + -- Total byte size of the messages retained in a snapshot. @@ -18293,7 +18293,7 @@ type: long -- -*`googlecloud.pubsub.snapshot.backlog_bytes_by_region.raw`*:: +*`googlecloud.pubsub.snapshot.backlog_bytes_by_region.value`*:: + -- Total byte size of the messages retained in a snapshot, broken down by Cloud region. @@ -18302,7 +18302,7 @@ type: long -- -*`googlecloud.pubsub.snapshot.num_messages.raw`*:: +*`googlecloud.pubsub.snapshot.num_messages.value`*:: + -- Number of messages retained in a snapshot. @@ -18311,7 +18311,7 @@ type: long -- -*`googlecloud.pubsub.snapshot.num_messages_by_region.raw`*:: +*`googlecloud.pubsub.snapshot.num_messages_by_region.value`*:: + -- Number of messages retained in a snapshot, broken down by Cloud region. @@ -18320,7 +18320,7 @@ type: long -- -*`googlecloud.pubsub.snapshot.config_updates_count.raw`*:: +*`googlecloud.pubsub.snapshot.config_updates_count.value`*:: + -- Cumulative count of configuration changes, grouped by operation type and result. @@ -18336,7 +18336,7 @@ Google Cloud Storage metrics -*`googlecloud.storage.api.request_count.raw`*:: +*`googlecloud.storage.api.request_count.value`*:: + -- Delta count of API calls, grouped by the API method name and response code. @@ -18346,7 +18346,7 @@ type: long -- -*`googlecloud.storage.authz.acl_based_object_access_count.raw`*:: +*`googlecloud.storage.authz.acl_based_object_access_count.value`*:: + -- Delta count of requests that result in an object being granted access solely due to object ACLs. @@ -18355,7 +18355,7 @@ type: long -- -*`googlecloud.storage.authz.acl_operations_count.raw`*:: +*`googlecloud.storage.authz.acl_operations_count.value`*:: + -- Usage of ACL operations broken down by type. @@ -18364,7 +18364,7 @@ type: long -- -*`googlecloud.storage.authz.object_specific_acl_mutation_count.raw`*:: +*`googlecloud.storage.authz.object_specific_acl_mutation_count.value`*:: + -- Delta count of changes made to object specific ACLs. @@ -18374,7 +18374,7 @@ type: long -- -*`googlecloud.storage.network.received_bytes_count.raw`*:: +*`googlecloud.storage.network.received_bytes_count.value`*:: + -- Delta count of bytes received over the network, grouped by the API method name and response code. @@ -18383,7 +18383,7 @@ type: long -- -*`googlecloud.storage.network.sent_bytes_count.raw`*:: +*`googlecloud.storage.network.sent_bytes_count.value`*:: + -- Delta count of bytes sent over the network, grouped by the API method name and response code. @@ -18393,7 +18393,7 @@ type: long -- -*`googlecloud.storage.storage.object_count.raw`*:: +*`googlecloud.storage.storage.object_count.value`*:: + -- Total number of objects per bucket, grouped by storage class. This value is measured once per day, and the value is repeated at each sampling interval throughout the day. @@ -18402,7 +18402,7 @@ type: long -- -*`googlecloud.storage.storage.total_byte_seconds.raw`*:: +*`googlecloud.storage.storage.total_byte_seconds.value`*:: + -- Delta count of bytes received over the network, grouped by the API method name and response code. @@ -18411,7 +18411,7 @@ type: long -- -*`googlecloud.storage.storage.total_bytes.raw`*:: +*`googlecloud.storage.storage.total_bytes.value`*:: + -- Total size of all objects in the bucket, grouped by storage class. This value is measured once per day, and the value is repeated at each sampling interval throughout the day. diff --git a/x-pack/metricbeat/module/googlecloud/compute/_meta/data_cpu.json b/x-pack/metricbeat/module/googlecloud/compute/_meta/data_cpu.json new file mode 100644 index 00000000000..8496bfd79b1 --- /dev/null +++ b/x-pack/metricbeat/module/googlecloud/compute/_meta/data_cpu.json @@ -0,0 +1,69 @@ +{ + "@timestamp": "2020-01-08T16:06:00.000Z", + "@metadata": { + "beat": "metricbeat", + "type": "_doc", + "version": "8.0.0" + }, + "host": { + "name": "mcastro", + "id": "54f70115bae545cbac2b150f254472a0", + "containerized": false, + "hostname": "mcastro", + "architecture": "x86_64", + "os": { + "version": "", + "family": "", + "name": "Antergos Linux", + "kernel": "5.4.3-arch1-1", + "platform": "antergos" + } + }, + "agent": { + "ephemeral_id": "8b802033-b611-414b-bcaf-1aa19e5f5901", + "hostname": "mcastro", + "id": "7e36a073-1a32-4a94-b65b-4c7f971fb228", + "version": "8.0.0", + "type": "metricbeat" + }, + "cloud": { + "account": { + "id": "elastic-metricbeat" + }, + "provider": "googlecloud", + "instance": { + "name": "instance-1", + "id": "4503798379141677974" + }, + "machine": { + "type": "f1-micro" + }, + "availability_zone": "us-central1-a" + }, + "event": { + "duration": 1398412653, + "dataset": "googlecloud.compute", + "module": "googlecloud" + }, + "metricset": { + "name": "compute", + "period": 300000 + }, + "googlecloud": { + "compute": { + "instance": { + "cpu": { + "reserved_cores": 0.2, + "utilization": 0.005524845140497596 + } + } + }, + "labels": {} + }, + "service": { + "type": "googlecloud" + }, + "ecs": { + "version": "1.2.0" + } +} diff --git a/x-pack/metricbeat/module/googlecloud/compute/_meta/data_disk_01.json b/x-pack/metricbeat/module/googlecloud/compute/_meta/data_disk_01.json new file mode 100644 index 00000000000..038c451d934 --- /dev/null +++ b/x-pack/metricbeat/module/googlecloud/compute/_meta/data_disk_01.json @@ -0,0 +1,74 @@ +{ + "@timestamp": "2020-01-08T16:05:00.000Z", + "@metadata": { + "beat": "metricbeat", + "type": "_doc", + "version": "8.0.0" + }, + "agent": { + "hostname": "mcastro", + "id": "7e36a073-1a32-4a94-b65b-4c7f971fb228", + "version": "8.0.0", + "type": "metricbeat", + "ephemeral_id": "8b802033-b611-414b-bcaf-1aa19e5f5901" + }, + "ecs": { + "version": "1.2.0" + }, + "googlecloud": { + "labels": { + "metrics": { + "device_type": "permanent", + "storage_type": "pd-standard", + "device_name": "instance-1" + } + }, + "compute": { + "instance": { + "disk": { + "write_bytes_count": 945853 + } + } + } + }, + "service": { + "type": "googlecloud" + }, + "cloud": { + "account": { + "id": "elastic-metricbeat" + }, + "provider": "googlecloud", + "instance": { + "name": "instance-1", + "id": "4503798379141677974" + }, + "machine": { + "type": "f1-micro" + }, + "availability_zone": "us-central1-a" + }, + "metricset": { + "name": "compute", + "period": 300000 + }, + "event": { + "module": "googlecloud", + "duration": 1398637364, + "dataset": "googlecloud.compute" + }, + "host": { + "containerized": false, + "hostname": "mcastro", + "architecture": "x86_64", + "os": { + "platform": "antergos", + "version": "", + "family": "", + "name": "Antergos Linux", + "kernel": "5.4.3-arch1-1" + }, + "name": "mcastro", + "id": "54f70115bae545cbac2b150f254472a0" + } +} diff --git a/x-pack/metricbeat/module/googlecloud/compute/_meta/data_disk_02.json b/x-pack/metricbeat/module/googlecloud/compute/_meta/data_disk_02.json new file mode 100644 index 00000000000..d3d0bc9c5ba --- /dev/null +++ b/x-pack/metricbeat/module/googlecloud/compute/_meta/data_disk_02.json @@ -0,0 +1,77 @@ +{ + "@timestamp": "2020-01-08T16:04:00.000Z", + "@metadata": { + "beat": "metricbeat", + "type": "_doc", + "version": "8.0.0" + }, + "service": { + "type": "googlecloud" + }, + "ecs": { + "version": "1.2.0" + }, + "host": { + "os": { + "name": "Antergos Linux", + "kernel": "5.4.3-arch1-1", + "platform": "antergos", + "version": "", + "family": "" + }, + "id": "54f70115bae545cbac2b150f254472a0", + "containerized": false, + "name": "mcastro", + "hostname": "mcastro", + "architecture": "x86_64" + }, + "agent": { + "ephemeral_id": "8b802033-b611-414b-bcaf-1aa19e5f5901", + "hostname": "mcastro", + "id": "7e36a073-1a32-4a94-b65b-4c7f971fb228", + "version": "8.0.0", + "type": "metricbeat" + }, + "cloud": { + "availability_zone": "us-central1-a", + "account": { + "id": "elastic-metricbeat" + }, + "provider": "googlecloud", + "instance": { + "id": "4503798379141677974", + "name": "instance-1" + }, + "machine": { + "type": "f1-micro" + } + }, + "metricset": { + "name": "compute", + "period": 300000 + }, + "event": { + "dataset": "googlecloud.compute", + "module": "googlecloud", + "duration": 1398743696 + }, + "googlecloud": { + "labels": { + "metrics": { + "device_name": "instance-1", + "device_type": "permanent", + "storage_type": "pd-standard" + } + }, + "compute": { + "instance": { + "disk": { + "write_ops_count": 140, + "read_ops_count": 2897, + "read_bytes_count": 71574649, + "write_bytes_count": 2557677 + } + } + } + } +} diff --git a/x-pack/metricbeat/module/googlecloud/compute/_meta/data_firewall.json b/x-pack/metricbeat/module/googlecloud/compute/_meta/data_firewall.json new file mode 100644 index 00000000000..ee219ec74e0 --- /dev/null +++ b/x-pack/metricbeat/module/googlecloud/compute/_meta/data_firewall.json @@ -0,0 +1,75 @@ +{ + "@timestamp": "2020-01-08T16:05:00.000Z", + "@metadata": { + "beat": "metricbeat", + "type": "_doc", + "version": "8.0.0" + }, + "ecs": { + "version": "1.2.0" + }, + "host": { + "containerized": false, + "name": "mcastro", + "hostname": "mcastro", + "architecture": "x86_64", + "os": { + "version": "", + "family": "", + "name": "Antergos Linux", + "kernel": "5.4.3-arch1-1", + "platform": "antergos" + }, + "id": "54f70115bae545cbac2b150f254472a0" + }, + "agent": { + "type": "metricbeat", + "ephemeral_id": "8b802033-b611-414b-bcaf-1aa19e5f5901", + "hostname": "mcastro", + "id": "7e36a073-1a32-4a94-b65b-4c7f971fb228", + "version": "8.0.0" + }, + "cloud": { + "availability_zone": "us-central1-a", + "account": { + "id": "elastic-metricbeat" + }, + "provider": "googlecloud", + "instance": { + "id": "4503798379141677974", + "name": "instance-1" + }, + "machine": { + "type": "f1-micro" + } + }, + "event": { + "dataset": "googlecloud.compute", + "module": "googlecloud", + "duration": 1397755844 + }, + "metricset": { + "name": "compute", + "period": 300000 + }, + "googlecloud": { + "labels": {}, + "compute": { + "instance": { + "uptime": 60.00000000000001, + "cpu": { + "reserved_cores": 0.2, + "utilization": 0.38202685489490784, + "usage_time": 0.06629814168597115 + } + }, + "firewall": { + "dropped_packets_count": 3 + } + } + }, + "service": { + "type": "googlecloud" + } +} + diff --git a/x-pack/metricbeat/module/googlecloud/compute/_meta/data_instance.json b/x-pack/metricbeat/module/googlecloud/compute/_meta/data_instance.json new file mode 100644 index 00000000000..4306273f73c --- /dev/null +++ b/x-pack/metricbeat/module/googlecloud/compute/_meta/data_instance.json @@ -0,0 +1,73 @@ +{ + "@timestamp": "2020-01-08T16:04:00.000Z", + "@metadata": { + "beat": "metricbeat", + "type": "_doc", + "version": "8.0.0" + }, + "ecs": { + "version": "1.2.0" + }, + "host": { + "os": { + "platform": "antergos", + "version": "", + "family": "", + "name": "Antergos Linux", + "kernel": "5.4.3-arch1-1" + }, + "id": "54f70115bae545cbac2b150f254472a0", + "containerized": false, + "hostname": "mcastro", + "name": "mcastro", + "architecture": "x86_64" + }, + "agent": { + "ephemeral_id": "8b802033-b611-414b-bcaf-1aa19e5f5901", + "hostname": "mcastro", + "id": "7e36a073-1a32-4a94-b65b-4c7f971fb228", + "version": "8.0.0", + "type": "metricbeat" + }, + "cloud": { + "provider": "googlecloud", + "instance": { + "id": "4503798379141677974", + "name": "instance-1" + }, + "machine": { + "type": "f1-micro" + }, + "availability_zone": "us-central1-a", + "account": { + "id": "elastic-metricbeat" + } + }, + "event": { + "module": "googlecloud", + "duration": 1397750508, + "dataset": "googlecloud.compute" + }, + "metricset": { + "period": 300000, + "name": "compute" + }, + "googlecloud": { + "labels": {}, + "compute": { + "firewall": { + "dropped_bytes_count": 0, + "dropped_packets_count": 0 + }, + "instance": { + "uptime": 46.181442, + "cpu": { + "usage_time": 4.5843222587388945 + } + } + } + }, + "service": { + "type": "googlecloud" + } +} diff --git a/x-pack/metricbeat/module/googlecloud/compute/_meta/fields.yml b/x-pack/metricbeat/module/googlecloud/compute/_meta/fields.yml index 4827165653b..5cbdfb3ea56 100644 --- a/x-pack/metricbeat/module/googlecloud/compute/_meta/fields.yml +++ b/x-pack/metricbeat/module/googlecloud/compute/_meta/fields.yml @@ -9,54 +9,54 @@ - name: firewall type: group fields: - - name: dropped_bytes_count.raw + - name: dropped_bytes_count.value type: long description: Incoming bytes dropped by the firewall - - name: dropped_packets_count.raw + - name: dropped_packets_count.value type: long description: Incoming packets dropped by the firewall - name: cpu type: group fields: - - name: reserved_cores.raw + - name: reserved_cores.value type: double description: Number of cores reserved on the host of the instance - - name: utilization.raw + - name: utilization.value type: double description: The fraction of the allocated CPU that is currently in use on the instance - - name: usage_time.raw + - name: usage_time.value type: double description: Usage for all cores in seconds - name: disk type: group fields: - - name: read_bytes_count.raw + - name: read_bytes_count.value type: long description: Count of bytes read from disk - - name: read_ops_count.raw + - name: read_ops_count.value type: long description: Count of disk read IO operations - - name: write_bytes_count.raw + - name: write_bytes_count.value type: long description: Count of bytes written to disk - - name: write_ops_count.raw + - name: write_ops_count.value type: long description: Count of disk write IO operations - - name: uptime.raw + - name: uptime.value type: long description: How long the VM has been running, in seconds - name: network type: group fields: - - name: received_bytes_count.raw + - name: received_bytes_count.value type: long description: Count of bytes received from the network - - name: received_packets_count.raw + - name: received_packets_count.value type: long description: Count of packets received from the network - - name: sent_bytes_count.raw + - name: sent_bytes_count.value type: long description: Count of bytes sent over the network - - name: sent_packets_count.raw + - name: sent_packets_count.value type: long description: Count of packets sent over the network diff --git a/x-pack/metricbeat/module/googlecloud/fields.go b/x-pack/metricbeat/module/googlecloud/fields.go index 99366c55683..6d629ce05c2 100644 --- a/x-pack/metricbeat/module/googlecloud/fields.go +++ b/x-pack/metricbeat/module/googlecloud/fields.go @@ -19,5 +19,5 @@ func init() { // AssetGooglecloud returns asset data. // This is the base64 encoded gzipped contents of module/googlecloud. func AssetGooglecloud() string { - return "eJzsXV1z2zbWvs+vONObxO84zsV7l9npjOvstplNtp6121sOCB5JWIMAiw+r6q/fAUBSpCR+iqTjrNKbWiJwnnMAPOcDAPUennD3EdZSrjlSLm3yBsAww/EjvP3Zfwp37mO458SspErfvgFQyJFo/AgxGvIGIEFNFcsMk+Ij/PgGAODnu3tIZWI5vgFYMeSJ/ui/eA+CpHgo0v0zu8x9rqTN8k+q7aptOYmR6/LjoqmM/4PUVD4+bF/tw2pUN/9X+6qxn32rFA1JiCGjWipG9fCGeqcNpv3aFW1+0IbQp0SxZ6dk+O+HbnuFD6LwbSJt7EfvxLdRSrKMiXX+6A+1zk/MhuLf12AEMBtiQKGxSmACKyVTeHCIP3nEcHv/Gf6wqHY3R5pRmWbWVGEdTsa6jtXpdASuNsHvQs/FQPWcRkxoQwT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otpfG+gTNeftdfv1ZmuCKiyasJ5PcMsvHDnG5vk/wcAAP//BgUovg==" } diff --git a/x-pack/metricbeat/module/googlecloud/loadbalancing/_meta/fields.yml b/x-pack/metricbeat/module/googlecloud/loadbalancing/_meta/fields.yml index 3f5cdc9a1db..93855f7ee9c 100644 --- a/x-pack/metricbeat/module/googlecloud/loadbalancing/_meta/fields.yml +++ b/x-pack/metricbeat/module/googlecloud/loadbalancing/_meta/fields.yml @@ -11,11 +11,11 @@ description: A distribution of the latency calculated from when the request was sent by the proxy to the backend until the proxy received from the backend the last byte of response. type: group fields: - - name: count.raw + - name: count.value type: long - - name: mean.raw + - name: mean.value type: long - - name: bucket_counts.raw + - name: bucket_counts.value type: long - name: bucket_options type: group @@ -26,30 +26,30 @@ - name: ExponentialBuckets type: group fields: - - name: growth_factor.raw + - name: growth_factor.value type: double - - name: scale.raw + - name: scale.value type: long - - name: num_finite_buckets.raw + - name: num_finite_buckets.value type: long - - name: backend_request_bytes_count.raw + - name: backend_request_bytes_count.value type: long description: The number of bytes sent as requests from HTTP/S load balancer to backends. - - name: backend_request_count.raw + - name: backend_request_count.value type: long description: The number of requests served by backends of HTTP/S load balancer. - - name: backend_response_bytes_count.raw + - name: backend_response_bytes_count.value type: long description: The number of bytes sent as responses from backends (or cache) to HTTP/S load balancer. - name: frontend_tcp_rtt description: A distribution of the RTT measured for each connection between client and proxy. type: group fields: - - name: count.raw + - name: count.value type: long - - name: mean.raw + - name: mean.value type: long - - name: bucket_counts.raw + - name: bucket_counts.value type: long - name: bucket_options type: group @@ -60,11 +60,11 @@ - name: ExponentialBuckets type: group fields: - - name: growth_factor.raw + - name: growth_factor.value type: double - - name: scale.raw + - name: scale.value type: long - - name: num_finite_buckets.raw + - name: num_finite_buckets.value type: long - name: internal type: group @@ -73,11 +73,11 @@ description: A distribution of the latency calculated from when the request was sent by the proxy to the backend until the proxy received from the backend the last byte of response. type: group fields: - - name: count.raw + - name: count.value type: long - - name: mean.raw + - name: mean.value type: long - - name: bucket_counts.raw + - name: bucket_counts.value type: long - name: bucket_options type: group @@ -88,30 +88,30 @@ - name: ExponentialBuckets type: group fields: - - name: growth_factor.raw + - name: growth_factor.value type: double - - name: scale.raw + - name: scale.value type: long - - name: num_finite_buckets.raw + - name: num_finite_buckets.value type: long - - name: request_bytes_count.raw + - name: request_bytes_count.value type: long description: The number of bytes sent as requests from clients to HTTP/S load balancer. - - name: request_count.raw + - name: request_count.value type: long description: The number of requests served by HTTP/S load balancer. - - name: response_bytes_count.raw + - name: response_bytes_count.value type: long description: The number of bytes sent as responses from HTTP/S load balancer to clients. - name: total_latencies description: A distribution of the latency calculated from when the request was received by the proxy until the proxy got ACK from client on last response byte. type: group fields: - - name: count.raw + - name: count.value type: long - - name: mean.raw + - name: mean.value type: long - - name: bucket_counts.raw + - name: bucket_counts.value type: long - name: bucket_options type: group @@ -122,30 +122,30 @@ - name: ExponentialBuckets type: group fields: - - name: growth_factor.raw + - name: growth_factor.value type: double - - name: scale.raw + - name: scale.value type: long - - name: num_finite_buckets.raw + - name: num_finite_buckets.value type: long - - name: request_bytes_count.raw + - name: request_bytes_count.value type: long description: The number of bytes sent as requests from clients to HTTP/S load balancer. - - name: request_count.raw + - name: request_count.value type: long description: The number of requests served by HTTP/S load balancer. - - name: response_bytes_count.raw + - name: response_bytes_count.value type: long description: The number of bytes sent as responses from HTTP/S load balancer to clients. - name: total_latencies description: A distribution of the latency calculated from when the request was received by the proxy until the proxy got ACK from client on last response byte. type: group fields: - - name: count.raw + - name: count.value type: long - - name: mean.raw + - name: mean.value type: long - - name: bucket_counts.raw + - name: bucket_counts.value type: long - name: bucket_options type: group @@ -156,37 +156,37 @@ - name: ExponentialBuckets type: group fields: - - name: growth_factor.raw + - name: growth_factor.value type: double - - name: scale.raw + - name: scale.value type: long - - name: num_finite_buckets.raw + - name: num_finite_buckets.value type: long - name: l3.internal type: group description: Google Cloud Load Balancing metrics fields: - - name: egress_bytes_count.raw + - name: egress_bytes_count.value type: long description: The number of bytes sent from ILB backend to client (for TCP flows it's counting bytes on application stream only). - - name: egress_packets_count.raw + - name: egress_packets_count.value type: long description: The number of packets sent from ILB backend to client of the flow. - - name: ingress_bytes_count.raw + - name: ingress_bytes_count.value type: long description: The number of bytes sent from client to ILB backend (for TCP flows it's counting bytes on application stream only). - - name: ingress_packets_count.raw + - name: ingress_packets_count.value type: long description: The number of packets sent from client to ILB backend. - name: rtt_latencies description: A distribution of RTT measured over TCP connections for ILB flows. type: group fields: - - name: count.raw + - name: count.value type: long - - name: mean.raw + - name: mean.value type: long - - name: bucket_counts.raw + - name: bucket_counts.value type: long - name: bucket_options type: group @@ -197,31 +197,31 @@ - name: ExponentialBuckets type: group fields: - - name: growth_factor.raw + - name: growth_factor.value type: double - - name: scale.raw + - name: scale.value type: long - - name: num_finite_buckets.raw + - name: num_finite_buckets.value type: long - name: tcp_ssl_proxy type: group description: Google Cloud Load Balancing metrics fields: - - name: closed_connections.raw + - name: closed_connections.value type: long description: Number of connections that were terminated over TCP/SSL proxy. - - name: egress_bytes_count.raw + - name: egress_bytes_count.value type: long description: Number of bytes sent from VM to client using proxy. - name: frontend_tcp_rtt description: A distribution of the smoothed RTT (in ms) measured by the proxy's TCP stack, each minute application layer bytes pass from proxy to client. type: group fields: - - name: count.raw + - name: count.value type: long - - name: mean.raw + - name: mean.value type: long - - name: bucket_counts.raw + - name: bucket_counts.value type: long - name: bucket_options type: group @@ -232,18 +232,18 @@ - name: ExponentialBuckets type: group fields: - - name: growth_factor.raw + - name: growth_factor.value type: double - - name: scale.raw + - name: scale.value type: long - - name: num_finite_buckets.raw + - name: num_finite_buckets.value type: long - - name: ingress_bytes_count.raw + - name: ingress_bytes_count.value type: long description: Number of bytes sent from client to VM using proxy. - - name: new_connections.raw + - name: new_connections.value type: long description: Number of connections that were created over TCP/SSL proxy. - - name: open_connections.raw + - name: open_connections.value type: long description: Current number of outstanding connections through the TCP/SSL proxy. diff --git a/x-pack/metricbeat/module/googlecloud/pubsub/_meta/fields.yml b/x-pack/metricbeat/module/googlecloud/pubsub/_meta/fields.yml index 4fecca10fbd..ae6443e219f 100644 --- a/x-pack/metricbeat/module/googlecloud/pubsub/_meta/fields.yml +++ b/x-pack/metricbeat/module/googlecloud/pubsub/_meta/fields.yml @@ -7,155 +7,155 @@ type: group description: Suscription related metrics fields: - - name: ack_message_count.raw + - name: ack_message_count.value type: long description: Cumulative count of messages acknowledged by Acknowledge requests, grouped by delivery type. - - name: backlog_bytes.raw + - name: backlog_bytes.value type: long description: Total byte size of the unacknowledged messages (a.k.a. backlog messages) in a subscription. - - name: num_outstanding_messages.raw + - name: num_outstanding_messages.value type: long description: Number of messages delivered to a subscription's push endpoint, but not yet acknowledged. - - name: num_undelivered_messages.raw + - name: num_undelivered_messages.value type: long description: Number of unacknowledged messages (a.k.a. backlog messages) in a subscription. - - name: oldest_unacked_message_age.raw + - name: oldest_unacked_message_age.value type: long description: Age (in seconds) of the oldest unacknowledged message (a.k.a. backlog message) in a subscription. - - name: pull_ack_message_operation_count.raw + - name: pull_ack_message_operation_count.value type: long description: Cumulative count of acknowledge message operations, grouped by result. For a definition of message operations, see Cloud Pub/Sub metric subscription/mod_ack_deadline_message_operation_count. - - name: pull_ack_request_count.raw + - name: pull_ack_request_count.value type: long description: Cumulative count of acknowledge requests, grouped by result. - - name: pull_message_operation_count.raw + - name: pull_message_operation_count.value type: long description: Cumulative count of pull message operations, grouped by result. For a definition of message operations, see Cloud Pub/Sub metric subscription/mod_ack_deadline_message_operation_count. - - name: pull_request_count.raw + - name: pull_request_count.value type: long description: Cumulative count of pull requests, grouped by result. - - name: push_request_count.raw + - name: push_request_count.value type: long description: Cumulative count of push attempts, grouped by result. Unlike pulls, the push server implementation does not batch user messages. So each request only contains one user message. The push server retries on errors, so a given user message can appear multiple times. - - name: push_request_latencies.raw + - name: push_request_latencies.value type: long description: Distribution of push request latencies (in microseconds), grouped by result. - - name: sent_message_count.raw + - name: sent_message_count.value type: long description: Cumulative count of messages sent by Cloud Pub/Sub to subscriber clients, grouped by delivery type. - - name: streaming_pull_ack_message_operation_count.raw + - name: streaming_pull_ack_message_operation_count.value type: long description: Cumulative count of StreamingPull acknowledge message operations, grouped by result. For a definition of message operations, see Cloud Pub/Sub metric subscription/mod_ack_deadline_message_operation_count. - - name: streaming_pull_ack_request_count.raw + - name: streaming_pull_ack_request_count.value type: long description: Cumulative count of streaming pull requests with non-empty acknowledge ids, grouped by result. - - name: streaming_pull_message_operation_count.raw + - name: streaming_pull_message_operation_count.value type: long description: Cumulative count of streaming pull message operations, grouped by result. For a definition of message operations, see Cloud Pub/Sub metric subscription/mod_ack_deadline_message_operation_count - - name: streaming_pull_response_count.raw + - name: streaming_pull_response_count.value type: long description: Cumulative count of streaming pull responses, grouped by result. - - name: dead_letter_message_count.raw + - name: dead_letter_message_count.value type: long description: Cumulative count of messages published to dead letter topic, grouped by result. - - name: mod_ack_deadline_message_count.raw + - name: mod_ack_deadline_message_count.value type: long description: Cumulative count of messages whose deadline was updated by ModifyAckDeadline requests, grouped by delivery type. - - name: mod_ack_deadline_message_operation_count.raw + - name: mod_ack_deadline_message_operation_count.value type: long description: Cumulative count of ModifyAckDeadline message operations, grouped by result. - - name: mod_ack_deadline_request_count.raw + - name: mod_ack_deadline_request_count.value type: long description: Cumulative count of ModifyAckDeadline requests, grouped by result. - - name: oldest_retained_acked_message_age.raw + - name: oldest_retained_acked_message_age.value type: long description: Age (in seconds) of the oldest acknowledged message retained in a subscription. - - name: oldest_retained_acked_message_age_by_region.raw + - name: oldest_retained_acked_message_age_by_region.value type: long description: Age (in seconds) of the oldest acknowledged message retained in a subscription, broken down by Cloud region. - - name: oldest_unacked_message_age_by_region.raw + - name: oldest_unacked_message_age_by_region.value type: long description: Age (in seconds) of the oldest unacknowledged message in a subscription, broken down by Cloud region. - - name: retained_acked_bytes.raw + - name: retained_acked_bytes.value type: long description: Total byte size of the acknowledged messages retained in a subscription. - - name: retained_acked_bytes_by_region.raw + - name: retained_acked_bytes_by_region.value type: long description: Total byte size of the acknowledged messages retained in a subscription, broken down by Cloud region. - - name: seek_request_count.raw + - name: seek_request_count.value type: long description: Cumulative count of seek attempts, grouped by result. - - name: streaming_pull_mod_ack_deadline_message_operation_count.raw + - name: streaming_pull_mod_ack_deadline_message_operation_count.value type: long description: Cumulative count of StreamingPull ModifyAckDeadline operations, grouped by result. - - name: streaming_pull_mod_ack_deadline_request_count.raw + - name: streaming_pull_mod_ack_deadline_request_count.value type: long description: Cumulative count of streaming pull requests with non-empty ModifyAckDeadline fields, grouped by result. - - name: byte_cost.raw + - name: byte_cost.value type: long description: Cumulative cost of operations, measured in bytes. This is used to measure quota utilization. - - name: config_updates_count.raw + - name: config_updates_count.value type: long description: Cumulative count of configuration changes for each subscription, grouped by operation type and result. - - name: unacked_bytes_by_region.raw + - name: unacked_bytes_by_region.value type: long description: Total byte size of the unacknowledged messages in a subscription, broken down by Cloud region. - name: topic type: group description: Topic related metrics fields: - - name: streaming_pull_response_count.raw + - name: streaming_pull_response_count.value type: long description: Cumulative count of streaming pull responses, grouped by result. - - name: send_message_operation_count.raw + - name: send_message_operation_count.value type: long description: Cumulative count of publish message operations, grouped by result. For a definition of message operations, see Cloud Pub/Sub metric subscription/mod_ack_deadline_message_operation_count. - - name: send_request_count.raw + - name: send_request_count.value type: long description: Cumulative count of publish requests, grouped by result. - - name: oldest_retained_acked_message_age_by_region.raw + - name: oldest_retained_acked_message_age_by_region.value type: long description: Age (in seconds) of the oldest acknowledged message retained in a topic, broken down by Cloud region. - - name: oldest_unacked_message_age_by_region.raw + - name: oldest_unacked_message_age_by_region.value type: long description: Age (in seconds) of the oldest unacknowledged message in a topic, broken down by Cloud region. - - name: retained_acked_bytes_by_region.raw + - name: retained_acked_bytes_by_region.value type: long description: Total byte size of the acknowledged messages retained in a topic, broken down by Cloud region. - - name: byte_cost.raw + - name: byte_cost.value type: long description: Cost of operations, measured in bytes. This is used to measure utilization for quotas. - - name: config_updates_count.raw + - name: config_updates_count.value type: long description: Cumulative count of configuration changes, grouped by operation type and result. - - name: message_sizes.raw + - name: message_sizes.value type: long description: Distribution of publish message sizes (in bytes) - - name: unacked_bytes_by_region.raw + - name: unacked_bytes_by_region.value type: long description: Total byte size of the unacknowledged messages in a topic, broken down by Cloud region. - name: snapshot type: group description: Snapshot related metrics fields: - - name: oldest_message_age.raw + - name: oldest_message_age.value type: long description: Age (in seconds) of the oldest message retained in a snapshot. - - name: oldest_message_age_by_region.raw + - name: oldest_message_age_by_region.value type: long description: Age (in seconds) of the oldest message retained in a snapshot, broken down by Cloud region. - - name: backlog_bytes.raw + - name: backlog_bytes.value type: long description: Total byte size of the messages retained in a snapshot. - - name: backlog_bytes_by_region.raw + - name: backlog_bytes_by_region.value type: long description: Total byte size of the messages retained in a snapshot, broken down by Cloud region. - - name: num_messages.raw + - name: num_messages.value type: long description: Number of messages retained in a snapshot. - - name: num_messages_by_region.raw + - name: num_messages_by_region.value type: long description: Number of messages retained in a snapshot, broken down by Cloud region. - - name: config_updates_count.raw + - name: config_updates_count.value type: long description: Cumulative count of configuration changes, grouped by operation type and result. diff --git a/x-pack/metricbeat/module/googlecloud/storage/_meta/fields.yml b/x-pack/metricbeat/module/googlecloud/storage/_meta/fields.yml index 17ea1d5b377..cdf2fde2fff 100644 --- a/x-pack/metricbeat/module/googlecloud/storage/_meta/fields.yml +++ b/x-pack/metricbeat/module/googlecloud/storage/_meta/fields.yml @@ -6,39 +6,39 @@ - name: api type: group fields: - - name: request_count.raw + - name: request_count.value type: long description: Delta count of API calls, grouped by the API method name and response code. - name: authz type: group fields: - - name: acl_based_object_access_count.raw + - name: acl_based_object_access_count.value type: long description: Delta count of requests that result in an object being granted access solely due to object ACLs. - - name: acl_operations_count.raw + - name: acl_operations_count.value type: long description: Usage of ACL operations broken down by type. - - name: object_specific_acl_mutation_count.raw + - name: object_specific_acl_mutation_count.value type: long description: Delta count of changes made to object specific ACLs. - name: network type: group fields: - - name: received_bytes_count.raw + - name: received_bytes_count.value type: long description: Delta count of bytes received over the network, grouped by the API method name and response code. - - name: sent_bytes_count.raw + - name: sent_bytes_count.value type: long description: Delta count of bytes sent over the network, grouped by the API method name and response code. - name: storage type: group fields: - - name: object_count.raw + - name: object_count.value type: long description: Total number of objects per bucket, grouped by storage class. This value is measured once per day, and the value is repeated at each sampling interval throughout the day. - - name: total_byte_seconds.raw + - name: total_byte_seconds.value type: long description: Delta count of bytes received over the network, grouped by the API method name and response code. - - name: total_bytes.raw + - name: total_bytes.value type: long description: Total size of all objects in the bucket, grouped by storage class. This value is measured once per day, and the value is repeated at each sampling interval throughout the day.