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 an endpoint to KOTS where application metrics can be retrieved adhoc #4060

Merged

Conversation

sgalsaleh
Copy link
Member

@sgalsaleh sgalsaleh commented Oct 6, 2023

What this PR does / why we need it:

Adds an endpoint to KOTS where application metrics can be retrieved adhoc to facilitate the KOTS/SDK integration and telemetry reconciliation.

Which issue(s) this PR fixes:

Fixes SC-88179

Special notes for your reviewer:

Example responses:

  • Valid license ID:
$ curl -s -H 'Authorization: <valid-license-id>' 10.43.247.154:3000/api/v1/app/metrics | jq .
{
  "X-Replicated-AppStatus": "ready",
  "X-Replicated-ClusterID": "qqtiozrovtsrtgibwfwvydghauchpmhw",
  "X-Replicated-DownstreamChannelID": "2TiLbGfE9YRXAPM2JCD9STfS11B",
  "X-Replicated-DownstreamChannelSequence": "18",
  "X-Replicated-DownstreamSequence": "1",
  "X-Replicated-DownstreamSource": "Upstream Update",
  "X-Replicated-GitOpsProvider": "",
  "X-Replicated-InstallStatus": "failed",
  "X-Replicated-InstanceID": "2W2EEjXOPlO7kdWRVtX7FetgCMp",
  "X-Replicated-IsGitOpsEnabled": "false",
  "X-Replicated-IsKurl": "true",
  "X-Replicated-K8sDistribution": "k3s",
  "X-Replicated-K8sVersion": "v1.20.2+k3s1",
  "X-Replicated-KotsInstallID": "dev-1pu4oeY162e2pbLpK4JubK6hxrX",
  "X-Replicated-KurlNodeCountReady": "1",
  "X-Replicated-KurlNodeCountTotal": "1",
  "X-Replicated-NativeHelmInstalls": "0",
  "X-Replicated-ReplHelmInstalls": "0",
  "X-Replicated-SkipPreflights": "true"
}
  • Invalid license ID:
$ curl -s -H 'Authorization: invalid-license-id' 10.43.247.154:3000/api/v1/app/metrics | jq .
{
  "error": "license ID is not valid",
  "success": false
}
  • No authorization header / license ID:
$ curl -s 10.43.247.154:3000/api/v1/app/metrics | jq .
{
  "error": "missing authorization header",
  "success": false
}

Steps to reproduce

Does this PR introduce a user-facing change?

NONE

Does this PR require documentation?

NONE

@sgalsaleh sgalsaleh requested a review from cbodonnell October 6, 2023 23:15
@sgalsaleh sgalsaleh changed the title Salah/sc 88179/add an endpoint to kots where application Add an endpoint to KOTS where application metrics can be retrieved adhoc Oct 6, 2023
@sgalsaleh sgalsaleh added the type::feature New feature or request label Oct 6, 2023
@sgalsaleh sgalsaleh force-pushed the salah/sc-88179/add-an-endpoint-to-kots-where-application branch 2 times, most recently from aa800c0 to f0c4878 Compare October 6, 2023 23:44
@sgalsaleh sgalsaleh force-pushed the salah/sc-88179/add-an-endpoint-to-kots-where-application branch from f0c4878 to e139fd9 Compare October 6, 2023 23:45
@sgalsaleh sgalsaleh merged commit 5705b14 into main Oct 9, 2023
78 checks passed
@sgalsaleh sgalsaleh deleted the salah/sc-88179/add-an-endpoint-to-kots-where-application branch October 9, 2023 17:47
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.

2 participants