From f94f09a9fa38c8d02bacb78d31504f14f0774a44 Mon Sep 17 00:00:00 2001 From: Danijel Martinek Date: Mon, 11 May 2026 11:25:29 +0200 Subject: [PATCH] feat(core-shared): OTel barrel + ESLint allowlist for SDK packages --- packages/core-eslint/base.js | 13 +++++++++++++ .../core-shared/src/instrumentation/otel/index.ts | 2 ++ 2 files changed, 15 insertions(+) create mode 100644 packages/core-shared/src/instrumentation/otel/index.ts diff --git a/packages/core-eslint/base.js b/packages/core-eslint/base.js index 4dbf05a..c0cb28f 100644 --- a/packages/core-eslint/base.js +++ b/packages/core-eslint/base.js @@ -90,6 +90,8 @@ export default [ { files: [ "**/instrumentation/sentry/**", + "**/instrumentation/otel/sentry-bridge.{ts,js}", + "**/instrumentation/otel/sentry-bridge.test.{ts,js}", "**/instrumentation/di/bind-sentry-instrumentation.{ts,js}", "**/instrumentation/di/bind-sentry-instrumentation.test.{ts,js}", "**/setup/no-sentry.{ts,js}", @@ -104,6 +106,17 @@ export default [ "no-restricted-imports": "off", }, }, + // R52 โ€” OTel SDK packages (@opentelemetry/sdk-*, @opentelemetry/resources, + // @opentelemetry/semantic-conventions, @sentry/opentelemetry) are restricted + // to core-shared/instrumentation/otel/ and app-level init paths. The + // vendor-neutral API packages (@opentelemetry/api, @opentelemetry/api-logs) + // are unrestricted and do not need a rule here. + { + files: ["**/instrumentation/otel/**/*.{ts,tsx,mjs,cjs,js}"], + rules: { + "no-restricted-imports": "off", + }, + }, // E1 โ€” Event handlers must not be re-exported. Wire them only inside the // consumer feature's bind-production / bind-dev-seed (spec ยง 2.2 Rule E1). // J โ€” Direct `payload.jobs.*` access is forbidden outside the integration diff --git a/packages/core-shared/src/instrumentation/otel/index.ts b/packages/core-shared/src/instrumentation/otel/index.ts new file mode 100644 index 0000000..365a5b9 --- /dev/null +++ b/packages/core-shared/src/instrumentation/otel/index.ts @@ -0,0 +1,2 @@ +export { initOtelServerNode, type InitOtelServerNodeOpts } from "./init-server-node"; +export { buildResource, type BuildResourceOpts } from "./resource";