Skip to content

feat: autumn-js pre-1.0 compat + local Jaeger trace playground#4

Merged
ibadus merged 2 commits intomainfrom
otel-autumn-compat
Apr 24, 2026
Merged

feat: autumn-js pre-1.0 compat + local Jaeger trace playground#4
ibadus merged 2 commits intomainfrom
otel-autumn-compat

Conversation

@ibadus
Copy link
Copy Markdown

@ibadus ibadus commented Apr 24, 2026

Summary

  • autumn-js pre-1.0 compatibility — expands the peer range to >=0.0.70 <2.0.0 and wraps the pre-1.0 flat-top-level methods (attach, cancel, setupPayment, usage) alongside the existing 1.x sub-resource coverage. The pre-1.0 Result<T, E> envelope is unwrapped automatically and product_id/product_ids map to autumn.plan_id/autumn.plan_ids so dashboards stay consistent. Missing methods on the installed SDK are skipped silently.
  • Local Jaeger trace playground — new root docker-compose.yml runs jaegertracing/all-in-one with OTLP, and each package gets an examples/ folder with otel-setup.ts, demo.ts, and a README. Autumn demo exercises every 1.x method (37 spans incl. one ERROR); Drizzle demo exercises every instrumentation surface (30 spans: promise + callback + execute, instrumentDrizzleClient with session/prepareQuery/$client/_.session/transactions, all SQL verbs, all query-object shapes, long-query truncation, both error paths).
  • Docs — new EXAMPLES.md at repo root with the full walkthrough; root README gets a brief ## Examples pointer. examples/ sits outside src/**/* so nothing leaks into dist/ or the published package.

Test plan

  • pnpm type-check — green
  • pnpm unit-test — 34 autumn + 27 drizzle tests pass, includes new pre-1.0 cases
  • pnpm builddist/ only contains index.js, index.js.map, types/; examples/ excluded
  • docker compose up -d && pnpm --filter @api-blitz/otel-autumn example && pnpm --filter @api-blitz/otel-drizzle example — both services appear in Jaeger UI at localhost:16686 with the expected span counts (37 / 30) and error/transaction markers

🤖 Generated with Claude Code

ibadus and others added 2 commits April 24, 2026 13:10
Two loosely-related changes landing together:

autumn-js pre-1.0 compatibility
- Widen `autumn-js` peer range to `>=0.0.70 <2.0.0` (was `>=1.0.0`).
- Wrap pre-1.0 flat-top-level methods (`attach`, `cancel`, `setupPayment`,
  `usage`) alongside the existing 1.x sub-resource coverage; methods missing
  from the installed SDK are skipped silently.
- Unwrap the pre-1.0 `Result<T, E>` response envelope so response-side span
  attributes populate the same on both versions; map `product_id`/`product_ids`
  to `autumn.plan_id`/`autumn.plan_ids` for dashboard consistency.
- Expand unit tests to cover the pre-1.0 shapes.

Local Jaeger trace playground (new)
- `docker-compose.yml` at repo root runs `jaegertracing/all-in-one` with OTLP
  enabled on ports 16686 (UI), 4318 (OTLP HTTP), 4317 (OTLP gRPC).
- Each package gets an `examples/` folder with `otel-setup.ts`, `demo.ts`, and
  a README. Demos use plain-object mocks (matching the unit tests) and export
  via OTLP/HTTP.
- Autumn demo exercises every 1.x instrumented method (37 spans incl. one
  ERROR path). Drizzle demo exercises all instrumentation surfaces:
  `instrumentDrizzle` (query + execute + callback), `instrumentDrizzleClient`
  (session.prepareQuery, session.query, $client fallback, _.session.execute
  fallback, transactions), all SQL-verb operations, all query-object shapes,
  long-query truncation, and both promise/callback error paths (30 spans).
- Root README gets a brief `## Examples` pointer; full walkthrough lives in a
  new `EXAMPLES.md`.
- Dev-only: new `@opentelemetry/sdk-trace-node`, `exporter-trace-otlp-http`,
  `resources`, `semantic-conventions`, and `tsx` devDeps; `examples/` is
  outside `src/**/*` so it is neither type-checked into `dist/` nor published.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Minor bump for autumn-js pre-1.0 compatibility (widened peer range,
flat top-level method wrapping, Result envelope unwrapping, plan id
attribute mapping).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ibadus ibadus merged commit 3aefbaa into main Apr 24, 2026
2 checks passed
@ibadus ibadus deleted the otel-autumn-compat branch April 24, 2026 11:15
@ibadus ibadus mentioned this pull request Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant