Avenue launches Custom Filters & Transform Functions
Previously, if customers wanted to invoke custom logic to conditionally trigger an Avenue alerts, they would need to deploy an API or Lambda Function in their own infrastructure and use a webhook destination. Now they can write & edit code all within Avenue, all without deploying any infrastructure.
With custom transforms, users can do things like:
Filter out rows that do not match certain characteristics
Enriching data (such as making an external call to an API)
Add computed values from your data
How does this work? To do this, we are partnering with Suborbital, a serverless WebAssembly runner. Using Suborbital, we are able to allow users to run code in a trusted environment explicitly allowing only the permissions required.
To get started, reach out to us on Intercom to get access to the new feature. Once added, simply navigate to the Monitor create/edit page and scroll to the custom transform section to get started!
What is being released today?
How can I get started?
Reach out to email@example.com or through Intercom and we will add you to the Beta.
How do I create a custom function?
In Avenue, you will see a custom code editor on each monitor form. Here, you’ll see a single function
processRowswhere you’ll get the data from each row as an object. Here you can add additional fields, transform fields, etc. All you have to do is return a new object based on the input row.
Once you’ve written your function, you can build from the editor and see streaming build logs below. Once you’ve successfully built your function, click deploy and you’re good to go!
Will the function be invoked for testing monitors?
While we won’t run the function for previewing fields, if you test your monitor with the
Send Test Signal button, we will invoke the Suborbital function so you can see the end result.
What permissions do I need in order to use Custom Transform functions?
Once you’ve been added to the Beta program, you will need
ADMIN permissions to write or edit custom transform functions.
How do I filter out rows?
If you return
undefined from the function, we will remove the row from the query.
What else can I use custom functions for?
We have a lot of upcoming work to add extensibility points throughout the product. We will be enabling custom actions (both manual and event-triggered) soon!
Can I use other languages, like Python?
As soon as Suborbital supports the underlying language, we will add support for it! Please reach out to us if there’s a language that your team would like to use for custom filters & transforms.