@vtex/api 6.45.19 → 6.45.20

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,13 @@ 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] - 2023-08-30
11
+ ### Changed
12
+ - Remove sampling decision from runtime
13
+ - Only create tracing spans when they come from router
14
+
15
+ ## [6.45.20-beta] - 2023-08-30
16
+
10
17
  ## [6.45.19] - 2023-07-12
11
18
  ### Changed
12
19
  - Bump `graphql-upload` version
@@ -1769,7 +1776,10 @@ instead
1769
1776
  - `HttpClient` now adds `'Accept-Encoding': 'gzip'` header by default.
1770
1777
 
1771
1778
 
1772
- [Unreleased]: https://github.com/vtex/node-vtex-api/compare/v6.45.15...HEAD
1779
+ [Unreleased]: https://github.com/vtex/node-vtex-api/compare/v6.45.20...HEAD
1773
1780
  [6.45.15]: https://github.com/vtex/node-vtex-api/compare/v6.45.14...v6.45.15
1774
1781
  [6.45.14]: https://github.com/vtex/node-vtex-api/compare/v6.45.13...v6.45.14
1775
1782
  [6.45.13]: https://github.com/vtex/node-vtex-api/compare/v6.45.12...v6.45.13
1783
+
1784
+ [6.45.20]: https://github.com/vtex/node-vtex-api/compare/v6.45.20-beta...v6.45.20
1785
+ [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",
4
4
  "description": "VTEX I/O API client",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",