diff --git a/.buildkite/scripts/steps/cloud/build_and_deploy.sh b/.buildkite/scripts/steps/cloud/build_and_deploy.sh index 0d18ca7207b1a5..8b202bea9fc84c 100755 --- a/.buildkite/scripts/steps/cloud/build_and_deploy.sh +++ b/.buildkite/scripts/steps/cloud/build_and_deploy.sh @@ -53,6 +53,13 @@ if [ -z "${CLOUD_DEPLOYMENT_ID}" ]; then CLOUD_DEPLOYMENT_ID=$(jq -r --slurp '.[0].id' "$JSON_FILE") CLOUD_DEPLOYMENT_STATUS_MESSAGES=$(jq --slurp '[.[]|select(.resources == null)]' "$JSON_FILE") + # Enable stack monitoring + jq ' + .settings.observability.metrics.destination.deployment_id = "'$CLOUD_DEPLOYMENT_ID'" | + .settings.observability.logging.destination.deployment_id = "'$CLOUD_DEPLOYMENT_ID'" + ' .buildkite/scripts/steps/cloud/stack_monitoring.json > /tmp/stack_monitoring.json + ecctl deployment update "$CLOUD_DEPLOYMENT_ID" --track --output json --file /tmp/stack_monitoring.json &> "$JSON_FILE" + # Refresh vault token VAULT_ROLE_ID="$(retry 5 15 gcloud secrets versions access latest --secret=kibana-buildkite-vault-role-id)" VAULT_SECRET_ID="$(retry 5 15 gcloud secrets versions access latest --secret=kibana-buildkite-vault-secret-id)" diff --git a/.buildkite/scripts/steps/cloud/stack_monitoring.json b/.buildkite/scripts/steps/cloud/stack_monitoring.json new file mode 100644 index 00000000000000..a7d49cf58ad8b2 --- /dev/null +++ b/.buildkite/scripts/steps/cloud/stack_monitoring.json @@ -0,0 +1,19 @@ +{ + "prune_orphans": false, + "settings": { + "observability": { + "metrics": { + "destination": { + "deployment_id": null, + "ref_id": "main-elasticsearch" + } + }, + "logging": { + "destination": { + "deployment_id": null, + "ref_id": "main-elasticsearch" + } + } + } + } +} diff --git a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/__snapshots__/update_source_editor.test.tsx.snap b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/__snapshots__/update_source_editor.test.tsx.snap index 7043613b8e20ae..c3c029ffd52905 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/__snapshots__/update_source_editor.test.tsx.snap +++ b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/__snapshots__/update_source_editor.test.tsx.snap @@ -80,6 +80,7 @@ exports[`source editor geo_grid_source should render editor 1`] = ` fields={Array []} key="12345" metrics={Array []} + metricsFilter={[Function]} onChange={[Function]} /> diff --git a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/update_source_editor.tsx b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/update_source_editor.tsx index fb748cdc63aff2..4754d26702c9ce 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/update_source_editor.tsx +++ b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/update_source_editor.tsx @@ -106,18 +106,18 @@ export class UpdateSourceEditor extends Component { }; _getMetricsFilter() { - if (this.props.currentLayerType === LAYER_TYPE.HEATMAP) { - return (metric: EuiComboBoxOptionOption) => { - // these are countable metrics, where blending heatmap color blobs make sense - return metric.value ? isMetricCountable(metric.value) : false; - }; - } - - if (this.props.resolution === GRID_RESOLUTION.SUPER_FINE) { - return (metric: EuiComboBoxOptionOption) => { - return metric.value !== AGG_TYPE.TERMS; - }; - } + return this.props.currentLayerType === LAYER_TYPE.HEATMAP + ? (metric: EuiComboBoxOptionOption) => { + // these are countable metrics, where blending heatmap color blobs make sense + return metric.value ? isMetricCountable(metric.value) : false; + } + : (metric: EuiComboBoxOptionOption) => { + // terms aggregation is not supported with Elasticsearch _mvt endpoint + // The goal is to remove GeoJSON ESGeoGridSource implemenation and only have MVT ESGeoGridSource implemenation + // First step is to deprecate terms aggregation for ESGeoGridSource + // and prevent new uses of terms aggregation for ESGeoGridSource + return metric.value !== AGG_TYPE.TERMS; + }; } _renderMetricsPanel() {