Socket
Socket
Sign inDemoInstall

@opentelemetry/instrumentation-aws-sdk

Package Overview
Dependencies
Maintainers
3
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentelemetry/instrumentation-aws-sdk

OpenTelemetry automatic instrumentation for the `aws-sdk` package


Version published
Weekly downloads
940K
increased by5.85%
Maintainers
3
Weekly downloads
 
Created

What is @opentelemetry/instrumentation-aws-sdk?

@opentelemetry/instrumentation-aws-sdk is an npm package that provides automatic instrumentation for AWS SDK clients using OpenTelemetry. This allows developers to collect and export telemetry data such as traces and metrics from AWS SDK operations, which can be used for monitoring and observability purposes.

What are @opentelemetry/instrumentation-aws-sdk's main functionalities?

Automatic Tracing

This feature allows you to automatically trace AWS SDK operations. The code sample demonstrates how to set up the NodeTracerProvider and register the AWS SDK instrumentation.

const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node');
const { AwsInstrumentation } = require('@opentelemetry/instrumentation-aws-sdk');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');

const provider = new NodeTracerProvider();
provider.register();

registerInstrumentations({
  instrumentations: [
    new AwsInstrumentation({
      // Optional configuration
    })
  ],
  tracerProvider: provider,
});

Custom Configuration

This feature allows you to customize the instrumentation behavior. The code sample shows how to configure hooks to add custom attributes to spans before and after AWS SDK requests.

const { AwsInstrumentation } = require('@opentelemetry/instrumentation-aws-sdk');

const awsInstrumentation = new AwsInstrumentation({
  suppressInternalInstrumentation: true,
  preRequestHook: (span, request) => {
    span.setAttribute('aws.requestId', request.requestId);
  },
  postRequestHook: (span, response) => {
    span.setAttribute('aws.statusCode', response.statusCode);
  }
});

Other packages similar to @opentelemetry/instrumentation-aws-sdk

Keywords

FAQs

Package last updated on 11 Mar 2024

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