This release of Apex features function name globbing, auto-completion, symlink support, cost metrics, development analytics and a seal!
This is part bug fix, part feature, but improvements made to symlink support now allow you to link directories. This means `npm link` is also now effective, and of course links to regular files work as well. Upon deploy these files and directories are pulled into the function, even if they live outside of the function’s dir.
Function & command autocompletion
We originally supported command autocompletion via docopt, however that was lost in the migration to Cobra. What we didn’t have however, is function auto-completion! Now you can tab-complete any command which accepts functions such as `deploy`, `delete`, `rollback`, and so on.
$ apex deploy alert_
alert_processor alert_queuer alert_reporter
Function name globbing
All commands which accept function names now support name “globbing” or pattern matching. This feature allows you to perform operations on entire groups of functions more easily.
For example where you might normally run:
$ apex deploy alert_processor alert_reporter
You may now use `*` as a wildcard:
$ apex deploy alert_*
As mentioned, this works for other commands as well:
$ apex logs -f alert_* api_*
Or deleting via suffix:
$ apex delete -f *_reporter
In the future we may allow arbitrary depths in ./functions, however at the moment this creates ambiguity with our runtime inference feature.
We’d love to hear feedback on which you would prefer, function inferences, or nested directories. I personally think nesting could be useful for other things as well, but I do like a simple clean list of functions.
Function cost metrics
Our `metrics` command now displays the total cost of each function, along with the breakdown of cost for the number of invocations and duration.
This does not include the free tier, which can actually be handy for cost analysis if you apply a real workload — no free tier surprises :). Here’s an example with the default 24 hours:
Apex is now utilizing https://github.com/tj/go-cli-analytics to collect usage metrics by default to help inform the team, allowing us to determine how commands and flags are used (if ever). No sensitive information is sent, no function names, alias names, or system details other than the operating system name. To get a better idea of what is tracked run:
$ grep -r stats.Track . -A 5
To opt-out at any time run:
$ touch ~/.apex/disable
To give you an idea of what is tracked, the following snippet is the `deploy` command, no sensitive or user specific information is transmitted.
“has_alias”: alias != “”,
Some smaller additions & fixes include:
- added apex_environment terraform variable
- added multi-function rollback support
- added implicit APEX_FUNCTION_NAME env variable
- added implicit LAMBDA_FUNCTION_NAME env variable
- fixed a bug causing logs to sometimes be missing
- fixed infra command terraform flags pass-through
Sponsors & backers
Big thanks to PubNub for being our first sponsor, and all of our backers who have been contributing on Open Collective!
If we don’t come up with anything project-specific, at least we’ll have full mugs :). As I’ve mentioned in the past, there are no plans to monetize apex(1) in any form, it will remain 100% open-source with no weird upsells etc, and all features are derived from real-world use.
Like always, grab the latest with:
$ apex upgrade