Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Migrate sample configurations to v2 #128

Merged
merged 10 commits into from
May 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions samples/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export STACKDRIVER_HOST_PROJECT_ID=
export GAE_PROJECT_ID=
export GAE_MODULE_ID=
export LB_PROJECT_ID=
export PUBSUB_PROJECT_ID=
export PUBSUB_TOPIC_NAME=
export GKE_PROJECT_ID=
export GKE_LOCATION=
export GKE_CLUSTER_NAME=
export GKE_SERVICE_NAMESPACE=
export GKE_SERVICE_NAME=
export GKE_MESH_UID=
export ELASTICSEARCH_URL=
export PROMETHEUS_URL=
export PROMETHEUS_PUSHGATEWAY_URL=
export DATADOG_SLO_ID=
export DATADOG_API_KEY=
export DATADOG_APP_KEY=
export DYNATRACE_API_URL=
export DYNATRACE_API_TOKEN=
export BIGQUERY_PROJECT_ID=
35 changes: 35 additions & 0 deletions samples/cloud_monitoring/slo_gae_app_availability.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: sre.google.com/v2
kind: ServiceLevelObjective
metadata:
name: gae-app-availability
labels:
service_name: gae
feature_name: app
slo_name: availability
spec:
description: Availability of App Engine app
backend: cloud_monitoring
method: good_bad_ratio
exporters:
- cloud_monitoring
service_level_indicator:
filter_good: >
project=${GAE_PROJECT_ID}
metric.type="appengine.googleapis.com/http/server/response_count"
resource.type="gae_app"
( metric.labels.response_code = 429 OR
metric.labels.response_code = 200 OR
metric.labels.response_code = 201 OR
metric.labels.response_code = 202 OR
metric.labels.response_code = 203 OR
metric.labels.response_code = 204 OR
metric.labels.response_code = 205 OR
metric.labels.response_code = 206 OR
metric.labels.response_code = 207 OR
metric.labels.response_code = 208 OR
metric.labels.response_code = 226 OR
metric.labels.response_code = 304 )
filter_valid: >
project=${GAE_PROJECT_ID}
metric.type="appengine.googleapis.com/http/server/response_count"
goal: 0.95
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,27 @@
# See the License for the specific language governing permissions and
# limitations under the License.
---
service_name: gae
feature_name: app
slo_description: Latency of App Engine app requests < 724ms
slo_name: latency724ms
slo_target: 0.999
backend:
class: StackdriverServiceMonitoring
method: distribution_cut
project_id: ${STACKDRIVER_HOST_PROJECT_ID}
measurement:
apiVersion: sre.google.com/v2
kind: ServiceLevelObjective
metadata:
name: gae-app-latency724ms
labels:
service_name: gae
feature_name: app
slo_name: latency724ms
spec:
description: Latency of App Engine app requests < 724ms
backend: cloud_monitoring
method: distribution_cut
exporters:
- cloud_monitoring
service_level_indicator:
filter_valid: >
project=${GAE_PROJECT_ID}
metric.type="appengine.googleapis.com/http/server/response_latencies"
resource.type="gae_app"
metric.labels.response_code >= 200
metric.labels.response_code < 500
range_min: 0
range_max: 724
good_below_threshold: true
threshold_bucket: 19
goal: 0.999
27 changes: 27 additions & 0 deletions samples/cloud_monitoring/slo_lb_request_availability.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: sre.google.com/v2
kind: ServiceLevelObjective
metadata:
name: lb-request-availability
labels:
service_name: lb
feature_name: request
slo_name: availability
spec:
description: Availability of HTTP Load Balancer
backend: cloud_monitoring
method: good_bad_ratio
exporters:
- cloud_monitoring
service_level_indicator:
filter_good: >
project=${LB_PROJECT_ID}
metric.type="loadbalancing.googleapis.com/https/request_count"
resource.type="https_lb_rule"
( metric.label.response_code_class="200" OR
metric.label.response_code_class="300" OR
metric.label.response_code_class="400" )
filter_valid: >
project=${LB_PROJECT_ID}
metric.type="loadbalancing.googleapis.com/https/request_count"
resource.type="https_lb_rule"
goal: 0.98
25 changes: 25 additions & 0 deletions samples/cloud_monitoring/slo_lb_request_latency.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: sre.google.com/v2
kind: ServiceLevelObjective
metadata:
name: lb-request-latency724ms
labels:
service_name: lb
feature_name: request
slo_name: latency724ms
spec:
description: Latency of HTTP Load Balancer < 724ms
backend: cloud_monitoring
method: distribution_cut
exporters:
- cloud_monitoring
service_level_indicator:
filter_valid: >
project=${LB_PROJECT_ID}
metric.type="loadbalancing.googleapis.com/https/total_latencies"
resource.type="https_lb_rule"
( metric.label.response_code_class="200" OR
metric.label.response_code_class="300" OR
metric.label.response_code_class="400" )
good_below_threshold: true
threshold_bucket: 19
goal: 0.98
24 changes: 24 additions & 0 deletions samples/cloud_monitoring/slo_pubsub_subscription_throughput.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: sre.google.com/v2
kind: ServiceLevelObjective
metadata:
name: pubsub-subscription-throughput
labels:
service_name: pubsub
feature_name: subscription
slo_name: throughput
spec:
description: Throughput of Pub/Sub subscription
backend: cloud_monitoring
method: good_bad_ratio
exporters:
- cloud_monitoring
service_level_indicator:
filter_good: >
project="${PUBSUB_PROJECT_ID}"
metric.type="pubsub.googleapis.com/subscription/ack_message_count"
resource.type="pubsub_subscription"
filter_bad: >
project="${PUBSUB_PROJECT_ID}"
metric.type="pubsub.googleapis.com/subscription/num_outstanding_messages"
resource.type="pubsub_subscription"
goal: 0.95
36 changes: 36 additions & 0 deletions samples/cloud_service_monitoring/slo_gae_app_availability.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: sre.google.com/v2
kind: ServiceLevelObjective
metadata:
name: gae-app-availability
labels:
service_name: gae
feature_name: app
slo_name: availability
spec:
description: Availability of App Engine app
error_budget_policy: cloud_service_monitoring
backend: cloud_service_monitoring
method: good_bad_ratio
exporters: []
service_level_indicator:
filter_good: >
project=${GAE_PROJECT_ID}
metric.type="appengine.googleapis.com/http/server/response_count"
resource.type="gae_app"
( metric.labels.response_code = 429 OR
metric.labels.response_code = 200 OR
metric.labels.response_code = 201 OR
metric.labels.response_code = 202 OR
metric.labels.response_code = 203 OR
metric.labels.response_code = 204 OR
metric.labels.response_code = 205 OR
metric.labels.response_code = 206 OR
metric.labels.response_code = 207 OR
metric.labels.response_code = 208 OR
metric.labels.response_code = 226 OR
metric.labels.response_code = 304 )
filter_valid: >
project=${GAE_PROJECT_ID}
metric.type="appengine.googleapis.com/http/server/response_count"
resource.type="gae_app"
goal: 0.95
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: sre.google.com/v2
kind: ServiceLevelObjective
metadata:
name: gae-app-availability
labels:
service_name: gae
feature_name: app
slo_name: availability
spec:
description: Availability of App Engine app
error_budget_policy: cloud_service_monitoring
backend: cloud_service_monitoring
method: basic
exporters: []
service_level_indicator:
app_engine:
project_id: ${GAE_PROJECT_ID}
module_id: ${GAE_MODULE_ID}
availability: {}
goal: 0.98
24 changes: 24 additions & 0 deletions samples/cloud_service_monitoring/slo_gae_app_latency.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: sre.google.com/v2
kind: ServiceLevelObjective
metadata:
name: gae-app-latency724ms
labels:
service_name: gae
feature_name: app
slo_name: latency724ms
spec:
description: Latency of App Engine app requests < 724ms
error_budget_policy: cloud_service_monitoring
backend: cloud_service_monitoring
method: distribution_cut
exporters: []
service_level_indicator:
filter_valid: >
project=${GAE_PROJECT_ID}
metric.type="appengine.googleapis.com/http/server/response_latencies"
resource.type="gae_app"
metric.labels.response_code >= 200
metric.labels.response_code < 500
range_min: 0
range_max: 724
goal: 0.999
21 changes: 21 additions & 0 deletions samples/cloud_service_monitoring/slo_gae_app_latency_basic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: sre.google.com/v2
kind: ServiceLevelObjective
metadata:
name: gae-app-latency724ms
labels:
service_name: gae
feature_name: app
slo_name: latency724ms
spec:
description: Latency of App Engine app requests < 724ms
error_budget_policy: cloud_service_monitoring
backend: cloud_service_monitoring
method: basic
exporters: []
service_level_indicator:
app_engine:
project_id: ${GAE_PROJECT_ID}
module_id: ${GAE_MODULE_ID}
latency:
threshold: 724 # ms
goal: 0.999
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: sre.google.com/v2
kind: ServiceLevelObjective
metadata:
name: gke-service-availability
labels:
service_name: gke
feature_name: service
slo_name: availability
spec:
description: Availability of GKE service
error_budget_policy: cloud_service_monitoring
backend: cloud_service_monitoring
method: basic
exporters: []
service_level_indicator:
mesh_istio:
mesh_uid: ${GKE_MESH_UID}
service_namespace: ${GKE_SERVICE_NAMESPACE}
service_name: ${GKE_SERVICE_NAME}
availability: {}
goal: 0.98
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: sre.google.com/v2
kind: ServiceLevelObjective
metadata:
name: gke-service-availability
labels:
service_name: gke
feature_name: service
slo_name: availability
spec:
description: Availability of GKE service
error_budget_policy: cloud_service_monitoring
backend: cloud_service_monitoring
method: basic
exporters: []
service_level_indicator:
cluster_istio:
project_id: ${GKE_PROJECT_ID}
zone: ${GKE_LOCATION}
cluster_name: ${GKE_CLUSTER_NAME}
service_namespace: ${GKE_SERVICE_NAMESPACE}
service_name: ${GKE_SERVICE_NAME}
availability: {}
goal: 0.98
22 changes: 22 additions & 0 deletions samples/cloud_service_monitoring/slo_gke_app_latency_basic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: sre.google.com/v2
kind: ServiceLevelObjective
metadata:
name: gke-service-latency724ms
labels:
service_name: gke
feature_name: service
slo_name: latency724ms
spec:
description: Latency of GKE service requests < 724ms
error_budget_policy: cloud_service_monitoring
backend: cloud_service_monitoring
method: basic
exporters: []
service_level_indicator:
mesh_istio:
mesh_uid: ${GKE_MESH_UID}
service_namespace: ${GKE_SERVICE_NAMESPACE}
service_name: ${GKE_SERVICE_NAME}
latency:
threshold: 724 # ms
goal: 0.999
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: sre.google.com/v2
kind: ServiceLevelObjective
metadata:
name: gke-service-latency724ms
labels:
service_name: gke
feature_name: service
slo_name: latency724ms
spec:
description: Latency of GKE service requests < 724ms
error_budget_policy: cloud_service_monitoring
backend: cloud_service_monitoring
method: basic
exporters: []
service_level_indicator:
cluster_istio:
project_id: ${GKE_PROJECT_ID}
zone: ${GKE_LOCATION}
cluster_name: ${GKE_CLUSTER_NAME}
service_namespace: ${GKE_SERVICE_NAMESPACE}
service_name: ${GKE_SERVICE_NAME}
latency:
threshold: 724 # ms
goal: 0.999
Loading