Skip to content

Commit

Permalink
Add nodejs auto instrumentation
Browse files Browse the repository at this point in the history
Add nodejs auto instrumentation
  • Loading branch information
liyanwei93 committed Nov 18, 2024
1 parent 30622bd commit f369b7a
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 8 deletions.
4 changes: 4 additions & 0 deletions src/paymentservice/opentelemetry.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const {awsEc2Detector, awsEksDetector} = require('@opentelemetry/resource-detect
const {containerDetector} = require('@opentelemetry/resource-detector-container')
const {gcpDetector} = require('@opentelemetry/resource-detector-gcp')
const {envDetector, hostDetector, osDetector, processDetector} = require('@opentelemetry/resources')
const {RuntimeNodeInstrumentation} = require('@opentelemetry/instrumentation-runtime-node')

const sdk = new opentelemetry.NodeSDK({
traceExporter: new OTLPTraceExporter(),
Expand All @@ -20,6 +21,9 @@ const sdk = new opentelemetry.NodeSDK({
'@opentelemetry/instrumentation-fs': {
requireParentSpan: true,
},
}),
new RuntimeNodeInstrumentation({
monitoringPrecision: 5000,
})
],
metricReader: new PeriodicExportingMetricReader({
Expand Down
62 changes: 59 additions & 3 deletions src/paymentservice/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions src/paymentservice/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,19 @@
"@grpc/proto-loader": "0.7.13",
"@openfeature/flagd-provider": "0.13.0",
"@openfeature/server-sdk": "1.14.0",
"@opentelemetry/api": "1.8.0",
"@opentelemetry/auto-instrumentations-node": "0.46.1",
"@opentelemetry/core": "1.24.1",
"@opentelemetry/resources": "1.24.1",
"@opentelemetry/api": "1.8.0",
"@opentelemetry/sdk-metrics": "1.24.1",
"@opentelemetry/exporter-trace-otlp-grpc": "0.51.1",
"@opentelemetry/exporter-metrics-otlp-grpc": "0.51.1",
"@opentelemetry/sdk-node": "0.51.1",
"@opentelemetry/exporter-trace-otlp-grpc": "0.51.1",
"@opentelemetry/instrumentation-runtime-node": "^0.10.0",
"@opentelemetry/resource-detector-alibaba-cloud": "0.28.9",
"@opentelemetry/resource-detector-aws": "1.5.0",
"@opentelemetry/resource-detector-container": "0.3.9",
"@opentelemetry/resource-detector-gcp": "0.29.9",
"@opentelemetry/resources": "1.24.1",
"@opentelemetry/sdk-metrics": "1.24.1",
"@opentelemetry/sdk-node": "0.51.1",
"grpc-js-health-check": "1.1.0",
"pino": "8.16.1",
"simple-card-validator": "1.1.0",
Expand Down

0 comments on commit f369b7a

Please sign in to comment.