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

@serverless/sdk

Package Overview
Dependencies
Maintainers
6
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@serverless/sdk

## [Serverless Console](https://www.serverless.com/console) SDK

  • 0.2.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
476
decreased by-11.69%
Maintainers
6
Weekly downloads
 
Created
Source

@serverless/sdk

Serverless Console SDK

Use case

Environment agnostic Serverless Console instrumentation functions for Node.js applications.

This library is safe to use without side-effects in any Node.js applications. It becomes effective once (one of the listed below) environment specific SDK is loaded on top.

Environment extensions

Installation

npm install @serverless/sdk

Usage

CJS:

const serverlessSdk = require('@serverless/sdk');

// ...
const customTraceSpan = serverlessSdk.createTraceSpan('custom.tracespan');
// ...
customTraceSpan.close();

ESM:

import serverlessSdk from '@serverless/sdk';

// ...
const customTraceSpan = serverlessSdk.createTraceSpan('custom.tracespan');
// ...
customTraceSpan.close();

Setup

1. Register with Serverless Console
2. Initialize and setup SDK specific to your enviroment

See Environment extensions

2.1 Configuration options

Common options supported by all environments:

SLS_ORG_ID (or options.orgId)

Required setting. Id of your organization in Serverless Console.

SLS_DISABLE_HTTP_MONITORING (or options.disableHttpMonitoring)

Disable tracing of HTTP and HTTPS requests. See HTTP instrumentation

SLS_DISABLE_REQUEST_RESPONSE_MONITORING (or options.disableRequestResponseMonitoring)

(Dev mode only) Disable monitoring requests and reponses (function, AWS SDK requests and HTTP(S) requests)

SLS_DISABLE_EXPRESS_MONITORING (or options.disableExpressMonitoring)

Disable automated express monitoring. See express app instrumentation

SLS_TRACE_MAX_CAPTURED_BODY_SIZE_KB (or options.traceMaxCapturedBodySizeKb)

In dev mode, HTTP request and response bodies are stored as tags. To avoid performance issues, bodies that extend 10 000KB in size are not exposed. This default can be overridden with this settin

Instrumentation

This package comes with instrumentation for following areas.

Note: instrumentation is enabled via environment specific SDK instance, relying just on @serverless/sdk doesn't enable any instrumentation)

API

FAQs

Package last updated on 05 Jan 2023

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