Giter VIP home page Giter VIP logo

serverless-lumigo-plugin's Introduction

serverless-lumigo

serverless version License CircleCI codecov

Serverless framework plugin to auto-install the Lumigo tracer for Node.js and Python functions.

TOC

Install

Run npm install in your Serverless project.

$ npm install --save-dev serverless-lumigo

Add the plugin to your serverless.yml file

plugins:
  - serverless-lumigo

Node.js functions

For Node.js functions, the plugin would install the latest version of the Lumigo tracer for Node.js during serverless package and serverless deploy. It would also wrap your functions as well, so you only need to configure your Lumigo token in a custom section inside the serverless.yml.

For example:

provider:
  name: aws
  runtime: nodejs10.x

custom:
  lumigo:
    token: <YOUR TOKEN GOES HERE>
    nodePackageManager: <npm or yarn>

Python functions

For Python functions, we recommend using the serverless-python-requirements plugin to help you manage your dependencies. You should have the following in your requirements.txt:

lumigo_tracer

This installs the Lumigo tracer for Python, and this plugin would wrap your functions during serverless package and serverless deploy.

You also need to configure the Lumigo token in a custom section in the serverless.yml.

provider:
  name: aws
  runtime: python3.7
custom:
  lumigo:
    token: <YOUR TOKEN GOES HERE>

Configuration

In order to pass parameters to the tracer, just add them as keys to lumigo custom configuration. For example, in order to add enhanced print support use:

custom:
  lumigo:
    token: <YOUR TOKEN GOES HERE>
    enhance_print: true

Function Scope Configuration

You can configure lumigo behavior for individual functions as well -

  • enabled - Allows one to enable or disable lumigo for specific a specific function
    functions:
      foo:
        lumigo:
          enabled: false
    
      bar:
        lumigo:
          enabled: ${self:custom.enabledLumigo}

How to test

  • Run npm run test-all

serverless-lumigo-plugin's People

Contributors

dependabot[bot] avatar doriaviram avatar efimk-lu avatar roni-frantchi avatar theburningmonk avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.