Skip to content

Commit 00cd7a0

Browse files
authored
chore(ci): add otel v1 release workflow (#651)
1 parent f09a480 commit 00cd7a0

File tree

2 files changed

+146
-0
lines changed

2 files changed

+146
-0
lines changed

.github/workflows/release-otel-v1.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Release - OpenTelemetry v1 Compatible
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
release:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
id-token: write
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
persist-credentials: false
15+
fetch-depth: 0
16+
ref: ${{ github.ref }}
17+
18+
- uses: pnpm/action-setup@v2
19+
with:
20+
version: 10
21+
- uses: actions/setup-node@v3
22+
with:
23+
cache: "pnpm"
24+
node-version-file: ".nvmrc"
25+
- run: pnpm install --frozen-lockfile
26+
- name: Build
27+
run: pnpm nx run-many --target=build --parallel=3
28+
- name: Git Identity
29+
run: |
30+
git config --global user.name 'github-actions[bot]'
31+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
32+
git remote set-url origin https://github-actions[bot]:${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
35+
- name: Create Version with OTel v1 suffix
36+
run: |
37+
# Get the current version and add -otel-v1 suffix
38+
CURRENT_VERSION=$(node -p 'require("./lerna.json").version')
39+
NEW_VERSION="${CURRENT_VERSION}-otel-v1"
40+
echo "NEW_VERSION=${NEW_VERSION}" >> $GITHUB_ENV
41+
# Update versions in memory only (no git commits)
42+
pnpm lerna version $NEW_VERSION --no-private --no-git-tag-version --no-push --yes
43+
- name: "NPM Identity"
44+
env:
45+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
46+
run: |
47+
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
48+
- name: Build for Release
49+
run: pnpm nx run-many --target=build --parallel=3
50+
- name: Publish with otel-v1 tag
51+
run: |
52+
# Publish all packages with otel-v1 dist-tag
53+
pnpm lerna publish from-git --dist-tag otel-v1 --no-private --yes

OTEL_V1_BRANCH_README.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# OpenTelemetry v1 Compatible Branch
2+
3+
This branch (`otel-v1-main`) contains a version of the OpenLLMetry JS SDK that is compatible with OpenTelemetry JavaScript SDK v1.30.1 and earlier versions.
4+
5+
## What's Different
6+
7+
### OpenTelemetry Dependency Versions
8+
9+
- **@opentelemetry/api**: `^1.7.0` (downgraded from `^1.9.0`)
10+
- **@opentelemetry/core**: `^1.30.1` (downgraded from `^2.0.1`)
11+
- **@opentelemetry/resources**: `^1.30.1` (downgraded from `^2.0.0`)
12+
- **@opentelemetry/sdk-trace-base**: `^1.30.1` (downgraded from `^2.0.0`)
13+
- **@opentelemetry/instrumentation**: `^0.48.0` (downgraded from `^0.203.0`)
14+
- **@opentelemetry/sdk-node**: `^0.48.0` (downgraded from `^0.203.0`)
15+
16+
### Code Changes Made for v1 Compatibility
17+
18+
1. **TypeScript Interface Updates**: Fixed `InstrumentationModuleDefinition<T>` generic type parameters across all instrumentation packages
19+
2. **SDK Configuration**: Updated `NodeSDK` configuration to use `spanProcessor` (singular) instead of `spanProcessors` (plural) as required by v1.x
20+
3. **API Version Compatibility**: Ensured all packages use compatible API versions
21+
22+
## Release Strategy
23+
24+
### Automated Releases
25+
26+
The branch has its own GitHub Actions workflow (`.github/workflows/release-otel-v1.yml`) that:
27+
28+
- Triggers on pushes to `otel-v1-main` branch
29+
- Automatically adds `-otel-v1` suffix to version numbers
30+
- Publishes to npm with `otel-v1` dist-tag
31+
- Creates GitHub releases with appropriate tagging
32+
33+
### Version Naming Convention
34+
35+
- Main branch releases: `0.16.2`, `0.17.0`, etc.
36+
- OTel v1 branch releases: `0.16.2-otel-v1`, `0.17.0-otel-v1`, etc.
37+
38+
### Installation for End Users
39+
40+
**For users on OpenTelemetry v2.x (latest):**
41+
42+
```bash
43+
npm install @traceloop/node-server-sdk
44+
```
45+
46+
**For users on OpenTelemetry v1.x:**
47+
48+
```bash
49+
npm install @traceloop/node-server-sdk@otel-v1
50+
```
51+
52+
## Maintenance
53+
54+
### Syncing Changes from Main
55+
56+
To keep this branch up-to-date with the main branch:
57+
58+
1. **Merge main branch changes:**
59+
60+
```bash
61+
git checkout otel-v1-main
62+
git merge main
63+
```
64+
65+
2. **Resolve any conflicts** related to OpenTelemetry dependencies
66+
3. **Test the build** to ensure v1 compatibility is maintained
67+
4. **Push changes** to trigger automated release
68+
69+
### Testing
70+
71+
Before releasing, ensure:
72+
73+
1. All instrumentation packages build successfully
74+
2. The main SDK package compiles (may have some remaining type issues with complex scenarios)
75+
3. Basic functionality works with OpenTelemetry v1.x setups
76+
77+
## Troubleshooting
78+
79+
### Common Issues
80+
81+
1. **Type Compatibility Errors**: The v1.x OpenTelemetry packages have different TypeScript interfaces. Most have been fixed, but complex scenarios may still have issues.
82+
83+
2. **Peer Dependency Warnings**: Some peer dependency warnings are expected due to the version differences between packages.
84+
85+
3. **Build Failures**: If new features from main use v2.x-only APIs, they'll need to be adapted or conditionally compiled for v1 compatibility.
86+
87+
### Getting Help
88+
89+
For issues specific to the OpenTelemetry v1 branch, please:
90+
91+
1. Check if the issue exists in the main branch
92+
2. Verify OpenTelemetry version compatibility
93+
3. Open issues with `[otel-v1]` prefix in the title

0 commit comments

Comments
 (0)