@obtrace/browser 2.5.0 → 2.5.2

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.
@@ -1,4 +1,4 @@
1
- import { trace, metrics, context, SpanStatusCode } from "@opentelemetry/api";
1
+ import { trace, metrics, context, SpanStatusCode, ROOT_CONTEXT } from "@opentelemetry/api";
2
2
  import { WebTracerProvider } from "@opentelemetry/sdk-trace-web";
3
3
  import { BatchSpanProcessor, TraceIdRatioBasedSampler, ParentBasedSampler } from "@opentelemetry/sdk-trace-web";
4
4
  import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
@@ -89,14 +89,14 @@ export function setupOtelWeb(config) {
89
89
  if (!parsed)
90
90
  return;
91
91
  const status = typeof result?.status === "number" ? result.status : 0;
92
- const t = trace.getTracer("@obtrace/sdk-browser", "2.4.0");
92
+ const t = trace.getTracer("@obtrace/sdk-browser", "2.5.1");
93
93
  const synth = { "session.id": sessionId, "supabase.ref": parsed.ref, "span.synthetic": "true" };
94
- const parentCtx = trace.setSpan(context.active(), parentSpan);
94
+ const parentCtx = trace.setSpan(ROOT_CONTEXT, parentSpan);
95
95
  context.with(parentCtx, () => {
96
96
  const gw = t.startSpan("supabase.gateway", {
97
97
  attributes: { ...synth, "http.method": method.toUpperCase(), "http.status_code": status, "peer.service": "supabase.kong" },
98
98
  });
99
- const gwCtx = trace.setSpan(context.active(), gw);
99
+ const gwCtx = trace.setSpan(ROOT_CONTEXT, gw);
100
100
  context.with(gwCtx, () => {
101
101
  if (parsed.service === "postgrest") {
102
102
  const db = t.startSpan("supabase.db.query", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@obtrace/browser",
3
- "version": "2.5.0",
3
+ "version": "2.5.2",
4
4
  "description": "Obtrace Browser SDK with frontend wrappers",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -58,6 +58,7 @@
58
58
  "node": ">=18"
59
59
  },
60
60
  "devDependencies": {
61
+ "@opentelemetry/context-async-hooks": "^2.6.1",
61
62
  "@types/node": "^25.5.0",
62
63
  "esbuild": "^0.27.4",
63
64
  "tsx": "^4.20.5",