Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Add more rollup rules docs #2462

Merged
merged 5 commits into from
Jul 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions docs/operational_guide/mapping_rollup.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,50 @@ downsample:
- resolution: 30s
retention: 720h
```

While the above example can be used to create a new rolled up metric,
often times the goal of rollup rules is to eliminate the underlaying,
raw metrics. In order to do this, a `mappingRule` will need to be
added like in the following example (using the metric above as an example)
with `drop` set to `true`. Additionally, if **all** of the underlaying metrics are
being dropped, there is no need to change the metric name (e.g. in the
`rollupRule`, the `metricName` field can be equal to the existing metric) --
see below for an example.

```yaml
downsample:
benraskin92 marked this conversation as resolved.
Show resolved Hide resolved
rules:
mappingRules:
- name: "http_request latency by route and git_sha drop raw"
filter: "__name__:http_request_bucket k8s_pod:* le:* git_sha:* route:*"
drop: true
rollupRules:
- name: "http_request latency by route and git_sha without pod"
filter: "__name__:http_request_bucket k8s_pod:* le:* git_sha:* route:*"
transforms:
- transform:
type: "Increase"
- rollup:
metricName: "http_request_bucket" # metric name doesn't change
groupBy: ["le", "git_sha", "route", "status_code", "region"]
aggregations: ["Sum"]
- transform:
type: "Add"
storagePolicies:
- resolution: 30s
retention: 720h
```

**Note:** In order to store rolled up metrics in an `unaggregated` namespace,
a matching `aggregated` namespace must be added to the coordinator config. For
example, if in the above rule, the `720h` namespace under `storagePolicies`
is `unaggregated`, the following will need to be added to the coordinator config.

```yaml
- namespace: default
resolution: 30s
retention: 720h
type: aggregated
downsample:
all: false
```