Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Support Apache OpenWhisk lambda functions #33

Open
rabbah opened this issue Jan 13, 2020 · 1 comment
Open

Support Apache OpenWhisk lambda functions #33

rabbah opened this issue Jan 13, 2020 · 1 comment

Comments

@rabbah
Copy link

rabbah commented Jan 13, 2020

With a few small localized changes, this library will work with Apache OpenWhisk - an open source platform for serverless functions powering public clouds (IBM Cloud Functions, Adobe I/O, Nimbella) and many others offerings on-prem.

There are two main differences between OpenWhisk and AWS:

  1. the "main" handler signature is main(event)in OpenWhisk vs main(event, context) in Lambda. The context is provided in environment variables in the former.

  2. the method utilts.get_fields is specific to AWS.

    def get_fields(context):

To keep changes minimal, I created a method to convert an OpenWhisk environment to an AWS-like context object (so get_fields remains agnostic to this change). I've confirmed the change is sufficient to allow OpenWhisk functions running on Nimbella to use the Lambda dashboards on SignalFx.

I can submit this patch as a pull request if desirable (do you have a contribution guide?), along with some documentation to show an OpenWhisk example as in this repo https://github.com/rabbah/sfx.

Here's the OpenWhisk lambda using the SignalFx decorator.

https://github.com/rabbah/sfx/blob/11c4264661a2d6c80f51e7f41ff0938174ac1e83/packages/default/hello.py#L1-L8

@slernersplunk
Copy link

slernersplunk commented Jan 13, 2020

FYI for Splunk SignalFx GitHub approvers... - I (SignalFx Splunk Senior Sales Engineer) am working with Rodric and Nimbella on this and am creating OpenWhisk and Nimbella demos...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants