Avenue launches Custom Filters & Transform Functions
Avenue launches Custom Filter & Transform Functions! Custom transform functions let users write & run arbitrary Javascript code to filter, transform, and enrich the data they receive from their database or data warehouse.
While we love SQL at Avenue, sometimes it's much easier to add, enrich, or filter out data using Javascript. Now, users have the option to use both! Avenue users can monitor for business events using SQL queries then modify the results using a built-in code editor all from Avenue’s web app.
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
Why Javascript?
There are many things that are easy to do in Javascript that are ergonomically unsound in SQL. We love SQL but often it’s easier to do complex calculations or date filters using a traditional programming language (like Javascript).
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!
FAQs
What is being released today?
An easy way to write custom Javascript filter & transform functions for Avenue monitors, all without deploying infrastructure.
How can I get started?
Reach out to info@useavenue.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 processRows
where 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 CREATOR
or ADMIN
permissions to write or edit custom transform functions.
How do I filter out rows?
If you return null
or 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.