Generalize setupOptionOtel as an independent runtime - #23
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe PR replaces ChangesIsolated runtime API
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant createIsolatedOtel
participant serviceResourceAttributes
participant IsolatedOtelRuntime
Caller->>createIsolatedOtel: provide service options and traceparentHeader
createIsolatedOtel->>serviceResourceAttributes: build resource attributes
createIsolatedOtel->>IsolatedOtelRuntime: create independent runtime
IsolatedOtelRuntime->>IsolatedOtelRuntime: validate endpoint and header
IsolatedOtelRuntime->>IsolatedOtelRuntime: propagate through configured header
Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@package.json`:
- Line 3: Update the package version from 3.6.0 to 4.0.0 to reflect the breaking
public API change, and synchronize the same version in src/version.ts. Ensure
both version declarations match.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6d441bb2-a051-4bd1-9e16-11c7ea7953ae
📒 Files selected for processing (9)
README.mddocs/concepts/architecture.mdxdocs/guides/option-runtime.mdxdocs/reference/api.mdxpackage.jsonsrc/option-runtime.tssrc/setup.tssrc/version.tstests/option-runtime.test.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)
Prefer
interfacefor defining object shapes in TypeScript rather thantypealiases
**/*.{ts,tsx}: Use explicit types for function parameters and return values when they enhance clarity
Preferunknownoveranywhen the type is genuinely unknown
Useas constconst assertions for immutable values and literal types
Leverage TypeScript type narrowing instead of type assertions
Use meaningful variable names instead of magic numbers; extract descriptive constants
Use arrow functions for callbacks and short functions
Preferfor...ofloops over.forEach()and indexedforloops
Use optional chaining (?.) and nullish coalescing (??) for safer property access
Prefer template literals over string concatenation
Use destructuring for object and array assignments
Useconstby default,letonly when reassignment is needed, and never usevar
Alwaysawaitpromises in async functions and use the return value
Useasync/awaitsyntax instead of promise chains for better readability
Handle errors appropriately in async code withtry-catchblocks
Don't use async functions as Promise executors
Files:
src/version.tssrc/option-runtime.tstests/option-runtime.test.tssrc/setup.ts
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)
**/*.{js,jsx,ts,tsx}: Use camelCase for variable and function names in JavaScript/TypeScript
Use PascalCase for class and component names in JavaScript/TypeScript
Always use async/await for promise handling instead of .then() chains
Include JSDoc comments for exported functions and classes
Use meaningful variable names that clearly describe their purpose
Avoid deeply nested conditionals; use early returns or guard clauses instead
Use const by default, let when reassignment is needed, avoid var
**/*.{js,jsx,ts,tsx}: Removeconsole.log,debugger, andalertstatements from production code
ThrowErrorobjects with descriptive messages, not strings or other values
Usetry-catchblocks meaningfully; don't catch errors just to rethrow them
Prefer early returns over nested conditionals for error cases
Keep functions focused and under reasonable cognitive complexity limits
Extract complex conditions into well-named boolean variables
Use early returns to reduce nesting
Prefer simple conditionals over nested ternary operators
Group related code together and separate concerns
Addrel="noopener"when usingtarget="_blank"on links
AvoiddangerouslySetInnerHTMLunless absolutely necessary
Don't useeval()or assign directly todocument.cookie
Validate and sanitize user input
Avoid spread syntax in accumulators within loops
Use top-level regex literals instead of creating them in loops
Prefer specific imports over namespace imports
Avoid barrel files (indexfiles that re-export everything)
Use proper image components (for example, Next.js<Image>) over<img>tags
Usenext/heador the App Router metadata API for head elements
Use Server Components for async data fetching instead of async Client Components
Files:
src/version.tssrc/option-runtime.tstests/option-runtime.test.tssrc/setup.ts
**/*.test.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)
Write unit tests for all public functions and components
Files:
tests/option-runtime.test.ts
**/*.{test,spec}.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{test,spec}.{js,jsx,ts,tsx}: Write assertions insideit()ortest()blocks
Avoid done callbacks in async tests; use async/await instead
Don't use.onlyor.skipin committed code
Keep test suites reasonably flat; avoid excessivedescribenesting
Files:
tests/option-runtime.test.ts
🔇 Additional comments (13)
src/option-runtime.ts (1)
20-23: LGTM!Also applies to: 36-52, 67-69, 123-138, 171-177, 191-212, 309-316
src/setup.ts (1)
22-22: LGTM!Also applies to: 356-366
tests/option-runtime.test.ts (1)
20-20: LGTM!Also applies to: 29-66, 75-75, 85-110, 120-189, 220-220, 244-244, 285-299, 332-332, 354-361, 382-382, 402-402, 434-434, 444-444
README.md (3)
8-8: LGTM!
98-98: LGTM!
119-140: LGTM!docs/concepts/architecture.mdx (1)
60-63: LGTM!docs/guides/option-runtime.mdx (3)
6-14: LGTM!
23-38: LGTM!
55-66: LGTM!docs/reference/api.mdx (2)
93-111: LGTM!
145-146: LGTM!src/version.ts (1)
1-1: LGTM!
Renames the isolated runtime API for clarity: the new name `createIsolatedOtel` better communicates that it is a plain factory (not a singleton) and that the result is an independent runtime. - Rename `src/option-runtime.ts` → `src/isolated-runtime.ts` - Rename `SetupOptionOtelOptions` → `IsolatedOtelOptions` - Rename `OptionOtelHandle` → `IsolatedOtelHandle` - Extract shared service identity into `src/service-resource.ts` so `setupOtel()` and `createIsolatedOtel()` accept `serviceName`, `serviceVersion`, and `resourceAttributes` identically - Update all docs, tests, and the package version accordingly
Replaces the hand-maintained version literal with a direct import from `package.json`, so the release pipeline only needs to bump one place. Adds a unit test and a CI step to assert the built artifact reports the correct version.
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (2)
src/isolated-runtime.ts (2)
174-178: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winPass the package version to
getTracer.
src/with-span.tsbuilds its tracer withresolveTracer("@photon-ai/otel", PHOTON_OTEL_VERSION). The isolated runtime omits the version, so spans it exports carry an instrumentation scope without a version. PassPHOTON_OTEL_VERSIONfor consistent scope identity across both runtimes.♻️ Proposed change
- const tracer = tracerProvider.getTracer(INSTRUMENTATION_SCOPE); + const tracer = tracerProvider.getTracer( + INSTRUMENTATION_SCOPE, + PHOTON_OTEL_VERSION + );Add the import:
import { PHOTON_OTEL_VERSION } from "./version";🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/isolated-runtime.ts` around lines 174 - 178, Update the tracer initialization in the isolated runtime to pass PHOTON_OTEL_VERSION as the version argument to tracerProvider.getTracer, adding the version import from "./version" if needed. Keep INSTRUMENTATION_SCOPE as the instrumentation scope name.
130-140: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMove the empty check out of the
tryblock.
Headers.prototype.set()throws aTypeErrorfor empty and malformed header names in Node.js and Bun. Use a guard clause for an emptytraceparentHeader, and keep thetryblock around theHeaders.set()probe.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/isolated-runtime.ts` around lines 130 - 140, In the traceparentHeader validation flow, move the empty-value guard before the try block so it directly throws the existing empty-header TypeError. Keep only the new Headers().set() probe inside try/catch, preserving the malformed-header error conversion in the catch block.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/index.ts`:
- Around line 9-13: Update the package version to a major release, 4.0.0,
because the public exports setupOptionOtel, SetupOptionOtelOptions, and
OptionOtelHandle were removed from the index export surface. Alternatively,
restore those exports with deprecation notices while retaining the new
isolated-runtime exports.
In `@src/isolated-runtime.ts`:
- Around line 112-128: Update the validation errors in createIsolatedOtelRuntime
to identify the exported function consistently as createIsolatedOtelRuntime
instead of createIsolatedOtel; apply the same prefix to all related endpoint
validation throws, including the later validation at the referenced location.
In `@src/version.ts`:
- Line 12: Update the package manifest version to 3.6.0, ensuring the value used
by PHOTON_OTEL_VERSION remains synchronized with package.json and the release
checks observe the new version.
---
Nitpick comments:
In `@src/isolated-runtime.ts`:
- Around line 174-178: Update the tracer initialization in the isolated runtime
to pass PHOTON_OTEL_VERSION as the version argument to tracerProvider.getTracer,
adding the version import from "./version" if needed. Keep INSTRUMENTATION_SCOPE
as the instrumentation scope name.
- Around line 130-140: In the traceparentHeader validation flow, move the
empty-value guard before the try block so it directly throws the existing
empty-header TypeError. Keep only the new Headers().set() probe inside
try/catch, preserving the malformed-header error conversion in the catch block.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: eaa97689-8b8f-44a7-9b50-9f8a50bd02bb
📒 Files selected for processing (12)
.github/workflows/ci.ymlREADME.mddocs/concepts/architecture.mdxdocs/guides/isolated-runtime.mdxdocs/reference/api.mdxsrc/index.tssrc/isolated-runtime.tssrc/service-resource.tssrc/setup.tssrc/version.tstests/isolated-runtime.test.tstests/version.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- docs/concepts/architecture.mdx
📜 Review details
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)
Prefer
interfacefor defining object shapes in TypeScript rather thantypealiases
**/*.{ts,tsx}: Use explicit types for function parameters and return values when they enhance clarity
Preferunknownoveranywhen the type is genuinely unknown
Useas constconst assertions for immutable values and literal types
Leverage TypeScript type narrowing instead of type assertions
Use meaningful variable names instead of magic numbers; extract descriptive constants
Use arrow functions for callbacks and short functions
Preferfor...ofloops over.forEach()and indexedforloops
Use optional chaining (?.) and nullish coalescing (??) for safer property access
Prefer template literals over string concatenation
Use destructuring for object and array assignments
Useconstby default,letonly when reassignment is needed, and never usevar
Alwaysawaitpromises in async functions and use the return value
Useasync/awaitsyntax instead of promise chains for better readability
Handle errors appropriately in async code withtry-catchblocks
Don't use async functions as Promise executors
Files:
src/service-resource.tssrc/version.tssrc/index.tstests/version.test.tssrc/setup.tstests/isolated-runtime.test.tssrc/isolated-runtime.ts
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)
**/*.{js,jsx,ts,tsx}: Use camelCase for variable and function names in JavaScript/TypeScript
Use PascalCase for class and component names in JavaScript/TypeScript
Always use async/await for promise handling instead of .then() chains
Include JSDoc comments for exported functions and classes
Use meaningful variable names that clearly describe their purpose
Avoid deeply nested conditionals; use early returns or guard clauses instead
Use const by default, let when reassignment is needed, avoid var
**/*.{js,jsx,ts,tsx}: Removeconsole.log,debugger, andalertstatements from production code
ThrowErrorobjects with descriptive messages, not strings or other values
Usetry-catchblocks meaningfully; don't catch errors just to rethrow them
Prefer early returns over nested conditionals for error cases
Keep functions focused and under reasonable cognitive complexity limits
Extract complex conditions into well-named boolean variables
Use early returns to reduce nesting
Prefer simple conditionals over nested ternary operators
Group related code together and separate concerns
Addrel="noopener"when usingtarget="_blank"on links
AvoiddangerouslySetInnerHTMLunless absolutely necessary
Don't useeval()or assign directly todocument.cookie
Validate and sanitize user input
Avoid spread syntax in accumulators within loops
Use top-level regex literals instead of creating them in loops
Prefer specific imports over namespace imports
Avoid barrel files (indexfiles that re-export everything)
Use proper image components (for example, Next.js<Image>) over<img>tags
Usenext/heador the App Router metadata API for head elements
Use Server Components for async data fetching instead of async Client Components
Files:
src/service-resource.tssrc/version.tssrc/index.tstests/version.test.tssrc/setup.tstests/isolated-runtime.test.tssrc/isolated-runtime.ts
**/*.test.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)
Write unit tests for all public functions and components
Files:
tests/version.test.tstests/isolated-runtime.test.ts
**/*.{test,spec}.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{test,spec}.{js,jsx,ts,tsx}: Write assertions insideit()ortest()blocks
Avoid done callbacks in async tests; use async/await instead
Don't use.onlyor.skipin committed code
Keep test suites reasonably flat; avoid excessivedescribenesting
Files:
tests/version.test.tstests/isolated-runtime.test.ts
🔇 Additional comments (25)
README.md (3)
8-8: LGTM!
98-98: LGTM!
112-147: LGTM!docs/guides/isolated-runtime.mdx (4)
2-33: LGTM!
35-57: LGTM!
59-64: LGTM!
66-74: LGTM!docs/reference/api.mdx (4)
11-11: LGTM!
42-42: LGTM!
91-156: LGTM!
436-437: LGTM!.github/workflows/ci.yml (1)
59-70: LGTM!tests/version.test.ts (1)
1-12: LGTM!src/service-resource.ts (1)
1-36: LGTM!src/setup.ts (3)
49-54: LGTM!
357-361: 🗄️ Data Integrity & IntegrationNo remaining callers use the removed resource state.
> Likely an incorrect or invalid review comment.
253-257: 🗄️ Data Integrity & IntegrationNo change required.
resourceAttributesintentionally overridesdefaults, includingdeployment.environmentandservice.name.> Likely an incorrect or invalid review comment.src/isolated-runtime.ts (3)
35-60: LGTM!
179-221: LGTM!
310-321: LGTM!tests/isolated-runtime.test.ts (5)
22-29: LGTM!Also applies to: 63-83
120-155: LGTM!Also applies to: 164-183
192-252: LGTM!
352-366: LGTM!Also applies to: 418-426, 446-447, 467-467, 499-499, 509-509
106-118: 📐 Maintainability & Code QualityNo lifecycle reset issue. The hooks clear
publicExportedSpansand shut down the active runtime.shutdown()also clearsactiveHandle.
| export const createIsolatedOtelRuntime = ( | ||
| options: IsolatedOtelTransport, | ||
| resource: Resource, | ||
| processors?: { | ||
| readonly logRecordProcessors?: readonly LogRecordProcessor[]; | ||
| readonly spanProcessors?: readonly SpanProcessor[]; | ||
| } | ||
| ): OptionOtelHandle => { | ||
| ): IsolatedOtelHandle => { | ||
| const endpoint = options.endpoint.trim(); | ||
| let endpointProtocol: string; | ||
| try { | ||
| endpointProtocol = new URL(endpoint).protocol; | ||
| } catch { | ||
| throw new TypeError("setupOptionOtel: endpoint must be a valid URL"); | ||
| throw new TypeError("createIsolatedOtel: endpoint must be a valid URL"); | ||
| } | ||
| if (!(endpointProtocol === "http:" || endpointProtocol === "https:")) { | ||
| throw new TypeError("setupOptionOtel: endpoint must use http or https"); | ||
| throw new TypeError("createIsolatedOtel: endpoint must use http or https"); |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Align the error message prefix with the called function.
createIsolatedOtelRuntime is an exported function, and tests/isolated-runtime.test.ts calls it directly at lines 418 and 446. All validation messages name createIsolatedOtel instead. A caller of createIsolatedOtelRuntime then receives an error that names a different function. Derive the prefix from a constant that matches the throwing function, or state both names.
Also applies to: 141-144
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/isolated-runtime.ts` around lines 112 - 128, Update the validation errors
in createIsolatedOtelRuntime to identify the exported function consistently as
createIsolatedOtelRuntime instead of createIsolatedOtel; apply the same prefix
to all related endpoint validation throws, including the later validation at the
referenced location.
Supersedes #22 after renaming the head branch to match ENG-2270.
Summary
The second OTel pipeline shipped in 3.4.0 as
setupOptionOtel()— a runtime hardwired to Photon Developer Logs and dependent on the mainsetupOtel()runtime. This PR generalizes it into a genuinely independent runtime, then renames it tocreateIsolatedOtel()to match what it actually is.setupOtel()behavior is unchanged. Its Resource attributes are built in the same order and resolve to the same values.What changed
1. Truly independent, no ordering requirement
On
main, the runtime was not independent at all — it borrowed the main runtime's Resource and threw if setup hadn't happened yet:It now builds its own Resource from its own options.
activeOtelResource()and the module-levelactiveResourcecache are deleted fromsrc/setup.ts, so the two pipelines share no code path and no import edge. The isolated runtime no longer requiressetupOtel()to exist at all, in any order.2. Caller-owned propagation header, validated
The carrier header and instrumentation scope were hardcoded product names:
traceparentHeaderis now a required caller-supplied option, rejected at construction with aTypeErrorwhen it is empty, not a valid HTTP header name, or the standardtraceparent(case-insensitively —TraceParentis rejected too). Refusing to hijacktraceparentis what keeps the isolated trace context from colliding with the main W3C context; spans propagate independently through the private header andtraceparentis never rewritten.Two identifiers were realigned to the package rather than the product:
main@photon-ai/developer-logs@photon-ai/otel@photon-ai/otel.option-runtime.local-span@photon-ai/isolated-otel.local-span3.
setupOptionOtel→createIsolatedOtel"Option" was a stranded domain word once the runtime was generalized, and it collided with "options," the config object —
SetupOptionOtelOptionsparses as "Setup Option Otel Options." The docs had already moved to "isolated"; the code now matches.create*rather thansetup*is deliberate and carries information:setupOtel()is an idempotent process-wide singleton that returns the same handle on a second call, while this is a plain factory returning a new independent runtime per call (pinned by a new test). It also matches the existingcreateLogger/createInstrumentedFetchconvention for "returns an instance you own."register: falseonsetupOtel()remains a separate, weaker concept — scoped mode still shares the global context manager, the W3C propagator, and the standardtraceparent. The naming keeps "scoped" and "isolated" distinct.4. Shared service identity across both runtimes
New
src/service-resource.tsholds aServiceResourceOptionsbase and aserviceResourceAttributes()helper.SetupOtelOptionsandIsolatedOtelOptionsboth extend it, so service identity cannot drift between the two again.This fixes a silent footgun: the isolated runtime previously accepted only
resourceAttributes, and omittingservice.nameproduced an empty Resource that backends display asunknown_service— with no compile-time or runtime signal.serviceNameis now required.Two asymmetries are intentional and now have tests:
deployment.environment.setupOtel()injects it fromDEPLOYMENT_ENV; the isolated runtime must not read ambient env, because its Resource is explicit by contract. A test setsDEPLOYMENT_ENVand asserts the attribute is absent.logLevel/register/instrumentFetch.setLogLevelwrites module-global state (src/logger.ts), so acceptinglogLevelhere would let an "isolated" runtime silently change the main runtime's log level.registeris meaningless when never registering globals is the entire point, and the standard fetch instrumentation propagatestraceparent, not this runtime's private header.setupOtel'sresourceAttributeswidened fromRecord<string, string | number | boolean>to OTel'sAttributesto match the base. Widening an input type, so existing callers are unaffected.5.
PHOTON_OTEL_VERSIONderived frompackage.jsonsrc/version.tswas a hand-maintained literal that nobody remembered to update:mainshipspackage.json3.5.0 alongsidePHOTON_OTEL_VERSION3.4.0, so published spans have been reporting a stale instrumentation-scope version for two releases.module: "Preserve"already impliesresolveJsonModule, so no tsconfig change was needed. Rolldown inlines the value —dist/index.jscontains a plainconst PHOTON_OTEL_VERSION = "3.5.0";— and tree-shaking drops the rest of the file (verified: nodevDependencies,scripts, orkeywordsin the bundle).Generating the file in a prebuild step was the alternative, and it was rejected because the drift would persist: the release bot bumps
package.jsonand commits without regenerating. Gitignoring a generated file instead breaksbun run teston a fresh clone, sincesrc/andtests/import it. Deriving the value removes the failure mode rather than adding a step someone has to remember.Both resolution paths were checked, since
exports.bunserves TypeScript source while npm consumers getdist:exports.bun→src/index.ts):3.5.03.5.0Two guards were added: a unit test that fails if a hand-maintained literal is reintroduced, and a CI step that asserts the built artifact reports
package.json's version — that is the one that matters, since the publish job builds from the commit the release bot just bumped.Breaking changes
setupOptionOtel→createIsolatedOtelSetupOptionOtelOptions→IsolatedOtelOptions,OptionOtelHandle→IsolatedOtelHandleserviceNamenow requiredunknown_service.traceparentHeaderno longer defaults tophoton-developer-traceparent@photon-ai/developer-logs→@photon-ai/otelactiveOtelResource()removed fromsrc/setup.tsPHOTON_OTEL_VERSIONtype"3.6.0"→stringMigration
setupOtel()callers need no changes.Versioning
package.jsonis intentionally not bumped in this PR — it is unchanged frommainat 3.5.0. The buildspace release pipeline owns the version:determine-publish-versionreads the previous version from the latest GitHub Release, classifies the diff, and thebump-npm-versionblock writespackage.jsonand commits asphoton-release[bot]. A hand-bump here would just be overwritten, and could even be overwritten downward if the classifier picked a patch.This diff should classify as major (4.0.0) given the removed export and the newly required option. Publishing requires the
releaselabel on this PR at merge time; without it the release job is skipped entirely.Validation
bun x ultracite check— clean (the one warning is a pre-existing broken symlink under.cursor/rules/)bun run test— 129 passed, 12 filesnode ./node_modules/vitest/vitest.mjs run— 129 passed, 12 files (CI runs Node 20 and 22, so thepackage.jsonimport was verified on that path too)bun run build— clean;dist/index.d.tsexportscreateIsolatedOtel/IsolatedOtelOptions/IsolatedOtelHandle, withServiceResourceOptionsemitted as an internal declaration rather than public surfacebunx tsc --noEmit— no new errors (3 pre-existingnew Request(input, init)overload errors remain in the fetch test files; CI does not runtsc)distversion check — built artifact andpackage.jsonagreeNew test coverage in
tests/isolated-runtime.test.ts(15 → 20 cases): a new runtime per call,serviceName/serviceVersionlanding in the exported Resource,resourceAttributesoverriding the derived service identity, andDEPLOYMENT_ENVbeing ignored.Follow-up, not in this PR
The Mintlify nav config lives outside this repo and likely still points at
docs/guides/option-runtime, which this PR renames toisolated-runtime.mdx. That path needs updating or the page 404s.Related
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
New Features
createIsolatedOtel()for independently managed OpenTelemetry runtimes.Breaking Changes
setupOptionOtel()withcreateIsolatedOtel().Documentation
Bug Fixes