Skip to content

Commit

Permalink
Merge pull request #3769 from davidchock/patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
paperclypse committed Sep 2, 2021
2 parents 8c21a74 + 850ad73 commit 3547938
Showing 1 changed file with 26 additions and 1 deletion.
Expand Up @@ -62,7 +62,7 @@ Go to the [Prometheus remote write setup launcher in New Relic One](https://one.
3. Restart your Prometheus server.
4. View your data in the New Relic UI. For example, use the remote write [dashboard](/docs/query-your-data/explore-query-data/dashboards/introduction-dashboards) we automatically create when you set up your integration.

## Mapping of Prometheus metric types [#mapping]
## Map Prometheus and New Relic metric types [#mapping]

The Prometheus remote write protocol does not include [metric type](/docs/telemetry-data-platform/ingest-manage-data/understand-data/metric-data-type#metric-types) information or other helpful metric metadata when sending metrics to New Relic. Because the remote write protocol doesn't include this information, New Relic infers the metric type based on Prometheus naming conventions. Metrics not following these naming conventions may not be mapped correctly.

Expand Down 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.

## Set allow or deny lists for sent metrics [#allow-deny]

If you need greater control over the data you send to New Relic, you can send a subset of your metrics. To do this, configure `remote-write` with the `write_relabel_configs` parameter with a subparameter `action` value of `keep` or `deny`.

In this example, you'll only send the metrics that match the regular expression. Unmatched metrics won't be sent. Alternatively, you can use `action: drop` to drop all of the metrics that match the regular expression.

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

This Kubernetes example uses this Helm chart's [`values.yaml`](https://github.com/helm/charts/blob/c40486ab2eba0391119b7cc1509d6958fd21c31d/stable/prometheus/values.yaml#L631) file. If you're using a different Helm chart, please check its `remoteWrite` documentation (for example, some Helm files use camelcase `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 3547938

Please sign in to comment.