@inference-net/otel-cf-workers 2.0.4 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -96,7 +96,7 @@ function passthroughGet(target, prop, thisArg) {
96
96
  }
97
97
  }
98
98
 
99
- const PACKAGE_VERSION = "2.0.4";
99
+ const PACKAGE_VERSION = "2.0.5";
100
100
  const PACKAGE_NAME = "@inference-net/otel-cf-workers";
101
101
  const ATTR_CLOUDFLARE_COLO = "cloudflare.colo";
102
102
  const ATTR_CLOUDFLARE_RAY_ID = "cloudflare.ray_id";
@@ -3203,6 +3203,7 @@ function instrumentRpcHandlerMethod(fn, methodName, initialiser, env, id) {
3203
3203
  const [extractedContext, cleanedArgs] = extractAndRemoveRpcContext(argArray);
3204
3204
  const carrierDoName = argArray.length > 0 && extractedContext ? argArray[0].doName : void 0;
3205
3205
  const doName = carrierDoName || id.name || void 0;
3206
+ const carrier = argArray.length > 0 ? argArray[0] : void 0;
3206
3207
  console.log("[DO RPC Server]", {
3207
3208
  methodName,
3208
3209
  hasExtractedContext: !!extractedContext,
@@ -3210,7 +3211,8 @@ function instrumentRpcHandlerMethod(fn, methodName, initialiser, env, id) {
3210
3211
  idName: id.name,
3211
3212
  finalDoName: doName,
3212
3213
  argArrayLength: argArray.length,
3213
- cleanedArgsLength: cleanedArgs.length
3214
+ cleanedArgsLength: cleanedArgs.length,
3215
+ carrierHeaders: carrier ? carrier.headers : void 0
3214
3216
  });
3215
3217
  let context$1 = extractedContext || context.active();
3216
3218
  context$1 = setConfig(config, context$1);
@@ -3231,7 +3233,7 @@ function instrumentRpcHandlerMethod(fn, methodName, initialiser, env, id) {
3231
3233
  attributes
3232
3234
  };
3233
3235
  const spanName = doName ? `${doName}.${methodName}` : `${attributes["do.id"]}.${methodName}`;
3234
- return tracer.startActiveSpan(spanName, options, async (span) => {
3236
+ return tracer.startActiveSpan(spanName, options, context.active(), async (span) => {
3235
3237
  try {
3236
3238
  const bound = target.bind(thisArg);
3237
3239
  const result = await bound.apply(thisArg, cleanedArgs);