Skip to content

Commit aeb09c4

Browse files
committed
fix(observability): instance id avoids the node crypto import shared code cannot use
Signed-off-by: Yordis Prieto <[email protected]>
1 parent 6e7d25e commit aeb09c4

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎packages/shared/src/observability.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import * as NodeCrypto from "node:crypto";
2-
31
import * as Cause from "effect/Cause";
42
import * as Context from "effect/Context";
53
import * as Effect from "effect/Effect";
@@ -41,7 +39,8 @@ export const processServiceInstanceId = (
4139
): string =>
4240
typeof operatorAttributes["service.instance.id"] === "string"
4341
? operatorAttributes["service.instance.id"]
44-
: (serviceInstanceId ??= NodeCrypto.randomUUID());
42+
: // @effect-diagnostics-next-line cryptoRandomUUID:off -- Resource attributes are built synchronously, before any Crypto service exists.
43+
(serviceInstanceId ??= crypto.randomUUID());
4544

4645
export const DEFAULT_SIGNAL_EXPORT: SignalExport = {
4746
protocol: "http/json",

0 commit comments

Comments
 (0)