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: reporting back installation and upgrade metrics #92

Conversation

ricardomaraschini
Copy link
Contributor

@ricardomaraschini ricardomaraschini commented Oct 3, 2023

Reporting back Installation, Join, and Upgrades data. This work is described in details here.

HelmVM adoption metrics

The reporting is based on events, some events will be generated by the installer (that this PR implements) and some by an operator running on the cluster (still to be implemented). The operator is responsible for keeping track of the nodes that compose the cluster while the installer is responsible for reporting installation, upgrades, and joins successes and failures.

These are the events reported through this PR:

  • InstallationStarted
  • InstallationSucceeded
  • InstallationFailed
  • UpgradeStarted
  • UpgradeSucceeded
  • UpgradeFailed
  • NodeUpgradeStarted
  • NodeUpgradeSucceeded
  • NodeUpgradeFailed
  • JoinStarted
  • JoinSucceeded
  • JoinFailed

This PR depends on https://github.com/replicatedhq/vandoor/pull/4333.

@ricardomaraschini ricardomaraschini force-pushed the ricardomaraschini/sc-89250/adoption-metrics-fire-events-for-install branch from efafc68 to 771dbeb Compare October 4, 2023 10:38
@ricardomaraschini ricardomaraschini force-pushed the ricardomaraschini/sc-89250/adoption-metrics-fire-events-for-install branch from 771dbeb to 7b46dd5 Compare October 4, 2023 10:57
@ricardomaraschini ricardomaraschini marked this pull request as ready for review October 4, 2023 13:52
encodedToken := bytes.NewBuffer(nil)
encoder := base64.NewEncoder(base64.StdEncoding, encodedToken)
marshaler := json.NewEncoder(encoder)
if err := marshaler.Encode(token); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

How about an Encode() function on the JoinToken struct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that makes sense. done.

url := fmt.Sprintf("%s/helmbin_metrics/%s", s.baseURL, ev.Title())
payload, err := s.payload(ev)
if err != nil {
logrus.Infof("unable to get payload for event %s: %s", ev.Title(), err)
Copy link
Member

Choose a reason for hiding this comment

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

Why is this info and the rest level debug?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

my bad, it should have been a debugf as well. fixed.

@ricardomaraschini ricardomaraschini force-pushed the ricardomaraschini/sc-89250/adoption-metrics-fire-events-for-install branch from 7011b73 to 4bb7cbf Compare October 5, 2023 10:04
@ricardomaraschini ricardomaraschini merged commit ab69c30 into main Oct 5, 2023
16 checks passed
@ricardomaraschini ricardomaraschini deleted the ricardomaraschini/sc-89250/adoption-metrics-fire-events-for-install branch October 5, 2023 13:59
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