numo-labs / aws-lambda-helper

:lollipop: Collection of helper methods for lambda
GNU General Public License v3.0
22 stars 2 forks source link

Forwarding tracing headers when invoking lambdas. #32

Closed tomgco closed 8 years ago

tomgco commented 8 years ago

This will forward the trace-request-id to the invoked lambda if present in the original event.

This is being patched in for now to maintain backwards compatibility, however eventually I would like to move all of our Payloads to a format like:

{
    body: { ... },
    headers: {
        'trace-request-id': 'some-id'
    }
}

However as it currently the headers attribute is being re-assigned to a new object.

Note: This assumes that we are not currently using the attribute headers on the Payload, if we are then we have two options. Either go straight to the (body / headers) change noted above, causing a lot of changes throughout many services. Or we can add the logic to check for the property and then extend it, if it already exists.

codecov-io commented 8 years ago

Current coverage is 100%

Merging #32 into master will not change coverage

  1. File lib/index.js was modified. more
    • Misses 0
    • Partials 0
    • Hits +36
@@           master   #32   diff @@
===================================
  Files           1     1          
  Lines         102   147    +45   
  Methods         0     0          
  Messages        0     0          
  Branches        0     0          
===================================
+ Hits          102   147    +45   
  Misses          0     0          
  Partials        0     0          

Powered by Codecov. Last updated by a921d51...586abbc

tomgco commented 8 years ago

@nelsonic @jruts Would you mind casting your eyes over this?

nelsonic commented 8 years ago

@tomgco looks good. are you making any further changes e.g. usage example in readme? or can we merge?

tomgco commented 8 years ago

@tomgco looks good. are you making any further changes e.g. usage example in readme? or can we merge?

@nelsonic I have just rebased and simplified some logic based on the other PR that has merged (and also a documentation fix). Everything around usage is documented sufficiently, however around the architecture I will update https://github.com/numo-labs/inspirational-search-docs with all of the required information.

So LGTM; and ready to merge.

nelsonic commented 8 years ago

@tomgco cool. agree. merging. 👍