I don’t understand your last error… its not something i’m seeing here locally doing manually tests of the gem.
But regardless,
This handler won’t work without an update to its logic for Sensu Go
it’s making use of the Sensu Core event “subscribers” attribute
for some reason… which does not exist in the new event model.
So this handler has to be updated to work with Sensu Go.
It looks like subscribers was something I missed in the mapping logic.
I think it should translate into “subscriptions” now but I’ll need to double check.
Are you in contact with the upstream author? This plugin is outside of the sensu-plugins collection so I don’t have access to fix this directly.
No I’m not in contact with the upstream author. This isn’t even the plugin I want to use directly. I have a much much simpler custom written plivo plugin that was working with sensu-classic but I was having the same handler error I was having with this one.
If I could figure out how to package it up like you’ve done here I may be able to get that to work, but honestly I’m losing patience. F*cking 3 days of work to get a 25 line ruby script to execute. It’s just too damn complicated. I think it might be time for us to call time of death on sensu-go.
Packaging ruby up as assets is a little complicated, because of the runtime deps and the need for the ruby environment.
Assets are an advanced usage pattern, but if the ruby script is working you can get things working an a ruby env in the client just using a more traditional gem install process.
also how are you testing the handler manually? I think I’m having extra trouble here because I’m testing in the alpine image. AFAICT I can’t test it manually there, since there’s no ruby.
well that’s the rub right… if I put this into bonsai myself without being an active user of the service, this is going to probably bitrot…i’m not sure that’s the best thing.
What we need is someone invested in the service integration to take on primary maintainership.
no im not manually testing in alpine…no. I don’t use alpine day to day…so i don’t trust my ability to troubleshoot it.
Alpine is…fascinatingly…different from all the other linuxes…making some interesting choices like using musl for libc and ressl for ssl by default…
I’ll put it on github with all the automation necessary to get this working, but I’m not sure I want to maintain it my bonsai namespace as a thing people depend on. My bonsai namespace is very much “here by dragons” stuff… its my brand.
I’ll get it as far as knowing it builds I can test against the free plivo acount…but…beyond that… i dont want to overpromise
What are you doing to generate the asset tarball? I ask because the build/deploy scripting in the repo you forked right now is somewhat dependent on the travisCI environment and the scripting makes some assumptions about env vars provided and will fail to run if certain env_vars are not set. This is deliberate. It’s not really tuned for local assets builds. If I understood what you were doing to build the asset, that error might make more sense.
The details in the intended build process for these assets is in the .travis.xml with controls the travisCI environment. The meat of the asset build is in the deploy section, which runs a script taken from a helper repository (installed in travis pre_deploy) that I specifically spun up to provide best-practices for the community sensu-plugins collection so we can start generating assets as part of the regular github release process managed by TravisCI. It makes heavy use of Docker images for each target linux platform There’s room to improve the scripting further to make local builds easier to fire off.
I hadn’t had time yet to generate the asset as I was making sure the underlying handler worked. The last thing i did was fix the Plivo syntax error by manually testing the ruby gem using standard gem build/gem install sort of interatings. Actually, it might not be clear how to do that so let me be explicit.
I’m running a development Sensu backend on my network (on a raspi cluster…but that’s immaterial at the moment)… but i’m using sensuctl on my fedora workstation to manually test the ruby handler using: sensuctl event info <entity> <check> --format json | handler-plivosms.rb --map-go-event-into-ruby 1
This lets me manually extract a sensu go event as a json string and pipe it into a handler under development, outside of the production env. This is how i do initial testing for handlers I haven’t used before so I can make sure I construct the Sensu Go handler resource correctly with any need env_var tweaks or what not. This is how I found and fixed that Plivo syntax error.
@jspaleta I was basically following the hello world example here:
But simply taring up the asset and creating a github release for it doesn’t seem to be what gets generated, in for example, @aaronsachs “releases” on his github:
Oh yeah there still loads to be done around lowering the bar for sharable assets.
Statically compiled golang assets are absolutely the easiest thing to share, interpreted languages or shell scripts are more complicated.
But if you are just trying to build assets for your own environment, the process is quite easy and the hello world example covers it. But you have to tune the environment to ensure the implicit requirements are met. If you control your environment fully, its quite easy to package up assets like shell or ruby scripts for your own consumption similar to the hello world example. You can be sure that the ruby env or the bash shell or anything else you need is already in the environment before you use the asset.
But the downside to that is you can’t easily share those assets with others using slightly different environments. This is why the statically compiled golang is superior here… much less overhead to worry about to produce reusable binary content.
When sharing assets, you can’t assume things will be available in the other person’s environment. Assets aren’t a full packaging system, there’s no dependency management. The intent is assets should provide everything they need…
However to support the existing collection of Ruby based sensu-plugins, we sort of stretched that intent a bit and found a way to layer multiple assets…so we could provide a consistent ruby-runtime asset for individual sensu-plugins assets to build and run against.
It’s a more complicated process, which is why I spun up the helper repository with the scripting…and drove it into the travisCI config…so as we refactor the best practice build process for the ruby runtime… individual plugins under the sensu-plugins org will be able to make use of it.
Yeah I’m still really unclear how what the .rb assets that end up on the alpine image are related to the tar file I was creating using the method above.
So, I’m still unclear what’s happening here. Are you planning on releasing this ruby plivo plugin with your changes via bonsai, or is @aaronsachs going to update his bonsai release? I feel, at this point, that I don’t have anywhere near the dev environment necessary to build it myself, and I need this to work or I can’t move forward with sensu-go. I thought packaging the asset was a much simpler thing than it appears that it is, for ruby assets anyway.