Skip to content

Commit a5b4e53

Browse files
authored
Document filter and file configuration (#62)
* Document filter and file configuration * Rephrase * Rephrase
1 parent 1f8142a commit a5b4e53

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,40 @@ can be used as a reference for setup:
4444
* [Standard deployment](./kube/prometheus-meta.yaml)
4545
* [Deployment with the Prometheus Operator](./kube/prometheus-meta-operated.yaml)
4646

47+
### Configuration
48+
49+
The majority of configuration options for the sidecar are set through flags. To see all available flags, run:
50+
51+
```
52+
stackdriver-prometheus-sidecar --help
53+
```
54+
55+
#### Filters
56+
57+
The `--filter` flag allows to provide filters which all series have to pass before being sent to Stackdriver. The flag may be repeated to provide several filters. Filters use the same syntax as the well-known PromQL label matchers, e.g.:
58+
59+
```
60+
stackdriver-prometheus-sidecar --filter='job="k8s"' --filter='__name__!~"cadvisor_.+"' ...
61+
```
62+
63+
This drops all series which do not have a `job` label `k8s` and all metrics that have a name starting with `cadvisor_`.
64+
65+
#### File
66+
67+
The sidecar can also be provided with a configuration file. It allows to define static metric renames and to overwrite metric metadata which is usually provided by Prometheus. A configuration file should not be required for the majority of users.
68+
69+
```yaml
70+
metric_renames:
71+
- from: original_metric_name
72+
to: new_metric_name
73+
# - ...
74+
75+
static_metadata:
76+
- metric: some_metric_name
77+
type: counter # or gauge/histogram
78+
help: an arbitrary help string
79+
# - ...
80+
```
4781

4882
## Compatibility
4983

0 commit comments

Comments
 (0)