Skip to content
This repository has been archived by the owner on Mar 6, 2020. It is now read-only.

add per-client subscriptions #40

Merged
merged 5 commits into from
Aug 9, 2016
Merged

Conversation

cwjohnston
Copy link
Contributor

This change set implements the per-client subscription feature as described in
sensu/sensu#1327:

The Sensu client should automatically create a subscription called
clint:client-name (e.g. client:i-424242) for every client. This will allow
for other features in Sensu to target specific clients or groups of clients
using subscriptions.

This feature is intended to support per-client silencing via the new silence API
described in sensu/sensu#1328

This change set implements the per-client subscription feature as described in
sensu/sensu#1327:

> The Sensu client should automatically create a subscription called
>  `clint:client-name` (e.g. `client:i-424242`) for every client. This will allow
> for other features in Sensu to target specific clients or groups of clients
> using subscriptions.

This feature is intended to support per-client silencing via the new silence API
described in sensu/sensu#1328
@portertech
Copy link
Contributor

I am not a fan of tacking this onto load_client_env(), perhaps it should live in a method like load_client_overrides() etc?

@cwjohnston
Copy link
Contributor Author

@portertech I've moved the implementation into its own method. Are tests 👌 as-is?

@runningman84
Copy link

Please make the optional or add some kind of standalone mode as I my pull request does. Otherwise this feature will break snssqs transport.

@portertech
Copy link
Contributor

@runningman84 a Sensu Transport that does not support Sensu's model must be able to handle such actions with an appropriate no-op.

@runningman84
Copy link

@portertech I have already done some modifications in order to handle this. But I need to know if the process is running in a client or server in order to handle things differently. Can you pass the type to the transport or is there a method to find this out?

@portertech
Copy link
Contributor

@cwjohnston 👍

@portertech
Copy link
Contributor

@cwjohnston the new method is still being called from within load_env(), which is no good, as configuration will still override the subscriptions. Check out the application order:

@loader.load_env

@runningman84
Copy link

@portertech this are my modifications:
runningman84/sensu-transport-snssqs@56c4518
General speaking it seems to work but the sensu client has 100% CPU load. Maybe I messed up some EM stuff. Do you see any problem in my code? As you can see I need to know if it is running as a client or server.

@troyready
Copy link

@runningman84 see Sean's suggestion at sensu/sensu#1327 (comment)

I could try to whip up a sensu-transport-snssqs PR for it unless you'd like to?

@runningman84
Copy link

runningman84 commented Aug 3, 2016

@troyready a PR would be really great. My ruby EM knowhow is quite limited.

@cwjohnston cwjohnston force-pushed the feature/per-client-subscription branch from cd7525c to f831c38 Compare August 3, 2016 19:43
@cwjohnston
Copy link
Contributor Author

cwjohnston commented Aug 4, 2016

The sensu-transport-snssqs issues are presumed to be resolved with v2.0.4 earlier today. @portertech is this ready to go?

@portertech
Copy link
Contributor

@cwjohnston this looks good.

1106

@portertech portertech merged commit 194d81e into master Aug 9, 2016
@portertech portertech deleted the feature/per-client-subscription branch August 9, 2016 16:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants