-
Notifications
You must be signed in to change notification settings - Fork 215
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
Connect probers and notifiers by Channel #108
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but maybe wait for another reviewer as these changes where a bit too much for my Go knowledge, and i'm not sure i fully understood the code. Will do a build/run test shortly and update with any details I find.
Well done @haoel
@@ -59,6 +59,8 @@ const ( | |||
DefaultProbeInterval = time.Second * 60 | |||
// DefaultTimeOut is 30 seconds | |||
DefaultTimeOut = time.Second * 30 | |||
// DefaultChannelName is the default wide channel name | |||
DefaultChannelName = "__EaseProbe_Channel__" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what will happen if i define this as a channel name or i define a probe to use it like
channels: [ __EaseProbe_Channel__ ]
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would be considered the default channel, it would be grouped with all of the probers and notifiers who have not defined the channel.
What's the problem the PR will solve? If we want to let users can config which notification can be applied to the prober, I don't think we should expose the |
The channel is not the Go concept, it's the channel literally. To design like this, we have several considerations.
Theoretically, this is an N x M relationship model, introducing a referring object would be the best practice. You can take a look the discussion #82 to have more information. |
Co-authored-by: Pantelis Roditis <[email protected]>
OK, got it. It's better to relate the issue with the PR in its description. So reviewers can easy to know the background of the PR. BTW, Why don't we choose the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mainly added some suggestions for improving code readability,for reference only.
Sounds like a very flexible, extensible design. 👍🏻 |
It's easy to do the naming work
But I think the @proditis & @nullsimon, what do you think? |
Lables and selector are great and commonly used,it's a kv store extension,and channels is just a one feature of them. If we have more new features,it is extensive. |
I just realize using
|
IMHO, the term channel represents different ways of sending notification, such as, we could treat email as a channel, SMS as another channel. The label helps us group different channels flexibly. So these terms would be much more intuitive to users and easy to use if we adopt them. |
Yeah,channel is just one dimension,labels and selector become two dimensions. For channel to probers and notifies is that they have a common base metadata,while another become a pub-sub thing. The More extensive the more complex. |
I like the common naming I dont have strong arguments for or against the change, though, so i leave the final decision to you guys. |
First of all, both of them have the same flexibility. Secondly, I believe different people like different terms, the intuition is subjective. Channel is business-specific, and Label/Selector is more general. If we want to make business sense, we should use the Channel, otherwise using Label/Selector. So, we must make the decision here. As the owner and PR author, I will make the final decision - Using the Channel for this version ;-) as this is based on the original discussion, and it's easier for coding work. Meanwhile, if we need the Label/Selector in the future, we still are open to doing that ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
> | ||
> 1) If you don't define the Channel, the default channel will be used for these probers and notifiers. The default channel name is `__EaseProbe_Channel__` | ||
> | ||
> 2) Versions of EaseProbe prior to v1.5.0, do not support the `channel` feature |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove the note from this spot and add it to the release notes of the next version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the major important feature, I think it's better to mention it in the user manual. like other software.
```YAML | ||
http: | ||
- name: probe A | ||
channels : [ Dev_Channel, Manager_Channel ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do the channel names need to follow any particular rules?
Such as no space, no symbols etc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like the limitation is just only for yaml file. If the chars can be accepted by yaml, then we can support that.
Co-authored-by: Pantelis Roditis <[email protected]>
Co-authored-by: Pantelis Roditis <[email protected]>
Co-authored-by: Pantelis Roditis <[email protected]>
This PR introduces the channel to connect the probers and notifiers.
For more information, please take a look the discussion #82
Example:
if we have the following configuration
Then, we will have the following diagram
Test
I've done the following test: