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

add http collector timeouts; fixes #1064 #1310

Merged
merged 4 commits into from
Sep 1, 2023

Conversation

arcolife
Copy link
Contributor

@arcolife arcolife commented Aug 25, 2023

Description, Motivation and Context

add http collector timeouts

Fixes #1064

Checklist

  • New and existing tests pass locally with introduced changes.
  • Tests for the changes have been added (for bug fixes / features)
  • The commit message(s) are informative and highlight any breaking changes
  • Any documentation required has been added/updated. For changes to https://troubleshoot.sh/ create a PR here

Does this PR introduce a breaking change?

  • Yes
  • No

adds the feature for both v1beta1 and v1beta2

@CLAassistant
Copy link

CLAassistant commented Aug 25, 2023

CLA assistant check
All committers have signed the CLA.

@arcolife arcolife added the type::feature New feature or request label Aug 25, 2023
@arcolife arcolife marked this pull request as ready for review August 25, 2023 07:20
@arcolife arcolife requested a review from a team as a code owner August 25, 2023 07:20
Copy link
Member

@banjoh banjoh left a comment

Choose a reason for hiding this comment

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

Your changes LGTM. I added one comment to address an improvement to some of the old code

I suggest we add some tests here. There are no tests for this collector unfortunately, so its a start from scratch

pkg/collect/http.go Outdated Show resolved Hide resolved
@banjoh
Copy link
Member

banjoh commented Aug 25, 2023

Probably on your radar already, either way, remember to create a PR with the docs change.

The collector parameters do not mention the HTTP methods (again, legacy issue). I suggest we add this to the docs as we add this new parameter so that the documentation represents such a hierachy

get|post|put - http method used to make the request
   - url: ....
   - insecureVerify: ....
   - ...

I did something like this replicatedhq/troubleshoot.sh#522

@banjoh
Copy link
Member

banjoh commented Aug 25, 2023

I did something like this replicatedhq/troubleshoot.sh#522

My change led to the docs looking like https://troubleshoot.sh/docs/collect/custom-metrics/#parameters

@arcolife
Copy link
Contributor Author

@banjoh I'll make the changes as per our discussions but really would've written it like this:

collectors:
    - http:
        collectorName: healthz
        url: https://example.com/
        method: get
        headers: ...

..for these purposes:

  • Avoid unnecessary nested levels thereby reducing chances of indentation errors
  • Removes the ambiguity while specifying multiple methods.
  • And we don't have to specify any special lint instructions in the doc.

Not sure what this breaks though (support bundle analysis, breaking changes in customer envs etc), so I wouldn't do it right away.

@banjoh
Copy link
Member

banjoh commented Aug 29, 2023

Not sure what this breaks though (support bundle analysis, breaking changes in customer envs etc), so I wouldn't do it right away.

Agreed. It would look cleaner this way but the migration effort to adopt this outweighs the benefits IMHO

pkg/collect/http_test.go Outdated Show resolved Hide resolved
Archit Sharma added 3 commits September 1, 2023 15:49
Signed-off-by: Archit Sharma <archit@replicated.com>
…#1064)

Signed-off-by: Archit Sharma <archit@replicated.com>
Signed-off-by: Archit Sharma <archit@replicated.com>
@arcolife arcolife force-pushed the collector-timeout branch 2 times, most recently from a054d83 to 200d155 Compare September 1, 2023 10:31
@arcolife arcolife marked this pull request as draft September 1, 2023 11:32
@arcolife arcolife marked this pull request as ready for review September 1, 2023 12:35
@arcolife arcolife requested a review from banjoh September 1, 2023 12:35
@arcolife arcolife force-pushed the collector-timeout branch 2 times, most recently from 420a5d1 to c39e7f7 Compare September 1, 2023 13:25
Signed-off-by: Archit Sharma <archit@replicated.com>
@arcolife arcolife merged commit 24c6278 into replicatedhq:main Sep 1, 2023
22 checks passed
@arcolife arcolife deleted the collector-timeout branch September 1, 2023 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

http collector timeouts
3 participants