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

feat: add prometheus.write.queue bearer token auth #1914

Conversation

freak12techno
Copy link
Contributor

@freak12techno freak12techno commented Oct 17, 2024

PR Description

Which issue(s) this PR fixes

Fixes #1913

Notes to the Reviewer

PR Checklist

  • CHANGELOG.md updated
  • Documentation added
  • Tests updated
  • Config converters updated

@CLAassistant
Copy link

CLAassistant commented Oct 17, 2024

CLA assistant check
All committers have signed the CLA.

@freak12techno freak12techno marked this pull request as ready for review October 17, 2024 16:01
@freak12techno freak12techno requested review from clayton-cornell and a team as code owners October 17, 2024 16:01
@freak12techno freak12techno force-pushed the add-prometheus-write-queue-bearer-token-auth branch from b9a5cb3 to 2867c13 Compare October 17, 2024 16:02
@freak12techno
Copy link
Contributor Author

@mattdurham mind taking a look?

@mattdurham
Copy link
Collaborator

Would like to see a validation so that you cannot set both bearer token and basic auth, with a test to catch that. Otherwise looks good!

`url` | `string` | Full URL to send metrics to. | | yes
`bearer_token` | `secret` | Bearer token to authenticate with. | | no
`write_timeout` | `duration` | Timeout for requests made to the URL. | `"30s"` | no
`retry_backoff` | `duration` | How often to wait between retries. | `1s` | no
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How often or how long?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@clayton-cornell I dont think he changed most of these, I think adding bearer_token triggered them to look different. I can create a separate PR for these doc comments related to backoff and flush interval.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I didn't, it's my IDE that apparently tried to format it, only thing I changed is adding this line and also fixing the typo (trigger -> triggered) in another one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might change it here as well though if you prefer

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handling it in #1917

`retry_backoff` | `duration` | How often to wait between retries. | `1s` | no
`max_retry_attempts` | Maximum number of retries before dropping the batch. | `0` | no
`batch_count` | `uint` | How many series to queue in each queue. | `1000` | no
`flush_interval` | `duration` | How often to wait until sending if `batch_count` is not triggered. | `1s` | no
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question.. often or long? If we say "how often" it doesn't make sense to me.. Wait 6 times (would be how often) vs Wait 2 minutes (would be how long).

@clayton-cornell clayton-cornell dismissed their stale review October 17, 2024 17:14

Clicked too soon

@clayton-cornell clayton-cornell added the type/docs Docs Squad label across all Grafana Labs repos label Oct 17, 2024
@mattdurham
Copy link
Collaborator

mattdurham commented Oct 17, 2024

@freak12techno I will follow up on the docs items in #1917 , has long as @clayton-cornell is good with the bearer token text.

Copy link
Contributor

@clayton-cornell clayton-cornell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, no blocks from docs side

Copy link
Collaborator

@mattdurham mattdurham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@mattdurham mattdurham merged commit a4a8e0f into grafana:main Oct 17, 2024
15 of 16 checks passed
@freak12techno
Copy link
Contributor Author

okay @mattdurham I didn't get a chance to add tests + validations before this got merged :( should I make another PR adding it, or would you add it in your PR?

@freak12techno freak12techno deleted the add-prometheus-write-queue-bearer-token-auth branch October 17, 2024 20:37
@mattdurham
Copy link
Collaborator

I can handle it, I jumped the gun on it

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age type/docs Docs Squad label across all Grafana Labs repos
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add bearer auth for prometheus.write.queue
4 participants