|
| 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