diff --git a/examples/surfacers/default_surfacers.cfg b/examples/surfacers/default_surfacers.cfg new file mode 100644 index 00000000..3ac5544d --- /dev/null +++ b/examples/surfacers/default_surfacers.cfg @@ -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://:/metrics +# +probe { + name: "http_google" + type: HTTP + targets { + host_names: "www.google.com" + } + interval_msec: 10000 # Probe every 10s + timeout_msec: 1000 +} diff --git a/examples/surfacers/stackdriver_surfacer.cfg b/examples/surfacers/stackdriver_surfacer.cfg new file mode 100644 index 00000000..dcee195a --- /dev/null +++ b/examples/surfacers/stackdriver_surfacer.cfg @@ -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\/.*" + } +} \ No newline at end of file