Prometheus dummy exporter
A simple prometheus-dummy-exporter container exposes a single Prometheus metric with a constant value. The metric name, value and port on which it will be served can be passed by flags.
This container is then deployed in the same pod with another container, prometheus-to-sd, configured to use the same port. It scrapes the metric and publishes it to Stackdriver. This adapter isn't part of the sample code, but a standard component used by many Kubernetes applications. You can learn more about it
here.
Build
Provided manifest files use already available images. You don't need to do
anything else to use them. Following steps are only applicable if you want to
build your own image.
-
Set TAG to build version and PROJECT to the project in which you want to host the image.
-
Build the image:
$ docker build --pull -t gcr.io/$PROJECT/prometheus-dummy-exporter:$TAG .
- Push the image:
$ gcloud docker -- push gcr.io/$PROJECT/prometheus-dummy-exporter:$TAG
- Edit manifest file to use image hosted in your project.