Permalink
Browse files

Export Prometheus metrics to StackDriver (#996)

* Add Prometheus to Stackdriver side-cars to 

- logserver
- logsigner
- keyserver
- sequencer

* Update docker auth
* Use non curl based liveness probes
* Remove kompose since docker-compose can't support sidecars.
  • Loading branch information...
gdbelvin committed Jun 26, 2018
1 parent 4b029f5 commit c4046a3a912a6eaf2237886c20deb5ac029aba1d
View

This file was deleted.

Oops, something went wrong.
@@ -26,18 +26,31 @@ spec:
- --alsologtostderr
image: us.gcr.io/key-transparency/log-server:latest
livenessProbe:
exec:
command:
- curl
- -f
- http://localhost:8091/metrics
failureThreshold: 3
periodSeconds: 30
timeoutSeconds: 30
httpGet:
path: /metrics
port: 8091
name: log-server
ports:
- containerPort: 8090
- containerPort: 8091
resources: {}
- name: prometheus-to-sd
image: gcr.io/google-containers/prometheus-to-sd:v0.2.6
command:
- /monitor
- --stackdriver-prefix=custom.googleapis.com
- --source=logserver:http://localhost:8091/metrics
- --pod-id=$(POD_NAME)
- --namespace-id=$(POD_NAMESPACE)
- --metrics-resolution=5s
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
restartPolicy: Always
status: {}
@@ -30,17 +30,30 @@ spec:
- --alsologtostderr
image: us.gcr.io/key-transparency/log-signer:latest
livenessProbe:
exec:
command:
- curl
- -f
- http://localhost:8091/metrics
failureThreshold: 3
periodSeconds: 30
timeoutSeconds: 30
httpGet:
path: /metrics
port: 8091
name: log-signer
ports:
- containerPort: 8091
resources: {}
- name: prometheus-to-sd
image: gcr.io/google-containers/prometheus-to-sd:v0.2.6
command:
- /monitor
- --stackdriver-prefix=custom.googleapis.com
- --source=logsigner:http://localhost:8091/metrics
- --pod-id=$(POD_NAME)
- --namespace-id=$(POD_NAMESPACE)
- --metrics-resolution=5s
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
restartPolicy: Always
status: {}
@@ -26,18 +26,31 @@ spec:
- --alsologtostderr
image: us.gcr.io/key-transparency/map-server:latest
livenessProbe:
exec:
command:
- curl
- -f
- http://localhost:8091/metrics
failureThreshold: 3
periodSeconds: 30
timeoutSeconds: 30
httpGet:
path: /metrics
port: 8091
name: map-server
ports:
- containerPort: 8090
- containerPort: 8091
resources: {}
- name: prometheus-to-sd
image: gcr.io/google-containers/prometheus-to-sd:v0.2.6
command:
- /monitor
- --stackdriver-prefix=custom.googleapis.com
- --source=mapserver:http://localhost:8091/metrics
- --pod-id=$(POD_NAME)
- --namespace-id=$(POD_NAMESPACE)
- --metrics-resolution=5s
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
restartPolicy: Always
status: {}
@@ -27,9 +27,32 @@ spec:
- --alsologtostderr
- --v=5
image: us.gcr.io/key-transparency/keytransparency-sequencer:latest
livenessProbe:
httpGet:
path: /metrics
port: 8081
name: sequencer
ports:
- containerPort: 8080
- containerPort: 8081
resources: {}
- name: prometheus-to-sd
image: gcr.io/google-containers/prometheus-to-sd:v0.2.6
command:
- /monitor
- --stackdriver-prefix=custom.googleapis.com
- --source=sequencer:http://localhost:8081/metrics
- --pod-id=$(POD_NAME)
- --namespace-id=$(POD_NAMESPACE)
- --metrics-resolution=5s
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
restartPolicy: Always
status: {}
@@ -13,6 +13,9 @@ spec:
- name: "8080"
port: 8080
targetPort: 8080
- name: "8081"
port: 8081
targetPort: 8081
selector:
io.kompose.service: sequencer
status:
@@ -32,18 +32,31 @@ spec:
- --v=5
image: us.gcr.io/key-transparency/keytransparency-server:latest
livenessProbe:
exec:
command:
- curl
- -f
- http://localhost:8081/metrics
failureThreshold: 5
periodSeconds: 30
timeoutSeconds: 10
httpGet:
path: /metrics
port: 8081
name: server
ports:
- containerPort: 8080
- containerPort: 8081
resources: {}
- name: prometheus-to-sd
image: gcr.io/google-containers/prometheus-to-sd:v0.2.6
command:
- /monitor
- --stackdriver-prefix=custom.googleapis.com
- --source=keyserver:http://localhost:8081/metrics
- --pod-id=$(POD_NAME)
- --namespace-id=$(POD_NAMESPACE)
- --metrics-resolution=5s
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
restartPolicy: Always
status: {}
View
@@ -1,5 +1,21 @@
version: "3"
services:
# Only works when when replicas = 1 for reach monitored service.
prometheus-to-sd:
container_name: prometheus-to-sd
image: gcr.io/google-containers/prometheus-to-sd:v0.2.6
entrypoint:
- /monitor
- --stackdriver-prefix=custom.googleapis.com
- --source=logserver:http://log-server:8091/metrics
- --source=logsigner:http://log-signer:8091/metrics
- --source=mapserver:http://map-server:8091/metrics
- --source=keyserver:http://server:8081/metrics
- --source=sequencer:http://sequencer:8081/metrics
- --pod-id=prometheus-to-sd
- --namespace-id=default
- --metrics-resolution=5s
prometheus:
depends_on:
- server
@@ -150,6 +166,12 @@ services:
- --v=5
ports:
- "8080"
- "8081"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8081/metrics"]
interval: 30s
timeout: 10s
retries: 5
init:
image: us.gcr.io/key-transparency/init:latest
View
@@ -31,7 +31,7 @@ gcloud --quiet config set project ${PROJECT_NAME_CI}
gcloud --quiet config set compute/zone ${CLOUDSDK_COMPUTE_ZONE}
gcloud --quiet config set container/cluster ${CLUSTER_NAME_CI}
gcloud --quiet container clusters get-credentials ${CLUSTER_NAME_CI}
gcloud --quiet docker --authorize-only
gcloud --quiet auth configure-docker
echo "Generating keys..."

0 comments on commit c4046a3

Please sign in to comment.