← Back to Pull requests

Add remote write configuration for v2.26+ #5414

Merged
cmacnaug merged 1 files (17 lines) on Jan 04, 2022 00:04 UTC
View on GitHub
cmacnaug cmacnaug commented on Dec 22, 2021 21:02 UTC
Author

Prometheus made changes to the preferred way to configure remote write credentials in v2.26.

Diff: 17 lines (+14 / -3) across 1 files Reviewer: paperclypse Review duration: 17462m
All Vouch review confidence checks passed
Residual risk 0.09 = Change Risk (0.43) × (1 − Review Confidence (0.80)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 17 lines diff across 1 files
0.43
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.73 · 5 substantive comment(s)
0.73
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
79%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.173
Sensitive Paths sensitive_paths
0.043
Real PR Conversation Timeline
17 items
CLAassistant CLAassistant commented on Dec 22, 2021 21:02 UTC
Contributor
github-actions[bot] github-actions[bot] commented on Dec 22, 2021 21:02 UTC
Bot

Hi @cmacnaug 👋
Thanks for your pull request! Your PR is in a queue, and a writer will take a look soon. We generally publish small edits within one business day, and larger edits within three days.

Gatsby Cloud will automatically generate a preview of your request, and will comment with a link when the preview is ready (usually 20 to 30 minutes).

haus haus commented on code on Dec 22, 2021 21:06 UTC
Code Review
src/content/docs/infrastructure/prometheus-integrations/install-configure-remote-write/set-your-prometheus-remote-write-integration.mdx:1
@@ -34,18 +34,29 @@ Go to the [Prometheus remote write setup launcher in New Relic One](https://one.
 
    Use the following syntax:
 
+   **Prometheus v2.26 and newer**
+   ``` 
+   remote_write: 
+   - url: https://metric-api.newrelic.com/prometheus/v1/write?prometheus_server=<var>YOUR_DATA_SOURCE_NAME</var>  
+     authorization:
+     credentials: YOUR_LICENSE_KEY

I think credentials needs an extra indentation to put it inside the authorization map?

cmacnaug cmacnaug commented on code on Dec 22, 2021 21:18 UTC
Code Review
src/content/docs/infrastructure/prometheus-integrations/install-configure-remote-write/set-your-prometheus-remote-write-integration.mdx:1
@@ -34,18 +34,29 @@ Go to the [Prometheus remote write setup launcher in New Relic One](https://one.
 
    Use the following syntax:
 
+   **Prometheus v2.26 and newer**
+   ``` 
+   remote_write: 
+   - url: https://metric-api.newrelic.com/prometheus/v1/write?prometheus_server=<var>YOUR_DATA_SOURCE_NAME</var>  
+     authorization:
+     credentials: YOUR_LICENSE_KEY

Thanks, @haus!

paperclypse paperclypse commented on code on Dec 22, 2021 21:22 UTC
Code Review
src/content/docs/infrastructure/prometheus-integrations/install-configure-remote-write/set-your-prometheus-remote-write-integration.mdx:1
@@ -34,18 +34,29 @@ Go to the [Prometheus remote write setup launcher in New Relic One](https://one.
 
    Use the following syntax:
 
+   **Prometheus v2.26 and newer**
+   ``` 
+   remote_write: 
+   - url: https://metric-api.newrelic.com/prometheus/v1/write?prometheus_server=<var>YOUR_DATA_SOURCE_NAME</var>  
+     authorization:
+       credentials: YOUR_LICENSE_KEY
+   ```
+
+   **Prometheus older than v2.26**
    ```
    remote_write: 
    - url: https://metric-api.newrelic.com/prometheus/v1/write?prometheus_server=<var>YOUR_DATA_SOURCE_NAME</var>  
      bearer_token:<var>YOUR_LICENSE_KEY</var>
    ```
-
-   OR
-
+   
+   OR 
+   
+   **Any Prometheus version**
    ```
    remote_write: 
    - url: https://metric-api.newrelic.com/prometheus/v1/write?X-License-Key=<var>YOUR_LICENSE_KEY</var>&prometheus_server=<var>YOUR_DATA_SOURCE_NAME</var>
    ```
+   *This approach is discouraged as it is preferable not to pass credentials in the url*

@cmacnaug I'd love to use something with a little less passive voice.

How about: "This passes credentials in the URL. We don't recommend using it."?

jgals jgals commented on Dec 22, 2021 21:23 UTC
Contributor
ghost ghost commented on Dec 22, 2021 21:29 UTC
Contributor

Gatsby Cloud Build Report


docs-website-develop

:tada: Your build was successful! See the Deploy preview here.

Build Details

View the build logs here.

:clock1: Build time: 27m

cmacnaug cmacnaug commented on code on Dec 23, 2021 00:23 UTC
Code Review
src/content/docs/infrastructure/prometheus-integrations/install-configure-remote-write/set-your-prometheus-remote-write-integration.mdx:1
@@ -34,18 +34,29 @@ Go to the [Prometheus remote write setup launcher in New Relic One](https://one.
 
    Use the following syntax:
 
+   **Prometheus v2.26 and newer**
+   ``` 
+   remote_write: 
+   - url: https://metric-api.newrelic.com/prometheus/v1/write?prometheus_server=<var>YOUR_DATA_SOURCE_NAME</var>  
+     authorization:
+       credentials: YOUR_LICENSE_KEY
+   ```
+
+   **Prometheus older than v2.26**
    ```
    remote_write: 
    - url: https://metric-api.newrelic.com/prometheus/v1/write?prometheus_server=<var>YOUR_DATA_SOURCE_NAME</var>  
      bearer_token:<var>YOUR_LICENSE_KEY</var>
    ```
-
-   OR
-
+   
+   OR 
+   
+   **Any Prometheus version**
    ```
    remote_write: 
    - url: https://metric-api.newrelic.com/prometheus/v1/write?X-License-Key=<var>YOUR_LICENSE_KEY</var>&prometheus_server=<var>YOUR_DATA_SOURCE_NAME</var>
    ```
+   *This approach is discouraged as it is preferable not to pass credentials in the url*

That sounds fine to me. I'm honestly not sure that we still have a use case for this configuration mode, but didn't want to remove it in case it was useful for a user. Would the following be too verbose?

"This approach passes credentials in the URL. We don't recommend using it unless one of the above approaches doesn't work in your environment."

cmacnaug cmacnaug commented on Dec 23, 2021 00:31 UTC
Author

@cmacnaug, there's at least one other doc page we'll need to update, I found this one as well:

> * https://github.com/newrelic/docs-website/blob/develop/src/content/docs/infrastructure/prometheus-integrations/install-configure/remote-write-drop-data.mdx

Given that Tyler's testing suggests that bearer_token _may_ still work in 2.26 plus, I think it is okay to reference bearer_token on that page

tclayton-newr tclayton-newr commented on Dec 23, 2021 20:52 UTC
Contributor

I think updating the doc to reflect the latest Prometheus doc (i.e. the authorization block) makes sense to do (though I think both do work in the latest versions).

I tested and verified that the changes documented here work for Prometheus v2.30.3

daphnee-jeune daphnee-jeune commented on Dec 27, 2021 17:43 UTC
Reviewer

~~LGTM~~
Please ignore!

paperclypse paperclypse commented on code on Jan 03, 2022 16:47 UTC
Code Review
src/content/docs/infrastructure/prometheus-integrations/install-configure-remote-write/set-your-prometheus-remote-write-integration.mdx:1
@@ -34,18 +34,29 @@ Go to the [Prometheus remote write setup launcher in New Relic One](https://one.
 
    Use the following syntax:
 
+   **Prometheus v2.26 and newer**
+   ``` 
+   remote_write: 
+   - url: https://metric-api.newrelic.com/prometheus/v1/write?prometheus_server=<var>YOUR_DATA_SOURCE_NAME</var>  
+     authorization:
+       credentials: YOUR_LICENSE_KEY
+   ```
+
+   **Prometheus older than v2.26**
    ```
    remote_write: 
    - url: https://metric-api.newrelic.com/prometheus/v1/write?prometheus_server=<var>YOUR_DATA_SOURCE_NAME</var>  
      bearer_token:<var>YOUR_LICENSE_KEY</var>
    ```
-
-   OR
-
+   
+   OR 
+   
+   **Any Prometheus version**
    ```
    remote_write: 
    - url: https://metric-api.newrelic.com/prometheus/v1/write?X-License-Key=<var>YOUR_LICENSE_KEY</var>&prometheus_server=<var>YOUR_DATA_SOURCE_NAME</var>
    ```
+   *This approach is discouraged as it is preferable not to pass credentials in the url*

No, I think that's fine. I'd change it slightly to:

"This approach passes credentials in the URL. We don't recommend using it unless one of these other approaches doesn't work in your environment."

What do you think @cmacnaug?

cmacnaug cmacnaug commented on code on Jan 03, 2022 17:40 UTC
Code Review
src/content/docs/infrastructure/prometheus-integrations/install-configure-remote-write/set-your-prometheus-remote-write-integration.mdx:1
@@ -34,18 +34,29 @@ Go to the [Prometheus remote write setup launcher in New Relic One](https://one.
 
    Use the following syntax:
 
+   **Prometheus v2.26 and newer**
+   ``` 
+   remote_write: 
+   - url: https://metric-api.newrelic.com/prometheus/v1/write?prometheus_server=<var>YOUR_DATA_SOURCE_NAME</var>  
+     authorization:
+       credentials: <var>YOUR_LICENSE_KEY</var>
+   ```
+
+   **Prometheus older than v2.26**
    ```
    remote_write: 
    - url: https://metric-api.newrelic.com/prometheus/v1/write?prometheus_server=<var>YOUR_DATA_SOURCE_NAME</var>  
      bearer_token:<var>YOUR_LICENSE_KEY</var>
    ```
-
-   OR
-
+   
+   OR 
+   
+   **Any Prometheus version**
    ```
    remote_write: 
    - url: https://metric-api.newrelic.com/prometheus/v1/write?X-License-Key=<var>YOUR_LICENSE_KEY</var>&prometheus_server=<var>YOUR_DATA_SOURCE_NAME</var>
    ```
+   *This passes credentials in the URL. We don't recommend using it.*

   *This approach passes credentials in the URL. We don't recommend using it unless one of these other approaches doesn't work in your environment.*

cmacnaug cmacnaug commented on code on Jan 03, 2022 17:41 UTC
Code Review
src/content/docs/infrastructure/prometheus-integrations/install-configure-remote-write/set-your-prometheus-remote-write-integration.mdx:1
@@ -34,18 +34,29 @@ Go to the [Prometheus remote write setup launcher in New Relic One](https://one.
 
    Use the following syntax:
 
+   **Prometheus v2.26 and newer**
+   ``` 
+   remote_write: 
+   - url: https://metric-api.newrelic.com/prometheus/v1/write?prometheus_server=<var>YOUR_DATA_SOURCE_NAME</var>  
+     authorization:
+       credentials: YOUR_LICENSE_KEY
+   ```
+
+   **Prometheus older than v2.26**
    ```
    remote_write: 
    - url: https://metric-api.newrelic.com/prometheus/v1/write?prometheus_server=<var>YOUR_DATA_SOURCE_NAME</var>  
      bearer_token:<var>YOUR_LICENSE_KEY</var>
    ```
-
-   OR
-
+   
+   OR 
+   
+   **Any Prometheus version**
    ```
    remote_write: 
    - url: https://metric-api.newrelic.com/prometheus/v1/write?X-License-Key=<var>YOUR_LICENSE_KEY</var>&prometheus_server=<var>YOUR_DATA_SOURCE_NAME</var>
    ```
+   *This approach is discouraged as it is preferable not to pass credentials in the url*

Works for me, Thanks. I think based on Tyler's testing we should be good to go with these changes.

paperclypse paperclypse approved these changes on Jan 04, 2022 00:02 UTC
Approved Reviewer

Looks good!

paperclypse paperclypse commented on Jan 04, 2022 00:03 UTC
Contributor

I'll get this merged in as soon as the checks pass @cmacnaug

Reviewers
Assignees
cmacnaug cmacnaug
Labels
risk: low confidence: 79.8% reviewed sensitive_module
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 43.5% (MEDIUM) · Higher = larger blast radius
43.5%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 79.8% · Lower = rushed or shallow review
79.8%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 8.8% · Safe to merge
8.8%