Skip to content

Commit 680607c

Browse files
authored
chore: Add bump_otel_instrumentations cursor command (#18253)
Bumping OpenTelemetry instrumentations is an important but tedious task, all instrumentations have to be bumped in lockstep across the codebase. That includes easy to miss dev-packages and third party instrumentations like prisma's. This command should make it easier to do that. Example of a PR that was kicked off with this command: #18239
1 parent be29c56 commit 680607c

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Bump OpenTelemetry instrumentations
2+
3+
1. Ensure you're on the `develop` branch with the latest changes:
4+
- If you have unsaved changes, stash them with `git stash -u`.
5+
- If you're on a different branch than `develop`, check out the develop branch using `git checkout develop`.
6+
- Pull the latest updates from the remote repository by running `git pull origin develop`.
7+
8+
2. Create a new branch `bump-otel-{yyyy-mm-dd}`, e.g. `bump-otel-2025-03-03`
9+
10+
3. Create a new empty commit with the commit message `feat(deps): Bump OpenTelemetry instrumentations`
11+
12+
4. Push the branch and create a draft PR, note down the PR number as {PR_NUMBER}
13+
14+
5. Create a changelog entry in `CHANGELOG.md` under
15+
`- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott` with the following format:
16+
`- feat(deps): Bump OpenTelemetry instrumentations ([#{PR_NUMBER}](https://github.com/getsentry/sentry-javascript/pull/{PR_NUMBER}))`
17+
18+
6. Find the "Upgrade OpenTelemetry instrumentations" rule in `.cursor/rules/upgrade_opentelemetry_instrumentations` and
19+
follow those complete instructions step by step.
20+
- Create one commit per package in `packages/**` with the commit message
21+
`Bump OpenTelemetry instrumentations for {SDK}`, e.g. `Bump OpenTelemetry instrumentation for @sentry/node`
22+
23+
- For each OpenTelemetry dependency bump, record an entry in the changelog with the format indented under the main
24+
entry created in step 5: `- Bump @opentelemetry/{instrumentation} from {previous_version} to {new_version}`, e.g.
25+
`- Bump @opentelemetry/instrumentation from 0.204.0 to 0.207.0` **CRITICAL**: Avoid duplicated entries, e.g. if we
26+
bump @opentelemetry/instrumentation in two packages, keep a single changelog entry.
27+
28+
7. Regenerate the yarn lockfile and run `yarn yarn-deduplicate`
29+
30+
8. Run `yarn fix` to fix all formatting issues
31+
32+
9. Finally update the PR description to list all dependency bumps
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
description: Use this rule if you are looking to grade OpenTelemetry instrumentations for the Sentry JavaScript SDKs
3+
globs: *
4+
alwaysApply: false
5+
---
6+
7+
# Upgrading OpenTelemetry instrumentations
8+
9+
1. For every package in packages/\*\*:
10+
- When upgrading dependencies for OpenTelemetry instrumentations we need to first upgrade `@opentelemetry/instrumentation` to the latest version.
11+
**CRITICAL**: `@opentelemetry/instrumentation` MUST NOT include any breaking changes.
12+
Read through the changelog of `@opentelemetry/instrumentation` to figure out if breaking changes are included and fail with the reason if it does include breaking changes.
13+
You can find the changelog at `https://github.com/open-telemetry/opentelemetry-js/blob/main/experimental/CHANGELOG.md`
14+
15+
- After successfully upgrading `@opentelemetry/instrumentation` upgrade all `@opentelemetry/instrumentation-{instrumentation}` packages, e.g. `@opentelemetry/instrumentation-pg`
16+
**CRITICAL**: `@opentelemetry/instrumentation-{instrumentation}` MUST NOT include any breaking changes.
17+
Read through the changelog of `@opentelemetry/instrumentation-{instrumentation}` to figure out if breaking changes are included and fail with the reason if it does including breaking changes.
18+
You can find the changelogs at `https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/packages/instrumentation-{instrumentation}/CHANGELOG.md`.
19+
20+
- Finally, upgrade third party instrumentations to their latest versions, these are currently:
21+
- @prisma/instrumentation
22+
23+
**CRITICAL**: Upgrades to third party instrumentations MUST NOT include breaking changes.
24+
Read through the changelog of each third party instrumentation to figure out if breaking changes are included and fail with the reason if it does include breaking changes.
25+
26+
2. For packages and apps in dev-packages/\*\*:
27+
- If an app depends on `@opentelemetry/instrumentation` >= 0.200.x upgrade it to the latest version.
28+
**CRITICAL**: `@opentelemetry/instrumentation` MUST NOT include any breaking changes.
29+
30+
- If an app depends on `@opentelemetry/instrumentation-http` >= 0.200.x upgrade it to the latest version.
31+
**CRITICAL**: `@opentelemetry/instrumentation-http` MUST NOT include any breaking changes.
32+
33+
3. Generate a new yarn lock file.

0 commit comments

Comments
 (0)