Skip to content

Commit

Permalink
Do not collect Google Cloud metadata (#15806) (#15821)
Browse files Browse the repository at this point in the history
* Do not collect Google Cloud metadata

Compute instances metadata may contain sensitive info, so we should not
collect them.

In the future we can enable this again with some kind of whitelisting,
to only report the metadata we want.

* Update docs

(cherry picked from commit 7296437)
  • Loading branch information
Carlos Pérez-Aradros Herce authored Jan 27, 2020
1 parent a72f6b2 commit 9772633
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion metricbeat/docs/modules/googlecloud.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ You can play in IAM pretty much with your service accounts and Instance level ac

Google Cloud Platform offers the https://cloud.google.com/monitoring/api/metrics_gcp[Stackdriver Monitoring API] to fetch metrics from its services. *Those metrics are retrieved one by one*.

If you also want to *extract service metadata and 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).
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.

Expand Down
2 changes: 1 addition & 1 deletion x-pack/metricbeat/module/googlecloud/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ You can play in IAM pretty much with your service accounts and Instance level ac

Google Cloud Platform offers the https://cloud.google.com/monitoring/api/metrics_gcp[Stackdriver Monitoring API] to fetch metrics from its services. *Those metrics are retrieved one by one*.

If you also want to *extract service metadata and 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).
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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,13 @@ func (s *metadataCollector) Metadata(ctx context.Context, resp *monitoringpb.Tim
metadataCollectorData.Labels[googlecloud.LabelUser] = s.computeMetadata.User
}

if s.computeMetadata.Metadata != nil {
metadataCollectorData.Labels[googlecloud.LabelMetadata] = s.computeMetadata.Metadata
}
/*
Do not collect meta for now, as it can contain sensitive info
TODO revisit this and make meta available through whitelisting
if s.computeMetadata.Metadata != nil {
metadataCollectorData.Labels[googlecloud.LabelMetadata] = s.computeMetadata.Metadata
}
*/

return metadataCollectorData, nil
}
Expand Down

0 comments on commit 9772633

Please sign in to comment.