@platformatic/telemetry 2.32.0 → 2.34.0

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/NOTICE CHANGED
@@ -11,3 +11,8 @@
11
11
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  See the License for the specific language governing permissions and
13
13
  limitations under the License.
14
+
15
+ The files in `test/otelserver/opentelemetry` has been created by the OpenTelemetry community and are licensed under the Apache License 2.0. The original files can be found at
16
+ https://github.com/open-telemetry/opentelemetry-proto/tree/1608f92cf08119f9aec237c910b200d1317ec696/opentelemetry
17
+
18
+
@@ -1,4 +1,5 @@
1
1
  'use strict'
2
+
2
3
  const process = require('node:process')
3
4
  const { AsyncLocalStorage } = require('node:async_hooks')
4
5
  const opentelemetry = require('@opentelemetry/sdk-node')
@@ -67,11 +68,14 @@ const setupNodeHTTPTelemetry = (opts) => {
67
68
  exporterObj = new ConsoleSpanExporter(exporterOptions)
68
69
  }
69
70
 
71
+ let spanProcessor
70
72
  // We use a SimpleSpanProcessor for the console/memory exporters and a BatchSpanProcessor for the others.
71
- // (these are the ones used by tests)
72
- const spanProcessor = ['memory', 'console', 'file'].includes(exporter.type)
73
- ? new SimpleSpanProcessor(exporterObj)
74
- : new BatchSpanProcessor(exporterObj)
73
+ // , unless "processor" is set to "simple" (used only in tests)
74
+ if (exporter.processor === 'simple' || ['memory', 'console', 'file'].includes(exporter.type)) {
75
+ spanProcessor = new SimpleSpanProcessor(exporterObj)
76
+ } else {
77
+ spanProcessor = new BatchSpanProcessor(exporterObj)
78
+ }
75
79
  spanProcessors.push(spanProcessor)
76
80
  }
77
81
 
@@ -135,11 +135,14 @@ const initTelemetry = (opts, logger) => {
135
135
  exporterObj = new ConsoleSpanExporter(exporterOptions)
136
136
  }
137
137
 
138
+ let spanProcessor
138
139
  // We use a SimpleSpanProcessor for the console/memory exporters and a BatchSpanProcessor for the others.
139
- // (these are the ones used by tests)
140
- const spanProcessor = ['memory', 'console', 'file'].includes(exporter.type)
141
- ? new SimpleSpanProcessor(exporterObj)
142
- : new BatchSpanProcessor(exporterObj)
140
+ // , unless "processor" is set to "simple" (used only in tests)
141
+ if (exporter.processor === 'simple' || ['memory', 'console', 'file'].includes(exporter.type)) {
142
+ spanProcessor = new SimpleSpanProcessor(exporterObj)
143
+ } else {
144
+ spanProcessor = new BatchSpanProcessor(exporterObj)
145
+ }
143
146
  spanProcessors.push(spanProcessor)
144
147
  exporterObjs.push(exporterObj)
145
148
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/telemetry",
3
- "version": "2.32.0",
3
+ "version": "2.34.0",
4
4
  "description": "OpenTelemetry integration for Platformatic",
5
5
  "main": "index.js",
6
6
  "author": "Platformatic Inc. <oss@platformatic.dev> (https://platformatic.dev)",
@@ -14,6 +14,7 @@
14
14
  "express": "^4.19.2",
15
15
  "fastify": "^5.0.0",
16
16
  "neostandard": "^0.12.0",
17
+ "protobufjs": "^7.4.0",
17
18
  "typescript": "^5.5.4"
18
19
  },
19
20
  "dependencies": {
@@ -30,7 +31,7 @@
30
31
  "@opentelemetry/sdk-trace-base": "^1.22.0",
31
32
  "@opentelemetry/semantic-conventions": "^1.27.0",
32
33
  "abstract-logging": "^2.0.1",
33
- "fast-uri": "^2.3.0",
34
+ "fast-uri": "^3.0.0",
34
35
  "fastify-plugin": "^5.0.0"
35
36
  },
36
37
  "scripts": {