From 3c8858438dc18080754f2269505dd545f6302eab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20K=C5=82obuszewski?= Date: Mon, 13 Aug 2018 15:03:49 +0200 Subject: [PATCH 1/2] Bump prometheus-to-sd version tag for releasing --- prometheus-to-sd/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prometheus-to-sd/Makefile b/prometheus-to-sd/Makefile index 311529554..353771da5 100644 --- a/prometheus-to-sd/Makefile +++ b/prometheus-to-sd/Makefile @@ -16,7 +16,7 @@ all: build ENVVAR = GOOS=linux GOARCH=amd64 CGO_ENABLED=0 PREFIX = gcr.io/google-containers -TAG = v0.2.6 +TAG = v0.3.0 build: $(ENVVAR) go build -a -o monitor From f72d321c01aed6748355ada3233df1885377956b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20K=C5=82obuszewski?= Date: Mon, 13 Aug 2018 15:31:24 +0200 Subject: [PATCH 2/2] Update README for scrape-interval and export-interval flags. --- prometheus-to-sd/README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/prometheus-to-sd/README.md b/prometheus-to-sd/README.md index 753369e1c..b1fdea458 100644 --- a/prometheus-to-sd/README.md +++ b/prometheus-to-sd/README.md @@ -7,7 +7,7 @@ k8s cluster should run on GCE or GKE. ## Container Image -Look at the following link: https://gcr.io/google-containers/prometheus-to-sd and pick the latest image. +Look at the following link: https://gcr.io/google-containers/prometheus-to-sd and pick the latest image. # Usage @@ -39,6 +39,16 @@ the prometheus-to-sd. Values of the `namespace_id` and `pod_id` can be passed to the component through the additional flags or omitted. `container_name` is always empty for now. Field `zone` is overridable via flag. +## Scrape interval vs. export interval + +There are two flags: `scrape-interval` and `export-interval` that allow +specifying how often metrics are read from the sources and how often they are +exported to Stackdriver, respectively. By default both are set to 1m. The +scrapes can be more frequent than exports, however, to achieve grater precision +for metrics being exported. For example, if metrics are exported once every +minute and a container dies between scrapes, up to 1 minutes of metrics can be +lost. Frequent scrapes mitigate that, at the cost of elevated resource usage. + ## Deployment Example of [deployment](https://github.com/GoogleCloudPlatform/k8s-stackdriver/blob/master/prometheus-to-sd/kubernetes/prometheus-to-sd-kube-state-metrics.yaml)