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 the SDK where metrics can be retrieved adhoc #101

Merged

Conversation

sgalsaleh
Copy link
Member

What this PR does / why we need it:

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

Which issue(s) this PR fixes:

Fixes SC-90703

Special notes for your reviewer:

  • Valid license ID:
$ curl -s -H 'Authorization: 2MqOPWspoqXLAIBchNPJA87GOzM' 10.43.103.73:3000/api/v1/app/metrics | jq .
{
  "X-Replicated-AppStatus": "unavailable",
  "X-Replicated-ClusterID": "7262d9de-1a14-417e-bc58-e2f714776f0a",
  "X-Replicated-DownstreamChannelID": "2MqOAm2LeY9gsaqFwczXAoSfRtD",
  "X-Replicated-DownstreamChannelSequence": "69",
  "X-Replicated-InstanceID": "7262d9de-1a14-417e-bc58-e2f714776f0a",
  "X-Replicated-K8sDistribution": "k3s",
  "X-Replicated-K8sVersion": "v1.20.2+k3s1"
}
  • Invalid license ID:
$ curl -s -H 'Authorization: invalid' 10.43.103.73:3000/api/v1/app/metrics | jq .
{
  "error": "license ID is not valid",
  "success": false
}
  • No authorization header / license ID:
$ curl -s 10.43.103.73: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 9, 2023 22:52
cbodonnell
cbodonnell previously approved these changes Oct 10, 2023
cbodonnell
cbodonnell previously approved these changes Oct 10, 2023
@sgalsaleh sgalsaleh merged commit 12f946d into main Oct 10, 2023
10 checks passed
@sgalsaleh sgalsaleh deleted the salah/sc-90703/add-an-endpoint-to-the-sdk-where-metrics branch October 10, 2023 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants