vendor-otel

Vendor OpenTelemetry instrumentation packages into the Sentry JavaScript SDK source tree.

8.7k|1.8k|Updated Feb 1, 2012
One-click install
npx skills add https://github.com/getsentry/sentry-javascript --skill vendor-otel
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vendor-otel
Source: https://github.com/getsentry/sentry-javascript/tree/main/.agents/skills/vendor-otel
Command: npx skills add https://github.com/getsentry/sentry-javascript --skill vendor-otel

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Maintaining npm dependencies on pre-v1 OpenTelemetry instrumentation packages creates upgrade risk and dependency bloat in the Sentry JavaScript SDK. This Skill automates the process of copying upstream OTel instrumentation TypeScript source directly into the SDK as vendored code, removing the npm dependency while preserving identical behavior.

Core Features & Use Cases

  • Upstream Research and Diffing: Fetches source files from the opentelemetry-js-contrib GitHub repo, compares pinned versus latest versions, and reviews changelogs before vendoring.
  • License-Compliant Vendoring: Copies TypeScript source with full Apache 2.0 headers, Sentry NOTICE blocks, and standard replacements like SDK_VERSION from @sentry/core.
  • External Type Inlining: Inlines simplified types from external packages into dedicated type files so builds do not rely on workspace hoisting.
  • Build and Test Verification: Runs yarn build, integration tests, and unit tests, then creates a draft PR against the develop branch.
  • Use Case: When you need to vendor @opentelemetry/instrumentation-graphql into @sentry/node, this Skill walks through research, planning, copying, type inlining, testing, and PR creation with user approval gates.

Quick Start

Vendor the @opentelemetry/instrumentation-kafkajs package into the Sentry Node SDK and create a draft PR.

Frequently Asked Questions about vendor-otel

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I vendor an OpenTelemetry instrumentation package into the Sentry JavaScript SDK?

Provide the npm package name, then the workflow researches upstream source in opentelemetry-js-contrib, diffs pinned versus latest versions, copies TypeScript files into a vendored directory with license headers, removes the npm dependency, and verifies builds and tests before creating a draft PR.

How to inline external types when vendoring OTel instrumentation?

Create a separate <package>-types.ts file in the vendored directory containing simplified versions of only the type members actually accessed. Keep generic parameters and field names close to the originals, add index signatures for permissiveness, and verify no external imports leak into the built .d.ts output.

Can vendored OpenTelemetry code be modified after the initial vendoring PR?

Yes. The no-logic-changes rule applies only to the initial vendoring PR. Afterward the vendored directory is Sentry-owned source, and follow-up PRs may refactor it, simplify it, or replace upstream utilities with Sentry equivalents like @sentry/core.

Why does vendored OTel code fail TypeScript compilation in the Sentry repo?

The Sentry repository uses strict TypeScript settings including strict mode and noUncheckedIndexedAccess, which upstream code may not satisfy. Fix the compilation errors minimally and document each change with a Minor TypeScript strictness adjustments bullet in the file header.

What tests should run after vendoring an instrumentation package?

Run the node integration tests under dev-packages/node-integration-tests for the instrumented package and the unit tests in packages/node. Update unit test imports and vi.mock calls from the npm package name to the new vendored path.