Skip to content
This repository was archived by the owner on Oct 2, 2023. It is now read-only.

Commit ef9ee03

Browse files
feat(v3): added support for TimeSeriesQueryLanguageCondition condition type in alert policies (#106)
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/8dc67c4c-b602-45d4-bcb1-8c58b15f5c34/targets
1 parent 1cb9d5e commit ef9ee03

File tree

114 files changed

+19652
-1452
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+19652
-1452
lines changed

.kokoro/build.sh

+12-7
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,22 @@ scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}"))
2020
## cd to the parent directory, i.e. the root of the git repo
2121
cd ${scriptDir}/..
2222

23+
# include common functions
24+
source ${scriptDir}/common.sh
25+
2326
# Print out Java version
2427
java -version
2528
echo ${JOB_TYPE}
2629

27-
mvn install -B -V \
28-
-DskipTests=true \
29-
-Dclirr.skip=true \
30-
-Denforcer.skip=true \
31-
-Dmaven.javadoc.skip=true \
32-
-Dgcloud.download.skip=true \
33-
-T 1C
30+
# attempt to install 3 times with exponential backoff (starting with 10 seconds)
31+
retry_with_backoff 3 10 \
32+
mvn install -B -V \
33+
-DskipTests=true \
34+
-Dclirr.skip=true \
35+
-Denforcer.skip=true \
36+
-Dmaven.javadoc.skip=true \
37+
-Dgcloud.download.skip=true \
38+
-T 1C
3439

3540
# if GOOGLE_APPLICATION_CREDIENTIALS is specified as a relative path prepend Kokoro root directory onto it
3641
if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then

.kokoro/common.sh

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
# Copyright 2020 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
# set -eo pipefail
17+
18+
function retry_with_backoff {
19+
attempts_left=$1
20+
sleep_seconds=$2
21+
shift 2
22+
command=$@
23+
24+
echo "${command}"
25+
${command}
26+
exit_code=$?
27+
28+
if [[ $exit_code == 0 ]]
29+
then
30+
return 0
31+
fi
32+
33+
# failure
34+
if [[ ${attempts_left} > 0 ]]
35+
then
36+
echo "failure (${exit_code}), sleeping ${sleep_seconds}..."
37+
sleep ${sleep_seconds}
38+
new_attempts=$((${attempts_left} - 1))
39+
new_sleep=$((${sleep_seconds} * 2))
40+
retry_with_backoff ${new_attempts} ${new_sleep} ${command}
41+
fi
42+
43+
return $exit_code
44+
}

.kokoro/dependencies.sh

+11-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@
1515

1616
set -eo pipefail
1717

18-
cd github/java-monitoring/
18+
## Get the directory of the build script
19+
scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}"))
20+
## cd to the parent directory, i.e. the root of the git repo
21+
cd ${scriptDir}/..
22+
23+
# include common functions
24+
source ${scriptDir}/common.sh
1925

2026
# Print out Java
2127
java -version
@@ -24,8 +30,9 @@ echo $JOB_TYPE
2430
export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m"
2531

2632
# this should run maven enforcer
27-
mvn install -B -V \
28-
-DskipTests=true \
29-
-Dclirr.skip=true
33+
retry_with_backoff 3 10 \
34+
mvn install -B -V \
35+
-DskipTests=true \
36+
-Dclirr.skip=true
3037

3138
mvn -B dependency:analyze -DfailOnWarning=true

.kokoro/linkage-monitor.sh

+15-7
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,26 @@ set -eo pipefail
1717
# Display commands being run.
1818
set -x
1919

20-
cd github/java-monitoring/
20+
## Get the directory of the build script
21+
scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}"))
22+
## cd to the parent directory, i.e. the root of the git repo
23+
cd ${scriptDir}/..
24+
25+
# include common functions
26+
source ${scriptDir}/common.sh
2127

2228
# Print out Java version
2329
java -version
2430
echo ${JOB_TYPE}
2531

26-
mvn install -B -V \
27-
-DskipTests=true \
28-
-Dclirr.skip=true \
29-
-Denforcer.skip=true \
30-
-Dmaven.javadoc.skip=true \
31-
-Dgcloud.download.skip=true
32+
# attempt to install 3 times with exponential backoff (starting with 10 seconds)
33+
retry_with_backoff 3 10 \
34+
mvn install -B -V \
35+
-DskipTests=true \
36+
-Dclirr.skip=true \
37+
-Denforcer.skip=true \
38+
-Dmaven.javadoc.skip=true \
39+
-Dgcloud.download.skip=true
3240

3341
# Kokoro job cloud-opensource-java/ubuntu/linkage-monitor-gcs creates this JAR
3442
JAR=linkage-monitor-latest-all-deps.jar

google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/MetricServiceClient.java

+23-32
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public MetricServiceStub getStub() {
175175
// AUTO-GENERATED DOCUMENTATION AND METHOD
176176
/**
177177
* Lists monitored resource descriptors that match a filter. This method does not require a
178-
* Stackdriver account.
178+
* Workspace.
179179
*
180180
* <p>Sample code:
181181
*
@@ -204,7 +204,7 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource
204204
// AUTO-GENERATED DOCUMENTATION AND METHOD
205205
/**
206206
* Lists monitored resource descriptors that match a filter. This method does not require a
207-
* Stackdriver account.
207+
* Workspace.
208208
*
209209
* <p>Sample code:
210210
*
@@ -231,7 +231,7 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource
231231
// AUTO-GENERATED DOCUMENTATION AND METHOD
232232
/**
233233
* Lists monitored resource descriptors that match a filter. This method does not require a
234-
* Stackdriver account.
234+
* Workspace.
235235
*
236236
* <p>Sample code:
237237
*
@@ -258,7 +258,7 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource
258258
// AUTO-GENERATED DOCUMENTATION AND METHOD
259259
/**
260260
* Lists monitored resource descriptors that match a filter. This method does not require a
261-
* Stackdriver account.
261+
* Workspace.
262262
*
263263
* <p>Sample code:
264264
*
@@ -285,7 +285,7 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource
285285
// AUTO-GENERATED DOCUMENTATION AND METHOD
286286
/**
287287
* Lists monitored resource descriptors that match a filter. This method does not require a
288-
* Stackdriver account.
288+
* Workspace.
289289
*
290290
* <p>Sample code:
291291
*
@@ -318,8 +318,7 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource
318318

319319
// AUTO-GENERATED DOCUMENTATION AND METHOD
320320
/**
321-
* Gets a single monitored resource descriptor. This method does not require a Stackdriver
322-
* account.
321+
* Gets a single monitored resource descriptor. This method does not require a Workspace.
323322
*
324323
* <p>Sample code:
325324
*
@@ -346,8 +345,7 @@ public final MonitoredResourceDescriptor getMonitoredResourceDescriptor(
346345

347346
// AUTO-GENERATED DOCUMENTATION AND METHOD
348347
/**
349-
* Gets a single monitored resource descriptor. This method does not require a Stackdriver
350-
* account.
348+
* Gets a single monitored resource descriptor. This method does not require a Workspace.
351349
*
352350
* <p>Sample code:
353351
*
@@ -371,8 +369,7 @@ public final MonitoredResourceDescriptor getMonitoredResourceDescriptor(String n
371369

372370
// AUTO-GENERATED DOCUMENTATION AND METHOD
373371
/**
374-
* Gets a single monitored resource descriptor. This method does not require a Stackdriver
375-
* account.
372+
* Gets a single monitored resource descriptor. This method does not require a Workspace.
376373
*
377374
* <p>Sample code:
378375
*
@@ -396,8 +393,7 @@ public final MonitoredResourceDescriptor getMonitoredResourceDescriptor(
396393

397394
// AUTO-GENERATED DOCUMENTATION AND METHOD
398395
/**
399-
* Gets a single monitored resource descriptor. This method does not require a Stackdriver
400-
* account.
396+
* Gets a single monitored resource descriptor. This method does not require a Workspace.
401397
*
402398
* <p>Sample code:
403399
*
@@ -420,8 +416,7 @@ public final MonitoredResourceDescriptor getMonitoredResourceDescriptor(
420416

421417
// AUTO-GENERATED DOCUMENTATION AND METHOD
422418
/**
423-
* Lists metric descriptors that match a filter. This method does not require a Stackdriver
424-
* account.
419+
* Lists metric descriptors that match a filter. This method does not require a Workspace.
425420
*
426421
* <p>Sample code:
427422
*
@@ -448,8 +443,7 @@ public final ListMetricDescriptorsPagedResponse listMetricDescriptors(ProjectNam
448443

449444
// AUTO-GENERATED DOCUMENTATION AND METHOD
450445
/**
451-
* Lists metric descriptors that match a filter. This method does not require a Stackdriver
452-
* account.
446+
* Lists metric descriptors that match a filter. This method does not require a Workspace.
453447
*
454448
* <p>Sample code:
455449
*
@@ -474,8 +468,7 @@ public final ListMetricDescriptorsPagedResponse listMetricDescriptors(String nam
474468

475469
// AUTO-GENERATED DOCUMENTATION AND METHOD
476470
/**
477-
* Lists metric descriptors that match a filter. This method does not require a Stackdriver
478-
* account.
471+
* Lists metric descriptors that match a filter. This method does not require a Workspace.
479472
*
480473
* <p>Sample code:
481474
*
@@ -501,8 +494,7 @@ public final ListMetricDescriptorsPagedResponse listMetricDescriptors(
501494

502495
// AUTO-GENERATED DOCUMENTATION AND METHOD
503496
/**
504-
* Lists metric descriptors that match a filter. This method does not require a Stackdriver
505-
* account.
497+
* Lists metric descriptors that match a filter. This method does not require a Workspace.
506498
*
507499
* <p>Sample code:
508500
*
@@ -527,8 +519,7 @@ public final ListMetricDescriptorsPagedResponse listMetricDescriptors(
527519

528520
// AUTO-GENERATED DOCUMENTATION AND METHOD
529521
/**
530-
* Lists metric descriptors that match a filter. This method does not require a Stackdriver
531-
* account.
522+
* Lists metric descriptors that match a filter. This method does not require a Workspace.
532523
*
533524
* <p>Sample code:
534525
*
@@ -560,7 +551,7 @@ public final ListMetricDescriptorsPagedResponse listMetricDescriptors(
560551

561552
// AUTO-GENERATED DOCUMENTATION AND METHOD
562553
/**
563-
* Gets a single metric descriptor. This method does not require a Stackdriver account.
554+
* Gets a single metric descriptor. This method does not require a Workspace.
564555
*
565556
* <p>Sample code:
566557
*
@@ -587,7 +578,7 @@ public final MetricDescriptor getMetricDescriptor(MetricDescriptorName name) {
587578

588579
// AUTO-GENERATED DOCUMENTATION AND METHOD
589580
/**
590-
* Gets a single metric descriptor. This method does not require a Stackdriver account.
581+
* Gets a single metric descriptor. This method does not require a Workspace.
591582
*
592583
* <p>Sample code:
593584
*
@@ -612,7 +603,7 @@ public final MetricDescriptor getMetricDescriptor(String name) {
612603

613604
// AUTO-GENERATED DOCUMENTATION AND METHOD
614605
/**
615-
* Gets a single metric descriptor. This method does not require a Stackdriver account.
606+
* Gets a single metric descriptor. This method does not require a Workspace.
616607
*
617608
* <p>Sample code:
618609
*
@@ -635,7 +626,7 @@ public final MetricDescriptor getMetricDescriptor(GetMetricDescriptorRequest req
635626

636627
// AUTO-GENERATED DOCUMENTATION AND METHOD
637628
/**
638-
* Gets a single metric descriptor. This method does not require a Stackdriver account.
629+
* Gets a single metric descriptor. This method does not require a Workspace.
639630
*
640631
* <p>Sample code:
641632
*
@@ -872,7 +863,7 @@ public final void deleteMetricDescriptor(DeleteMetricDescriptorRequest request)
872863

873864
// AUTO-GENERATED DOCUMENTATION AND METHOD
874865
/**
875-
* Lists time series that match a filter. This method does not require a Stackdriver account.
866+
* Lists time series that match a filter. This method does not require a Workspace.
876867
*
877868
* <p>Sample code:
878869
*
@@ -918,7 +909,7 @@ public final ListTimeSeriesPagedResponse listTimeSeries(
918909

919910
// AUTO-GENERATED DOCUMENTATION AND METHOD
920911
/**
921-
* Lists time series that match a filter. This method does not require a Stackdriver account.
912+
* Lists time series that match a filter. This method does not require a Workspace.
922913
*
923914
* <p>Sample code:
924915
*
@@ -964,7 +955,7 @@ public final ListTimeSeriesPagedResponse listTimeSeries(
964955

965956
// AUTO-GENERATED DOCUMENTATION AND METHOD
966957
/**
967-
* Lists time series that match a filter. This method does not require a Stackdriver account.
958+
* Lists time series that match a filter. This method does not require a Workspace.
968959
*
969960
* <p>Sample code:
970961
*
@@ -995,7 +986,7 @@ public final ListTimeSeriesPagedResponse listTimeSeries(ListTimeSeriesRequest re
995986

996987
// AUTO-GENERATED DOCUMENTATION AND METHOD
997988
/**
998-
* Lists time series that match a filter. This method does not require a Stackdriver account.
989+
* Lists time series that match a filter. This method does not require a Workspace.
999990
*
1000991
* <p>Sample code:
1001992
*
@@ -1026,7 +1017,7 @@ public final ListTimeSeriesPagedResponse listTimeSeries(ListTimeSeriesRequest re
10261017

10271018
// AUTO-GENERATED DOCUMENTATION AND METHOD
10281019
/**
1029-
* Lists time series that match a filter. This method does not require a Stackdriver account.
1020+
* Lists time series that match a filter. This method does not require a Workspace.
10301021
*
10311022
* <p>Sample code:
10321023
*

0 commit comments

Comments
 (0)