Skip to content

Commit

Permalink
first commit; my attempt without the full setup code from open-teleme…
Browse files Browse the repository at this point in the history
  • Loading branch information
trentm committed Mar 31, 2023
0 parents commit 49cb0fb
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/node_modules
/dist
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
19 changes: 19 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "repro-otel-js-issue-3701",
"version": "1.0.0",
"private": "true",
"main": "dist/repro.js",
"scripts": {
"build": "esbuild --bundle src/repro.ts --outdir=dist --platform=node",
"start": "npm run build && node dist/repro.js"
},
"devDependencies": {
"@tsconfig/node16": "^1.0.3",
"esbuild": "^0.17.14"
},
"dependencies": {
"@opentelemetry/auto-instrumentations-node": "^0.36.4",
"@opentelemetry/sdk-node": "^0.36.1",
"@opentelemetry/sdk-trace-base": "^1.10.1"
}
}
14 changes: 14 additions & 0 deletions src/repro.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { NodeSDK } from '@opentelemetry/sdk-node'
import { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node'
import { ConsoleSpanExporter } from '@opentelemetry/sdk-trace-base'

const sdk = new NodeSDK({
traceExporter: new ConsoleSpanExporter(),
instrumentations: [getNodeAutoInstrumentations()],
});

sdk.start();

setInterval(() => {
console.log('hi')
}, 5000)
6 changes: 6 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "@tsconfig/node16/tsconfig.json",
"compilerOptions": {
"outDir": "dist"
}
}

0 comments on commit 49cb0fb

Please sign in to comment.