Skip to content

Instantly share code, notes, and snippets.

@Clivern
Last active May 19, 2021 18:51
Show Gist options
  • Save Clivern/7d5b375d2359d7a50429ee63ecb1777c to your computer and use it in GitHub Desktop.
Save Clivern/7d5b375d2359d7a50429ee63ecb1777c to your computer and use it in GitHub Desktop.
  • Run a simple web server
$ while true; do printf 'HTTP/1.1 200 OK\n\n%s' "Hello World" | nc -l 8000; done
  • Validate it's running
$ curl http://127.0.0.1:8000
  • Create cloudprober.cfg File
probe {
  name: "test_server_http"
  type: HTTP
  targets {
    host_names: "127.0.0.1"
  }

  interval_msec: 10000
  timeout_msec: 1000

  http_probe {
      protocol: HTTP
      port: 8000
  }
}

probe {
    name: "test_server_ping"
    type: PING
    targets {
        host_names: "127.0.0.1"
    }

    interval_msec: 10000
    timeout_msec: 1000
}

surfacer {
  type: PROMETHEUS
}
  • Run cloudprober
./cloudprober --config_file cloudprober.cfg -logtostderr

Metrics will be available on http://localhost:9313/metrics & http://localhost:9313/status

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment