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

Monitoring improvements #616

Closed
wants to merge 13 commits into from
Closed

Monitoring improvements #616

wants to merge 13 commits into from

Conversation

metacosm
Copy link
Collaborator

Fixes #598

@metacosm metacosm requested a review from csviri October 21, 2021 20:48
@@ -4,4 +4,13 @@

CustomResourceID getRelatedCustomResourceID();

Type getType();

default boolean isDeleteEvent() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think this is actually a better model. Do I understand it correctly , that this is just to handle differentiation between delete and other events? The current way although it's not nicely abstracted, but it's quite descriptive.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure what the best way would be but having the event handler be aware of specific event types and have specific behavior to handle them is a sign that something is wrong with the implementation, in my opinion. I agree, though, that probably no other event sources will produce events with the type DELETED… so it is indeed also artificial to do it this way.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I thing it was better before, since these events will be used also possible by users of the framework who implements an EventSource, so we should keep it as clean as possible for them.


public interface Metrics {
Metrics NOOP = new Metrics() {};

default void processingEvent(Event event) {}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this really what we should measure? Isn't that the number of reconciliations in this case actually. Since we tried to move away from events.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it measures the number of reconciliation requests. The thinking was that it might be interesting to see how many reconciliation requests happened vs. the number of reconciliations that actually went through (processedEvent).

Copy link
Collaborator

@csviri csviri Oct 25, 2021

Choose a reason for hiding this comment

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

Shouldn't we rename the method accordingly? Like reconcilingStarted, reconcilingFinished, reconcilingFailed ?


public ExecutionScope(R customResource, RetryInfo retryInfo) {
ExecutionScope(R customResource, RetryInfo retryInfo, Event triggeringEvent) {
Copy link
Collaborator

@csviri csviri Oct 25, 2021

Choose a reason for hiding this comment

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

This is actually meant before, do we really need this event? The idea was that from a certain layer we don't work with the events at all, not even in our internal classes, just with the marker. Note that usually it can be multiple event's that received and triggered the execution.

@@ -280,7 +249,7 @@ private void handleRetryOnException(ExecutionScope<R> executionScope) {
if (eventPresent) {
log.debug("New events exists for for resource id: {}",
customResourceID);
submitReconciliationExecution(customResourceID);
submitReconciliationExecution(executionScope.getTriggeringEvent());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here, cannot we avoid using the event?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Well, the event provide more information about what happened. We could not have that information but the recording would be less interesting I think. Look at the MicrometerMetrics implementation to see how it's used.

@csviri
Copy link
Collaborator

csviri commented Oct 26, 2021

Replaced by this PR: #622

@csviri csviri closed this Oct 26, 2021
@metacosm metacosm deleted the monitoring-improvements branch October 26, 2021 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants