rian 0.4.0-beta.1 → 0.4.0-beta.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.
package/async.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // src/async.ts
2
2
  const async_hooks = require('node:async_hooks');
3
3
  const { measure } = require('rian/utils');
4
- const tctx = require('tctx');
4
+ const traceparent = require('tctx/traceparent');
5
5
 
6
6
  // src/_internal/index.ts
7
7
  var resource = {};
@@ -10,7 +10,7 @@ function configure(name, attributes = {}) {
10
10
  ...attributes,
11
11
  ["service.name"]: name,
12
12
  ["telemetry.sdk.name"]: "rian",
13
- ["telemetry.sdk.version"]: "0.4.0.beta.1"
13
+ ["telemetry.sdk.version"]: "0.4.0-beta.2"
14
14
  };
15
15
  }
16
16
  var span_buffer = /* @__PURE__ */ new Set(), wait_promises = /* @__PURE__ */ new WeakMap();
@@ -44,8 +44,8 @@ function span(name, parent_id) {
44
44
  let context = resourceStore.getStore();
45
45
  if (!context)
46
46
  throw Error("no current tracer");
47
- let api = context[0], scope = api.scope, current_span = context[1], should_sample = api.sampler, parent = typeof parent_id == "string" ? tctx.parse(parent_id) : parent_id || current_span?.traceparent, id = parent?.child() || tctx.make(), is_sampling = typeof should_sample == "boolean" ? should_sample : should_sample(id.parent_id, parent, name, scope);
48
- is_sampling ? tctx.sample(id) : tctx.unsample(id);
47
+ let api = context[0], scope = api.scope, current_span = context[1], should_sample = api.sampler, parent = typeof parent_id == "string" ? traceparent.parse(parent_id) : parent_id || current_span?.traceparent, id = parent?.child() || traceparent.make(), is_sampling = typeof should_sample == "boolean" ? should_sample : should_sample(id.parent_id, parent, name, scope);
48
+ is_sampling ? traceparent.sample(id) : traceparent.unsample(id);
49
49
  let span_obj = {
50
50
  id,
51
51
  parent,
package/async.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  // src/async.ts
2
2
  import * as async_hooks from "node:async_hooks";
3
3
  import { measure } from "rian/utils";
4
- import * as tctx from "tctx";
4
+ import * as traceparent from "tctx/traceparent";
5
5
 
6
6
  // src/_internal/index.ts
7
7
  var resource = {};
@@ -10,7 +10,7 @@ function configure(name, attributes = {}) {
10
10
  ...attributes,
11
11
  ["service.name"]: name,
12
12
  ["telemetry.sdk.name"]: "rian",
13
- ["telemetry.sdk.version"]: "0.4.0.beta.1"
13
+ ["telemetry.sdk.version"]: "0.4.0-beta.2"
14
14
  };
15
15
  }
16
16
  var span_buffer = /* @__PURE__ */ new Set(), wait_promises = /* @__PURE__ */ new WeakMap();
@@ -44,8 +44,8 @@ function span(name, parent_id) {
44
44
  let context = resourceStore.getStore();
45
45
  if (!context)
46
46
  throw Error("no current tracer");
47
- let api = context[0], scope = api.scope, current_span = context[1], should_sample = api.sampler, parent = typeof parent_id == "string" ? tctx.parse(parent_id) : parent_id || current_span?.traceparent, id = parent?.child() || tctx.make(), is_sampling = typeof should_sample == "boolean" ? should_sample : should_sample(id.parent_id, parent, name, scope);
48
- is_sampling ? tctx.sample(id) : tctx.unsample(id);
47
+ let api = context[0], scope = api.scope, current_span = context[1], should_sample = api.sampler, parent = typeof parent_id == "string" ? traceparent.parse(parent_id) : parent_id || current_span?.traceparent, id = parent?.child() || traceparent.make(), is_sampling = typeof should_sample == "boolean" ? should_sample : should_sample(id.parent_id, parent, name, scope);
48
+ is_sampling ? traceparent.sample(id) : traceparent.unsample(id);
49
49
  let span_obj = {
50
50
  id,
51
51
  parent,
package/index.d.ts CHANGED
@@ -53,7 +53,7 @@ export function Sampler(
53
53
  */
54
54
  id: string,
55
55
  /**
56
- * The traceparent of the new span looking for a sampling decision.
56
+ * The parent id of the new span looking for a sampling decision.
57
57
  */
58
58
  parent: Traceparent | undefined,
59
59
  /**
package/index.js CHANGED
@@ -8,7 +8,7 @@ function configure(name, attributes = {}) {
8
8
  ...attributes,
9
9
  ["service.name"]: name,
10
10
  ["telemetry.sdk.name"]: "rian",
11
- ["telemetry.sdk.version"]: "0.4.0.beta.1"
11
+ ["telemetry.sdk.version"]: "0.4.0-beta.2"
12
12
  };
13
13
  }
14
14
  var span_buffer = /* @__PURE__ */ new Set(), wait_promises = /* @__PURE__ */ new WeakMap();
@@ -31,13 +31,13 @@ async function report(exporter) {
31
31
  }
32
32
 
33
33
  // src/index.ts
34
- const tctx = require('tctx');
34
+ const traceparent = require('tctx/traceparent');
35
35
  function tracer(name, options) {
36
36
  let should_sample = options?.sampler ?? !0, clock = options?.clock ?? Date, scope = { name }, ps = /* @__PURE__ */ new Set();
37
37
  wait_promises.set(scope, ps);
38
38
  let span = (name2, parent_id) => {
39
- let parent = typeof parent_id == "string" ? tctx.parse(parent_id) : parent_id, id = parent?.child() || tctx.make(), is_sampling = typeof should_sample == "boolean" ? should_sample : should_sample(id.parent_id, parent, name2, scope);
40
- is_sampling ? tctx.sample(id) : tctx.unsample(id);
39
+ let parent = typeof parent_id == "string" ? traceparent.parse(parent_id) : parent_id, id = parent?.child() || traceparent.make(), is_sampling = typeof should_sample == "boolean" ? should_sample : should_sample(id.parent_id, parent, name2, scope);
40
+ is_sampling ? traceparent.sample(id) : traceparent.unsample(id);
41
41
  let span_obj = {
42
42
  id,
43
43
  parent,
package/index.mjs CHANGED
@@ -8,7 +8,7 @@ function configure(name, attributes = {}) {
8
8
  ...attributes,
9
9
  ["service.name"]: name,
10
10
  ["telemetry.sdk.name"]: "rian",
11
- ["telemetry.sdk.version"]: "0.4.0.beta.1"
11
+ ["telemetry.sdk.version"]: "0.4.0-beta.2"
12
12
  };
13
13
  }
14
14
  var span_buffer = /* @__PURE__ */ new Set(), wait_promises = /* @__PURE__ */ new WeakMap();
@@ -31,13 +31,13 @@ async function report(exporter) {
31
31
  }
32
32
 
33
33
  // src/index.ts
34
- import * as tctx from "tctx";
34
+ import * as traceparent from "tctx/traceparent";
35
35
  function tracer(name, options) {
36
36
  let should_sample = options?.sampler ?? !0, clock = options?.clock ?? Date, scope = { name }, ps = /* @__PURE__ */ new Set();
37
37
  wait_promises.set(scope, ps);
38
38
  let span = (name2, parent_id) => {
39
- let parent = typeof parent_id == "string" ? tctx.parse(parent_id) : parent_id, id = parent?.child() || tctx.make(), is_sampling = typeof should_sample == "boolean" ? should_sample : should_sample(id.parent_id, parent, name2, scope);
40
- is_sampling ? tctx.sample(id) : tctx.unsample(id);
39
+ let parent = typeof parent_id == "string" ? traceparent.parse(parent_id) : parent_id, id = parent?.child() || traceparent.make(), is_sampling = typeof should_sample == "boolean" ? should_sample : should_sample(id.parent_id, parent, name2, scope);
40
+ is_sampling ? traceparent.sample(id) : traceparent.unsample(id);
41
41
  let span_obj = {
42
42
  id,
43
43
  parent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rian",
3
- "version": "0.4.0-beta.1",
3
+ "version": "0.4.0-beta.2",
4
4
  "description": "Effective tracing for the edge and origins",
5
5
  "keywords": [
6
6
  "opentelemetry",
@@ -72,8 +72,8 @@
72
72
  },
73
73
  "prettier": "@marais/prettier",
74
74
  "dependencies": {
75
- "flattie": "^1.1.0",
76
- "tctx": "tctx@0.2.1-beta.1"
75
+ "flattie": "^1.1.1",
76
+ "tctx": "^0.2.3"
77
77
  },
78
78
  "devDependencies": {
79
79
  "@marais/prettier": "0.0.4",