We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent de0bbad commit 8ae6389Copy full SHA for 8ae6389
3 files changed
lib/ProcessUtils.js
@@ -1,7 +1,28 @@
1
'use strict'
2
3
module.exports = {
4
- injectModules: function() {
+ injectModules() {
5
+ const { NodeSDK } = require('@opentelemetry/sdk-node');
6
+ const {
7
+ getNodeAutoInstrumentations,
8
+ } = require('@opentelemetry/auto-instrumentations-node');
9
+
10
+ const serviceName = process.env.OTEL_SERVICE_NAME || `${process.env.name}-${process.env.pm_id}`;
11
12
+ const sdk = new NodeSDK({
13
+ serviceName: serviceName,
14
+ instrumentations: [getNodeAutoInstrumentations({
15
+ '@opentelemetry/instrumentation-dns': {
16
+ enabled: false,
17
+ },
18
+ '@opentelemetry/instrumentation-fs': {
19
20
21
+ })],
22
+ });
23
24
+ sdk.start();
25
26
if (process.env.pmx !== 'false') {
27
const pmx = require('@pm2/io')
28
@@ -53,3 +74,4 @@ module.exports = {
53
74
}
54
75
55
76
77
0 commit comments