Skip to content

Commit

Permalink
Add allow and deny list examples for remote write
Browse files Browse the repository at this point in the history
Examples include Prometheus standalone and Prometheus on Kubernetes using a specific Helm chart. Also brings out a caveat of other helm charts
  • Loading branch information
davidchock committed Sep 2, 2021
1 parent 1470311 commit 8dc2012
Showing 1 changed file with 25 additions and 0 deletions.
Expand Up @@ -99,6 +99,31 @@ This rule matches any metric with the name `my_counter` and adds a `newrelic_met

When a `newrelic_metric_type` label is present on a metric received and set to one of the valid values, New Relic will assign the indicated type to the metric (and strip the label) before downstream consumption in the data pipeline. If you have multiple metrics that don't follow the above naming conventions, you can add multiple rules with each rule matching different source labels.

## Setting allow or deny lists for metrics sent [#allowlisting]

If you only want to send a subset of metrics in order to control your data better, you can configure remote-write with the write_relabel_configs parameter with a subparameter action value of keep or deny.

**Example:** This example sends all metrics that match the regex and drops the rest. You can also use action: drop to drop all metrics that match the regex

```
- url: https://metric-api.newrelic.com/prometheus/v1/write?X-License-Key=...
write_relabel_configs:
- source_labels: [__name__]
regex: "coredns_(.*)|etcd_(.*)"
action: keep
```

**Kubernetes and Helm Example:** This example uses this Helm chart's [`values.yaml`](https://github.com/helm/charts/blob/c40486ab2eba0391119b7cc1509d6958fd21c31d/stable/prometheus/values.yaml#L631) file. If you are using a different Helm chart, please check it's remote write documentation (e.g. some will use camel case writeRelabelConfigs instead)

```
remoteWrite:
- url: https://metric-api.newrelic.com/prometheus/v1/write?X-License-Key=...
write_relabel_configs:
- source_labels: [__name__]
regex: "coredns_(.*)|etcd_(.*)"
action: keep
```

## Customize remote write behavior [#customize]

You can customize the following parameters if you are writing to more than one account in New Relic or are connecting more than one Prometheus data source to the same account in New Relic. For more information, see the [docs on remote write tuning](https://prometheus.io/docs/practices/remote_write/).
Expand Down

0 comments on commit 8dc2012

Please sign in to comment.