sowawa / fluent-plugin-slack

132 stars 52 forks source link

Toward v2 #44

Open sonots opened 6 years ago

sonots commented 6 years ago

This issue describes a loadmap to v2.

Once release v1 (nothing is changed with v0.xx) to do semantic versioning, then work for v2.

Breaking changes:

  1. To fix https://github.com/sowawa/fluent-plugin-slack/issues/28, revert escaping special characters in message.
  2. By historical reasons, default values of some parameters are different with Slack API default values. Align with Slack API default values.
  3. Allow adding arbitrary slack parameters
  4. Migrate to Fluentd v0.14 (v1) API.

Allow adding arbitrary slack parameters

Slack API itself evolves, and will support new parameters. I want to support new parameters without updating slack plugin.

Maybe we can achieve by changing interfaces as:

<match slack>
  @type slack
  webhook_url https://hooks.slack.com/services/XXX/XXX/XXX
  <payload>
    channel general
    username sonots
    # arbitrary key=val parameters can be added
  </payload>
</match>

If we support only Fluentd >= v0.14.20, users can get dynamic values from nested records via record accessor as:

ref. https://www.fluentd.org/blog/fluentd-v0.14.20-has-been-released

<match slack>
  @type slack
  webhook_url https://hooks.slack.com/services/XXX/XXX/XXX
  <payload>
    channel $.foo.channel
    username $["username"]
    # arbitrary key=val parameters can be added
  </payload>
</match>

TODO: Test whether we can write ruby codes combined with record accessor as #{$.text..gsub(/&/, '&amp;').gsub(/</, '&lt;').gsub(/>/, '&gt;')} (hmm, looks not possible) so that users can write their own escaping function by themselves to support https://github.com/sowawa/fluent-plugin-slack/pull/22.

TODO: Think how to support nested parameters. Create config_section dynamically?

payload
  channel
  username
  attachments
     blah blah
rasheedamir commented 6 years ago

@sonots any idea when you will be able to work on this ticket?

sonots commented 6 years ago

No idea ...