Skip to content

Commit

Permalink
Merge pull request #18046 from bshankararamaya/NR-292090
Browse files Browse the repository at this point in the history
feat(NR-292090): Updated prometheus install framework link
  • Loading branch information
nbaenam committed Jul 17, 2024
2 parents a213e72 + f1a4a88 commit fe96cae
Showing 1 changed file with 20 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ You can get Prometheus data flowing in New Relic with just a few simple steps. O

If you're using the [Prometheus Operator](https://github.com/prometheus-operator/prometheus-operator), you'll need to create a secret with the New Relic <InlinePopover type="licenseKey" /> for the account to which you want to report data. Make sure the API key is of the type `Ingest - License`.

```
```shell
kubectl -n YOUR_PROM_NAMESPACE create secret generic nr-license-key --from-literal=value=YOUR_LICENSE_KEY
```

Next, add the following to your Prometheus CRD (`kind:Prometheus`) in the corresponding field from the [Helm chart](https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/values.yaml):

```
```yaml
prometheus:
prometheusSpec:
remoteWrite:
Expand All @@ -44,33 +44,38 @@ Next, add the following to your Prometheus CRD (`kind:Prometheus`) in the corres
## Set up the integration [#setup]
Go to the [Prometheus remote write setup launcher in the UI](https://one.newrelic.com/launcher/nr1-core.settings?pane=eyJuZXJkbGV0SWQiOiJwcm9tZXRoZXVzLXJlbW90ZS13cml0ZS1pbnRlZ3JhdGlvbi1uZXJkbGV0cy5zZXR1cC1wcm9tZXRoZXVzIn0=), and complete these steps to add Prometheus data.
Go to the [Prometheus remote write setup launcher in the UI](https://one.newrelic.com/marketplace/install-data-source?state=c8c296ea-4be7-405a-eb38-53215c68d0bb), and complete these steps to add Prometheus data.
<ButtonLink
role="button"
to="https://one.newrelic.com/launcher/nr1-core.settings?pane=eyJuZXJkbGV0SWQiOiJwcm9tZXRoZXVzLXJlbW90ZS13cml0ZS1pbnRlZ3JhdGlvbi1uZXJkbGV0cy5zZXR1cC1wcm9tZXRoZXVzIn0="
to="https://one.newrelic.com/marketplace/install-data-source?state=c8c296ea-4be7-405a-eb38-53215c68d0bb"
variant="primary"
>
Add Prometheus data
</ButtonLink>
1. Enter a name for the Prometheus server to be connected and your `remote_write` URL. <DNT>**Important:**</DNT> The name you enter for the server will create an attribute on your data. It will also be the name that identifies which Prometheus server is sending data to New Relic.
1. Enter a name for the Prometheus server to be connected and your `remote_write` URL.

<Callout variant="important">
The name you enter for the server creates an attribute on your data. This is also the name that identifies which Prometheus server is sending data to New Relic.
</Callout>

2. Add a new `remote_write` URL to your Prometheus YML file. Add this information under `global_config` in the file, at the same indentation level as the `global` section.

Use the following syntax:

<DNT>**Prometheus v2.26 and newer**</DNT>
<DNT>**Prometheus v2.26 and higher**</DNT>

```
```yaml
remote_write:
- url: https://metric-api.newrelic.com/prometheus/v1/write?prometheus_server=YOUR_DATA_SOURCE_NAME
authorization:
credentials: YOUR_LICENSE_KEY
```

<DNT>**Prometheus older than v2.26**</DNT>
<DNT>**Prometheus lower than v2.26**</DNT>

```
```yaml
remote_write:
- url: https://metric-api.newrelic.com/prometheus/v1/write?prometheus_server=YOUR_DATA_SOURCE_NAME
bearer_token:YOUR_LICENSE_KEY
Expand All @@ -80,7 +85,7 @@ Go to the [Prometheus remote write setup launcher in the UI](https://one.newreli

<DNT>**Any Prometheus version**</DNT>

```
```yaml
remote_write:
- url: https://metric-api.newrelic.com/prometheus/v1/write?X-License-Key=YOUR_LICENSE_KEY&prometheus_server=YOUR_DATA_SOURCE_NAME
```
Expand All @@ -89,13 +94,13 @@ Go to the [Prometheus remote write setup launcher in the UI](https://one.newreli

<DNT>**European Union accounts:**</DNT> If you're connecting from the EU, use the following URL:

```
```yaml
https://metric-api.eu.newrelic.com/prometheus/v1/write
```

<DNT>**Kubernetes and Helm remote write integrations:**</DNT> Add the remote write URL to your Helm [`values.yaml`](https://github.com/helm/charts/blob/c40486ab2eba0391119b7cc1509d6958fd21c31d/stable/prometheus/values.yaml#L631) file. Replace `remoteWrite: []` with two lines similar to the following example. Be sure to use your remote write URL and use indentation that matches the rest of the file:

```
```yaml
remoteWrite:
- url: https://metric-api.newrelic.com/prometheus/v1/write?prometheus_server=YOUR_DATA_SOURCE_NAME
bearer_token:YOUR_LICENSE_KEY
Expand Down Expand Up @@ -124,7 +129,7 @@ If you have metrics that don't follow Prometheus naming conventions, you can con

<DNT>**Example:**</DNT> You have a counter metric named `my_counter`, which does not have our naming convention suffix of `_bucket`, `_count` or `_total`. In this situation, your metric would be identified as a gauge rather than a counter. To correct this, add the following relabel configuration to your `prometheus.yml`:

```
```yaml
- url: https://metric-api.newrelic.com/prometheus/v1/write?X-License-Key=...
write_relabel_configs:
- source_labels: [__name__]
Expand All @@ -148,7 +153,7 @@ If you need greater control over the data you send to New Relic, you can send a

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.

```
```yaml
- url: https://metric-api.newrelic.com/prometheus/v1/write?X-License-Key=...
write_relabel_configs:
- source_labels: [__name__]
Expand All @@ -158,7 +163,7 @@ In this example, you'll only send the metrics that match the regular expression.

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).

```
```yaml
remoteWrite:
- url: https://metric-api.newrelic.com/prometheus/v1/write?X-License-Key=...
write_relabel_configs:
Expand Down

0 comments on commit fe96cae

Please sign in to comment.