Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

serverless-plugin-tracing

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serverless-plugin-tracing

Enables AWS X-Ray for entire Serverless stack or individual functions

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
37K
increased by1.12%
Maintainers
2
Weekly downloads
 
Created
Source

serverless-plugin-tracing

npm version CircleCI Coverage Status

Enables AWS X-Ray (https://aws.amazon.com/xray/) for the entire Serverless stack or individual functions.

Note: this plugin is currently Beta.

Note: tested to work well with serverless@1.13.2. Some older versions of serverless may not work due to outdated Javascript SDK that does not support TracingConfig.

npm install --save-dev serverless-plugin-tracing

Example serverless.yml:

service: my-great-service

provider:
  name: aws
  stage: test
  tracing: true # enable tracing
  iamRoleStatements:
    - Effect: "Allow" # xray permissions (required)
      Action:
        - "xray:PutTraceSegments"
        - "xray:PutTelemetryRecords"
      Resource:
        - "*"

plugins:
  - serverless-plugin-tracing

functions:
  mainFunction: # inherits tracing settings from "provider"
    handler: src/app/index.handler
  healthcheck:
    tracing: false # overrides provider settings (opt out)

Output after serverless deploy:

Serverless: Tracing ENABLED for function
  "my-great-service-test-mainFunction"
Serverless: Tracing DISABLED for function
  "my-great-service-test-healthcheck"

Important: in addition to using the plugin, you need to enable capturing traces in the code as well:

const awsXRay = require('aws-xray-sdk');
const awsSdk = awsXRay.captureAWS(require('aws-sdk'));

The plugin only controls the checkbox that be viewed in AWS Console: go to AWS Lambda -> select a Lambda function -> Configuration tab -> Advanced settings -> "Enable active tracing". If tracing ends up being true for a function, the checkbox will be checked for that function.

Keywords

FAQs

Package last updated on 13 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc