You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While this is all still in a development state, here is roughly how I work on this:
16
+
17
+
Get a clone of the https://github.com/open-telemetry/opentelemetry-js/pull/4818 feature branch (e.g. to `~/tm/opentelemetry-js10` in the example below).
18
+
Get a clone of the https://github.com/open-telemetry/opentelemetry-js-contrib/pull/2295 feature branch (e.g. to `~/tm/opentelemetry-js-contrib5` in the example below).
19
+
20
+
Setup the node_modules in the example in the contrib repo.
21
+
22
+
```bash
23
+
cd~/tm/opentelemetry-js-contrib5/packages/esbuild-plugin/example # my tm-esbuild-plugin-alternative branch
24
+
# Note: You probably want to update to a recent '@opentelemetry/auto-instrumentations-node' dep, e.g. '^0.55.2'
25
+
npm install # get the initial layout
26
+
```
27
+
28
+
Build and copy in the changes from `@opentelemetry/instrumentation` in the core repo clone.
29
+
30
+
```bash
31
+
cd~/tm/opentelemetry-js10/experimental/packages/opentelemetry-instrumentation # my tm-esbuild-plugin-alternative branch
Run services used by app.js in a separate terminal:
44
+
45
+
```bash
46
+
docker run --name redis -ti --rm -p 6379:6379 redis:7 # run redis in a terminal for app.js to use
47
+
```
48
+
49
+
To watch OTel telemetry data for dev, I personally use `mockotlpserver` (https://github.com/elastic/elastic-otel-node/tree/main/packages/mockotlpserver#readme) which I and co-workers have written at Elastic. It is a smallish Node.js app that listens on the OTLP/HTTP and gRPC default ports and dumps a text representation of the data it receives. You can use it as follows, or use whatever you are used to:
50
+
51
+
```bash
52
+
npx @elastic/mockotlpserver
53
+
```
54
+
55
+
Now, run the *unbundled* app with instrumentation to see what to expect:
56
+
57
+
```bash
58
+
export OTEL_NODE_DISABLED_INSTRUMENTATIONS=net,dns,fs # disable some distracting instrumentations
59
+
export OTEL_NODE_RESOURCE_DETECTORS=env,host,os,process,serviceinstance # avoid cloud detectors to reduce noise
0 commit comments