Skip to content

Exclude optional performance instrumentation by default for AWS Serverless #11991

@jd-carroll

Description

@jd-carroll

Problem Statement

Opentelemetry adds a massive amount of overhead. The screen shot below represents a minimized / treeshook lambda built with esbuild that has very little of its own code.
image

I understand some of the challenges here (ie. nothing is free or magic), but Sentry + Opentelemetry is > 50% of the bundled lambda.

For opentelemetry specifically, it bundles a whole series of instrumentation hooks which will never be consumed.
image

Of the 16 bundled instrumentation hooks, we will only use three of them:

  • instrumentation-aws-sdk
  • instrumentation-http
  • instrumentation-aws-lambda

There is a guide which mentions "customizing" the opentelemetry configuration:
https://docs.sentry.io/platforms/javascript/guides/node/migration/v7-to-v8/v8-opentelemetry/#custom-opentelemetry-setup

But it seems incomplete. It is not clear how or where I would instantiate the three instrumentation providers.

Solution Brainstorm

It would be great if there was a complete example of an aws lambda which configures only three instrumentation providers:

  • instrumentation-aws-sdk
  • instrumentation-http
  • instrumentation-aws-lambda

This should be a "gold-standard" for how to configure sentry for aws-lambda, because even with full ESM + treeshaking + minification the size of Sentry + Opentelemetry is a substantial problem.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions