-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: AWS lambda programatic wrap #1308
feat: AWS lambda programatic wrap #1308
Conversation
instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda/wrap.rb
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @joshwestbrook! It's great to see the lambda instrumentation getting some use and I like your adjustment to make it more flexible for different scenarios.
Since @xuan-cao-swi initially wrote this, I'd like him to also take a look before we merge.
Awesome, thanks for taking a look at this @kaylareopelle! |
Thanks @joshwestbrook , I think it looks good. Would you mind add some test case around the |
fc01a58
to
c5994bc
Compare
Sure thing @xuan-cao-swi! I pushed up some tests for the I'm very used to using RSpec for specs so let me know if you have any recommendations for improvements 😄 |
Hi @joshwestbrook , just need linting from rubocop, then I can approve it. |
@xuan-cao-swi - Rubocop linting has passed now! Can you take another look? |
…metry-ruby-contrib into strip-rails-format-suffix * 'strip-rails-format-suffix' of github.com:akahn/opentelemetry-ruby-contrib: feat: AWS lambda programatic wrap (open-telemetry#1308) chore: bump ruby/setup-ruby from 1.213.0 to 1.214.0 (open-telemetry#1371) test: Fix simplecov configuration (open-telemetry#1366) chore: Strip Rails (.:format) suffix from http.route
* feat: Support programatically wrapping lambda handlers * chore: Update README and conditionally flush metrics * fix: No ruby 3.1 shorthand * fix: typo and module length * Add tests for instrument_handler * fix: Trailing whitespace --------- Co-authored-by: Kayla Reopelle <[email protected]>
Our company uses container images for deploying our lambda functions and use herokuish Procfile entries as our entrypoints for the images.
This means it takes a ton of jiggery-pokery to get this working for our situation because:
_HANDLER
environment variable actually contains our Procfile entry (which calls the lambda RIC under the hood with the handler that's expected by this wrapper)This PR introduces an alternative way of instrumenting by programmatically wrapping an arbitrary handler method for scenarios where using lambda layers aren't an option (such as ours).
Example: