@platformatic/telemetry 3.68.0 → 4.0.0-new-config.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/lib/node-telemetry.js +12 -9
- package/lib/schema.js +1 -1
- package/package.json +3 -3
package/lib/node-telemetry.js
CHANGED
|
@@ -36,7 +36,7 @@ const contextManager = new AsyncLocalStorageContextManager()
|
|
|
36
36
|
contextManager.enable()
|
|
37
37
|
context.setGlobalContextManager(contextManager)
|
|
38
38
|
|
|
39
|
-
const setupNodeHTTPTelemetry = async (opts, applicationDir) => {
|
|
39
|
+
const setupNodeHTTPTelemetry = async (opts, applicationDir, usesPlatformaticDispatcher) => {
|
|
40
40
|
setupDiagLogger(opts)
|
|
41
41
|
|
|
42
42
|
const { applicationName, instrumentations = [] } = opts
|
|
@@ -55,9 +55,9 @@ const setupNodeHTTPTelemetry = async (opts, applicationDir) => {
|
|
|
55
55
|
updateGlobals({ clientSpansAls, tracerProvider })
|
|
56
56
|
|
|
57
57
|
// Register instrumentations with our TracerProvider
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
const defaultInstrumentations = [new HttpInstrumentation(), ...additionalInstrumentations]
|
|
59
|
+
if (!usesPlatformaticDispatcher) {
|
|
60
|
+
defaultInstrumentations.unshift(
|
|
61
61
|
new UndiciInstrumentation({
|
|
62
62
|
responseHook: span => {
|
|
63
63
|
const store = clientSpansAls.getStore()
|
|
@@ -65,10 +65,13 @@ const setupNodeHTTPTelemetry = async (opts, applicationDir) => {
|
|
|
65
65
|
store.span = span
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
})
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
})
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
registerInstrumentations({
|
|
73
|
+
tracerProvider,
|
|
74
|
+
instrumentations: defaultInstrumentations
|
|
72
75
|
})
|
|
73
76
|
|
|
74
77
|
process.on('SIGTERM', async () => {
|
|
@@ -110,7 +113,7 @@ async function main () {
|
|
|
110
113
|
const telemetryConfig = useWorkerData ? data?.applicationConfig?.telemetry : data?.telemetryConfig
|
|
111
114
|
if (telemetryConfig) {
|
|
112
115
|
debuglog('telemetryConfig %o', telemetryConfig)
|
|
113
|
-
await setupNodeHTTPTelemetry(telemetryConfig, applicationDir)
|
|
116
|
+
await setupNodeHTTPTelemetry(telemetryConfig, applicationDir, data.applicationConfig?.type === '@platformatic/next')
|
|
114
117
|
resolveTelemetryReady()
|
|
115
118
|
} else {
|
|
116
119
|
resolveTelemetryReady()
|
package/lib/schema.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/telemetry",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-new-config.0",
|
|
4
4
|
"description": "OpenTelemetry integration for Platformatic",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"@opentelemetry/semantic-conventions": "1.41.1",
|
|
38
38
|
"fast-uri": "^4.0.0",
|
|
39
39
|
"fastify-plugin": "^5.0.1",
|
|
40
|
-
"@platformatic/foundation": "
|
|
41
|
-
"@platformatic/globals": "
|
|
40
|
+
"@platformatic/foundation": "4.0.0-new-config.0",
|
|
41
|
+
"@platformatic/globals": "4.0.0-new-config.0"
|
|
42
42
|
},
|
|
43
43
|
"engines": {
|
|
44
44
|
"node": ">=22.19.0"
|