Skip to content

Commit 0b223b7

Browse files
authored
Document migration from stackdriver-prometheus (#66)
1 parent a35ce27 commit 0b223b7

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

docs/migration.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Migration from stackdriver-prometheus
2+
3+
This document is for users of the previous Stackdriver Prometheus integration [strackdriver-prometheus](https://github.com/Stackdriver/stackdriver-prometheus) who wish to migrate to the integration in this repository ([stackdriver-prometheus-sidecar](https://github.com/Stackdriver/stackdriver-prometheus-sidecar/new/master/docs)). For full instruction on how to set up the sidecar, refer to the [README](README.md).
4+
5+
The old integration packaged some of the Prometheus Server functionality in the same binary and was configured in the Prometheus Server configuration file. The new integration runs side-by-side with an existing Prometheus Server and is configured directly.
6+
7+
## Required configuration
8+
9+
In the old configuration you had a block like:
10+
11+
```yaml
12+
global:
13+
external_labels:
14+
_stackdriver_project_id: 'prometheus-to-sd'
15+
_kubernetes_cluster_name: 'prom-test-cluster-1'
16+
_kubernetes_location: 'us-central1-a'
17+
```
18+
19+
In the new configuration you pass those variables as command-line flags to the sidecar:
20+
21+
```sh
22+
stackdriver-prometheus-sidecar \
23+
--stackdriver.project-id="prometheus-to-sd" \
24+
--prometheus.wal-directory=${WAL_DIR}" \
25+
--prometheus.api-address=${API_ADDRESS} \
26+
--stackdriver.kubernetes.location="us-central1-a" \
27+
--stackdriver.kubernetes.cluster-name="prom-test-cluster-1"
28+
```
29+
30+
## Additional configuration
31+
32+
In the old configuration you could filter metrics using Prometheus relabel configs such as:
33+
34+
```yaml
35+
metric_relabel_configs:
36+
- source_labels: [__name__]
37+
regex: 'go_memstats_mallocs_total'
38+
action: drop
39+
```
40+
41+
In the new configuration you can set up filters by passing PromQL label matchers as command-line flags to the sidecar:
42+
43+
```sh
44+
stackdriver-prometheus-sidecar --filter='__name__!="go_memstats_mallocs_total"'
45+
```

0 commit comments

Comments
 (0)