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

Enhance Notification with Channels. #226

Closed
1 of 3 tasks
xellos00 opened this issue Aug 11, 2022 · 17 comments
Closed
1 of 3 tasks

Enhance Notification with Channels. #226

xellos00 opened this issue Aug 11, 2022 · 17 comments
Assignees
Labels
area:svc Anything related to Vatz Service. type:enhancement Any enhancement for feature or anything type:feature-development Any development regarding Vatz service/plugin, etc. Vatz Project Name

Comments

@xellos00
Copy link
Member

xellos00 commented Aug 11, 2022


Checklist

  • New Feature for the Service/Plugin (Vatz)
  • Enhancement (Vatz)
  • others(etc. e.g, documentation, project policy management)

Is your feature request related to a problem? Please describe.

A clear and concise description of what the problem is. such as Ex. I'm always frustrated

I'm always frustrated we didn't deal with our notification through channels

  • I want this to dispatcher send a notification only registered channels that is defined in default.yaml

Describe the solution you'd like| Ex

A clear and concise description of what you want to happen

Let's set up a notification channels as below
image

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you have considered.

Additional context or comment

Add any other context or screenshots about the feature request here.

@xellos00 xellos00 added Vatz Project Name type:feature-development Any development regarding Vatz service/plugin, etc. labels Aug 11, 2022
@xellos00 xellos00 added area:svc Anything related to Vatz Service. type:enhancement Any enhancement for feature or anything labels Aug 11, 2022
@xellos00 xellos00 added this to the Sprint 15 ( ~ 2022-08-17) milestone Aug 11, 2022
@xellos00 xellos00 self-assigned this Aug 11, 2022
@xellos00
Copy link
Member Author

xellos00 commented Aug 11, 2022

@Choi-Jinhong
Can you understand issue above?
once #224 has finished and closed, I want you to start this issue.

@gnongs
Copy link
Member

gnongs commented Aug 17, 2022

I would like to change the yaml file as below.
@xellos00 Could you give me your opinion?

vatz_protocol_info:
  protocol_identifier: "VATZ"
  port: 9090
  notification_info:
    host_name: "put your host name here"
    dispatch_channels:
      - channel: "discord"
        secret: "Your secert"
      - channel: "pagerduty"
        secret: "Your secret"
  health_checker_schedule:
    - "0 1 * * *"
plugins_infos:
  default_verify_interval: 15
  default_execute_interval: 30
  default_plugin_name: "vatz-plugin"
  plugins:
    - plugin_name: "sample1"
      plugin_address: "localhost"
      plugin_port: 9091
      executable_methods:
        - method_name: "sampleMethod1"
    - plugin_name: "sample2"
      plugin_address: "localhost"
      verify_interval: 7
      execute_interval: 9
      plugin_port: 10002
      executable_methods:
        - method_name: "sampleMethod2"

@xellos00
Copy link
Member Author

xellos00 commented Aug 17, 2022

I would like to change the yaml file as below.

@xellos00 Could you give me your opinion?

vatz_protocol_info:

  protocol_identifier: "VATZ"

  port: 9090

  notification_info:

    dispatch_channels:

      - channel: "discord"

        secret: "Your secert"

      - channel: "pagerduty"

        secret: "Your secret"

  health_checker_schedule:

    - "0 1 * * *"

plugins_infos:

  default_verify_interval: 15

  default_execute_interval: 30

  default_plugin_name: "vatz-plugin"

  plugins:

    - plugin_name: "sample1"

      plugin_address: "localhost"

      plugin_port: 9091

      executable_methods:

        - method_name: "sampleMethod1"

    - plugin_name: "sample2"

      plugin_address: "localhost"

      verify_interval: 7

      execute_interval: 9

      plugin_port: 10002

      executable_methods:

        - method_name: "sampleMethod2"

better than my sample😎 btw Please, add host_name as well.

@gnongs
Copy link
Member

gnongs commented Aug 17, 2022

I would like to change the yaml file as below.
@xellos00 Could you give me your opinion?

vatz_protocol_info:

  protocol_identifier: "VATZ"

  port: 9090

  notification_info:

    dispatch_channels:

      - channel: "discord"

        secret: "Your secert"

      - channel: "pagerduty"

        secret: "Your secret"

  health_checker_schedule:

    - "0 1 * * *"

plugins_infos:

  default_verify_interval: 15

  default_execute_interval: 30

  default_plugin_name: "vatz-plugin"

  plugins:

    - plugin_name: "sample1"

      plugin_address: "localhost"

      plugin_port: 9091

      executable_methods:

        - method_name: "sampleMethod1"

    - plugin_name: "sample2"

      plugin_address: "localhost"

      verify_interval: 7

      execute_interval: 9

      plugin_port: 10002

      executable_methods:

        - method_name: "sampleMethod2"

better than my sample😎 btw Please, add host_name as well.

How about channel_type ?

@xellos00
Copy link
Member Author

@Choi-Jinhong
I mean host_name for notification to recognize which machine has sent notification.
what's channel_type for?

@gnongs
Copy link
Member

gnongs commented Aug 17, 2022

I mean host_name for notification to recognize which machine has sent notification.

Sorry. I misunderstand. I thought channel-typewould be clearer thanchannel, so I said it would be better to change it to channel-type`.

Could I change it as below?

vatz_protocol_info:
  protocol_identifier: "VATZ"
  port: 9090
  notification_info:
    host_name: "Your machine name"
    dispatch_channels:
      - channel_type: "discord"
        secret: "Your secert"
      - channel_type: "pagerduty"
        secret: "Your secret"
  health_checker_schedule:
    - "0 1 * * *"
plugins_infos:
  default_verify_interval: 15
  default_execute_interval: 30
  default_plugin_name: "vatz-plugin"
  plugins:
    - plugin_name: "sample1"
      plugin_address: "localhost"
      plugin_port: 9091
      executable_methods:
        - method_name: "sampleMethod1"
    - plugin_name: "sample2"
      plugin_address: "localhost"
      verify_interval: 7
      execute_interval: 9
      plugin_port: 10002
      executable_methods:
        - method_name: "sampleMethod2"

@xellos00
Copy link
Member Author

xellos00 commented Aug 17, 2022

I mean host_name for notification to recognize which machine has sent notification.

Sorry. I misunderstand. I thought channel-typewould be clearer thanchannel, so I said it would be better to change it to channel-type`.

Could I change it as below?

vatz_protocol_info:
  protocol_identifier: "VATZ"
  port: 9090
  notification_info:
    host_name: "Your machine name"
    dispatch_channels:
      - channel_type: "discord"
        secret: "Your secert"
      - channel_type: "pagerduty"
        secret: "Your secret"
  health_checker_schedule:
    - "0 1 * * *"
plugins_infos:
  default_verify_interval: 15
  default_execute_interval: 30
  default_plugin_name: "vatz-plugin"
  plugins:
    - plugin_name: "sample1"
      plugin_address: "localhost"
      plugin_port: 9091
      executable_methods:
        - method_name: "sampleMethod1"
    - plugin_name: "sample2"
      plugin_address: "localhost"
      verify_interval: 7
      execute_interval: 9
      plugin_port: 10002
      executable_methods:
        - method_name: "sampleMethod2"

I prefer channel than channel_type for me.
you can add and find out for everyone to review because It doesn't matter that much, I guess.

@gnongs
Copy link
Member

gnongs commented Aug 17, 2022

I mean host_name for notification to recognize which machine has sent notification.

Sorry. I misunderstand. I thought channel-typewould be clearer thanchannel, so I said it would be better to change it to channel-type`.
Could I change it as below?

vatz_protocol_info:
  protocol_identifier: "VATZ"
  port: 9090
  notification_info:
    host_name: "Your machine name"
    dispatch_channels:
      - channel_type: "discord"
        secret: "Your secert"
      - channel_type: "pagerduty"
        secret: "Your secret"
  health_checker_schedule:
    - "0 1 * * *"
plugins_infos:
  default_verify_interval: 15
  default_execute_interval: 30
  default_plugin_name: "vatz-plugin"
  plugins:
    - plugin_name: "sample1"
      plugin_address: "localhost"
      plugin_port: 9091
      executable_methods:
        - method_name: "sampleMethod1"
    - plugin_name: "sample2"
      plugin_address: "localhost"
      verify_interval: 7
      execute_interval: 9
      plugin_port: 10002
      executable_methods:
        - method_name: "sampleMethod2"

I prefer channel than channel_type for me. you can add and find out for everyone to review because It doesn't matter that much, I guess.

Then I think we can just proceed with channel :D

@gnongs
Copy link
Member

gnongs commented Aug 23, 2022

TODOs

  • Make a new channel type.
  • Edit dispatcher that can read multi-channel on default.yaml.
  • When ./vatz init, modify the contents of the file that appears at this time.

@xellos00 Could I ask you questions?

  • What do I develop channel first? telegram? pagerduty?
  • Is the resource_type the variable that checks the criteria of the channel to be sent in the message?

@xellos00
Copy link
Member Author

  • resource_type

I am going to resolve issue for PR #235, It would contain sample code for telegram, You can start from that point.
I mainly put resource_type as plugin identifier previously if you have somewhat idea to deal with resource_type, let me know. Thanks

@gnongs
Copy link
Member

gnongs commented Aug 24, 2022

I mainly put resource_type as plugin identifier previously if you have somewhat idea to deal with resource_type, let me know. Thanks

@xellos00 If resource type is a variable containing information about the plug-in, I think we need a new variable for channel.

@xellos00
Copy link
Member Author

xellos00 commented Aug 29, 2022

@Choi-Jinhong
I still don't get your point, what do we need for new variable for channel?
Let me know if there's further point that we need discuss.

@gnongs
Copy link
Member

gnongs commented Aug 30, 2022

@Choi-Jinhong

I still don't get your point, what do we need for new variable for channel?

Let me know if there's further point that we need discuss.

I think I got confused with the way that send messages.

@xellos00
Copy link
Member Author

@Choi-Jinhong
I will create a issue to Notification Enhancement as good first issue to deal child issues.

@xellos00
Copy link
Member Author

@gnongs
I think you don't need to worry about sync with compatibility with previous version for config.
Let's let them update it all together, let them update and re-run their plugins with vatz, until we settle proper way to do it.

@gnongs
Copy link
Member

gnongs commented Sep 17, 2022

@gnongs I think you don't need to worry about sync with compatibility with previous version for config. Let's let them update it all together, let them update and re-run their plugins with vatz, until we settle proper way to do it.

@xellos00
First, I will develop it so that it can be used in parallel with the previous method.

@xellos00
Copy link
Member Author

I think you need to have following TODOs

    1. Config update
notification_info: [
{ channel: telegram,  secret: `...` , chatId: `...` },
{ channel: discord,   secret: `...` },
]

    1. GetDispatchers
    • secret 을 포함한다.
    • config를 읽어와서, 선언되 있는 dispatcher만 등록한다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:svc Anything related to Vatz Service. type:enhancement Any enhancement for feature or anything type:feature-development Any development regarding Vatz service/plugin, etc. Vatz Project Name
Projects
None yet
Development

No branches or pull requests

2 participants