Skip to content

Include other labels in notification outside the com.df namespace? #46

@dazinator

Description

@dazinator

At the moment, information about a service inlcuidng it's labels, are sent as query string values in the notification:

created notification to https://messengerserver:443/api/Service/Notification?distribute=true&madeup=foo&notify=true&replicas=1&serviceName=dummy-nginx (13 try)

Above, the madeup=foo is being sent by this swarm listener because the service has a label:

com.df.madeup=foo

So by virtue of the service having a label prefixed with com.df. that label value gets included in the notification with the com.df stripped.

I'd love to re-use this listener agent to forward notifications regarding services with labels relating to other custom functionality, that dockerflow does not currently provide any solutions for. For example, i'd like to label my services with custom labels that use the prefix io.messaging. and I'd like the swarm listener to be able to include those label values, not just com.df. labels values, in the notification.

I can work around this at present by:

  1. Use docker flow swarm listner to notify me about a new service
  2. Call back into swarm / docker api to inspect this new service and grab the additional custom label data I need myself

However things would be much more efficient if this label data could somehow be included in the original notification.

I would have thought that setting DF_NOTIFY_LABEL=io.messaging.notify may have changed things so that the listener only included labels with io.messaging. as the prefix but that is not the intention of that environment variable.

Would you be open to any change to facilitate this behaviour?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions