Skip to content
This repository has been archived by the owner on Nov 5, 2021. It is now read-only.

Commit

Permalink
Add surfacers examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
manugarg committed Nov 9, 2020
1 parent ffb22ec commit 4be46a9
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
30 changes: 30 additions & 0 deletions examples/surfacers/default_surfacers.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This config file doesn't specify any surfacers. In this case, following two
# surfacers are added automatically:
#
# surfacer {
# type: FILE
# }
#
# sufacer {
# type: PROMETHEUS
# }
#
# Note: If any surfacer is configured explicitly, default surfacers will not be
# added automatically.
#
# File surfacer writes metrics to stdout (you can specify a file as well) in
# the following format:
# https://github.com/google/cloudprober/blob/ffb22ec61142a65180c42dce9b78c635e596e73f/metrics/eventmetrics.go#L192
#
# Prometheus surfacer exports metrics in prometheus-compatible format at the
# URL: http://<cloudprober-host>:<cloudprober-port|default:9313>/metrics
#
probe {
name: "http_google"
type: HTTP
targets {
host_names: "www.google.com"
}
interval_msec: 10000 # Probe every 10s
timeout_msec: 1000
}
37 changes: 37 additions & 0 deletions examples/surfacers/stackdriver_surfacer.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This config file adds two surfacers: prometheus and stackdriver. Prometheus
# surfacer exports data for all probes, while stackdriver exports data only
# from one probe.
#
# NOTE: We need to explicitly specify prometheus surfacer since stackdriver
# surfacer is configured.
probe {
name: "http_google"
type: HTTP
targets {
host_names: "www.google.com"
}
}
probe {
name: "http_aws"
type: HTTP
targets {
host_names: "aws.amazon.com"
}
}
surfacer {
type: PROMETHEUS
}

# Surfacer to export data to Google Cloud Monitoring (Stackdriver). It assumes
# that cloudprober is running on GCP (that's why no project specification), and
# VMs or GKE nodes have write access for Stackdriver.
# More on stackdriver surfacer:
# https://cloudprober.org/surfacers/stackdriver/
surfacer {
type: STACKDRIVER

# Exports data only from the "http_aws" probe.
stackdriver_surfacer {
allowed_metrics_regex: ".*\/http_aws\/.*"
}
}

0 comments on commit 4be46a9

Please sign in to comment.