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: [sc-106625] http analyzer for in-cluster #1566

Merged
merged 2 commits into from
Jun 19, 2024

Conversation

nvanthao
Copy link
Member

@nvanthao nvanthao commented Jun 18, 2024

Story details: https://app.shortcut.com/replicated/story/106625

Changes

  • Refactor existing host HTTP analyzer code, move analyzing code into new function analyzeHTTPResult that will be re-used by in-cluster HTTP analyzer.

Sample spec

apiVersion: troubleshoot.sh/v1beta2
kind: SupportBundle
metadata:
  name: sample
spec:
  collectors:
    - http:
        collectorName: healthz
        get:
          url: https://dummyjson.com/test
          timeout: 5s
  analyzers:
    - http:
        collectorName: healthz
        outcomes:
          - warn:
              when: "error"
              message: Error connecting to dummyjson.com/test
          - pass:
              when: "statusCode == 200"
              message: Connected to dummyjson.com/test
          - warn:
              message: "Unexpected response"
apiVersion: troubleshoot.sh/v1beta2
kind: Preflight
metadata:
  name: sample
spec:
  collectors:
    - http:
        collectorName: healthz
        get:
          url: https://dummyjson.com/test
          timeout: 5s
  analyzers:
    - http:
        collectorName: healthz
        outcomes:
          - warn:
              when: "error"
              message: Error connecting to dummyjson.com/test
          - pass:
              when: "statusCode == 200"
              message: Connected to dummyjson.com/test
          - warn:
              message: "Unexpected response"

@nvanthao nvanthao added the type::feature New feature or request label Jun 18, 2024
@nvanthao nvanthao requested a review from a team as a code owner June 18, 2024 03:05
@nvanthao nvanthao force-pushed the gerard/sc-106625/http-analyzer-in-cluster branch from 0b3aecc to 273bb16 Compare June 18, 2024 03:22
@nvanthao nvanthao force-pushed the gerard/sc-106625/http-analyzer-in-cluster branch from 273bb16 to fd6a9dc Compare June 18, 2024 07:09
Copy link
Member

@DexterYan DexterYan left a comment

Choose a reason for hiding this comment

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

LGTM

@nvanthao
Copy link
Member Author

Many thanks @DexterYan !

@nvanthao nvanthao merged commit edfa01c into main Jun 19, 2024
27 checks passed
@nvanthao nvanthao deleted the gerard/sc-106625/http-analyzer-in-cluster branch June 19, 2024 02:14
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.

None yet

2 participants