Skip to content

usagereporter: on-prem dial home#23916

Merged
espadolini merged 34 commits intomasterfrom
espadolini/usagereporter-onprem
Apr 5, 2023
Merged

usagereporter: on-prem dial home#23916
espadolini merged 34 commits intomasterfrom
espadolini/usagereporter-onprem

Conversation

@espadolini
Copy link
Copy Markdown
Contributor

@espadolini espadolini commented Mar 31, 2023

This PR implements the public changes to Teleport for the implementation of gravitational/cloud#3830. Proto changes depend on gravitational/cloud#4018.

Will be enabled by gravitational/teleport.e#1061.

@espadolini espadolini force-pushed the espadolini/usagereporter-onprem branch 2 times, most recently from b410a65 to cad19c7 Compare April 3, 2023 09:44
Copy link
Copy Markdown
Collaborator

@zmb3 zmb3 left a comment

Choose a reason for hiding this comment

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

This implementation seems a bit over complicated for the task at hand. I worry that we're somewhat mis-using a number of concurrency primitives (contexts, waitgroups, and muteness).

Comment thread lib/service/service.go Outdated
Comment thread lib/usagereporter/teleport/aggregating/reporter.go Outdated
Comment thread lib/usagereporter/teleport/aggregating/reporter.go Outdated
Comment thread lib/usagereporter/teleport/aggregating/reporter.go Outdated
@espadolini
Copy link
Copy Markdown
Contributor Author

@zmb3 a913ac50a4c322742530c9062ef4b38342042854 reworks the Reporter logic - it's a lot more straightforward now, PTAL.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't understand the semantics here - what is the passed in context used for?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Documented in the interface in 91b75dc:

	// GracefulStop gracefully closes and runs any finalization needed by the
	// UsageReporter; operations can run as long as the context is alive, but
	// must terminate quickly (even losing data) if the context is closed.
	// Returns nil if operations have completed cleanly.
	GracefulStop(context.Context) error

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In the case of the aggregating.Reporter, closing the context that's passed in will trigger the closing of the base context, and thus all closing operations ungracefully (and quickly) fail.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
}).Errorf("Failed to send usage reports.")
}).Error("Failed to send usage reports.")

@espadolini espadolini force-pushed the espadolini/usagereporter-onprem branch from 199cc77 to 766011c Compare April 4, 2023 08:53
This includes a move to prehog.v1 for the new rpc and messages
This renames imports of ".../prehog/v1alpha" from prehogv1a to prehogv1,
and imports of ".../prehog/v1alpha/prehogv1alphaconnect" from prehogv1c
to prehogv1ac, to avoid confusion with imports of the newly added
".../prehog/v1" and ".../prehog/v1/prehogv1connect".
@public-teleport-github-review-bot
Copy link
Copy Markdown

@espadolini - this PR will require admin approval to merge due to its size. Consider breaking it up into a series smaller changes.

@espadolini
Copy link
Copy Markdown
Contributor Author

Sorry for the noise, the manual merge lost its correct parents

@espadolini espadolini added this pull request to the merge queue Apr 5, 2023
@espadolini espadolini removed this pull request from the merge queue due to a manual request Apr 5, 2023
@espadolini
Copy link
Copy Markdown
Contributor Author

Waiting for gravitational/cloud#4018 to confirm the .proto changes

@espadolini espadolini enabled auto-merge April 5, 2023 19:09
@espadolini espadolini added this pull request to the merge queue Apr 5, 2023
Merged via the queue into master with commit c296b77 Apr 5, 2023
@espadolini espadolini deleted the espadolini/usagereporter-onprem branch April 5, 2023 19:40
espadolini added a commit that referenced this pull request Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants