stackdriver-exporter

by joaquinito2051

Helm chartv1.1.0App 0.6.0

Stackdriver exporter for Prometheus

About this chart

Stackdriver Exporter

Prometheus exporter for Stackdriver, allowing for Google Cloud metrics. You must have appropriate IAM permissions for this exporter to work. If you are passing in an IAM key then you must have:

  • monitoring.metricDescriptors.list
  • monitoring.timeSeries.list

These are contained within roles/monitoring.viewer. If you're using legacy access scopes, then you must have https://www.googleapis.com/auth/monitoring.read.

Learn more: https://github.com/frodenas/stackdriver_exporter

TL;DR;

$ helm install <helm-repo>/stackdriver-exporter --set stackdriver.projectId=google-project-name

$ helm install stable/stackdriver-exporter --set stackdriver.projectId=google-project-name

Introduction

This chart creates a Stackdriver-Exporter deployment on a Kubernetes cluster using the Helm package manager.

Prerequisites

  • Kubernetes 1.8+ with Beta APIs enabled

Installing the Chart

To install the chart with the release name my-release:

$ helm install --name my-release <helm-repo>/stackdriver-exporter --set stackdriver.projectId=google-project-name

$ helm install --name my-release stable/stackdriver-exporter --set stackdriver.projectId=google-project-name The command deploys Stackdriver-Exporter on the Kubernetes cluster using the default configuration. The configuration section lists the parameters that can be configured during installation.

Uninstalling the Chart

To uninstall/delete the my-release deployment:

$ helm delete --purge my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

The following table lists the configurable parameters of the Stackdriver-Exporter chart and their default values.

ParameterDescriptionDefault
replicaCountDesired number of pods1
restartPolicyContainer restart policyAlways
image.repositoryContainer image repositoryfrodenas/stackdriver-exporter
image.tagContainer image tagv0.6.0
image.pullPolicyContainer image pull policyIfNotPresent
resourcesResource requests & limits{}
service.typeType of service to createClusterIP
service.httpPortPort for the http service9255
stackdriver.projectIdGCP Project ID``
stackdriver.serviceAccountSecretOptionally specify an existing secret which contains credentials.json if necessary.""
stackdriver.serviceAccountKeyOptionally specify the service account key JSON file. Must be provided when no existing secret is used, in this case a new secret will be created holding this service account""
stackdriver.maxRetriesMax number of retries that should be attempted on errors from Stackdriver0
stackdriver.httpTimeoutHow long should Stackdriver_exporter wait for a result from the Stackdriver API10s
stackdriver.maxBackoffMax time between each request in an exponential backoff scenario5s
stackdriver.backoffJitterThe amount of jitter to introduce in an exponential backoff scenario1s
stackdriver.retryStatusesThe HTTP statuses that should trigger a retry503
stackdriver.metrics.typePrefixesComma separated Metric Type prefixescompute.googleapis.com/instance/cpu
stackdriver.metrics.intervalMetrics interval to request from GCP5m
stackdriver.metrics.offsetOffset (into the past) to request0s
web.listenAddressPort to listen on9255
web.pathPath under which to expose metrics/metrics
annotationsDeployment annotations{}
affinityPod affinity{}
nodeSelectorNode labels for pod assignment{}
tolerationsNode taints to tolerate (requires Kubernetes >=1.6)[]

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,

helm install. For example,

$ helm install --name my-release \
    --set key_1=value_1,key_2=value_2 \
    <helm-repo>/stackdriver-exporter
$ helm install --name my-release \

Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,

# example for staging
$ helm install --name my-release -f values.yaml <helm-repo>/stackdriver-exporter

$ helm install --name my-release -f values.yaml stable/stackdriver-exporter

Tip: You can use the default values.yaml, as long as you provide a value for stackdriver.projectId

Google Storage Metrics

In order to get metrics for GCS you need to ensure the metrics interval is > 24h. You can read more information about this in this bug report.

The easiest way to do this is to create two separate exporters with different prefixes and intervals, to ensure you gather all appropriate metrics.

Deploy stackdriver-exporter with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has stackdriver-exporter on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartstackdriver-exporter is pinned at v1.1.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply