exporter

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

README

blackbox-exporter-cloudfunction

This is a blackbox_exporter that runs on GCP Cloud Functions, insipired by blackbox-exporter-lambda.

It can be configured like a normal blackbox_exporter, an example config can be found here.

Deploying

The terraform directory provides a ready to be used Terraform module to easily deploy this function. Just put your blackbox exporter config next to your Terraform config and reference it with the file function.

module "blackbox-exporter-cloudrun" {
  source      = "github.com/ninech/blackbox-exporter-cloudfunction//terraform?ref=v0.1.0"
  project     = "some-project-id"
  region      = "europe-west6"
  bucket_name = "my-cloudfunctions"
  config      = file("config.yml")
}

This does not require any authentication but is only available within the VPC using the ALLOW_INTERNAL_ONLY ingress setting.

Testing the function

curl "https://<url_from_output>?target=https://example.org"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(w http.ResponseWriter, r *http.Request)

Handler is a http.Handler which will be called by the GCP Cloud Function on every request. It has been adapted from the original blackbox_exporter probeHandler: https://github.com/prometheus/blackbox_exporter/blob/63678419a6a274ac6d43d3d4088cad2a1d06371f/main.go#L70

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL