@vtex/api 6.45.19 → 6.45.20-beta

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/CHANGELOG.md CHANGED
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [6.45.20-beta] - 2023-08-30
11
+
10
12
  ## [6.45.19] - 2023-07-12
11
13
  ### Changed
12
14
  - Bump `graphql-upload` version
@@ -1769,7 +1771,9 @@ instead
1769
1771
  - `HttpClient` now adds `'Accept-Encoding': 'gzip'` header by default.
1770
1772
 
1771
1773
 
1772
- [Unreleased]: https://github.com/vtex/node-vtex-api/compare/v6.45.15...HEAD
1774
+ [Unreleased]: https://github.com/vtex/node-vtex-api/compare/v6.45.20-beta...HEAD
1773
1775
  [6.45.15]: https://github.com/vtex/node-vtex-api/compare/v6.45.14...v6.45.15
1774
1776
  [6.45.14]: https://github.com/vtex/node-vtex-api/compare/v6.45.13...v6.45.14
1775
1777
  [6.45.13]: https://github.com/vtex/node-vtex-api/compare/v6.45.12...v6.45.13
1778
+
1779
+ [6.45.20-beta]: https://github.com/vtex/node-vtex-api/compare/v6.45.19...v6.45.20-beta
@@ -30,12 +30,6 @@ class TracerSingleton {
30
30
  reporter: {
31
31
  agentHost: process.env.VTEX_OWN_NODE_IP,
32
32
  },
33
- sampler: {
34
- host: process.env.VTEX_OWN_NODE_IP,
35
- param: 0.05,
36
- refreshIntervalMs: 60 * 1000,
37
- type: 'remote',
38
- },
39
33
  serviceName,
40
34
  };
41
35
  const options = {
@@ -19,12 +19,12 @@ exports.addTracingMiddleware = (tracer) => {
19
19
  var _a;
20
20
  const start = process.hrtime();
21
21
  concurrentRequests.inc(1);
22
- if (PATHS_BLACKLISTED_FOR_TRACING.includes(ctx.request.path)) {
22
+ const rootSpan = tracer.extract(opentracing_1.FORMAT_HTTP_HEADERS, ctx.request.headers);
23
+ if (!shouldTrace(ctx, rootSpan)) {
23
24
  await next();
24
25
  concurrentRequests.dec(1);
25
26
  return;
26
27
  }
27
- const rootSpan = tracer.extract(opentracing_1.FORMAT_HTTP_HEADERS, ctx.request.headers);
28
28
  const currentSpan = tracer.startSpan('unknown-operation', {
29
29
  childOf: rootSpan,
30
30
  tags: { [Tags_1.OpentracingTags.SPAN_KIND]: Tags_1.OpentracingTags.SPAN_KIND_RPC_SERVER },
@@ -117,3 +117,7 @@ exports.traceUserLandRemainingPipelineMiddleware = () => {
117
117
  }
118
118
  };
119
119
  };
120
+ function shouldTrace(ctx, rootSpan) {
121
+ // Should trace if path isnt blacklisted and tracing decision came from the edge
122
+ return !PATHS_BLACKLISTED_FOR_TRACING.includes(ctx.request.path) && rootSpan != null;
123
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtex/api",
3
- "version": "6.45.19",
3
+ "version": "6.45.20-beta",
4
4
  "description": "VTEX I/O API client",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",